aclocal.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
  2. dnl if the cache file is inconsistent with the current host,
  3. dnl target and build system types, execute CMD or print a default
  4. dnl error message.
  5. AC_DEFUN([AC_VALIDATE_CACHE_SYSTEM_TYPE], [
  6. AC_REQUIRE([AC_CANONICAL_SYSTEM])
  7. AC_MSG_CHECKING([config.cache system type])
  8. if { test x"${ac_cv_host_system_type+set}" = x"set" &&
  9. test x"$ac_cv_host_system_type" != x"$host"; } ||
  10. { test x"${ac_cv_build_system_type+set}" = x"set" &&
  11. test x"$ac_cv_build_system_type" != x"$build"; } ||
  12. { test x"${ac_cv_target_system_type+set}" = x"set" &&
  13. test x"$ac_cv_target_system_type" != x"$target"; }; then
  14. AC_MSG_RESULT([different])
  15. ifelse($#, 1, [$1],
  16. [AC_MSG_ERROR([you must remove config.cache and restart configure])])
  17. else
  18. AC_MSG_RESULT([same])
  19. fi
  20. ac_cv_host_system_type="$host"
  21. ac_cv_build_system_type="$build"
  22. ac_cv_target_system_type="$target"
  23. ])
  24. dnl based on Automake's maintainer mode
  25. AC_DEFUN([SAMBA_MAINTAINER_MODE],[
  26. AC_ARG_ENABLE(maintainer-mode,
  27. [ --enable-maintainer-mode enable some make rules for maintainers],
  28. maint_mode=$enableval, maint_mode=no)
  29. if test x"$maint_mode" = x"yes"; then MAINT=; else MAINT='#'; fi
  30. AC_SUBST(MAINT)
  31. AC_PATH_PROG(AUTOCONF, autoconf, autoconf)
  32. AC_SUBST(AUTOCONF)
  33. AC_PATH_PROG(AUTOHEADER, autoheader, autoheader)
  34. AC_SUBST(AUTOHEADER)
  35. ])
  36. dnl AC_PROG_CC_FLAG(flag)
  37. AC_DEFUN([AC_PROG_CC_FLAG],
  38. [AC_CACHE_CHECK([whether ${CC-cc} accepts -$1], ac_cv_prog_cc_$1,
  39. [echo 'void f(){}' > conftest.c
  40. if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
  41. ac_cv_prog_cc_$1=yes
  42. else
  43. ac_cv_prog_cc_$1=no
  44. fi
  45. rm -f conftest*
  46. ])])
  47. dnl check for a function in a library, but don't
  48. dnl keep adding the same library to the LIBS variable.
  49. dnl AC_LIBTESTFUNC(lib,func)
  50. AC_DEFUN([AC_LIBTESTFUNC],
  51. [case "$LIBS" in
  52. *-l$1*) AC_CHECK_FUNCS($2) ;;
  53. *) AC_CHECK_LIB($1, $2)
  54. AC_CHECK_FUNCS($2)
  55. ;;
  56. esac
  57. ])