-dnl local autoconf macros
-dnl Bruno Haible 2001-02-04
-dnl Marcus Daniels 1997-04-10
-dnl
-AC_PREREQ(2.12)dnl
-dnl
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+
+AC_PREREQ(2.57)
+
+AC_DEFUN([CL_AS_UNDERSCORE],
+[AC_BEFORE([$0], [CL_GLOBAL_CONSTRUCTORS])
+m4_pattern_allow([^AS_UNDERSCORE$])
+AC_CACHE_CHECK(for underscore in external names, cl_cv_prog_as_underscore, [
+cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C"
+#endif
+int foo() { return 0; }
+EOF
+# look for the assembly language name in the .s file
+AC_TRY_COMMAND(${CC-cc} -S conftest.c) >/dev/null 2>&1
+if grep _foo conftest.s >/dev/null ; then
+ cl_cv_prog_as_underscore=yes
+else
+ cl_cv_prog_as_underscore=no
+fi
+rm -f conftest*
+])
+if test $cl_cv_prog_as_underscore = yes; then
+ AS_UNDERSCORE=true
+ AC_DEFINE(ASM_UNDERSCORE,,[symbols are prefixed by an underscore in assembly language])
+else
+ AS_UNDERSCORE=false
+fi
+AC_SUBST(AS_UNDERSCORE)dnl
+])
+
+dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels.
+
+AC_PREREQ(2.13)
+
+AC_DEFUN([CL_GLOBAL_CONSTRUCTORS],
+[AC_REQUIRE([CL_AS_UNDERSCORE])dnl
+if test -n "$GCC"; then
+AC_CACHE_CHECK(for the global constructors function prefix,
+cl_cv_cplusplus_ctorprefix, [
+cat > conftest.cc << EOF
+struct foo { foo (); };
+foo foobar;
+EOF
+# look for the assembly language name in the .s file
+AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
+if grep '_GLOBAL_\$I\$foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_ctorprefix='_GLOBAL_$I$'
+else
+ if grep '_GLOBAL_\.I\.foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_ctorprefix='_GLOBAL_.I.'
+ else
+ if grep '_GLOBAL__I_foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_ctorprefix='_GLOBAL__I_'
+ else
+ cl_cv_cplusplus_ctorprefix=unknown
+ fi
+ fi
+fi
+rm -f conftest*
+])
+if test "$cl_cv_cplusplus_ctorprefix" '!=' unknown; then
+ ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
+ AC_DEFINE_UNQUOTED(CL_GLOBAL_CONSTRUCTOR_PREFIX,$ac_value)
+AC_CACHE_CHECK(for the global destructors function prefix,
+cl_cv_cplusplus_dtorprefix, [
+cat > conftest.cc << EOF
+struct foo { foo (); ~ foo (); };
+foo foobar;
+EOF
+# look for the assembly language name in the .s file
+AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
+if grep '_GLOBAL_\$D\$foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_dtorprefix='_GLOBAL_$D$'
+else
+ if grep '_GLOBAL_\.D\.foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_dtorprefix='_GLOBAL_.D.'
+ else
+ if grep '_GLOBAL__D_foobar' conftest.s >/dev/null ; then
+ cl_cv_cplusplus_dtorprefix='_GLOBAL__D_'
+ else
+ cl_cv_cplusplus_dtorprefix=none
+ fi
+ fi
+fi
+rm -f conftest*
+])
+ if test "$cl_cv_cplusplus_dtorprefix" '!=' none; then
+ ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
+ AC_DEFINE_UNQUOTED(CL_GLOBAL_DESTRUCTOR_PREFIX,$ac_value)
+ fi
+dnl Check whether the global constructors/destructors functions are file-scope
+dnl only by default. This is the case in egcs-1.1.2 or newer.
+AC_CACHE_CHECK(whether the global constructors function need to be exported,
+cl_cv_cplusplus_ctorexport, [
+cat > conftest1.cc << EOF
+struct foo { foo (); };
+foo foobar;
+EOF
+cat > conftest2.cc << EOF
+#include "confdefs.h"
+#ifdef ASM_UNDERSCORE
+#define ASM_UNDERSCORE_PREFIX "_"
+#else
+#define ASM_UNDERSCORE_PREFIX ""
+#endif
+struct foo { foo (); };
+foo::foo () {}
+extern "C" void ctor (void) __asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX "foobar");
+int main() { ctor(); return 0; }
+EOF
+if AC_TRY_COMMAND(${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest1.cc conftest2.cc $LIBS 1>&5) >/dev/null 2>&1 && test -s conftest${ac_exeext}; then
+ cl_cv_cplusplus_ctorexport=no
+else
+ cl_cv_cplusplus_ctorexport=yes
+fi
+rm -f conftest*
+])
+if test "$cl_cv_cplusplus_ctorexport" = yes; then
+ AC_DEFINE(CL_NEED_GLOBALIZE_CTORDTOR)
+fi
+fi
+fi
+])
+
+dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+
+AC_PREREQ(2.13)
+
dnl without AC_MSG_...: with AC_MSG_... and caching:
dnl AC_TRY_CPP CL_CPP_CHECK
dnl AC_TRY_COMPILE CL_COMPILE_CHECK
dnl CL_xxx_CHECK(ECHO-TEXT, CACHE-ID,
dnl INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-dnl
-define(CL_CPP_CHECK,
+
+AC_DEFUN([CL_CPP_CHECK],
[AC_MSG_CHECKING(for $1)
AC_CACHE_VAL($2,[
AC_TRY_CPP([$3], $2=yes, $2=no)
$5
])dnl
fi
-])dnl
-dnl
-define(CL_COMPILE_CHECK,
+])
+
+AC_DEFUN([CL_COMPILE_CHECK],
[AC_MSG_CHECKING(for $1)
AC_CACHE_VAL($2,[
AC_TRY_COMPILE([$3],[$4], $2=yes, $2=no)
$6
])dnl
fi
-])dnl
-dnl
-define(CL_LINK_CHECK,
+])
+
+AC_DEFUN([CL_LINK_CHECK],
[AC_MSG_CHECKING(for $1)
AC_CACHE_VAL($2,[
AC_TRY_LINK([$3],[$4], $2=yes, $2=no)
$6
])dnl
fi
-])dnl
-dnl
-dnl CL_PROTO(IDENTIFIER, ACTION-IF-NOT-FOUND, FINAL-PROTOTYPE)
-define(CL_PROTO,
-[AC_MSG_CHECKING([for $1 declaration])
-AC_CACHE_VAL(cl_cv_proto_[$1], [$2
-cl_cv_proto_$1="$3"])
-cl_cv_proto_$1=`echo "[$]cl_cv_proto_$1" | tr -s ' ' | sed -e 's/( /(/'`
-AC_MSG_RESULTPROTO([$]cl_cv_proto_$1)
-])dnl
-dnl
-dnl CL_PROTO_RET(INCLUDES, DECL, CACHE-ID, TYPE-IF-OK, TYPE-IF-FAILS)
-define(CL_PROTO_RET,
-[AC_TRY_COMPILE([$1]
-AC_LANG_EXTERN[$2
-], [], $3="$4", $3="$5")
-])dnl
-dnl
-dnl CL_PROTO_TRY(INCLUDES, ANSI-DECL, TRAD-DECL, ACTION-IF-OK, ACTION-IF-FAILS)
-define(CL_PROTO_TRY,
-[AC_TRY_COMPILE([$1]
-AC_LANG_EXTERN
-[#if defined(__STDC__) || defined(__cplusplus)
-$2
-#else
-$3
-#endif
-], [], [$4], [$5])
-])dnl
-dnl
-dnl CL_PROTO_CONST(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID)
-define(CL_PROTO_CONST,
-[CL_PROTO_TRY([$1], [$2], [$3], $4="", $4="const")]
-)dnl
-dnl
+])
+
dnl CL_SILENT(ACTION)
dnl performs ACTION, with AC_MSG_CHECKING and AC_MSG_RESULT being defined away.
-define(CL_SILENT,
+AC_DEFUN([CL_SILENT],
[pushdef([AC_MSG_CHECKING],[:])dnl
pushdef([AC_CHECKING],[:])dnl
pushdef([AC_MSG_RESULT],[:])dnl
-pushdef([AC_MSG_RESULTPROTO],[:])dnl
$1[]dnl
-popdef([AC_MSG_RESULTPROTO])dnl
popdef([AC_MSG_RESULT])dnl
popdef([AC_CHECKING])dnl
popdef([AC_MSG_CHECKING])dnl
-])dnl
-dnl
-AC_DEFUN(CL_AS_UNDERSCORE,
-[AC_BEFORE([$0], [CL_GLOBAL_CONSTRUCTORS])
-AC_CACHE_CHECK(for underscore in external names, cl_cv_prog_as_underscore, [
-cat > conftest.c <<EOF
-int foo() { return 0; }
-EOF
-# look for the assembly language name in the .s file
-AC_TRY_COMMAND(${CC-cc} -S conftest.c) >/dev/null 2>&1
-if grep _foo conftest.s >/dev/null ; then
- cl_cv_prog_as_underscore=yes
-else
- cl_cv_prog_as_underscore=no
-fi
-rm -f conftest*
])
-if test $cl_cv_prog_as_underscore = yes; then
- AS_UNDERSCORE=true
- AC_DEFINE(ASM_UNDERSCORE)
-else
- AS_UNDERSCORE=false
-fi
-AC_SUBST(AS_UNDERSCORE)dnl
-])dnl
-dnl
-AC_DEFUN(CL_PROG_RANLIB, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)])dnl
-dnl
-AC_DEFUN(CL_PROG_INSTALL,
-[dnl This is mostly copied from AC_PROG_INSTALL.
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-AC_MSG_CHECKING(for a BSD compatible install)
-if test -z "$INSTALL"; then
-AC_CACHE_VAL(cl_cv_path_install,
-[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- if test $ac_prog = installbsd &&
- grep src/bos $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX installbsd doesn't work without option "-g".
- :
- else
- cl_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_ifs"
- # As a last resort, use cp.
- test -z "$cl_cv_path_install" && cl_cv_path_install="cp"
-])dnl
- INSTALL="$cl_cv_path_install"
-fi
-dnl We do special magic for INSTALL instead of AC_SUBST, to get
-dnl relative paths right.
-AC_MSG_RESULT($INSTALL)
-AC_SUBST(INSTALL)dnl
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
-AC_SUBST(INSTALL_PROGRAM)dnl
-if test -z "$INSTALL_DATA"; then
- case "$INSTALL" in
- cp | */cp ) INSTALL_DATA='$(INSTALL)' ;;
- * ) INSTALL_DATA='$(INSTALL) -m 644' ;;
- esac
-fi
-AC_SUBST(INSTALL_DATA)dnl
-])dnl
-dnl
-AC_DEFUN(CL_CANONICAL_HOST,
+
+dnl Expands to the "extern ..." prefix used for system declarations.
+dnl AC_LANG_EXTERN()
+AC_DEFUN([AC_LANG_EXTERN],
+[extern
+#ifdef __cplusplus
+"C"
+#endif
+])
+
+AC_DEFUN([CL_CC_WORKS],
+[AC_CACHE_CHECK(whether CC works at all, cl_cv_prog_cc_works, [
+AC_LANG_SAVE()
+AC_LANG_C()
+AC_TRY_RUN([int main() { exit(0); }],
+cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no,
+AC_TRY_LINK([], [], cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no))
+AC_LANG_RESTORE()
+])
+case "$cl_cv_prog_cc_works" in
+ *no) echo "Installation or configuration problem: C compiler cannot create executables."; exit 1;;
+ *yes) ;;
+esac
+])
+
+AC_DEFUN([CL_CONFIG_SUBDIRS],
+[dnl No AC_CONFIG_AUX_DIR_DEFAULT, so we don't need install.sh.
+AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])
+AC_CONFIG_SUBDIRS([$1])dnl
+])
+
+AC_DEFUN([CL_CANONICAL_HOST],
[AC_REQUIRE([AC_PROG_CC]) dnl Actually: AC_REQUIRE([CL_CC_WORKS])
dnl Set ac_aux_dir before the cache check, because AM_PROG_LIBTOOL needs it.
ac_aux_dir=${srcdir}/$1
dnl A substitute for AC_CONFIG_AUX_DIR_DEFAULT, so we don't need install.sh.
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-AC_CACHE_CHECK(host system type, cl_cv_host, [
-dnl Mostly copied from AC_CANONICAL_HOST.
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else AC_MSG_ERROR(can not run $ac_config_sub)
-fi
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE) dnl config.guess needs to compile things
- host_alias=`export CC; ${CONFIG_SHELL-/bin/sh} $ac_config_guess` ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-# Don't fail just because the system is not listed in GNU's database.
-if test -n "$host_alias"; then
- host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-else
- host_alias=unknown
- host=unknown-unknown-unknown
-fi
-cl_cv_host_alias="$host_alias"
-cl_cv_host="$host"
-])
-host_alias="$cl_cv_host_alias"
-host="$cl_cv_host"
-changequote(,)dnl
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-changequote([,])dnl
-AC_SUBST(host)dnl
-AC_SUBST(host_cpu)dnl
-AC_SUBST(host_vendor)dnl
-AC_SUBST(host_os)dnl
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
dnl We have defined $ac_aux_dir.
AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-dnl We have defined $host_alias and $host.
-AC_PROVIDE([AC_CANONICAL_HOST])dnl
-])dnl
-dnl
-AC_DEFUN(CL_CANONICAL_HOST_CPU,
+dnl In autoconf-2.52, a single AC_CANONICAL_HOST has the effect of inserting
+dnl the code of AC_CANONICAL_BUILD *before* CL_CANONICAL_HOST, i.e. before
+dnl ac_aux_dir has been set. To work around this, we list AC_CANONICAL_BUILD
+dnl explicitly.
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+])
+
+AC_DEFUN([CL_CANONICAL_HOST_CPU],
[AC_REQUIRE([CL_CANONICAL_HOST])AC_REQUIRE([AC_PROG_CC])
case "$host_cpu" in
changequote(,)dnl
i[4567]86 )
host_cpu=i386
;;
- alphaev[4-7] | alphaev56 | alphapca5[67] )
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
host_cpu=alpha
;;
- hppa1.0 | hppa1.1 | hppa2.0 )
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
host_cpu=hppa
;;
powerpc )
c1 | c2 | c32 | c34 | c38 | c4 )
host_cpu=convex
;;
+ arm* )
+ host_cpu=arm
+ ;;
changequote([,])dnl
mips )
AC_CACHE_CHECK([for 64-bit MIPS], cl_cv_host_mips64, [
#define __${host_cpu}__ 1
#endif
EOF
-])dnl
-dnl
-AC_DEFUN(CL_LONGLONG,
-[AC_CACHE_CHECK(for long long type, cl_cv_c_longlong, [
-AC_TRY_RUN([int main()
-{
-/* long longs don't work right with gcc-2.7.2 on m68k */
-/* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
- miscompiled. */
-#ifdef __GNUC__
-#if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
-#if (__GNUC__ == 2)
-#if (__GNUC_MINOR__ <= 7)
- exit(1);
-#endif
-#endif
-#endif
-#endif
- { long x = 944938507; long y = 737962842; long z = 162359677;
- exit(!(((long long) x)*((long long) y)>>32 == z));
- }
-}],
-cl_cv_c_longlong=yes, cl_cv_c_longlong=no,
-dnl When cross-compiling, don't assume anything.
-cl_cv_c_longlong="guessing no")
])
-case "$cl_cv_c_longlong" in
- *yes) AC_DEFINE(HAVE_LONGLONG) ;;
- *no) ;;
-esac
-])dnl
-dnl
-AC_DEFUN(CL_LONGDOUBLE,
-[AC_CACHE_CHECK(for long double type, cl_cv_c_longdouble, [
-AC_TRY_RUN([int main()
-{ long double x = 2.7182818284590452354L; x = x*x; exit (x==0.0L); }],
-cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no,
-dnl When cross-compiling, don't assume anything.
-cl_cv_c_longdouble="guessing no")
-])
-case "$cl_cv_c_longdouble" in
- *yes) AC_DEFINE(HAVE_LONGDOUBLE) ;;
- *no) ;;
-esac
-])dnl
-dnl
-AC_DEFUN(CL_TEMPLATE_NULL,
-[CL_COMPILE_CHECK([working template<>], cl_cv_c_templatenull,
-[template <class T> class c {}; template <> class c<int> { int x; };], ,
-AC_DEFINE(HAVE_TEMPLATE_NULL))
-])dnl
-dnl
-AC_DEFUN(CL_UNISTD_H,
-[AC_CHECK_HEADERS(unistd.h)]
-)dnl
-dnl
-AC_DEFUN(CL_ALLOCA,
-[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-CL_LINK_CHECK(working alloca.h, cl_cv_header_alloca_h,
-[#include <alloca.h>], [char *p = (char *) alloca(2 * sizeof(int));],
-AC_DEFINE(HAVE_ALLOCA_H))dnl
-decl="#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#ifdef _MSC_VER
-#include <malloc.h>
-#define alloca _alloca
-#else
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#else
-#ifdef _AIX
- #pragma alloca
-#else
-#ifndef alloca
-char *alloca ();
-#endif
-#endif
-#endif
+
+AC_DEFUN([CL_CANONICAL_HOST_CPU_FOR_FFCALL],
+[AC_REQUIRE([CL_CANONICAL_HOST])AC_REQUIRE([AC_PROG_CC])
+case "$host_cpu" in
+changequote(,)dnl
+ i[4567]86 )
+ host_cpu=i386
+ ;;
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+ host_cpu=alpha
+ ;;
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ host_cpu=hppa
+ ;;
+ powerpc )
+ host_cpu=rs6000
+ ;;
+ c1 | c2 | c32 | c34 | c38 | c4 )
+ host_cpu=convex
+ ;;
+ arm* )
+ host_cpu=arm
+ ;;
+changequote([,])dnl
+ mips )
+ AC_CACHE_CHECK([for 64-bit MIPS], cl_cv_host_mips64, [
+AC_EGREP_CPP(yes,
+[#if defined(_MIPS_SZLONG)
+#if (_MIPS_SZLONG == 64)
+/* We should also check for (_MIPS_SZPTR == 64), but gcc keeps this at 32. */
+ yes
#endif
#endif
-"
-CL_LINK_CHECK([alloca], cl_cv_func_alloca,
-$decl, [char *p = (char *) alloca(1);],
- , [alloca_missing=1])dnl
-if test -n "$alloca_missing"; then
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.${ac_objext}
- AC_DEFINE(NO_ALLOCA)
-fi
-AC_SUBST(ALLOCA)dnl
-])dnl
-dnl
-AC_DEFUN(CL_FPU_CONTROL,
-[dnl Check for Linux with <fpu_control.h> and fpu_control_t or __setfpucw().
-dnl glibc versions since October 1998 define fpu_control_t. Earlier versions
-dnl define and declare __setfpucw(). Very early Linux libc versions have none,
-dnl and __fpu_control is of type `unsigned short'.
-CL_COMPILE_CHECK([fpu_control_t], cl_cv_type_fpu_control_t,
-[#include <fpu_control.h>], [fpu_control_t x;],
-AC_DEFINE(HAVE_FPU_CONTROL_T))
-CL_COMPILE_CHECK([__setfpucw], cl_cv_func_setfpucw,
-[#include <fpu_control.h>], [__setfpucw(_FPU_IEEE);],
-AC_DEFINE(HAVE_SETFPUCW))
-])dnl
-dnl
-AC_DEFUN(CL_PERROR,
-[AC_MSG_CHECKING(for perror declaration)
-AC_CACHE_VAL(cl_cv_proto_perror, [
-AC_TRY_COMPILE([
-/* Some systems declare perror() in <errno.h>, some in <stdio.h>, some don't
- declare it at all. */
-#include <stdio.h>
-#include <errno.h>
-]AC_LANG_EXTERN[double perror ();], [],
-cl_cv_proto_perror=no, cl_cv_proto_perror=yes)
+], cl_cv_host_mips64=yes, cl_cv_host_mips64=no)
])
-AC_MSG_RESULT([$cl_cv_proto_perror])
-if test $cl_cv_proto_perror = yes; then
-AC_DEFINE(HAVE_PERROR_DECL)
-fi
-])dnl
-dnl
-AC_DEFUN(CL_RUSAGE,
-[AC_CHECK_HEADERS(sys/resource.h sys/times.h)dnl
-if test $ac_cv_header_sys_resource_h = yes; then
- dnl HAVE_SYS_RESOURCE_H defined
- CL_LINK_CHECK([getrusage], cl_cv_func_getrusage,
-[#include <sys/types.h> /* NetBSD 1.0 needs this */
-#include <sys/time.h>
-#include <sys/resource.h>],
- [struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;],
- AC_DEFINE(HAVE_GETRUSAGE))dnl
- if test $cl_cv_func_getrusage = yes; then
- CL_PROTO([getrusage], [
- CL_PROTO_TRY([
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/types.h> /* NetBSD 1.0 needs this */
-#include <sys/time.h>
-#include <sys/resource.h>
-],
-[int getrusage (int who, struct rusage * rusage);],
-[int getrusage();],
-[cl_cv_proto_getrusage_arg1="int"],
-[cl_cv_proto_getrusage_arg1="enum __rusage_who"])
-], [extern int getrusage ($cl_cv_proto_getrusage_arg1, struct rusage *);])
- AC_DEFINE_UNQUOTED(RUSAGE_WHO_T,$cl_cv_proto_getrusage_arg1)
- fi
-fi
-])dnl
-dnl
-AC_DEFUN(CL_GETTIMEOFDAY,
-[AC_BEFORE([$0], [CL_TIMES_CLOCK])
-AC_CHECK_FUNCS(gettimeofday)dnl
-if test $ac_cv_func_gettimeofday = yes; then
-dnl HAVE_GETTIMEOFDAY is defined
-CL_PROTO([gettimeofday], [
-CL_PROTO_TRY([
-#include <sys/types.h>
-#include <sys/time.h>
-], [int gettimeofday (struct timeval * tp, struct timezone * tzp);],
-[int gettimeofday();],
-cl_cv_proto_gettimeofday_dots=no
-cl_cv_proto_gettimeofday_arg2="struct timezone *",
-CL_PROTO_TRY([
-#include <sys/types.h>
-#include <sys/time.h>
-], [int gettimeofday (struct timeval * tp, void * tzp);],
-[int gettimeofday();],
-cl_cv_proto_gettimeofday_dots=no
-cl_cv_proto_gettimeofday_arg2="void *",
-cl_cv_proto_gettimeofday_dots=yes
-cl_cv_proto_gettimeofday_arg2="..."))
-], [extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);])
-if test $cl_cv_proto_gettimeofday_dots = yes; then
-AC_DEFINE(GETTIMEOFDAY_DOTS)
+if test $cl_cv_host_mips64 = yes; then
+ host_cpu=mips64
else
-AC_DEFINE_UNQUOTED(GETTIMEOFDAY_TZP_T,$cl_cv_proto_gettimeofday_arg2)
-fi
-fi
-])dnl
-dnl
-AC_DEFUN(CL_FTIME,
-[AC_BEFORE([$0], [CL_TIMES_CLOCK])
-AC_CHECK_FUNCS(ftime)])dnl
-dnl
-AC_DEFUN(CL_TIMES_CLOCK,
-[AC_REQUIRE([CL_GETTIMEOFDAY])dnl
-AC_REQUIRE([CL_FTIME])dnl
-if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then
-AC_CHECK_FUNC(times, , no_times=1)dnl
-if test -z "$no_times"; then
-AC_CACHE_CHECK(for times return value, cl_cv_func_times_return, [
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <time.h> /* needed for CLK_TCK */
-#ifndef CLK_TCK
-#include <sys/time.h> /* needed for CLK_TCK on SYSV PTX */
+ AC_CACHE_CHECK([for MIPS with n32 ABI], cl_cv_host_mipsn32, [
+dnl Strictly speaking, the MIPS ABI (-32 or -n32) is independent from the CPU
+dnl identification (-mips[12] or -mips[34]). But -n32 is commonly used together
+dnl with -mips3, and it's easier to test the CPU identification.
+AC_EGREP_CPP(yes,
+[#if __mips >= 3
+ yes
#endif
-#include <sys/times.h>
-int main ()
-{ struct tms buffer;
- clock_t result1;
- clock_t result2;
- int ticks;
- result1 = times(&buffer);
- if ((result1 == (clock_t)0) || (result1 == (clock_t)(-1))) exit(1);
- sleep(1);
- result2 = times(&buffer);
- if ((result2 == (clock_t)0) || (result2 == (clock_t)(-1))) exit(1);
- ticks = result2 - result1;
- exit(!((ticks >= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2)));
-}], cl_cv_func_times_return=yes, cl_cv_func_times_return=no,
-dnl When cross-compiling, don't assume anything.
-cl_cv_func_times_return="guessing no")
+], cl_cv_host_mipsn32=yes, cl_cv_host_mipsn32=no)
])
-case "$cl_cv_func_times_return" in
- *yes) AC_DEFINE(HAVE_TIMES_CLOCK) ;;
- *no) ;;
-esac
-fi
+if test $cl_cv_host_mipsn32 = yes; then
+ host_cpu=mipsn32
fi
-])dnl
-dnl
-AC_DEFUN(CL_GLOBAL_CONSTRUCTORS,
-[AC_REQUIRE([CL_AS_UNDERSCORE])dnl
-if test -n "$GCC"; then
-AC_CACHE_CHECK(for the global constructors function prefix,
-cl_cv_cplusplus_ctorprefix, [
-cat > conftest.cc << EOF
-struct foo { foo (); };
-foo foobar;
-EOF
-# look for the assembly language name in the .s file
-AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
-if grep '_GLOBAL_\$I\$foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_ctorprefix='_GLOBAL_$I$'
-else
- if grep '_GLOBAL_\.I\.foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_ctorprefix='_GLOBAL_.I.'
- else
- if grep '_GLOBAL__I_foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_ctorprefix='_GLOBAL__I_'
- else
- cl_cv_cplusplus_ctorprefix=unknown
- fi
- fi
fi
-rm -f conftest*
+ ;;
+dnl UltraSPARCs running Linux have `uname -m` = "sparc64", but the C compiler
+dnl still generates 32-bit code.
+ sparc | sparc64 )
+ AC_CACHE_CHECK([for 64-bit SPARC], cl_cv_host_sparc64, [
+AC_EGREP_CPP(yes,
+[#if defined(__sparcv9) || defined(__arch64__)
+ yes
+#endif
+], cl_cv_host_sparc64=yes, cl_cv_host_sparc64=no)
])
-if test "$cl_cv_cplusplus_ctorprefix" '!=' unknown; then
- ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
- AC_DEFINE_UNQUOTED(CL_GLOBAL_CONSTRUCTOR_PREFIX,$ac_value)
-AC_CACHE_CHECK(for the global destructors function prefix,
-cl_cv_cplusplus_dtorprefix, [
-cat > conftest.cc << EOF
-struct foo { foo (); ~ foo (); };
-foo foobar;
-EOF
-# look for the assembly language name in the .s file
-AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
-if grep '_GLOBAL_\$D\$foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_dtorprefix='_GLOBAL_$D$'
+if test $cl_cv_host_sparc64 = yes; then
+ host_cpu=sparc64
else
- if grep '_GLOBAL_\.D\.foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_dtorprefix='_GLOBAL_.D.'
- else
- if grep '_GLOBAL__D_foobar' conftest.s >/dev/null ; then
- cl_cv_cplusplus_dtorprefix='_GLOBAL__D_'
- else
- cl_cv_cplusplus_dtorprefix=none
- fi
- fi
+ host_cpu=sparc
fi
-rm -f conftest*
-])
- if test "$cl_cv_cplusplus_dtorprefix" '!=' none; then
- ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
- AC_DEFINE_UNQUOTED(CL_GLOBAL_DESTRUCTOR_PREFIX,$ac_value)
- fi
-dnl Check whether the global constructors/destructors functions are file-scope
-dnl only by default. This is the case in egcs-1.1.2 or newer.
-AC_CACHE_CHECK(whether the global constructors function need to be exported,
-cl_cv_cplusplus_ctorexport, [
-cat > conftest1.cc << EOF
-struct foo { foo (); };
-foo foobar;
-EOF
-cat > conftest2.cc << EOF
-#include "confdefs.h"
-#ifdef ASM_UNDERSCORE
-#define ASM_UNDERSCORE_PREFIX "_"
-#else
-#define ASM_UNDERSCORE_PREFIX ""
+ ;;
+esac
+dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this
+cat >> confdefs.h <<EOF
+#ifndef __${host_cpu}__
+#define __${host_cpu}__ 1
#endif
-struct foo { foo (); };
-foo::foo () {}
-extern "C" void ctor (void) __asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX "foobar");
-int main() { ctor(); return 0; }
EOF
-if AC_TRY_COMMAND(${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest1.cc conftest2.cc $LIBS 1>&5) >/dev/null 2>&1 && test -s conftest${ac_exeext}; then
- cl_cv_cplusplus_ctorexport=no
-else
- cl_cv_cplusplus_ctorexport=yes
-fi
-rm -f conftest*
])
-if test "$cl_cv_cplusplus_ctorexport" = yes; then
- AC_DEFINE(CL_NEED_GLOBALIZE_CTORDTOR)
-fi
-fi
-fi
-])dnl
-dnl
-AC_DEFUN(CL_CHAR_UNSIGNED,
-[dnl This is mostly copied from AC_C_CHAR_UNSIGNED.
-AC_CACHE_CHECK(whether characters are unsigned, ac_cv_c_char_unsigned, [
-if test $ac_cv_prog_gcc = yes; then
- # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
- yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs. */
-#if !defined(__STDC__) || __STDC__ != 1
-#define volatile
-#endif
-int main() {
- volatile char c = 255; exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no,
-ac_cv_c_char_unsigned="guessing no")
-fi])
-if test $ac_cv_prog_gcc = no; then
- # GCC defines __CHAR_UNSIGNED__ by itself, no need to fix up.
- case "$ac_cv_c_char_unsigned" in
- *yes) AC_DEFINE(__CHAR_UNSIGNED__) ;;
- *no) ;;
- esac
-fi
-])dnl
-dnl
-AC_DEFUN(CL_BOOL,
-[AC_LANG_SAVE()
-AC_LANG_CPLUSPLUS()
-CL_COMPILE_CHECK([bool type], cl_cv_cplusplus_bool, , [bool x;],
-AC_DEFINE(HAVE_BOOL), AC_DEFINE(bool,int))dnl
-AC_LANG_RESTORE()
-])dnl
-dnl
-AC_DEFUN(CL_MACHINE,
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([CL_CHAR_UNSIGNED])dnl
-cl_machine_file_c=$2
-cl_machine_file_h=$3
-if test $cross_compiling = no; then
-if test -z "$[$4]"; then
-AC_CHECKING(for [$1])
-cat > conftest.$ac_ext <<EOF
-#include "confdefs.h"
-EOF
-cat "$cl_machine_file_c" >> conftest.$ac_ext
-ORIGCC="$CC"
-if test $ac_cv_prog_gcc = yes; then
-# gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
-# target 80386. Strip "-O".
-CC=`echo "$CC " | sed -e 's/-O //g'`
-fi
-AC_TRY_EVAL(ac_link)
-CC="$ORIGCC"
-if test -s conftest; then
- echo "creating $cl_machine_file_h"
- ./conftest > conftest.h
- if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
- # The file exists and we would not be changing it
- rm -f conftest.h
- else
- rm -f "$cl_machine_file_h"
- mv conftest.h "$cl_machine_file_h"
- fi
- [$4]=1
-else
- echo "creation of $cl_machine_file_h failed"
-fi
-rm -f conftest*
-fi
-else
-echo "cross-compiling - cannot create $cl_machine_file_h"
-fi
-])dnl
-dnl
+
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-##
-## As a special exception to the GNU General Public License, if you
-## distribute this file as part of a program that contains a
-## configuration script generated by Autoconf, you may include it under
-## the same distribution terms that you use for the rest of that program.
-
-# The next line was added by Bruno Haible 2001-06-08.
-builtin([undefine],[symbols])
# serial 46 AC_PROG_LIBTOOL
+
AC_DEFUN([AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([CL_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
AC_REQUIRE([AC_OBJEXT])dnl
])
+# AC_LIBTOOL_HEADER_ASSERT
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
+[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
+ [lt_cv_func_assert_works],
+ [case $host in
+ *-*-solaris*)
+ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
+ case `$CC --version 2>/dev/null` in
+ [[12]].*) lt_cv_func_assert_works=no ;;
+ *) lt_cv_func_assert_works=yes ;;
+ esac
+ fi
+ ;;
+ esac])
+
+if test "x$lt_cv_func_assert_works" = xyes; then
+ AC_CHECK_HEADERS(assert.h)
+fi
+])# AC_LIBTOOL_HEADER_ASSERT
+
# _LT_AC_CHECK_DLFCN
# --------------------
-AC_DEFUN(_LT_AC_CHECK_DLFCN,
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
[AC_CHECK_HEADERS(dlfcn.h)
])# _LT_AC_CHECK_DLFCN
# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
# ---------------------------------
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([CL_CANONICAL_HOST])
+[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_OBJEXT])
# Check for command to grab the raw symbol name followed by C symbol from nm.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
# Character class describing NM global symbol codes.
-[symcode='[BCDEGRST]']
+symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
-[sympat='\([_A-Za-z][_A-Za-z0-9]*\)']
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
# Transform the above into a raw symbol and a C symbol.
symxfrm='\1 \2\3 \3'
# Transform an extracted symbol line into a proper C declaration
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
# Define system-specific variables.
case $host_os in
aix*)
- [symcode='[BCDT]']
+ symcode='[[BCDT]]'
;;
cygwin* | mingw* | pw32*)
- [symcode='[ABCDGISTW]']
+ symcode='[[ABCDGISTW]]'
;;
hpux*) # Its linker distinguishes data from code symbols
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-irix*)
- [symcode='[BCDEGRST]']
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
;;
solaris* | sysv5*)
- [symcode='[BDT]']
+ symcode='[[BDT]]'
;;
sysv4)
- [symcode='[DFNSTU]']
+ symcode='[[DFNSTU]]'
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- [symcode='[ABCDGISTW]']
+ symcode='[[ABCDGISTW]]'
fi
# Try without a prefix undercore, then with it.
for ac_symprfx in "" "_"; do
# Write the raw and C identifiers.
-[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
+lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
cat <<EOF >> conftest.$ac_ext
#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
+# define lt_ptr void *
#else
-# define lt_ptr_t char *
+# define lt_ptr char *
# define const
#endif
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
- lt_ptr_t address;
+ lt_ptr address;
}
-[lt_preloaded_symbols[] =]
+lt_preloaded_symbols[[]] =
{
EOF
- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
+ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
+ {0, (lt_ptr) 0}
};
#ifdef __cplusplus
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
pipe_works=yes
fi
LIBS="$save_LIBS"
global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
if test -z "$lt_cv_sys_global_symbol_pipe"; then
global_symbol_to_cdecl=
+ global_symbol_to_c_name_address=
else
global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
+if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+then
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(ok)
*-DOS) lt_cv_sys_path_separator=';' ;;
*) lt_cv_sys_path_separator=':' ;;
esac
+ PATH_SEPARATOR=$lt_cv_sys_path_separator
fi
])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# _LT_AC_PROG_ECHO_BACKSLASH
# --------------------------
# Add some code to the start of the generated configure script which
-# will find an echo command which doesn;t interpret backslashes.
+# will find an echo command which doesn't interpret backslashes.
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
+ [AC_DIVERT_PUSH(NOTICE)])
_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# Check that we are running under the correct shell.
#
# So, first we look for a working echo in the user's PATH.
- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for dir in $PATH /usr/ucb; do
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
# ------------------------------------------------------------------
-AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF,
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
[if test "$cross_compiling" = yes; then :
[$4]
else
# AC_LIBTOOL_DLOPEN_SELF
# -------------------
-AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF,
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
[if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
;;
*)
- AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen",
- [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load",
- [AC_CHECK_LIB(svld, dlopen,
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB(dld, shl_load,
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
])
- ])
- ])
+ ])
+ ])
])
;;
esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
old_postuninstall_cmds=
if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
fi
# Allow CC to be a program name with arguments.
set dummy $CC
compiler="[$]2"
-## FIXME: this should be a separate macro
-##
AC_MSG_CHECKING([for objdir])
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
fi
rmdir .libs 2>/dev/null
AC_MSG_RESULT($objdir)
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
-AC_ARG_WITH(pic,
+AC_ARG_WITH(pic,
[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
pic_mode="$withval", pic_mode=default)
test -z "$pic_mode" && pic_mode=default
# libC (AIX C++ library), which obviously doesn't included in libraries
# list by gcc. This cause undefined symbols with -static flags.
# This hack allows C programs to be linked with "-static -ldl", but
- # we not sure about C++ programs.
+ # not sure about C++ programs.
lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
;;
amigaos*)
# like `-m68040'.
lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
darwin* | rhapsody*)
# PORTME Check for PIC flags for the system compiler.
case $host_os in
aix3* | aix4* | aix5*)
+ lt_cv_prog_cc_wl='-Wl,'
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_cv_prog_cc_static='-Bstatic'
- lt_cv_prog_cc_wl='-Wl,'
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
else
- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
lt_cv_prog_cc_pic='+Z'
;;
- irix5* | irix6*)
+ irix5* | irix6* | nonstopux*)
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static='-non_shared'
# PIC (with -KPIC) is the default.
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
lt_cv_prog_cc_pic='-KPIC'
lt_cv_prog_cc_static='-Bstatic'
- if test "x$host_vendor" = xsni; then
- lt_cv_prog_cc_wl='-LD'
- else
- lt_cv_prog_cc_wl='-Wl,'
- fi
+ lt_cv_prog_cc_wl='-Wl,'
;;
uts4*)
AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
fi
-##
-## END FIXME
# Check for any special shared library compilation flags.
if test -n "$lt_cv_prog_cc_shlib"; then
AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
- if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then :
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
else
AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
lt_cv_prog_cc_can_build_shared=no
fi
fi
-## FIXME: this should be a separate macro
-##
AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
lt_cv_prog_cc_static_works=no
link_static_flag="$lt_cv_prog_cc_static"
no_builtin_flag="$lt_cv_prog_cc_no_builtin"
can_build_shared="$lt_cv_prog_cc_can_build_shared"
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# Check to see if options -o and -c are simultaneously supported by compiler
AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
AC_CACHE_VAL([lt_cv_compiler_c_o], [
lt_cv_compiler_o_lo=no
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -c -o conftest.lo"
+ save_objext="$ac_objext"
+ ac_objext=lo
AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
lt_cv_compiler_o_lo=yes
fi
])
+ ac_objext="$save_objext"
CFLAGS="$save_CFLAGS"
])
compiler_o_lo=$lt_cv_compiler_o_lo
- AC_MSG_RESULT([$compiler_c_lo])
+ AC_MSG_RESULT([$compiler_o_lo])
else
compiler_o_lo=no
fi
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
if test "$compiler_c_o" = no && test "$need_locks" != no; then
else
need_locks=no
fi
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
if test "$GCC" = yes; then
# Check to see if options -fno-rtti -fno-exceptions are supported by compiler
AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
no_builtin_flag=' -fno-builtin'
fi
fi
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# See if the linker supports building shared libraries.
AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
extract_expsyms_cmds=
case $host_os in
-cygwin* | mingw* | pw32* )
+cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
with_gnu_ld=no
fi
;;
-
+openbsd*)
+ with_gnu_ld=no
+ ;;
esac
ld_shlibs=yes
# can override, but on older systems we have to supply one (in ltdll.c)
if test "x$lt_cv_need_dllmain" = "xyes"; then
ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
+ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
else
ltdll_obj=
# Be careful not to strip the DATA tag left be newer dlltools.
export_symbols_cmds="$ltdll_cmds"'
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
- [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols'
+ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is.
# If DATA tags from a recent dlltool are present, honour them!
- archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname-def;
+ archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname-def;
else
- echo EXPORTS > $output_objdir/$soname-def;
- _lt_hint=1;
- cat $export_symbols | while read symbol; do
- set dummy \$symbol;
- case \[$]# in
- 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
- *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
- esac;
- _lt_hint=`expr 1 + \$_lt_hint`;
- done;
+ echo EXPORTS > $output_objdir/$soname-def;
+ _lt_hint=1;
+ cat $export_symbols | while read symbol; do
+ set dummy \$symbol;
+ case \[$]# in
+ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+ 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+ esac;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done;
fi~
'"$ltdll_cmds"'
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
;;
aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+ hardcode_direct=yes
archive_cmds=''
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+
shared_flag='-shared'
else
+ # not using gcc
if test "$host_cpu" = ia64; then
- shared_flag='-G'
+ shared_flag='${wl}-G'
else
- shared_flag='${wl}-bM:SRE'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
fi
- hardcode_direct=yes
fi
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # Test if we are trying to use run time linking, or normal AIX style linking.
- # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
- aix_use_runtimelinking=no
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
# It seems that -bexpall can do strange things, so it is better to
# generate a list of symbols to export.
always_export_symbols=yes
if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
- allow_undefined_flag=' -Wl,-G'
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-znodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
else
- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
- # Warning - without using the other run time loading flags, -berok will
- # link without error, but may produce a broken library.
- allow_undefined_flag='${wl}-berok"
- # This is a bit strange, but is similar to how AIX traditionally builds
- # it's shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
+ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='${wl}-berok'
+ # This is a bit strange, but is similar to how AIX traditionally builds
+ # it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
fi
fi
;;
;;
darwin* | rhapsody*)
- allow_undefined_flag='-undefined suppress'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ esac
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
- # yet detect zsh echo's removal of \ escapes.
- archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
# We need to add '_' to the symbols in $export_symbols first
#archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
hardcode_direct=yes
export_dynamic_flag_spec='${wl}-E'
;;
- irix5* | irix6*)
+ irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='-rpath $libdir'
fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
link_all_deplibs=yes
;;
;;
newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case "$host_os" in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
;;
os2*)
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
;;
solaris*)
+ # gcc --version < 3.0 without binutils cannot create self contained
+ # shared libraries reliably, requiring libgcc.a to resolve some of
+ # the object symbols generated in some cases. Libraries that use
+ # assert need libgcc.a to resolve __eprintf, for example. Linking
+ # a copy of libgcc.a into every shared library to guarantee resolving
+ # such symbols causes other problems: According to Tim Van Holder
+ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
+ # (to the application) exception stack for one thing.
no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ case `$CC --version 2>/dev/null` in
+ [[12]].*)
+ cat <<EOF 1>&2
+
+*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+*** create self contained shared libraries on Solaris systems, without
+*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
+*** -no-undefined support, which will at least allow you to build shared
+*** libraries. However, you may find that when you link such libraries
+*** into an application without using GCC, you have to manually add
+*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
+*** upgrade to a newer version of GCC. Another option is to rebuild your
+*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+
+EOF
+ no_undefined_flag=
+ ;;
+ esac
+ fi
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
- [solaris2.[0-5] | solaris2.[0-5].*]) ;;
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
esac
;;
sysv4)
- if test "x$host_vendor" = xsno; then
- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
- hardcode_direct=yes # is this really true???
- else
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- fi
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
fi
AC_MSG_RESULT([$ld_shlibs])
test "$ld_shlibs" = no && can_build_shared=no
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# Check hardcoding attributes.
AC_MSG_CHECKING([how to hardcode library paths into programs])
hardcode_action=
hardcode_action=unsupported
fi
AC_MSG_RESULT([$hardcode_action])
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
else
AC_MSG_RESULT([no])
fi
-##
-## END FIXME
reload_cmds='$LD$reload_flag -o $output$reload_objs'
test -z "$deplibs_check_method" && deplibs_check_method=unknown
-## FIXME: this should be a separate macro
-##
# PORTME Fill in your ld.so characteristics
AC_MSG_CHECKING([dynamic linker characteristics])
library_names_spec=
aix4* | aix5*)
version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
- [ aix4 | aix4.[01] | aix4.[01].*)]
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
+ # AIX (on Power*) has no versioning support, so currently we can
+ # not hardcode correct soname into executable. Probably we can
+ # add versioning support to collect2, so additional links can
+ # be useful in future.
if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
- # lib<name>.a to let people know that these are not typical AIX shared libraries.
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
else
# We preserve .a as extension for shared libraries through AIX4.2
soname_spec='${libname}${release}.so$major'
fi
shlibpath_var=LIBPATH
- deplibs_check_method=pass_all
fi
+ hardcode_into_libs=yes
;;
amigaos*)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
;;
beos*)
case $GCC,$host_os in
yes,cygwin*)
library_names_spec='$libname.dll.a'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$rm \$dlpath'
;;
yes,mingw*)
- library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
;;
yes,pw32*)
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
;;
*)
- library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib'
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
;;
esac
dynamic_linker='Win32 ld.exe'
postinstall_cmds='chmod 555 $lib'
;;
-irix5* | irix6*)
- version_type=irix
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *) version_type=irix ;;
+ esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}.so$major'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
case $host_os in
- irix5*)
+ irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
openbsd*)
version_type=sunos
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- need_version=no
+ need_lib_prefix=no
+ need_version=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case "$host_os" in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
fi
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
osf3* | osf4* | osf5*)
version_type=osf
need_version=no
- soname_spec='${libname}${release}.so'
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ hardcode_into_libs=yes
;;
sco3.2v5*)
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# Report the final consequences.
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
-##
-## END FIXME
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
if test "$hardcode_action" = relink; then
# Fast installation is not supported
AC_LIBTOOL_DLOPEN_SELF
-## FIXME: this should be a separate macro
-##
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $archive_cmds in
*'~'*)
esac
fi
need_lc=${lt_cv_archive_cmds_need_lc-yes}
-##
-## END FIXME
-## FIXME: this should be a separate macro
-##
# The second clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS \
+ for var in echo old_CC old_CFLAGS SED \
AR AR_FLAGS CC LD LN_S NM SHELL \
reload_flag reload_cmds wl \
pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
old_striplib striplib file_magic_cmd export_symbols_cmds \
deplibs_check_method allow_undefined_flag no_undefined_flag \
finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+ global_symbol_to_c_name_address \
hardcode_libdir_flag_spec hardcode_libdir_separator \
sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+# A sed that does not truncate output.
+SED=$lt_SED
+
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="sed -e s/^X//"
+Xsed="${SED} -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
# Whether or not to build shared libraries.
build_libtool_libs=$enable_shared
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
-
# Whether or not to build static libraries.
build_old_libs=$enable_static
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$need_lc
+
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
# Transform the output of nm in a proper C declaration
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+
# This is the shared library runtime path variable.
runpath_var=$runpath_var
# return TRUE;
# }
# /* ltdll.c ends here */
- # This is a source program that is used to create import libraries
- # on Windows for dlls which lack them. Don't remove nor modify the
- # starting and closing comments
+ # This is a source program that is used to create import libraries
+ # on Windows for dlls which lack them. Don't remove nor modify the
+ # starting and closing comments
# /* impgen.c starts here */
# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
#
# }
# /* impgen.c ends here */
-EOF
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+
+ mv -f "${ofile}T" "$ofile" || \
+ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
+ chmod +x "$ofile"
+fi
+
+])# _LT_AC_LTCONFIG_HACK
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+# Where MODE is either `yes' or `no'. If omitted, it defaults to
+# `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+
+# AC_PROG_LD_GNU -
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ ;;
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+freebsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
- mv -f "${ofile}T" "$ofile" || \
- (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
- chmod +x "$ofile"
-fi
-##
-## END FIXME
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-])# _LT_AC_LTCONFIG_HACK
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+# This must be Linux ELF.
+linux-gnu*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$ac_save_ifs"
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
+ fi
;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)])
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$ac_save_ifs"
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[[78]]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
fi
done
IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+AC_MSG_RESULT([$NM])
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32*)
+ # These system don't have libm
;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, main, LIBM="-lm")
+ ;;
+esac
])
-# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and LTDLINCL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)])
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])
-# AC_LIBTOOL_PICMODE - implement the --with-pic flag
-# Usage: AC_LIBTOOL_PICMODE[(MODE)]
-# Where MODE is either `yes' or `no'. If omitted, it defaults to
-# `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)])
-
+ AC_CHECK_LIB(ltdl, main,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
- /*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
- ?:/*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
- ;;
- *)
- ac_save_MAGIC_CMD="$MAGIC_CMD"
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- egrep "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
-EOF
- fi ;;
- esac
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
fi
+ done
+ done
+done
+
+ # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=$TMPDIR/sed$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+}
+ _max=0
+ _count=0
+ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+ # along with /bin/sed that truncates output.
+ for _sed in $_sed_list /usr/xpg4/bin/sed; do
+ test ! -f ${_sed} && break
+ cat /dev/null > "$tmp/sed.in"
+ _count=0
+ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+ # Check for GNU sed and select it if it is found.
+ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+ lt_cv_path_SED=${_sed}
break
fi
+ while true; do
+ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+ mv "$tmp/sed.tmp" "$tmp/sed.in"
+ cp "$tmp/sed.in" "$tmp/sed.nl"
+ echo >>"$tmp/sed.nl"
+ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+ # 40000 chars as input seems more than enough
+ test $_count -gt 10 && break
+ _count=`expr $_count + 1`
+ if test $_count -gt $_max; then
+ _max=$_count
+ lt_cv_path_SED=$_sed
+ fi
+ done
done
- IFS="$ac_save_ifs"
- MAGIC_CMD="$ac_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
+ rm -rf "$tmp"
+])
+if test "X$SED" != "X"; then
+ lt_cv_path_SED=$SED
else
- AC_MSG_RESULT(no)
+ SED=$lt_cv_path_SED
fi
+AC_MSG_RESULT([$SED])
])
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
-AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+AC_PREREQ(2.57)
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([CL_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]* | [A-Za-z]:[\\/]*)]
- [re_direlt='/[^/][^/]*/\.\./']
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
- test "$with_gnu_ld" != no && break
- else
- test "$with_gnu_ld" != yes && break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
+AC_DEFUN([CL_LONGLONG],
+[AC_CACHE_CHECK(for long long type, cl_cv_c_longlong, [
+AC_TRY_RUN([int main()
+{
+/* long longs don't work right with gcc-2.7.2 on m68k */
+/* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
+ miscompiled. */
+#if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
+#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)
+ exit(1);
+#endif
+#endif
+ { long x = 944938507; long y = 737962842; long z = 162359677;
+ exit(!(((long long) x)*((long long) y)>>32 == z));
+ }
+}],
+cl_cv_c_longlong=yes, cl_cv_c_longlong=no,
+dnl When cross-compiling, don't assume anything.
+cl_cv_c_longlong="guessing no")
])
-
-# AC_PROG_LD_GNU -
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- lt_cv_prog_gnu_ld=yes
-else
- lt_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$lt_cv_prog_gnu_ld
+case "$cl_cv_c_longlong" in
+ *yes) AC_DEFINE(HAVE_LONGLONG,,[compiler supports the `long long' type]) ;;
+ *no) ;;
+esac
])
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
+dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels.
+
+AC_PREREQ(2.13)
+
+AC_DEFUN([CL_LONGDOUBLE],
+[AC_CACHE_CHECK(for long double type, cl_cv_c_longdouble, [
+AC_TRY_RUN([int main()
+{ long double x = 2.7182818284590452354L; x = x*x; exit (x==0.0L); }],
+cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no,
+dnl When cross-compiling, don't assume anything.
+cl_cv_c_longdouble="guessing no")
+])
+case "$cl_cv_c_longdouble" in
+ *yes) AC_DEFINE(HAVE_LONGDOUBLE) ;;
+ *no) ;;
+esac
])
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependant libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# ['file_magic [regex]'] -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+AC_PREREQ(2.57)
-bsdi4*)
- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
+AC_DEFUN([CL_ALLOCA],
+[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+CL_LINK_CHECK(working alloca.h, cl_cv_header_alloca_h,
+[#include <alloca.h>], [char *p = (char *) alloca(2 * sizeof(int));],
+AC_DEFINE(HAVE_ALLOCA_H,,[have <alloca.h> and it should be used (not Ultrix)]))
+decl="#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else
+#ifdef _MSC_VER
+#include <malloc.h>
+#define alloca _alloca
+#else
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#else
+#ifdef _AIX
+ #pragma alloca
+#else
+#ifndef alloca
+char *alloca ();
+#endif
+#endif
+#endif
+#endif
+#endif
+"
+CL_LINK_CHECK([alloca], cl_cv_func_alloca,
+$decl, [char *p = (char *) alloca(1);],
+ , [alloca_missing=1])dnl
+if test -n "$alloca_missing"; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.${ac_objext}
+ AC_DEFINE(NO_ALLOCA,,[need to link with an external alloca.o when using alloca()])
+fi
+AC_SUBST(ALLOCA)dnl
+])
-cygwin* | mingw* | pw32*)
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- case "$host_os" in
- rhapsody* | darwin1.[012])
- lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
- ;;
- *) # Darwin 1.3 on
- lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
- ;;
- esac
- ;;
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
-freebsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
+AC_PREREQ(2.57)
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+AC_DEFUN([CL_FPU_CONTROL],
+[dnl Check for Linux with <fpu_control.h> and fpu_control_t or __setfpucw().
+dnl glibc versions since October 1998 define fpu_control_t. Earlier versions
+dnl define and declare __setfpucw(). Very early Linux libc versions have none,
+dnl and __fpu_control is of type `unsigned short'.
+CL_COMPILE_CHECK([fpu_control_t], cl_cv_type_fpu_control_t,
+[#include <fpu_control.h>], [fpu_control_t x;],
+AC_DEFINE(HAVE_FPU_CONTROL_T,,[have <fpu_control.h> and it defines the fpu_control_t type]))
+CL_COMPILE_CHECK([__setfpucw], cl_cv_func_setfpucw,
+[#include <fpu_control.h>], [__setfpucw(_FPU_IEEE);],
+AC_DEFINE(HAVE_SETFPUCW,,[have <fpu_control.h> and it declares the __setfpucw() function]))
+])
-hpux10.20*|hpux11*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-irix5* | irix6*)
- case $host_os in
- irix5*)
- # this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
- ;;
- *)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- # this will be overridden with pass_all, but let us keep it just in case
- [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
- ;;
- esac
- lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
- lt_cv_deplibs_check_method=pass_all
- ;;
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
-# This must be Linux ELF.
-linux-gnu*)
- case $host_cpu in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
- lt_cv_deplibs_check_method=pass_all ;;
- *)
- # glibc up to 2.1.1 does not perform some relocations on ARM
- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;]
- esac
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
+AC_PREREQ(2.57)
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
- else
- [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
- fi
- ;;
+AC_DEFUN([CL_GETTIMEOFDAY],
+[AC_BEFORE([$0], [CL_TIMES_CLOCK])
+AC_CHECK_FUNCS(gettimeofday)dnl
+if test $ac_cv_func_gettimeofday = yes; then
+dnl HAVE_GETTIMEOFDAY is defined
+CL_PROTO([gettimeofday], [
+CL_PROTO_TRY([
+#include <sys/types.h>
+#include <sys/time.h>
+], [int gettimeofday (struct timeval * tp, struct timezone * tzp);],
+[int gettimeofday();],
+cl_cv_proto_gettimeofday_dots=no
+cl_cv_proto_gettimeofday_arg2="struct timezone *",
+CL_PROTO_TRY([
+#include <sys/types.h>
+#include <sys/time.h>
+], [int gettimeofday (struct timeval * tp, void * tzp);],
+[int gettimeofday();],
+cl_cv_proto_gettimeofday_dots=no
+cl_cv_proto_gettimeofday_arg2="void *",
+cl_cv_proto_gettimeofday_dots=yes
+cl_cv_proto_gettimeofday_arg2="..."))
+], [extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);])
+if test $cl_cv_proto_gettimeofday_dots = yes; then
+AC_DEFINE(GETTIMEOFDAY_DOTS,,[declaration of gettimeofday() needs dots])
+else
+AC_DEFINE_UNQUOTED(GETTIMEOFDAY_TZP_T,$cl_cv_proto_gettimeofday_arg2,[type of `tzp' in gettimeofday() declaration])
+fi
+fi
+])
-newos6*)
- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+
+AC_PREREQ(2.57)
+
+AC_DEFUN([CL_TIMES_CLOCK],
+[AC_REQUIRE([CL_GETTIMEOFDAY])dnl
+if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then
+AC_CHECK_FUNC(times, , no_times=1)dnl
+if test -z "$no_times"; then
+AC_CACHE_CHECK(for times return value, cl_cv_func_times_return, [
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <time.h> /* needed for CLK_TCK */
+#ifndef CLK_TCK
+#include <sys/time.h> /* needed for CLK_TCK on SYSV PTX */
+#endif
+#include <sys/times.h>
+int main ()
+{ struct tms buffer;
+ clock_t result1;
+ clock_t result2;
+ int ticks;
+ result1 = times(&buffer);
+ if ((result1 == (clock_t)0) || (result1 == (clock_t)(-1))) exit(1);
+ sleep(1);
+ result2 = times(&buffer);
+ if ((result2 == (clock_t)0) || (result2 == (clock_t)(-1))) exit(1);
+ ticks = result2 - result1;
+ exit(!((ticks >= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2)));
+}], cl_cv_func_times_return=yes, cl_cv_func_times_return=no,
+dnl When cross-compiling, don't assume anything.
+cl_cv_func_times_return="guessing no")
+])
+case "$cl_cv_func_times_return" in
+ *yes) AC_DEFINE(HAVE_TIMES_CLOCK,,[have the times() function and it returns the real time, but do not have the gettimeofday() or ftime() function]) ;;
+ *no) ;;
+esac
+fi
+fi
+])
-osf3* | osf4* | osf5*)
- # this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
- lt_cv_file_magic_test_file=/shlib/libc.so
- lt_cv_deplibs_check_method=pass_all
- ;;
+dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-sco3.2v5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
+dnl From Bruno Haible, Marcus Daniels.
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
+AC_PREREQ(2.13)
-[sysv5uw[78]* | sysv4*uw2*)]
- lt_cv_deplibs_check_method=pass_all
- ;;
+dnl CL_PROTO(IDENTIFIER, ACTION-IF-NOT-FOUND, FINAL-PROTOTYPE)
+AC_DEFUN([CL_PROTO],
+[AC_MSG_CHECKING([for $1 declaration])
+AC_CACHE_VAL(cl_cv_proto_[$1], [$2
+cl_cv_proto_$1="$3"])
+cl_cv_proto_$1=`echo "[$]cl_cv_proto_$1" | tr -s ' ' | sed -e 's/( /(/'`
+AC_MSG_RESULT([$]{ac_t:-
+ }[$]cl_cv_proto_$1)
+])
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case $host_vendor in
- motorola)
- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )']
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"]
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- esac
- ;;
-esac
+dnl CL_PROTO_RET(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID, TYPE-IF-OK, TYPE-IF-FAILS)
+AC_DEFUN([CL_PROTO_RET],
+[AC_TRY_COMPILE([$1]
+AC_LANG_EXTERN
+[#if defined(__STDC__) || defined(__cplusplus)
+$2
+#else
+$3
+#endif
+], [], $4="$5", $4="$6")
])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
+
+dnl CL_PROTO_TRY(INCLUDES, ANSI-DECL, TRAD-DECL, ACTION-IF-OK, ACTION-IF-FAILS)
+AC_DEFUN([CL_PROTO_TRY],
+[AC_TRY_COMPILE([$1]
+AC_LANG_EXTERN
+[#if defined(__STDC__) || defined(__cplusplus)
+$2
+#else
+$3
+#endif
+], [], [$4], [$5])
])
+dnl CL_PROTO_CONST(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID)
+AC_DEFUN([CL_PROTO_CONST],
+[CL_PROTO_TRY([$1], [$2], [$3], $4="", $4="const")]
+)
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/${ac_tool_prefix}nm
- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- lt_cv_path_NM="$tmp_nm -B"
- break
- elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- lt_cv_path_NM="$tmp_nm -p"
- break
- else
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([CL_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
- # These system don't have libm
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, main, LIBM="-lm")
- ;;
-esac
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold, Peter Burwood, Sam Steingold.
+
+AC_PREREQ(2.57)
+
+AC_DEFUN([CL_RUSAGE],
+[AC_CHECK_HEADERS(sys/resource.h sys/times.h)dnl
+if test $ac_cv_header_sys_resource_h = yes; then
+ dnl HAVE_SYS_RESOURCE_H defined
+ CL_LINK_CHECK([getrusage], cl_cv_func_getrusage,
+[#include <sys/types.h> /* NetBSD 1.0 needs this */
+#include <sys/time.h>
+#include <sys/resource.h>],
+ [struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;])dnl
+ if test $cl_cv_func_getrusage = yes; then
+ CL_PROTO([getrusage], [
+ CL_PROTO_TRY([
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h> /* NetBSD 1.0 needs this */
+#include <sys/time.h>
+#include <sys/resource.h>
+],
+[int getrusage (int who, struct rusage * rusage);],
+[int getrusage();],
+[cl_cv_proto_getrusage_arg1="int"],
+[cl_cv_proto_getrusage_arg1="enum __rusage_who"])
+], [extern int getrusage ($cl_cv_proto_getrusage_arg1, struct rusage *);])dnl
+ AC_CACHE_CHECK(whether getrusage works, cl_cv_func_getrusage_works, [
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <sys/types.h> /* NetBSD 1.0 needs this */
+#include <sys/time.h>
+#include <time.h> /* for time(2) */
+#include <sys/resource.h>
+int main ()
+{
+ struct rusage used, prev;
+ time_t end = time(NULL)+2;
+ int count = 0;
+
+ if ((count = getrusage(RUSAGE_SELF, &prev))) {
+ /* getrusage is defined but does not do anything. */
+ /*fprintf(stderr,"getrusage failed: return=%d\n",count);*/
+ return 1;
+ }
+ while (time(NULL) < end) {
+ count++;
+ getrusage(RUSAGE_SELF, &used);
+ if ((used.ru_utime.tv_usec != prev.ru_utime.tv_usec)
+ || (used.ru_utime.tv_sec != prev.ru_utime.tv_sec)
+ || (used.ru_stime.tv_usec != prev.ru_stime.tv_usec)
+ || (used.ru_stime.tv_sec != prev.ru_stime.tv_sec)) {
+ /*fprintf(stderr,"success after %d runs\n",count);*/
+ return 0;
+ }
+ }
+ /* getrusage is defined but does not work. */
+ /*fprintf(stderr,"failure after %d runs\n",count);*/
+ return 1;
+}],
+cl_cv_func_getrusage_works=yes,
+cl_cv_func_getrusage_works=no,
+dnl When cross-compiling, don't assume anything.
+cl_cv_func_getrusage_works="guessing no")])
+ fi
+ if test $cl_cv_func_getrusage_works = yes; then
+ AC_DEFINE(HAVE_GETRUSAGE,,[have <sys/time.h>, the getrusage() function, the struct rusage type, and <sys/resource.h> defines RUSAGE_SELF])
+ AC_DEFINE_UNQUOTED(RUSAGE_WHO_T,$cl_cv_proto_getrusage_arg1,[type of `who' in getrusage() declaration])
+ fi
+fi
])
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments. Note that LIBLTDL and INCLTDL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
-# with '${top_builddir}/' and INCLTDL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+
+AC_PREREQ(2.57)
+
+AC_DEFUN([CL_PERROR],
+[AC_MSG_CHECKING(for perror declaration)
+AC_CACHE_VAL(cl_cv_proto_perror, [
+AC_TRY_COMPILE([
+/* Some systems declare perror() in <errno.h>, some in <stdio.h>, some don't
+ declare it at all. */
+#include <stdio.h>
+#include <errno.h>
+]AC_LANG_EXTERN[double perror ();], [],
+cl_cv_proto_perror=no, cl_cv_proto_perror=yes)
+])
+AC_MSG_RESULT([$cl_cv_proto_perror])
+if test $cl_cv_proto_perror = yes; then
+AC_DEFINE(HAVE_PERROR_DECL,,[<errno.h> or <stdio.h> contains a declaration for perror()])
+fi
])
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
-# with '${top_srcdir}/' (note the single quotes!). If your package is
-# not flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, main,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
+
+AC_PREREQ(2.13)
+
+AC_DEFUN([CL_MACHINE],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_C_CHAR_UNSIGNED])dnl
+cl_machine_file_c=$2
+cl_machine_file_h=$3
+if test $cross_compiling = no; then
+if test -z "$[$4]"; then
+AC_CHECKING(for [$1])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+EOF
+cat "$cl_machine_file_c" >> conftest.$ac_ext
+ORIGCC="$CC"
+if test $ac_cv_prog_gcc = yes; then
+# gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
+# target 80386. Strip "-O".
+CC=`echo "$CC " | sed -e 's/-O //g'`
+fi
+AC_TRY_EVAL(ac_link)
+CC="$ORIGCC"
+if test -s conftest; then
+ echo "creating $cl_machine_file_h"
+ ./conftest > conftest.h
+ if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
+ # The file exists and we would not be changing it
+ rm -f conftest.h
else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- INCLTDL=
+ rm -f "$cl_machine_file_h"
+ mv conftest.h "$cl_machine_file_h"
fi
+ [$4]=1
+else
+ echo "creation of $cl_machine_file_h failed"
+fi
+rm -f conftest*
+fi
+else
+echo "cross-compiling - cannot create $cl_machine_file_h"
+fi
])
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+dnl -*- Autoconf -*-
+dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-# Is the gmp header file new enough? (should be implemented with an argument)
-AC_DEFUN(CL_GMP_H_VERSION,
+dnl From Richard B. Kreckel.
+
+AC_PREREQ(2.13)
+
+dnl Is the gmp header file new enough? (should be implemented with an argument)
+AC_DEFUN([CL_GMP_H_VERSION],
[AC_CACHE_CHECK([for recent enough gmp.h], cl_cv_new_gmp_h, [
AC_TRY_CPP([#include <gmp.h>
#if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3)
cl_cv_new_gmp_h="yes", cl_cv_new_gmp_h="no")
])])dnl
-# Does libgmp provide some functionality introduced in version 3.0?
-AC_DEFUN(CL_GMP_CHECK,
+dnl Does libgmp provide some functionality introduced in version 3.0?
+AC_DEFUN([CL_GMP_CHECK],
[AC_CACHE_CHECK([for working libgmp], cl_cv_new_libgmp, [
SAVELIBS=$LIBS
LIBS="$LIBS -lgmp"
AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
-cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
-])])
+cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no")
+ LIBS=$SAVELIBS])
+ if test x"$cl_cv_new_libgmp" = xyes; then
+ LIBS="$LIBS -lgmp"
+ fi
+])
-# What is sizeof(mp_limb_t)? (It has to match sizeof(uintD) later.)
-AC_DEFUN(CL_GMP_SET_UINTD,
+dnl What is sizeof(mp_limb_t)? (It has to match sizeof(uintD) later.)
+AC_DEFUN([CL_GMP_SET_UINTD],
[AC_CACHE_CHECK([how large gmp demands uintD to be], cl_cv_gmp_set_uintd, [
AC_TRY_RUN([#include <stdio.h>
#include <gmp.h>
int main() {
FILE *f=fopen("conftestval", "w");
- if (!f) return(1);
+ if (!f) return(255);
if (sizeof(mp_limb_t) > sizeof(long))
fprintf(f, "long long");
else if (sizeof(mp_limb_t) == sizeof(long))
fprintf(f, "long");
else if (sizeof(mp_limb_t) == sizeof(int))
fprintf(f, "int");
- else return(1);
+ else return(sizeof(mp_limb_t));
+#if defined(__GMP_BITS_PER_MP_LIMB)
+ /* Is there a nail in a limb? */
+ if (8*sizeof(mp_limb_t)!=__GMP_BITS_PER_MP_LIMB)
+ return(254);
+#endif
return(0);
-}], cl_cv_gmp_set_uintd=`cat conftestval`; \
- cl_gmp_demands="GMP_DEMANDS_UINTD_`echo ${cl_cv_gmp_set_uintd} | sed -e 'y/ gilnot/_GILNOT/'`";
- AC_DEFINE_UNQUOTED($cl_gmp_demands),
- AC_MSG_ERROR([CLN can't handle the result]),dnl
+}], cl_cv_gmp_set_uintd=`cat conftestval`
+ cl_gmp_demands="GMP_DEMANDS_UINTD_`echo ${cl_cv_gmp_set_uintd} | sed -e 'y/ gilnot/_GILNOT/'`",
+ gmp_retval="$ac_status"
+ if test x$gmp_retval = "x255"; then AC_MSG_ERROR([error opening output file.]); fi
+ if test x$gmp_retval = "x254"; then AC_MSG_ERROR([nails in MP limbs are unsupported.]); fi
+ AC_MSG_ERROR([Don't know which C-type has sizeof $gmp_retval.]),
AC_MSG_ERROR([cross-compiling - cannot determine]))
-])])
+])
+AC_DEFINE_UNQUOTED($cl_gmp_demands)
+])
+