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