source: abuse/tags/pd/abuse/aclocal.m4 @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 4.8 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
3dnl AB_CHECK_FLAG(FLAG, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
4AC_DEFUN(AB_CHECK_FLAG,
5[
6AC_MSG_CHECKING([whether ifelse(AC_LANG, CPLUSPLUS, ${CXX}, ${CC}) supports the $1 flag])
7ab_flag_var=`echo $1 | sed 'y%./+-%__p_%'`
8AC_CACHE_VAL(ab_cv_flag_$ab_flag_var,
9[
10ifelse(AC_LANG, CPLUSPLUS, [
11ab_save_flags="$CXXFLAGS"
12CXXFLAGS="$CXXFLAGS $1"
13], [
14ab_save_flags="$CFLAGS"
15CFLAGS="$CFLAGS $1"
16])dnl
17AC_TRY_COMPILE(,[int a;],
18eval "ab_cv_flag_$ab_flag_var=yes", eval "ab_cv_flag_$ab_flag_var=no")
19ifelse(AC_LANG, CPLUSPLUS, CXXFLAGS="$ab_save_flags", CFLAGS="$ab_save_flags")
20])
21if eval "test \"`echo '$ab_cv_flag_'$ab_flag_var`\" = yes"; then
22  AC_MSG_RESULT(yes)
23  ifelse([$2], , :, [$2])
24else
25  AC_MSG_RESULT(no)
26ifelse([$3], , , [$3
27])dnl
28fi
29])
30
31dnl AB_ADD_FLAGS(FLAG...)
32AC_DEFUN(AB_ADD_FLAGS,
33[ab_flags=
34for ab_flag in $1; do
35AB_CHECK_FLAG([$ab_flag], [ab_flags="$ab_flags $ab_flag"])
36ifelse(AC_LANG, CPLUSPLUS, [
37ADDCXXFLAGS="$ab_flags"
38AC_SUBST(ADDCXXFLAGS)
39], [
40ADDCFLAGS="$ab_flags"
41AC_SUBST(ADDCFLAGS)
42])dnl
43done
44])
45
46AC_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.
50AC_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)])])
57if test $ac_cv_c_bigendian = unknown; then
58# See if sys/param.h defines the BYTE_ORDER macro.
59AC_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.
64AC_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)])
69fi
70if test $ac_cv_c_bigendian = unknown; then
71AC_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)
81fi])
82if test $ac_cv_c_bigendian = yes; then
83  AC_DEFINE(WORDS_BIGENDIAN)
84fi
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
93dnl Usage:
94dnl AM_INIT_AUTOMAKE(package,version, [no-define])
95
96AC_DEFUN(AM_INIT_AUTOMAKE,
97[AC_REQUIRE([AM_PROG_INSTALL])
98PACKAGE=[$1]
99AC_SUBST(PACKAGE)
100VERSION=[$2]
101AC_SUBST(VERSION)
102dnl test to see if srcdir already configured
103if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
104  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
105fi
106ifelse([$3],,
107AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
108AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
109AM_SANITY_CHECK
110AC_ARG_PROGRAM
111dnl FIXME This is truly gross.
112missing_dir=`cd $ac_aux_dir && pwd`
113AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
114AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
115AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
116AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
117AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
118AC_PROG_MAKE_SET])
119
120
121# serial 1
122
123AC_DEFUN(AM_PROG_INSTALL,
124[AC_REQUIRE([AC_PROG_INSTALL])
125test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
126AC_SUBST(INSTALL_SCRIPT)dnl
127])
128
129#
130# Check to make sure that the build environment is sane.
131#
132
133AC_DEFUN(AM_SANITY_CHECK,
134[AC_MSG_CHECKING([whether build environment is sane])
135# Just in case
136sleep 1
137echo 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).
143if (
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   )
151then
152   # Ok.
153   :
154else
155   AC_MSG_WARN([newly created file is older than distributed files!
156Check your system clock])
157fi
158rm -f conftest*
159AC_MSG_RESULT(yes)])
160
161dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
162dnl The program must properly implement --version.
163AC_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.
168if ($2 --version) < /dev/null > /dev/null 2>&1; then
169   $1=$2
170   AC_MSG_RESULT(found)
171else
172   $1="$3/missing $2"
173   AC_MSG_RESULT(missing)
174fi
175AC_SUBST($1)])
176
Note: See TracBrowser for help on using the repository browser.