make.m4 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Check to see how 'make' treats includes. -*- Autoconf -*-
  2. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # AM_MAKE_INCLUDE()
  8. # -----------------
  9. # Check to see how make treats includes.
  10. AC_DEFUN([AM_MAKE_INCLUDE],
  11. [am_make=${MAKE-make}
  12. cat > confinc << 'END'
  13. am__doit:
  14. @echo this is the am__doit target
  15. .PHONY: am__doit
  16. END
  17. # If we don't find an include directive, just comment out the code.
  18. AC_MSG_CHECKING([for style of include used by $am_make])
  19. am__include="#"
  20. am__quote=
  21. _am_result=none
  22. # First try GNU make style include.
  23. echo "include confinc" > confmf
  24. # Ignore all kinds of additional output from 'make'.
  25. case `$am_make -s -f confmf 2> /dev/null` in #(
  26. *the\ am__doit\ target*)
  27. am__include=include
  28. am__quote=
  29. _am_result=GNU
  30. ;;
  31. esac
  32. # Now try BSD make style include.
  33. if test "$am__include" = "#"; then
  34. echo '.include "confinc"' > confmf
  35. case `$am_make -s -f confmf 2> /dev/null` in #(
  36. *the\ am__doit\ target*)
  37. am__include=.include
  38. am__quote="\""
  39. _am_result=BSD
  40. ;;
  41. esac
  42. fi
  43. AC_SUBST([am__include])
  44. AC_SUBST([am__quote])
  45. AC_MSG_RESULT([$_am_result])
  46. rm -f confinc confmf
  47. ])