3 dnl This is a copy of AM_PROG_LIBTOOL from libtool 1.0, modified to
4 dnl not produce a shared library by default.
5 AC_DEFUN(AM_PROG_LIBTOOL,
6 [AC_REQUIRE([AC_CANONICAL_HOST])
7 AC_REQUIRE([AC_PROG_CC])
8 AC_REQUIRE([AC_PROG_RANLIB])
9 AC_REQUIRE([AM_PROG_LD])
10 AC_REQUIRE([AC_PROG_LN_S])
12 # Always use our own libtool.
13 LIBTOOL='$(top_builddir)/libtool'
16 dnl Allow the --disable-shared flag to stop us from building shared libs.
18 [ --enable-shared build shared libraries [default=yes]],
19 test "$enableval" = no && libtool_shared=" --disable-shared",
20 libtool_shared=--disable-shared)
22 dnl Allow the --disable-static flag to stop us from building static libs.
24 [ --enable-static build static libraries [default=yes]],
25 test "$enableval" = no && libtool_static=" --disable-static",
28 libtool_flags="$libtool_shared$libtool_static"
29 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
30 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
31 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
33 # Some flags need to be propagated to the compiler or linker for good
37 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
38 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
45 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
46 CFLAGS="$CFLAGS -belf"
50 # Actually configure libtool. ac_aux_dir is where install-sh is found.
51 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
52 LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
53 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
54 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
55 || AC_MSG_ERROR([libtool configure failed])
58 # AM_PROG_LD - find the path to the GNU or non-GNU linker
61 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
62 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
63 if test "$with_gnu_ld" = yes; then
64 AC_MSG_CHECKING([for GNU ld])
66 AC_MSG_CHECKING([for non-GNU ld])
68 AC_CACHE_VAL(ac_cv_path_LD,
71 ac_cv_path_LD="$LD" # Let the user override the test with a path.
74 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
75 for ac_dir in $PATH; do
76 test -z "$ac_dir" && ac_dir=.
77 if test -f "$ac_dir/ld"; then
78 ac_cv_path_LD="$ac_dir/ld"
79 # Check to see if the program is GNU ld. I'd rather use --version,
80 # but apparently some GNU ld's only accept -v.
81 # Break only if it was the GNU/non-GNU ld that we prefer.
82 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
83 test "$with_gnu_ld" = yes && break
85 test "$with_gnu_ld" != yes && break
93 if test -n "$LD"; then
98 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
103 AC_DEFUN(AM_PROG_LD_GNU,
104 [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
105 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
106 if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
107 ac_cv_prog_gnu_ld=yes