configure 970 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # Probes the build environment (libs, headers).
  3. if [ -z "$MAKE" ]
  4. then
  5. # Look for GNU Make; prefer "gmake" over "make".
  6. (false ; echo "nothing:" | make -f - > /dev/null 2>&1) && MAKE=make
  7. (false ; echo "nothing:" | gmake -f - > /dev/null 2>&1) && MAKE=gmake
  8. else
  9. echo "Using value of MAKE environment variable: \"$MAKE\"."
  10. fi
  11. if [ -z "$MAKE" ]
  12. then
  13. echo 'Error: no Make found.'
  14. echo 'Please install GNU Make and put it in your path as "gmake" or "make",'
  15. echo 'or put its location in an environment variable named "MAKE".'
  16. exit 1
  17. fi
  18. if [ "gmake" != "$MAKE" ]
  19. then
  20. if ! ( $MAKE --version > /dev/null 2>&1 \
  21. && ($MAKE --version 2> /dev/null | grep "GNU Make" > /dev/null) )
  22. then
  23. echo "Error: Make does not appear to be GNU Make."
  24. echo 'Please install GNU Make and put it in your path as "gmake" or "make",'
  25. echo 'or put its location in an environment variable named "MAKE".'
  26. exit 1
  27. fi
  28. fi
  29. # Invoke actual probe.
  30. $MAKE -f build/main.mk probe