aclocal.m4 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. dnl aclocal.m4 generated automatically by aclocal 1.2
  2. dnl AB_CHECK_FLAG(FLAG, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  3. AC_DEFUN(AB_CHECK_FLAG,
  4. [
  5. AC_MSG_CHECKING([whether ifelse(AC_LANG, CPLUSPLUS, ${CXX}, ${CC}) supports the $1 flag])
  6. ab_flag_var=`echo $1 | sed 'y%./+-%__p_%'`
  7. AC_CACHE_VAL(ab_cv_flag_$ab_flag_var,
  8. [
  9. ifelse(AC_LANG, CPLUSPLUS, [
  10. ab_save_flags="$CXXFLAGS"
  11. CXXFLAGS="$CXXFLAGS $1"
  12. ], [
  13. ab_save_flags="$CFLAGS"
  14. CFLAGS="$CFLAGS $1"
  15. ])dnl
  16. AC_TRY_COMPILE(,[int a;],
  17. eval "ab_cv_flag_$ab_flag_var=yes", eval "ab_cv_flag_$ab_flag_var=no")
  18. ifelse(AC_LANG, CPLUSPLUS, CXXFLAGS="$ab_save_flags", CFLAGS="$ab_save_flags")
  19. ])
  20. if eval "test \"`echo '$ab_cv_flag_'$ab_flag_var`\" = yes"; then
  21. AC_MSG_RESULT(yes)
  22. ifelse([$2], , :, [$2])
  23. else
  24. AC_MSG_RESULT(no)
  25. ifelse([$3], , , [$3
  26. ])dnl
  27. fi
  28. ])
  29. dnl AB_ADD_FLAGS(FLAG...)
  30. AC_DEFUN(AB_ADD_FLAGS,
  31. [ab_flags=
  32. for ab_flag in $1; do
  33. AB_CHECK_FLAG([$ab_flag], [ab_flags="$ab_flags $ab_flag"])
  34. ifelse(AC_LANG, CPLUSPLUS, [
  35. ADDCXXFLAGS="$ab_flags"
  36. AC_SUBST(ADDCXXFLAGS)
  37. ], [
  38. ADDCFLAGS="$ab_flags"
  39. AC_SUBST(ADDCFLAGS)
  40. ])dnl
  41. done
  42. ])
  43. AC_DEFUN(AB_C_BIGENDIAN,
  44. [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
  45. [ac_cv_c_bigendian=unknown
  46. # See if we have a good endian.h.
  47. AC_TRY_CPP([#include <endian.h>], [AC_TRY_COMPILE([#include <endian.h>], [
  48. #if !__BYTE_ORDER || !__BIG_ENDIAN
  49. bogus endian macros
  50. #endif], [AC_TRY_COMPILE([#include <endian.h>], [
  51. #if __BYTE_ORDER != __BIG_ENDIAN
  52. not big endian
  53. #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])])
  54. if test $ac_cv_c_bigendian = unknown; then
  55. # See if sys/param.h defines the BYTE_ORDER macro.
  56. AC_TRY_COMPILE([#include <sys/types.h>
  57. #include <sys/param.h>], [
  58. #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  59. bogus endian macros
  60. #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
  61. AC_TRY_COMPILE([#include <sys/types.h>
  62. #include <sys/param.h>], [
  63. #if BYTE_ORDER != BIG_ENDIAN
  64. not big endian
  65. #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
  66. fi
  67. if test $ac_cv_c_bigendian = unknown; then
  68. AC_TRY_RUN([main () {
  69. /* Are we little or big endian? From Harbison&Steele. */
  70. union
  71. {
  72. long l;
  73. char c[sizeof (long)];
  74. } u;
  75. u.l = 1;
  76. exit (u.c[sizeof (long) - 1] == 1);
  77. }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)
  78. fi])
  79. if test $ac_cv_c_bigendian = yes; then
  80. AC_DEFINE(WORDS_BIGENDIAN)
  81. fi
  82. ])
  83. # Do all the work for Automake. This macro actually does too much --
  84. # some checks are only needed if your package does certain things.
  85. # But this isn't really a big deal.
  86. # serial 1
  87. dnl Usage:
  88. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  89. AC_DEFUN(AM_INIT_AUTOMAKE,
  90. [AC_REQUIRE([AM_PROG_INSTALL])
  91. PACKAGE=[$1]
  92. AC_SUBST(PACKAGE)
  93. VERSION=[$2]
  94. AC_SUBST(VERSION)
  95. dnl test to see if srcdir already configured
  96. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  97. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  98. fi
  99. ifelse([$3],,
  100. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  101. AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
  102. AM_SANITY_CHECK
  103. AC_ARG_PROGRAM
  104. dnl FIXME This is truly gross.
  105. missing_dir=`cd $ac_aux_dir && pwd`
  106. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  107. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  108. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  109. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  110. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  111. AC_PROG_MAKE_SET])
  112. # serial 1
  113. AC_DEFUN(AM_PROG_INSTALL,
  114. [AC_REQUIRE([AC_PROG_INSTALL])
  115. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  116. AC_SUBST(INSTALL_SCRIPT)dnl
  117. ])
  118. #
  119. # Check to make sure that the build environment is sane.
  120. #
  121. AC_DEFUN(AM_SANITY_CHECK,
  122. [AC_MSG_CHECKING([whether build environment is sane])
  123. # Just in case
  124. sleep 1
  125. echo timestamp > conftestfile
  126. # Do `set' in a subshell so we don't clobber the current shell's
  127. # arguments. Must try -L first in case configure is actually a
  128. # symlink; some systems play weird games with the mod time of symlinks
  129. # (eg FreeBSD returns the mod time of the symlink's containing
  130. # directory).
  131. if (
  132. set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  133. if test "$@" = "X"; then
  134. # -L didn't work.
  135. set X `ls -t $srcdir/configure conftestfile`
  136. fi
  137. test "[$]2" = conftestfile
  138. )
  139. then
  140. # Ok.
  141. :
  142. else
  143. AC_MSG_WARN([newly created file is older than distributed files!
  144. Check your system clock])
  145. fi
  146. rm -f conftest*
  147. AC_MSG_RESULT(yes)])
  148. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  149. dnl The program must properly implement --version.
  150. AC_DEFUN(AM_MISSING_PROG,
  151. [AC_MSG_CHECKING(for working $2)
  152. # Run test in a subshell; some versions of sh will print an error if
  153. # an executable is not found, even if stderr is redirected.
  154. # Redirect stdin to placate older versions of autoconf. Sigh.
  155. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  156. $1=$2
  157. AC_MSG_RESULT(found)
  158. else
  159. $1="$3/missing $2"
  160. AC_MSG_RESULT(missing)
  161. fi
  162. AC_SUBST($1)])