]> git.sur5r.net Git - openldap/blob - aclocal.m4
regen
[openldap] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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 dnl $OpenLDAP$
14 dnl
15 dnl Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved.
16 dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file
17 dnl
18 dnl OpenLDAP Autoconf Macros
19 dnl
20 divert(-1)
21 builtin(include, build/openldap.m4)dnl
22
23 # Do all the work for Automake.  This macro actually does too much --
24 # some checks are only needed if your package does certain things.
25 # But this isn't really a big deal.
26
27 # serial 1
28
29 dnl Usage:
30 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
31
32 AC_DEFUN(AM_INIT_AUTOMAKE,
33 [AC_REQUIRE([AC_PROG_INSTALL])
34 dnl We require 2.13 because we rely on SHELL being computed by configure.
35 AC_PREREQ([2.13])
36 PACKAGE=[$1]
37 AC_SUBST(PACKAGE)
38 VERSION=[$2]
39 AC_SUBST(VERSION)
40 dnl test to see if srcdir already configured
41 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
42   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
43 fi
44 ifelse([$3],,
45 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
46 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
47 AC_REQUIRE([AM_SANITY_CHECK])
48 AC_REQUIRE([AC_ARG_PROGRAM])
49 dnl FIXME This is truly gross.
50 missing_dir=`cd $ac_aux_dir && pwd`
51 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
52 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
53 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
54 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
55 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
56 dnl Set install_sh for make dist
57 install_sh="$missing_dir/install-sh"
58 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
59 AC_SUBST(install_sh)
60 dnl We check for tar when the user configures the end package.
61 dnl This is sad, since we only need this for "dist".  However,
62 dnl there's no other good way to do it.  We prefer GNU tar if
63 dnl we can find it.  If we can't find a tar, it doesn't really matter.
64 AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
65 dnl We need awk for the "check" target.  The system "awk" is bad on
66 dnl some platforms.
67 AC_REQUIRE([AC_PROG_AWK])
68 AMTARFLAGS=
69 if test -n "$AMTAR"; then
70   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
71     dnl We have GNU tar.
72     AMTARFLAGS=o
73   fi
74 fi
75 AC_SUBST(AMTARFLAGS)
76 AC_REQUIRE([AC_PROG_MAKE_SET])])
77
78 #
79 # Check to make sure that the build environment is sane.
80 #
81
82 AC_DEFUN(AM_SANITY_CHECK,
83 [AC_MSG_CHECKING([whether build environment is sane])
84 # Just in case
85 sleep 1
86 echo timestamp > conftestfile
87 # Do `set' in a subshell so we don't clobber the current shell's
88 # arguments.  Must try -L first in case configure is actually a
89 # symlink; some systems play weird games with the mod time of symlinks
90 # (eg FreeBSD returns the mod time of the symlink's containing
91 # directory).
92 if (
93    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
94    if test "[$]*" = "X"; then
95       # -L didn't work.
96       set X `ls -t $srcdir/configure conftestfile`
97    fi
98    if test "[$]*" != "X $srcdir/configure conftestfile" \
99       && test "[$]*" != "X conftestfile $srcdir/configure"; then
100
101       # If neither matched, then we have a broken ls.  This can happen
102       # if, for instance, CONFIG_SHELL is bash and it inherits a
103       # broken ls alias from the environment.  This has actually
104       # happened.  Such a system could not be considered "sane".
105       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
106 alias in your environment])
107    fi
108
109    test "[$]2" = conftestfile
110    )
111 then
112    # Ok.
113    :
114 else
115    AC_MSG_ERROR([newly created file is older than distributed files!
116 Check your system clock])
117 fi
118 rm -f conftest*
119 AC_MSG_RESULT(yes)])
120
121 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
122 dnl The program must properly implement --version.
123 AC_DEFUN(AM_MISSING_PROG,
124 [AC_MSG_CHECKING(for working $2)
125 # Run test in a subshell; some versions of sh will print an error if
126 # an executable is not found, even if stderr is redirected.
127 # Redirect stdin to placate older versions of autoconf.  Sigh.
128 if ($2 --version) < /dev/null > /dev/null 2>&1; then
129    $1=$2
130    AC_MSG_RESULT(found)
131 else
132    $1="$3/missing $2"
133    AC_MSG_RESULT(missing)
134 fi
135 AC_SUBST($1)])
136
137
138 # serial 40 AC_PROG_LIBTOOL
139 AC_DEFUN(AC_PROG_LIBTOOL,
140 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
141
142 # Save cache, so that ltconfig can load it
143 AC_CACHE_SAVE
144
145 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
146 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
147 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
148 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
149 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
150 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
151 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
152 || AC_MSG_ERROR([libtool configure failed])
153
154 # Reload cache, that may have been modified by ltconfig
155 AC_CACHE_LOAD
156
157 # This can be used to rebuild libtool when needed
158 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
159
160 # Always use our own libtool.
161 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
162 AC_SUBST(LIBTOOL)dnl
163
164 # Redirect the config.log output again, so that the ltconfig log is not
165 # clobbered by the next message.
166 exec 5>>./config.log
167 ])
168
169 AC_DEFUN(AC_LIBTOOL_SETUP,
170 [AC_PREREQ(2.13)dnl
171 AC_REQUIRE([AC_ENABLE_SHARED])dnl
172 AC_REQUIRE([AC_ENABLE_STATIC])dnl
173 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
174 AC_REQUIRE([AC_CANONICAL_HOST])dnl
175 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
176 AC_REQUIRE([AC_PROG_RANLIB])dnl
177 AC_REQUIRE([AC_PROG_CC])dnl
178 AC_REQUIRE([AC_PROG_LD])dnl
179 AC_REQUIRE([AC_PROG_NM])dnl
180 AC_REQUIRE([AC_PROG_LN_S])dnl
181 dnl
182
183 case "$target" in
184 NONE) lt_target="$host" ;;
185 *) lt_target="$target" ;;
186 esac
187
188 # Check for any special flags to pass to ltconfig.
189 libtool_flags="--cache-file=$cache_file"
190 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
191 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
192 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
193 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
194 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
195 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
196 [libtool_flags="$libtool_flags --enable-dlopen"])
197 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
198 [libtool_flags="$libtool_flags --enable-win32-dll"])
199 AC_ARG_ENABLE(libtool-lock,
200   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
201 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
202 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
203
204 # Some flags need to be propagated to the compiler or linker for good
205 # libtool support.
206 case "$lt_target" in
207 *-*-irix6*)
208   # Find out which ABI we are using.
209   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
210   if AC_TRY_EVAL(ac_compile); then
211     case "`/usr/bin/file conftest.o`" in
212     *32-bit*)
213       LD="${LD-ld} -32"
214       ;;
215     *N32*)
216       LD="${LD-ld} -n32"
217       ;;
218     *64-bit*)
219       LD="${LD-ld} -64"
220       ;;
221     esac
222   fi
223   rm -rf conftest*
224   ;;
225
226 *-*-sco3.2v5*)
227   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
228   SAVE_CFLAGS="$CFLAGS"
229   CFLAGS="$CFLAGS -belf"
230   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
231     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
232   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
233     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
234     CFLAGS="$SAVE_CFLAGS"
235   fi
236   ;;
237
238 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
239 [*-*-cygwin* | *-*-mingw*)
240   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
241   AC_CHECK_TOOL(AS, as, false)
242   AC_CHECK_TOOL(OBJDUMP, objdump, false)
243   ;;
244 ])
245 esac
246 ])
247
248 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
249 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
250
251 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
252 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
253
254 # AC_ENABLE_SHARED - implement the --enable-shared flag
255 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
256 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
257 #   `yes'.
258 AC_DEFUN(AC_ENABLE_SHARED, [dnl
259 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
260 AC_ARG_ENABLE(shared,
261 changequote(<<, >>)dnl
262 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
263 changequote([, ])dnl
264 [p=${PACKAGE-default}
265 case "$enableval" in
266 yes) enable_shared=yes ;;
267 no) enable_shared=no ;;
268 *)
269   enable_shared=no
270   # Look at the argument we got.  We use all the common list separators.
271   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
272   for pkg in $enableval; do
273     if test "X$pkg" = "X$p"; then
274       enable_shared=yes
275     fi
276   done
277   IFS="$ac_save_ifs"
278   ;;
279 esac],
280 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
281 ])
282
283 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
284 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
285 AC_ENABLE_SHARED(no)])
286
287 # AC_ENABLE_STATIC - implement the --enable-static flag
288 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
289 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
290 #   `yes'.
291 AC_DEFUN(AC_ENABLE_STATIC, [dnl
292 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
293 AC_ARG_ENABLE(static,
294 changequote(<<, >>)dnl
295 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
296 changequote([, ])dnl
297 [p=${PACKAGE-default}
298 case "$enableval" in
299 yes) enable_static=yes ;;
300 no) enable_static=no ;;
301 *)
302   enable_static=no
303   # Look at the argument we got.  We use all the common list separators.
304   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
305   for pkg in $enableval; do
306     if test "X$pkg" = "X$p"; then
307       enable_static=yes
308     fi
309   done
310   IFS="$ac_save_ifs"
311   ;;
312 esac],
313 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
314 ])
315
316 # AC_DISABLE_STATIC - set the default static flag to --disable-static
317 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
318 AC_ENABLE_STATIC(no)])
319
320
321 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
322 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
323 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
324 #   `yes'.
325 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
326 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
327 AC_ARG_ENABLE(fast-install,
328 changequote(<<, >>)dnl
329 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
330 changequote([, ])dnl
331 [p=${PACKAGE-default}
332 case "$enableval" in
333 yes) enable_fast_install=yes ;;
334 no) enable_fast_install=no ;;
335 *)
336   enable_fast_install=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_fast_install=yes
342     fi
343   done
344   IFS="$ac_save_ifs"
345   ;;
346 esac],
347 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
348 ])
349
350 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
351 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
352 AC_ENABLE_FAST_INSTALL(no)])
353
354 # AC_PROG_LD - find the path to the GNU or non-GNU linker
355 AC_DEFUN(AC_PROG_LD,
356 [AC_ARG_WITH(gnu-ld,
357 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
358 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
359 AC_REQUIRE([AC_PROG_CC])dnl
360 AC_REQUIRE([AC_CANONICAL_HOST])dnl
361 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
362 ac_prog=ld
363 if test "$ac_cv_prog_gcc" = yes; then
364   # Check if gcc -print-prog-name=ld gives a path.
365   AC_MSG_CHECKING([for ld used by GCC])
366   ac_prog=`($CC -print-prog-name=ld) 2>&5`
367   case "$ac_prog" in
368     # Accept absolute paths.
369 changequote(,)dnl
370     [\\/]* | [A-Za-z]:[\\/]*)
371       re_direlt='/[^/][^/]*/\.\./'
372 changequote([,])dnl
373       # Canonicalize the path of ld
374       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
375       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
376         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
377       done
378       test -z "$LD" && LD="$ac_prog"
379       ;;
380   "")
381     # If it fails, then pretend we aren't using GCC.
382     ac_prog=ld
383     ;;
384   *)
385     # If it is relative, then search for the first ld in PATH.
386     with_gnu_ld=unknown
387     ;;
388   esac
389 elif test "$with_gnu_ld" = yes; then
390   AC_MSG_CHECKING([for GNU ld])
391 else
392   AC_MSG_CHECKING([for non-GNU ld])
393 fi
394 AC_CACHE_VAL(ac_cv_path_LD,
395 [if test -z "$LD"; then
396   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
397   for ac_dir in $PATH; do
398     test -z "$ac_dir" && ac_dir=.
399     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
400       ac_cv_path_LD="$ac_dir/$ac_prog"
401       # Check to see if the program is GNU ld.  I'd rather use --version,
402       # but apparently some GNU ld's only accept -v.
403       # Break only if it was the GNU/non-GNU ld that we prefer.
404       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
405         test "$with_gnu_ld" != no && break
406       else
407         test "$with_gnu_ld" != yes && break
408       fi
409     fi
410   done
411   IFS="$ac_save_ifs"
412 else
413   ac_cv_path_LD="$LD" # Let the user override the test with a path.
414 fi])
415 LD="$ac_cv_path_LD"
416 if test -n "$LD"; then
417   AC_MSG_RESULT($LD)
418 else
419   AC_MSG_RESULT(no)
420 fi
421 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
422 AC_PROG_LD_GNU
423 ])
424
425 AC_DEFUN(AC_PROG_LD_GNU,
426 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
427 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
428 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
429   ac_cv_prog_gnu_ld=yes
430 else
431   ac_cv_prog_gnu_ld=no
432 fi])
433 ])
434
435 # AC_PROG_NM - find the path to a BSD-compatible name lister
436 AC_DEFUN(AC_PROG_NM,
437 [AC_MSG_CHECKING([for BSD-compatible nm])
438 AC_CACHE_VAL(ac_cv_path_NM,
439 [if test -n "$NM"; then
440   # Let the user override the test.
441   ac_cv_path_NM="$NM"
442 else
443   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
444   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
445     test -z "$ac_dir" && ac_dir=.
446     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
447       # Check to see if the nm accepts a BSD-compat flag.
448       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
449       #   nm: unknown option "B" ignored
450       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
451         ac_cv_path_NM="$ac_dir/nm -B"
452         break
453       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
454         ac_cv_path_NM="$ac_dir/nm -p"
455         break
456       else
457         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
458         continue # so that we can try to find one that supports BSD flags
459       fi
460     fi
461   done
462   IFS="$ac_save_ifs"
463   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
464 fi])
465 NM="$ac_cv_path_NM"
466 AC_MSG_RESULT([$NM])
467 ])
468
469 # AC_CHECK_LIBM - check for math library
470 AC_DEFUN(AC_CHECK_LIBM,
471 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
472 LIBM=
473 case "$lt_target" in
474 *-*-beos* | *-*-cygwin*)
475   # These system don't have libm
476   ;;
477 *-ncr-sysv4.3*)
478   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
479   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
480   ;;
481 *)
482   AC_CHECK_LIB(m, main, LIBM="-lm")
483   ;;
484 esac
485 ])
486
487 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
488 # the libltdl convenience library and INCLTDL to the include flags for
489 # the libltdl header and adds --enable-ltdl-convenience to the
490 # configure arguments.  Note that LIBLTDL and INCLTDL are not
491 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
492 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
493 # with '${top_builddir}/' and INCLTDL will be prefixed with
494 # '${top_srcdir}/' (note the single quotes!).  If your package is not
495 # flat and you're not using automake, define top_builddir and
496 # top_srcdir appropriately in the Makefiles.
497 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
498   case "$enable_ltdl_convenience" in
499   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
500   "") enable_ltdl_convenience=yes
501       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
502   esac
503   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
504   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
505 ])
506
507 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
508 # the libltdl installable library and INCLTDL to the include flags for
509 # the libltdl header and adds --enable-ltdl-install to the configure
510 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
511 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
512 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
513 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
514 # with '${top_srcdir}/' (note the single quotes!).  If your package is
515 # not flat and you're not using automake, define top_builddir and
516 # top_srcdir appropriately in the Makefiles.
517 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
518 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
519   AC_CHECK_LIB(ltdl, main,
520   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
521   [if test x"$enable_ltdl_install" = xno; then
522      AC_MSG_WARN([libltdl not installed, but installation disabled])
523    else
524      enable_ltdl_install=yes
525    fi
526   ])
527   if test x"$enable_ltdl_install" = x"yes"; then
528     ac_configure_args="$ac_configure_args --enable-ltdl-install"
529     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
530     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
531   else
532     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
533     LIBLTDL="-lltdl"
534     INCLTDL=
535   fi
536 ])
537
538 dnl old names
539 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
540 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
541 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
542 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
543 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
544 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
545 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
546
547 dnl This is just to silence aclocal about the macro not being used
548 ifelse([AC_DISABLE_FAST_INSTALL])dnl
549
550
551 # serial 1
552
553 # @defmac AC_PROG_CC_STDC
554 # @maindex PROG_CC_STDC
555 # @ovindex CC
556 # If the C compiler in not in ANSI C mode by default, try to add an option
557 # to output variable @code{CC} to make it so.  This macro tries various
558 # options that select ANSI C on some system or another.  It considers the
559 # compiler to be in ANSI C mode if it handles function prototypes correctly.
560 #
561 # If you use this macro, you should check after calling it whether the C
562 # compiler has been set to accept ANSI C; if not, the shell variable
563 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
564 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
565 # program @code{ansi2knr}, which comes with Ghostscript.
566 # @end defmac
567
568 AC_DEFUN(AM_PROG_CC_STDC,
569 [AC_REQUIRE([AC_PROG_CC])
570 AC_BEFORE([$0], [AC_C_INLINE])
571 AC_BEFORE([$0], [AC_C_CONST])
572 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
573 dnl a magic option to avoid problems with ANSI preprocessor commands
574 dnl like #elif.
575 dnl FIXME: can't do this because then AC_AIX won't work due to a
576 dnl circular dependency.
577 dnl AC_BEFORE([$0], [AC_PROG_CPP])
578 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
579 AC_CACHE_VAL(am_cv_prog_cc_stdc,
580 [am_cv_prog_cc_stdc=no
581 ac_save_CC="$CC"
582 # Don't try gcc -ansi; that turns off useful extensions and
583 # breaks some systems' header files.
584 # AIX                   -qlanglvl=ansi
585 # Ultrix and OSF/1      -std1
586 # HP-UX 10.20 and later -Ae
587 # HP-UX older versions  -Aa -D_HPUX_SOURCE
588 # SVR4                  -Xc -D__EXTENSIONS__
589 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
590 do
591   CC="$ac_save_CC $ac_arg"
592   AC_TRY_COMPILE(
593 [#include <stdarg.h>
594 #include <stdio.h>
595 #include <sys/types.h>
596 #include <sys/stat.h>
597 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
598 struct buf { int x; };
599 FILE * (*rcsopen) (struct buf *, struct stat *, int);
600 static char *e (p, i)
601      char **p;
602      int i;
603 {
604   return p[i];
605 }
606 static char *f (char * (*g) (char **, int), char **p, ...)
607 {
608   char *s;
609   va_list v;
610   va_start (v,p);
611   s = g (p, va_arg (v,int));
612   va_end (v);
613   return s;
614 }
615 int test (int i, double x);
616 struct s1 {int (*f) (int a);};
617 struct s2 {int (*f) (double a);};
618 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
619 int argc;
620 char **argv;
621 ], [
622 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
623 ],
624 [am_cv_prog_cc_stdc="$ac_arg"; break])
625 done
626 CC="$ac_save_CC"
627 ])
628 if test -z "$am_cv_prog_cc_stdc"; then
629   AC_MSG_RESULT([none needed])
630 else
631   AC_MSG_RESULT($am_cv_prog_cc_stdc)
632 fi
633 case "x$am_cv_prog_cc_stdc" in
634   x|xno) ;;
635   *) CC="$CC $am_cv_prog_cc_stdc" ;;
636 esac
637 ])
638
639 dnl From Jim Meyering.
640
641 # serial 1
642
643 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
644 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
645  AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
646                 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
647   [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
648
649   gwinsz_in_termios_h=no
650   if test $am_cv_sys_posix_termios = yes; then
651     AC_EGREP_CPP([yes],
652     [#include <sys/types.h>
653 #     include <termios.h>
654 #     ifdef TIOCGWINSZ
655         yes
656 #     endif
657     ], gwinsz_in_termios_h=yes)
658   fi
659
660   if test $gwinsz_in_termios_h = no; then
661     AC_EGREP_CPP([yes],
662     [#include <sys/types.h>
663 #     include <sys/ioctl.h>
664 #     ifdef TIOCGWINSZ
665         yes
666 #     endif
667     ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
668   fi
669   ])
670   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
671     AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
672               [Define if TIOCGWINSZ requires sys/ioctl.h])
673   fi
674 ])
675
676 dnl From Jim Meyering.
677
678 # serial 1
679
680 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
681 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
682   [AC_TRY_LINK([#include <sys/types.h>
683 #include <unistd.h>
684 #include <termios.h>],
685   [/* SunOS 4.0.3 has termios.h but not the library calls.  */
686    tcgetattr(0, 0);],
687   am_cv_sys_posix_termios=yes,
688   am_cv_sys_posix_termios=no)])
689 ])
690
691 # From Ulrich Drepper.
692
693 # serial 1
694
695 AC_DEFUN(AM_TYPE_PTRDIFF_T,
696   [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
697      [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
698                      am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
699    if test $am_cv_type_ptrdiff_t = yes; then
700      AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])
701    fi
702 ])
703