1 dnl aclocal.m4 generated automatically by aclocal 1.2
3 sinclude(../bfd/acinclude.m4)
5 # Do all the work for Automake. This macro actually does too much --
6 # some checks are only needed if your package does certain things.
7 # But this isn't really a big deal.
12 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
14 AC_DEFUN(AM_INIT_AUTOMAKE,
15 [AC_REQUIRE([AM_PROG_INSTALL])
20 dnl test to see if srcdir already configured
21 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
22 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
25 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
26 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
29 dnl FIXME This is truly gross.
30 missing_dir=`cd $ac_aux_dir && pwd`
31 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
32 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
33 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
34 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
35 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
41 AC_DEFUN(AM_PROG_INSTALL,
42 [AC_REQUIRE([AC_PROG_INSTALL])
43 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
44 AC_SUBST(INSTALL_SCRIPT)dnl
48 # Check to make sure that the build environment is sane.
51 AC_DEFUN(AM_SANITY_CHECK,
52 [AC_MSG_CHECKING([whether build environment is sane])
55 echo timestamp > conftestfile
56 # Do `set' in a subshell so we don't clobber the current shell's
57 # arguments. Must try -L first in case configure is actually a
58 # symlink; some systems play weird games with the mod time of symlinks
59 # (eg FreeBSD returns the mod time of the symlink's containing
62 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
63 if test "$@" = "X"; then
65 set X `ls -t $srcdir/configure conftestfile`
67 test "[$]2" = conftestfile
73 AC_MSG_ERROR([newly created file is older than distributed files!
74 Check your system clock])
79 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
80 dnl The program must properly implement --version.
81 AC_DEFUN(AM_MISSING_PROG,
82 [AC_MSG_CHECKING(for working $2)
83 # Run test in a subshell; some versions of sh will print an error if
84 # an executable is not found, even if stderr is redirected.
85 # Redirect stdin to placate older versions of autoconf. Sigh.
86 if ($2 --version) < /dev/null > /dev/null 2>&1; then
91 AC_MSG_RESULT(missing)
96 # serial 9 AM_PROG_LIBTOOL
97 AC_DEFUN(AM_PROG_LIBTOOL,
98 [AC_REQUIRE([AC_CANONICAL_HOST])
99 AC_REQUIRE([AC_PROG_CC])
100 AC_REQUIRE([AC_PROG_RANLIB])
101 AC_REQUIRE([AM_PROG_LD])
102 AC_REQUIRE([AC_PROG_LN_S])
104 # Always use our own libtool.
105 LIBTOOL='$(top_builddir)/libtool'
108 dnl Allow the --disable-shared flag to stop us from building shared libs.
109 AC_ARG_ENABLE(shared,
110 [ --enable-shared build shared libraries [default=yes]],
111 [case "$enableval" in
112 yes) enable_shared=yes ;;
113 no) enable_shared=no ;;
114 *opcodes*) enable_shared=yes ;;
118 test "$enable_shared" = no && libtool_shared=" --disable-shared"
120 dnl Allow the --disable-static flag to stop us from building static libs.
121 AC_ARG_ENABLE(static,
122 [ --enable-static build static libraries [default=yes]],
123 [if test "$enableval" = no; then
129 test "$enable_static" = no && libtool_static=" --disable-static"
131 libtool_flags="$libtool_shared$libtool_static"
132 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
133 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
134 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
136 # Some flags need to be propagated to the compiler or linker for good
140 ac_save_CFLAGS="$CFLAGS"
141 # -n32 always needs to be added to the linker when using GCC.
142 test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
143 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
144 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
148 CFLAGS="$ac_save_CFLAGS"
152 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
153 CFLAGS="$CFLAGS -belf"
157 # Actually configure libtool. ac_aux_dir is where install-sh is found.
158 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
159 LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
160 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
161 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
162 || AC_MSG_ERROR([libtool configure failed])
165 # AM_PROG_LD - find the path to the GNU or non-GNU linker
168 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
169 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
170 if test "$with_gnu_ld" = yes; then
171 AC_MSG_CHECKING([for GNU ld])
173 AC_MSG_CHECKING([for non-GNU ld])
175 AC_CACHE_VAL(ac_cv_path_LD,
178 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
179 for ac_dir in $PATH; do
180 test -z "$ac_dir" && ac_dir=.
181 if test -f "$ac_dir/ld"; then
182 ac_cv_path_LD="$ac_dir/ld"
183 # Check to see if the program is GNU ld. I'd rather use --version,
184 # but apparently some GNU ld's only accept -v.
185 # Break only if it was the GNU/non-GNU ld that we prefer.
186 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
187 test "$with_gnu_ld" = yes && break
189 test "$with_gnu_ld" != yes && break
196 ac_cv_path_LD="$LD" # Let the user override the test with a path.
200 if test -n "$LD"; then
205 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
210 AC_DEFUN(AM_PROG_LD_GNU,
211 [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
212 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
213 if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
214 ac_cv_prog_gnu_ld=yes
220 # Like AC_CONFIG_HEADER, but automatically create stamp file.
222 AC_DEFUN(AM_CONFIG_HEADER,
224 AC_CONFIG_HEADER([$1])
225 dnl When config.status generates a header, we must update the stamp-h file.
226 dnl This file resides in the same directory as the config header
227 dnl that is generated. We must strip everything past the first ":",
228 dnl and everything past the last "/".
229 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
230 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
231 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
233 for am_file in <<$1>>; do
234 case " <<$>>CONFIG_HEADERS " in
235 *" <<$>>am_file "*<<)>>
236 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
239 am_indx=`expr "<<$>>am_indx" + 1`
243 # Add --enable-maintainer-mode option to configure.
248 AC_DEFUN(AM_MAINTAINER_MODE,
249 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
250 dnl maintainer-mode is disabled by default
251 AC_ARG_ENABLE(maintainer-mode,
252 [ --enable-maintainer-mode enable make rules and dependencies not useful
253 (and sometimes confusing) to the casual installer],
254 USE_MAINTAINER_MODE=$enableval,
255 USE_MAINTAINER_MODE=no)
256 AC_MSG_RESULT($USE_MAINTAINER_MODE)
257 if test $USE_MAINTAINER_MODE = yes; then
266 # Check to see if we're running under Cygwin32, without using
267 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
268 # Otherwise set it to "no".
271 AC_DEFUN(AM_CYGWIN32,
272 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
273 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
274 am_cv_cygwin32=yes, am_cv_cygwin32=no)
277 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
279 # Check to see if we're running under Win32, without using
280 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
281 # Otherwise set it to "".
284 dnl This knows we add .exe if we're building in the Cygwin32
285 dnl environment. But if we're not, then it compiles a test program
286 dnl to see if there is a suffix for executables.
288 [AC_REQUIRE([AM_CYGWIN32])
289 AC_REQUIRE([AM_MINGW32])
290 AC_MSG_CHECKING([for executable suffix])
291 AC_CACHE_VAL(am_cv_exeext,[
292 if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
295 cat > am_c_test.c << 'EOF'
297 /* Nothing needed here */
300 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
301 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
303 test x"${am_cv_exeext}" = x && am_cv_exeext=no
306 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
307 AC_MSG_RESULT(${am_cv_exeext})
310 # Check to see if we're running under Mingw, without using
311 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
312 # Otherwise set it to "no".
316 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
317 [AC_TRY_COMPILE(,[return __MINGW32__;],
318 am_cv_mingw32=yes, am_cv_mingw32=no)
321 test "$am_cv_mingw32" = yes && MINGW32=yes])