Ignore SIGCHLD.
[tinc] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31 fi
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46 #
47 # Check to make sure that the build environment is sane.
48 #
49
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
52 # Just in case
53 sleep 1
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments.  Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
59 # directory).
60 if (
61    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62    if test "[$]*" = "X"; then
63       # -L didn't work.
64       set X `ls -t $srcdir/configure conftestfile`
65    fi
66    if test "[$]*" != "X $srcdir/configure conftestfile" \
67       && test "[$]*" != "X conftestfile $srcdir/configure"; then
68
69       # If neither matched, then we have a broken ls.  This can happen
70       # if, for instance, CONFIG_SHELL is bash and it inherits a
71       # broken ls alias from the environment.  This has actually
72       # happened.  Such a system could not be considered "sane".
73       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
74 alias in your environment])
75    fi
76
77    test "[$]2" = conftestfile
78    )
79 then
80    # Ok.
81    :
82 else
83    AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
85 fi
86 rm -f conftest*
87 AC_MSG_RESULT(yes)])
88
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf.  Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
97    $1=$2
98    AC_MSG_RESULT(found)
99 else
100    $1="$3/missing $2"
101    AC_MSG_RESULT(missing)
102 fi
103 AC_SUBST($1)])
104
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
106
107 AC_DEFUN(AM_CONFIG_HEADER,
108 [AC_PREREQ([2.12])
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated.  We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
117 <<am_indx=1
118 for am_file in <<$1>>; do
119   case " <<$>>CONFIG_HEADERS " in
120   *" <<$>>am_file "*<<)>>
121     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
122     ;;
123   esac
124   am_indx=`expr "<<$>>am_indx" + 1`
125 done<<>>dnl>>)
126 changequote([,]))])
127
128 #serial 1
129
130 dnl From Jim Meyering.
131 dnl Find a new-enough version of Perl.
132 dnl
133
134 AC_DEFUN(jm_PERL,
135 [
136   dnl FIXME: don't hard-code 5.003
137   dnl FIXME: should we cache the result?
138   AC_MSG_CHECKING([for perl5.003 or newer])
139   if test "${PERL+set}" = set; then
140     # `PERL' is set in the user's environment.
141     candidate_perl_names="$PERL"
142     perl_specified=yes
143   else
144     candidate_perl_names='perl perl5'
145     perl_specified=no
146   fi
147
148   found=no
149   AC_SUBST(PERL)
150   PERL="$missing_dir/missing perl"
151   for perl in $candidate_perl_names; do
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     if ( $perl -e 'require 5.003' ) > /dev/null 2>&1; then
155       PERL=$perl
156       found=yes
157       break
158     fi
159   done
160
161   AC_MSG_RESULT($found)
162   test $found = no && AC_MSG_WARN([
163 *** You don't seem to have perl5.003 or newer installed.
164 *** Because of that, you may be unable to regenerate certain files
165 *** if you modify the sources from which they are derived.] )
166 ])
167
168
169 # serial 40 AC_PROG_LIBTOOL
170 AC_DEFUN(AC_PROG_LIBTOOL,
171 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
172
173 # Save cache, so that ltconfig can load it
174 AC_CACHE_SAVE
175
176 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
177 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
178 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
179 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
180 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
181 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
182 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
183 || AC_MSG_ERROR([libtool configure failed])
184
185 # Reload cache, that may have been modified by ltconfig
186 AC_CACHE_LOAD
187
188 # This can be used to rebuild libtool when needed
189 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
190
191 # Always use our own libtool.
192 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
193 AC_SUBST(LIBTOOL)dnl
194
195 # Redirect the config.log output again, so that the ltconfig log is not
196 # clobbered by the next message.
197 exec 5>>./config.log
198 ])
199
200 AC_DEFUN(AC_LIBTOOL_SETUP,
201 [AC_PREREQ(2.13)dnl
202 AC_REQUIRE([AC_ENABLE_SHARED])dnl
203 AC_REQUIRE([AC_ENABLE_STATIC])dnl
204 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
205 AC_REQUIRE([AC_CANONICAL_HOST])dnl
206 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
207 AC_REQUIRE([AC_PROG_RANLIB])dnl
208 AC_REQUIRE([AC_PROG_CC])dnl
209 AC_REQUIRE([AC_PROG_LD])dnl
210 AC_REQUIRE([AC_PROG_NM])dnl
211 AC_REQUIRE([AC_PROG_LN_S])dnl
212 dnl
213
214 case "$target" in
215 NONE) lt_target="$host" ;;
216 *) lt_target="$target" ;;
217 esac
218
219 # Check for any special flags to pass to ltconfig.
220 libtool_flags="--cache-file=$cache_file"
221 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
222 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
223 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
224 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
225 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
226 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
227 [libtool_flags="$libtool_flags --enable-dlopen"])
228 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
229 [libtool_flags="$libtool_flags --enable-win32-dll"])
230 AC_ARG_ENABLE(libtool-lock,
231   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
232 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
233 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
234
235 # Some flags need to be propagated to the compiler or linker for good
236 # libtool support.
237 case "$lt_target" in
238 *-*-irix6*)
239   # Find out which ABI we are using.
240   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
241   if AC_TRY_EVAL(ac_compile); then
242     case "`/usr/bin/file conftest.o`" in
243     *32-bit*)
244       LD="${LD-ld} -32"
245       ;;
246     *N32*)
247       LD="${LD-ld} -n32"
248       ;;
249     *64-bit*)
250       LD="${LD-ld} -64"
251       ;;
252     esac
253   fi
254   rm -rf conftest*
255   ;;
256
257 *-*-sco3.2v5*)
258   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
259   SAVE_CFLAGS="$CFLAGS"
260   CFLAGS="$CFLAGS -belf"
261   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
262     [AC_LANG_SAVE
263      AC_LANG_C
264      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
265      AC_LANG_RESTORE])
266   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
267     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
268     CFLAGS="$SAVE_CFLAGS"
269   fi
270   ;;
271
272 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
273 [*-*-cygwin* | *-*-mingw*)
274   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
275   AC_CHECK_TOOL(AS, as, false)
276   AC_CHECK_TOOL(OBJDUMP, objdump, false)
277   ;;
278 ])
279 esac
280 ])
281
282 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
283 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
284
285 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
286 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
287
288 # AC_ENABLE_SHARED - implement the --enable-shared flag
289 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
290 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
291 #   `yes'.
292 AC_DEFUN(AC_ENABLE_SHARED, [dnl
293 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
294 AC_ARG_ENABLE(shared,
295 changequote(<<, >>)dnl
296 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
297 changequote([, ])dnl
298 [p=${PACKAGE-default}
299 case "$enableval" in
300 yes) enable_shared=yes ;;
301 no) enable_shared=no ;;
302 *)
303   enable_shared=no
304   # Look at the argument we got.  We use all the common list separators.
305   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
306   for pkg in $enableval; do
307     if test "X$pkg" = "X$p"; then
308       enable_shared=yes
309     fi
310   done
311   IFS="$ac_save_ifs"
312   ;;
313 esac],
314 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
315 ])
316
317 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
318 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
319 AC_ENABLE_SHARED(no)])
320
321 # AC_ENABLE_STATIC - implement the --enable-static flag
322 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
323 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
324 #   `yes'.
325 AC_DEFUN(AC_ENABLE_STATIC, [dnl
326 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
327 AC_ARG_ENABLE(static,
328 changequote(<<, >>)dnl
329 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
330 changequote([, ])dnl
331 [p=${PACKAGE-default}
332 case "$enableval" in
333 yes) enable_static=yes ;;
334 no) enable_static=no ;;
335 *)
336   enable_static=no
337   # Look at the argument we got.  We use all the common list separators.
338   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
339   for pkg in $enableval; do
340     if test "X$pkg" = "X$p"; then
341       enable_static=yes
342     fi
343   done
344   IFS="$ac_save_ifs"
345   ;;
346 esac],
347 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
348 ])
349
350 # AC_DISABLE_STATIC - set the default static flag to --disable-static
351 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
352 AC_ENABLE_STATIC(no)])
353
354
355 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
356 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
357 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
358 #   `yes'.
359 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
360 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
361 AC_ARG_ENABLE(fast-install,
362 changequote(<<, >>)dnl
363 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
364 changequote([, ])dnl
365 [p=${PACKAGE-default}
366 case "$enableval" in
367 yes) enable_fast_install=yes ;;
368 no) enable_fast_install=no ;;
369 *)
370   enable_fast_install=no
371   # Look at the argument we got.  We use all the common list separators.
372   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
373   for pkg in $enableval; do
374     if test "X$pkg" = "X$p"; then
375       enable_fast_install=yes
376     fi
377   done
378   IFS="$ac_save_ifs"
379   ;;
380 esac],
381 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
382 ])
383
384 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
385 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
386 AC_ENABLE_FAST_INSTALL(no)])
387
388 # AC_PROG_LD - find the path to the GNU or non-GNU linker
389 AC_DEFUN(AC_PROG_LD,
390 [AC_ARG_WITH(gnu-ld,
391 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
392 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
393 AC_REQUIRE([AC_PROG_CC])dnl
394 AC_REQUIRE([AC_CANONICAL_HOST])dnl
395 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
396 ac_prog=ld
397 if test "$ac_cv_prog_gcc" = yes; then
398   # Check if gcc -print-prog-name=ld gives a path.
399   AC_MSG_CHECKING([for ld used by GCC])
400   ac_prog=`($CC -print-prog-name=ld) 2>&5`
401   case "$ac_prog" in
402     # Accept absolute paths.
403 changequote(,)dnl
404     [\\/]* | [A-Za-z]:[\\/]*)
405       re_direlt='/[^/][^/]*/\.\./'
406 changequote([,])dnl
407       # Canonicalize the path of ld
408       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
409       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
410         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
411       done
412       test -z "$LD" && LD="$ac_prog"
413       ;;
414   "")
415     # If it fails, then pretend we aren't using GCC.
416     ac_prog=ld
417     ;;
418   *)
419     # If it is relative, then search for the first ld in PATH.
420     with_gnu_ld=unknown
421     ;;
422   esac
423 elif test "$with_gnu_ld" = yes; then
424   AC_MSG_CHECKING([for GNU ld])
425 else
426   AC_MSG_CHECKING([for non-GNU ld])
427 fi
428 AC_CACHE_VAL(ac_cv_path_LD,
429 [if test -z "$LD"; then
430   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
431   for ac_dir in $PATH; do
432     test -z "$ac_dir" && ac_dir=.
433     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
434       ac_cv_path_LD="$ac_dir/$ac_prog"
435       # Check to see if the program is GNU ld.  I'd rather use --version,
436       # but apparently some GNU ld's only accept -v.
437       # Break only if it was the GNU/non-GNU ld that we prefer.
438       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
439         test "$with_gnu_ld" != no && break
440       else
441         test "$with_gnu_ld" != yes && break
442       fi
443     fi
444   done
445   IFS="$ac_save_ifs"
446 else
447   ac_cv_path_LD="$LD" # Let the user override the test with a path.
448 fi])
449 LD="$ac_cv_path_LD"
450 if test -n "$LD"; then
451   AC_MSG_RESULT($LD)
452 else
453   AC_MSG_RESULT(no)
454 fi
455 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
456 AC_PROG_LD_GNU
457 ])
458
459 AC_DEFUN(AC_PROG_LD_GNU,
460 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
461 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
462 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
463   ac_cv_prog_gnu_ld=yes
464 else
465   ac_cv_prog_gnu_ld=no
466 fi])
467 ])
468
469 # AC_PROG_NM - find the path to a BSD-compatible name lister
470 AC_DEFUN(AC_PROG_NM,
471 [AC_MSG_CHECKING([for BSD-compatible nm])
472 AC_CACHE_VAL(ac_cv_path_NM,
473 [if test -n "$NM"; then
474   # Let the user override the test.
475   ac_cv_path_NM="$NM"
476 else
477   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
478   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
479     test -z "$ac_dir" && ac_dir=.
480     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
481       # Check to see if the nm accepts a BSD-compat flag.
482       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
483       #   nm: unknown option "B" ignored
484       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
485         ac_cv_path_NM="$ac_dir/nm -B"
486         break
487       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
488         ac_cv_path_NM="$ac_dir/nm -p"
489         break
490       else
491         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
492         continue # so that we can try to find one that supports BSD flags
493       fi
494     fi
495   done
496   IFS="$ac_save_ifs"
497   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
498 fi])
499 NM="$ac_cv_path_NM"
500 AC_MSG_RESULT([$NM])
501 ])
502
503 # AC_CHECK_LIBM - check for math library
504 AC_DEFUN(AC_CHECK_LIBM,
505 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
506 LIBM=
507 case "$lt_target" in
508 *-*-beos* | *-*-cygwin*)
509   # These system don't have libm
510   ;;
511 *-ncr-sysv4.3*)
512   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
513   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
514   ;;
515 *)
516   AC_CHECK_LIB(m, main, LIBM="-lm")
517   ;;
518 esac
519 ])
520
521 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
522 # the libltdl convenience library, adds --enable-ltdl-convenience to
523 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
524 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
525 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
526 # '${top_builddir}/' (note the single quotes!) if your package is not
527 # flat, and, if you're not using automake, define top_builddir as
528 # appropriate in the Makefiles.
529 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
530   case "$enable_ltdl_convenience" in
531   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
532   "") enable_ltdl_convenience=yes
533       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
534   esac
535   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
536   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
537 ])
538
539 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
540 # the libltdl installable library, and adds --enable-ltdl-install to
541 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
542 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
543 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
544 # '${top_builddir}/' (note the single quotes!) if your package is not
545 # flat, and, if you're not using automake, define top_builddir as
546 # appropriate in the Makefiles.
547 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
548 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
549   AC_CHECK_LIB(ltdl, main,
550   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
551   [if test x"$enable_ltdl_install" = xno; then
552      AC_MSG_WARN([libltdl not installed, but installation disabled])
553    else
554      enable_ltdl_install=yes
555    fi
556   ])
557   if test x"$enable_ltdl_install" = x"yes"; then
558     ac_configure_args="$ac_configure_args --enable-ltdl-install"
559     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
560     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
561   else
562     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
563     LIBLTDL="-lltdl"
564     INCLTDL=
565   fi
566 ])
567
568 dnl old names
569 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
570 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
571 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
572 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
573 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
574 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
575 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
576
577 dnl This is just to silence aclocal about the macro not being used
578 ifelse([AC_DISABLE_FAST_INSTALL])dnl
579
580 #serial 1
581
582 dnl From Jim Meyering.
583 dnl Determine whether malloc accepts 0 as its argument.
584 dnl If it doesn't, arrange to use the replacement function.
585 dnl
586 dnl If you use this macro in a package, you should
587 dnl add the following two lines to acconfig.h:
588 dnl  /* Define to rpl_malloc if the replacement function should be used.  */
589 dnl  #undef malloc
590 dnl
591
592 AC_DEFUN(jm_FUNC_MALLOC,
593 [
594  if test x = y; then
595    dnl This code is deliberately never run via ./configure.
596    dnl FIXME: this is a gross hack to make autoheader put an entry
597    dnl for this symbol in config.h.in.
598    AC_CHECK_FUNCS(DONE_WORKING_MALLOC_CHECK)
599  fi
600  dnl xmalloc.c requires that this symbol be defined so it doesn't
601  dnl mistakenly use a broken malloc -- as it might if this test were omitted.
602  ac_kludge=HAVE_DONE_WORKING_MALLOC_CHECK
603  AC_DEFINE_UNQUOTED($ac_kludge)
604
605  AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
606   [AC_TRY_RUN([
607     char *malloc ();
608     int
609     main ()
610     {
611       exit (malloc (0) ? 0 : 1);
612     }
613           ],
614          jm_cv_func_working_malloc=yes,
615          jm_cv_func_working_malloc=no,
616          dnl When crosscompiling, assume malloc is broken.
617          jm_cv_func_working_malloc=no)
618   ])
619   if test $jm_cv_func_working_malloc = no; then
620     LIBOBJS="$LIBOBJS malloc.o"
621     AC_DEFINE_UNQUOTED(malloc, rpl_malloc)
622   fi
623 ])
624
625 #serial 1
626
627 dnl From Jim Meyering.
628 dnl Determine whether realloc works when both arguments are 0.
629 dnl If it doesn't, arrange to use the replacement function.
630 dnl
631 dnl If you use this macro in a package, you should
632 dnl add the following two lines to acconfig.h:
633 dnl  /* Define to rpl_realloc if the replacement function should be used.  */
634 dnl  #undef realloc
635 dnl
636
637 AC_DEFUN(jm_FUNC_REALLOC,
638 [
639  if test x = y; then
640    dnl This code is deliberately never run via ./configure.
641    dnl FIXME: this is a gross hack to make autoheader put an entry
642    dnl for this symbol in config.h.in.
643    AC_CHECK_FUNCS(DONE_WORKING_REALLOC_CHECK)
644  fi
645  dnl xmalloc.c requires that this symbol be defined so it doesn't
646  dnl mistakenly use a broken realloc -- as it might if this test were omitted.
647  ac_kludge=HAVE_DONE_WORKING_REALLOC_CHECK
648  AC_DEFINE_UNQUOTED($ac_kludge)
649
650  AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
651   [AC_TRY_RUN([
652     char *realloc ();
653     int
654     main ()
655     {
656       exit (realloc (0, 0) ? 0 : 1);
657     }
658           ],
659          jm_cv_func_working_realloc=yes,
660          jm_cv_func_working_realloc=no,
661          dnl When crosscompiling, assume realloc is broken.
662          jm_cv_func_working_realloc=no)
663   ])
664   if test $jm_cv_func_working_realloc = no; then
665     LIBOBJS="$LIBOBJS realloc.o"
666     AC_DEFINE_UNQUOTED(realloc, rpl_realloc)
667   fi
668 ])
669