2 ## Id: aclocal.m4,v 1.1 2003/06/04 00:25:05 marka Exp
4 AC_DEFUN(AC_FIND_SYSTEM_SHOBJ,[
5 AC_MSG_CHECKING(for $1 shared object)
16 for shobj_libdir in /lib /usr/lib; do
17 if test -f $shobj_libdir/$shobj_name.$SOEXT; then
18 shobj_path=$shobj_libdir/$shobj_name.$SOEXT
20 shobj_path=`ls -r $shobj_libdir/$shobj_name.$SOEXT* 2>/dev/null | head -1`
21 if test "$shobj_path" != "" -a -f "$shobj_path"; then
27 if test "$shobj_path" != ""; then
28 AC_MSG_RESULT($shobj_path)
29 shobj_pathsymbol=SOPATH_`echo $shobj_name | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
30 AC_DEFINE_UNQUOTED($shobj_pathsymbol, "$shobj_path")
34 if test "$shobj_path" = ""; then
39 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
40 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
41 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
43 ## This program is free software; you can redistribute it and/or modify
44 ## it under the terms of the GNU General Public License as published by
45 ## the Free Software Foundation; either version 2 of the License, or
46 ## (at your option) any later version.
48 ## This program is distributed in the hope that it will be useful, but
49 ## WITHOUT ANY WARRANTY; without even the implied warranty of
50 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
51 ## General Public License for more details.
53 ## You should have received a copy of the GNU General Public License
54 ## along with this program; if not, write to the Free Software
55 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
57 ## As a special exception to the GNU General Public License, if you
58 ## distribute this file as part of a program that contains a
59 ## configuration script generated by Autoconf, you may include it under
60 ## the same distribution terms that you use for the rest of that program.
62 # serial 40 AC_PROG_LIBTOOL
63 AC_DEFUN(AC_PROG_LIBTOOL,
64 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
66 # Save cache, so that ltconfig can load it
69 # Actually configure libtool. ac_aux_dir is where install-sh is found.
70 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
71 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
72 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
73 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
74 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
75 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
76 || AC_MSG_ERROR([libtool configure failed])
78 # Reload cache, that may have been modified by ltconfig
81 # This can be used to rebuild libtool when needed
82 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
84 # Always use our own libtool.
85 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
88 # Redirect the config.log output again, so that the ltconfig log is not
89 # clobbered by the next message.
93 AC_DEFUN(AC_LIBTOOL_SETUP,
95 AC_REQUIRE([AC_ENABLE_SHARED])dnl
96 AC_REQUIRE([AC_ENABLE_STATIC])dnl
97 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
98 AC_REQUIRE([AC_CANONICAL_HOST])dnl
99 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
100 AC_REQUIRE([AC_PROG_RANLIB])dnl
101 AC_REQUIRE([AC_PROG_CC])dnl
102 AC_REQUIRE([AC_PROG_LD])dnl
103 AC_REQUIRE([AC_PROG_NM])dnl
104 AC_REQUIRE([AC_PROG_LN_S])dnl
108 NONE) lt_target="$host" ;;
109 *) lt_target="$target" ;;
112 # Check for any special flags to pass to ltconfig.
113 libtool_flags="--cache-file=$cache_file"
114 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
115 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
116 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
117 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
118 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
119 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
120 [libtool_flags="$libtool_flags --enable-dlopen"])
121 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
122 [libtool_flags="$libtool_flags --enable-win32-dll"])
123 AC_ARG_ENABLE(libtool-lock,
124 [ --disable-libtool-lock avoid locking (might break parallel builds)])
125 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
126 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
128 # Some flags need to be propagated to the compiler or linker for good
132 # Find out which ABI we are using.
133 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
134 if AC_TRY_EVAL(ac_compile); then
135 case "`/usr/bin/file conftest.o`" in
151 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
152 SAVE_CFLAGS="$CFLAGS"
153 CFLAGS="$CFLAGS -belf"
154 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
155 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
156 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
157 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
158 CFLAGS="$SAVE_CFLAGS"
162 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
163 [*-*-cygwin* | *-*-mingw*)
164 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
165 AC_CHECK_TOOL(AS, as, false)
166 AC_CHECK_TOOL(OBJDUMP, objdump, false)
172 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
173 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
175 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
176 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
178 # AC_ENABLE_SHARED - implement the --enable-shared flag
179 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
180 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
182 AC_DEFUN(AC_ENABLE_SHARED, [dnl
183 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
184 AC_ARG_ENABLE(shared,
185 changequote(<<, >>)dnl
186 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
188 [p=${PACKAGE-default}
190 yes) enable_shared=yes ;;
191 no) enable_shared=no ;;
194 # Look at the argument we got. We use all the common list separators.
195 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
196 for pkg in $enableval; do
197 if test "X$pkg" = "X$p"; then
204 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
207 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
208 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
209 AC_ENABLE_SHARED(no)])
211 # AC_ENABLE_STATIC - implement the --enable-static flag
212 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
213 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
215 AC_DEFUN(AC_ENABLE_STATIC, [dnl
216 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
217 AC_ARG_ENABLE(static,
218 changequote(<<, >>)dnl
219 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
221 [p=${PACKAGE-default}
223 yes) enable_static=yes ;;
224 no) enable_static=no ;;
227 # Look at the argument we got. We use all the common list separators.
228 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
229 for pkg in $enableval; do
230 if test "X$pkg" = "X$p"; then
237 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
240 # AC_DISABLE_STATIC - set the default static flag to --disable-static
241 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
242 AC_ENABLE_STATIC(no)])
245 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
246 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
247 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
249 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
250 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
251 AC_ARG_ENABLE(fast-install,
252 changequote(<<, >>)dnl
253 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
255 [p=${PACKAGE-default}
257 yes) enable_fast_install=yes ;;
258 no) enable_fast_install=no ;;
260 enable_fast_install=no
261 # Look at the argument we got. We use all the common list separators.
262 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
263 for pkg in $enableval; do
264 if test "X$pkg" = "X$p"; then
265 enable_fast_install=yes
271 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
274 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
275 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
276 AC_ENABLE_FAST_INSTALL(no)])
278 # AC_PROG_LD - find the path to the GNU or non-GNU linker
281 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
282 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
283 AC_REQUIRE([AC_PROG_CC])dnl
284 AC_REQUIRE([AC_CANONICAL_HOST])dnl
285 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
287 if test "$ac_cv_prog_gcc" = yes; then
288 # Check if gcc -print-prog-name=ld gives a path.
289 AC_MSG_CHECKING([for ld used by GCC])
290 ac_prog=`($CC -print-prog-name=ld) 2>&5`
292 # Accept absolute paths.
294 [\\/]* | [A-Za-z]:[\\/]*)
295 re_direlt='/[^/][^/]*/\.\./'
297 # Canonicalize the path of ld
298 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
299 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
300 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
302 test -z "$LD" && LD="$ac_prog"
305 # If it fails, then pretend we aren't using GCC.
309 # If it is relative, then search for the first ld in PATH.
313 elif test "$with_gnu_ld" = yes; then
314 AC_MSG_CHECKING([for GNU ld])
316 AC_MSG_CHECKING([for non-GNU ld])
318 AC_CACHE_VAL(ac_cv_path_LD,
319 [if test -z "$LD"; then
320 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
321 for ac_dir in $PATH; do
322 test -z "$ac_dir" && ac_dir=.
323 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
324 ac_cv_path_LD="$ac_dir/$ac_prog"
325 # Check to see if the program is GNU ld. I'd rather use --version,
326 # but apparently some GNU ld's only accept -v.
327 # Break only if it was the GNU/non-GNU ld that we prefer.
328 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
329 test "$with_gnu_ld" != no && break
331 test "$with_gnu_ld" != yes && break
337 ac_cv_path_LD="$LD" # Let the user override the test with a path.
340 if test -n "$LD"; then
345 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
349 AC_DEFUN(AC_PROG_LD_GNU,
350 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
351 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
352 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
353 ac_cv_prog_gnu_ld=yes
359 # AC_PROG_NM - find the path to a BSD-compatible name lister
361 [AC_MSG_CHECKING([for BSD-compatible nm])
362 AC_CACHE_VAL(ac_cv_path_NM,
363 [if test -n "$NM"; then
364 # Let the user override the test.
367 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
368 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
369 test -z "$ac_dir" && ac_dir=.
370 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
371 # Check to see if the nm accepts a BSD-compat flag.
372 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
373 # nm: unknown option "B" ignored
374 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
375 ac_cv_path_NM="$ac_dir/nm -B"
377 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
378 ac_cv_path_NM="$ac_dir/nm -p"
381 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
382 continue # so that we can try to find one that supports BSD flags
387 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
393 # AC_CHECK_LIBM - check for math library
394 AC_DEFUN(AC_CHECK_LIBM,
395 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
398 *-*-beos* | *-*-cygwin*)
399 # These system don't have libm
402 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
403 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
406 AC_CHECK_LIB(m, main, LIBM="-lm")
411 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
412 # the libltdl convenience library and INCLTDL to the include flags for
413 # the libltdl header and adds --enable-ltdl-convenience to the
414 # configure arguments. Note that LIBLTDL and INCLTDL are not
415 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
416 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
417 # with '${top_builddir}/' and INCLTDL will be prefixed with
418 # '${top_srcdir}/' (note the single quotes!). If your package is not
419 # flat and you're not using automake, define top_builddir and
420 # top_srcdir appropriately in the Makefiles.
421 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
422 case "$enable_ltdl_convenience" in
423 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
424 "") enable_ltdl_convenience=yes
425 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
427 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
428 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
431 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
432 # the libltdl installable library and INCLTDL to the include flags for
433 # the libltdl header and adds --enable-ltdl-install to the configure
434 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
435 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
436 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
437 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
438 # with '${top_srcdir}/' (note the single quotes!). If your package is
439 # not flat and you're not using automake, define top_builddir and
440 # top_srcdir appropriately in the Makefiles.
441 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
442 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
443 AC_CHECK_LIB(ltdl, main,
444 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
445 [if test x"$enable_ltdl_install" = xno; then
446 AC_MSG_WARN([libltdl not installed, but installation disabled])
448 enable_ltdl_install=yes
451 if test x"$enable_ltdl_install" = x"yes"; then
452 ac_configure_args="$ac_configure_args --enable-ltdl-install"
453 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
454 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
456 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
463 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
464 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
465 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
466 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
467 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
468 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
469 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
471 dnl This is just to silence aclocal about the macro not being used
472 ifelse([AC_DISABLE_FAST_INSTALL])dnl