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