1130803Smarcel## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
2130803Smarcel## Copyright 1996, 1997, 1998, 1999, 2000, 2001
3130803Smarcel## Free Software Foundation, Inc.
4130803Smarcel## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5130803Smarcel##
6130803Smarcel## This program is free software; you can redistribute it and/or modify
7130803Smarcel## it under the terms of the GNU General Public License as published by
8130803Smarcel## the Free Software Foundation; either version 2 of the License, or
9130803Smarcel## (at your option) any later version.
10130803Smarcel##
11130803Smarcel## This program is distributed in the hope that it will be useful, but
12130803Smarcel## WITHOUT ANY WARRANTY; without even the implied warranty of
13130803Smarcel## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14130803Smarcel## General Public License for more details.
15130803Smarcel##
16130803Smarcel## You should have received a copy of the GNU General Public License
17130803Smarcel## along with this program; if not, write to the Free Software
18130803Smarcel## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19130803Smarcel##
20130803Smarcel## As a special exception to the GNU General Public License, if you
21130803Smarcel## distribute this file as part of a program that contains a
22130803Smarcel## configuration script generated by Autoconf, you may include it under
23130803Smarcel## the same distribution terms that you use for the rest of that program.
24130803Smarcel
25130803Smarcel# serial 46 AC_PROG_LIBTOOL
26130803SmarcelAC_DEFUN([AC_PROG_LIBTOOL],
27130803Smarcel[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
28130803Smarceldnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
29130803Smarceldnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
30130803Smarcel  AC_PROVIDE_IFELSE([AC_PROG_CXX],
31130803Smarcel    [AC_LIBTOOL_CXX],
32130803Smarcel    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
33130803Smarcel])])
34130803Smarcel
35130803Smarceldnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
36130803Smarceldnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
37130803Smarceldnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
38130803Smarcel  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
39130803Smarcel    [AC_LIBTOOL_GCJ],
40130803Smarcel    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
41130803Smarcel        [AC_LIBTOOL_GCJ],
42130803Smarcel	[AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
43130803Smarcel	  [AC_LIBTOOL_GCJ],
44130803Smarcel	[ifdef([AC_PROG_GCJ],
45130803Smarcel	       [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
46130803Smarcel])])
47130803Smarcel	 ifdef([A][M_PROG_GCJ],
48130803Smarcel	       [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
49130803Smarcel])])
50130803Smarcel	 ifdef([LT_AC_PROG_GCJ],
51130803Smarcel	       [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
52130803Smarcel])])])])])])
53130803Smarcel
54130803SmarcelAC_DEFUN([_AC_PROG_LIBTOOL],
55130803Smarcel[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
56130803SmarcelAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
57130803SmarcelAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
58130803Smarcel
59130803Smarcel# Save cache, so that ltconfig can load it
60130803SmarcelAC_CACHE_SAVE
61130803Smarcel
62130803Smarcel# Actually configure libtool.  ac_aux_dir is where install-sh is found.
63130803SmarcelAR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
64130803SmarcelMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
65130803SmarcelLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
66130803SmarcelAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
67130803Smarcelobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
68130803Smarceldeplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
69130803Smarcel${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
70130803Smarcel$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
71130803Smarcel|| AC_MSG_ERROR([libtool configure failed])
72130803Smarcel
73130803Smarcel# Reload cache, that may have been modified by ltconfig
74130803SmarcelAC_CACHE_LOAD
75130803Smarcel
76130803Smarcel# This can be used to rebuild libtool when needed
77130803SmarcelLIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
78130803Smarcel
79130803Smarcel# Always use our own libtool.
80130803SmarcelLIBTOOL='$(SHELL) $(top_builddir)/libtool'
81130803SmarcelAC_SUBST(LIBTOOL)dnl
82130803Smarcel
83130803Smarcel# Redirect the config.log output again, so that the ltconfig log is not
84130803Smarcel# clobbered by the next message.
85130803Smarcelexec 5>>./config.log
86130803Smarcel])
87130803Smarcel
88130803SmarcelAC_DEFUN([AC_LIBTOOL_SETUP],
89130803Smarcel[AC_PREREQ(2.13)dnl
90130803SmarcelAC_REQUIRE([AC_ENABLE_SHARED])dnl
91130803SmarcelAC_REQUIRE([AC_ENABLE_STATIC])dnl
92130803SmarcelAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
93130803SmarcelAC_REQUIRE([AC_CANONICAL_HOST])dnl
94130803SmarcelAC_REQUIRE([AC_CANONICAL_BUILD])dnl
95130803SmarcelAC_REQUIRE([AC_PROG_CC])dnl
96130803SmarcelAC_REQUIRE([AC_PROG_LD])dnl
97130803SmarcelAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
98130803SmarcelAC_REQUIRE([AC_PROG_NM])dnl
99130803SmarcelAC_REQUIRE([AC_PROG_LN_S])dnl
100130803SmarcelAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
101130803Smarcel# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
102130803SmarcelAC_REQUIRE([AC_OBJEXT])dnl
103130803SmarcelAC_REQUIRE([AC_EXEEXT])dnl
104130803Smarceldnl
105130803Smarcel
106130803Smarcel# Only perform the check for file, if the check method requires it
107130803Smarcelcase $deplibs_check_method in
108130803Smarcelfile_magic*)
109130803Smarcel  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
110130803Smarcel    AC_PATH_MAGIC
111130803Smarcel  fi
112130803Smarcel  ;;
113130803Smarcelesac
114130803Smarcel
115130803SmarcelAC_CHECK_TOOL(RANLIB, ranlib, :)
116130803SmarcelAC_CHECK_TOOL(STRIP, strip, :)
117130803Smarcel
118130803Smarcel# Check for any special flags to pass to ltconfig.
119130803Smarcellibtool_flags="--cache-file=$cache_file"
120130803Smarceltest "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
121130803Smarceltest "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
122130803Smarceltest "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
123130803Smarceltest "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
124130803Smarceltest "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
125130803Smarcelifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
126130803Smarcel[libtool_flags="$libtool_flags --enable-dlopen"])
127130803Smarcelifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
128130803Smarcel[libtool_flags="$libtool_flags --enable-win32-dll"])
129130803SmarcelAC_ARG_ENABLE(libtool-lock,
130130803Smarcel  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
131130803Smarceltest "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
132130803Smarceltest x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
133130803Smarcel
134130803SmarcelAC_ARG_WITH(pic,
135130803Smarcel  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
136130803Smarcel     pic_mode="$withval", pic_mode=default)
137130803Smarceltest x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
138130803Smarceltest x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
139130803Smarcel
140130803Smarcel# Some flags need to be propagated to the compiler or linker for good
141130803Smarcel# libtool support.
142130803Smarcelcase $host in
143130803Smarcel*-*-irix6*)
144130803Smarcel  # Find out which ABI we are using.
145130803Smarcel  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
146130803Smarcel  if AC_TRY_EVAL(ac_compile); then
147130803Smarcel   if test "$lt_cv_prog_gnu_ld" = yes; then
148130803Smarcel    case `/usr/bin/file conftest.$ac_objext` in
149130803Smarcel    *32-bit*)
150130803Smarcel      LD="${LD-ld} -melf32bsmip"
151130803Smarcel      ;;
152130803Smarcel    *N32*)
153130803Smarcel      LD="${LD-ld} -melf32bmipn32"
154130803Smarcel      ;;
155130803Smarcel    *64-bit*)
156130803Smarcel      LD="${LD-ld} -melf64bmip"
157130803Smarcel      ;;
158130803Smarcel    esac
159130803Smarcel   else
160130803Smarcel    case `/usr/bin/file conftest.$ac_objext` in
161130803Smarcel    *32-bit*)
162130803Smarcel      LD="${LD-ld} -32"
163130803Smarcel      ;;
164130803Smarcel    *N32*)
165130803Smarcel      LD="${LD-ld} -n32"
166130803Smarcel      ;;
167130803Smarcel    *64-bit*)
168130803Smarcel      LD="${LD-ld} -64"
169130803Smarcel      ;;
170130803Smarcel    esac
171130803Smarcel   fi
172130803Smarcel  fi
173130803Smarcel  rm -rf conftest*
174130803Smarcel  ;;
175130803Smarcel
176130803Smarcelia64-*-hpux*)
177130803Smarcel  # Find out which ABI we are using.
178130803Smarcel  echo 'int i;' > conftest.$ac_ext
179130803Smarcel  if AC_TRY_EVAL(ac_compile); then
180130803Smarcel    case "`/usr/bin/file conftest.o`" in
181130803Smarcel    *ELF-32*)
182130803Smarcel      HPUX_IA64_MODE="32"
183130803Smarcel      ;;
184130803Smarcel    *ELF-64*)
185130803Smarcel      HPUX_IA64_MODE="64"
186130803Smarcel      ;;
187130803Smarcel    esac
188130803Smarcel  fi
189130803Smarcel  rm -rf conftest*
190130803Smarcel  ;;
191130803Smarcel
192130803Smarcel*-*-sco3.2v5*)
193130803Smarcel  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
194130803Smarcel  SAVE_CFLAGS="$CFLAGS"
195130803Smarcel  CFLAGS="$CFLAGS -belf"
196130803Smarcel  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
197130803Smarcel    [AC_LANG_SAVE
198130803Smarcel     AC_LANG_C
199130803Smarcel     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
200130803Smarcel     AC_LANG_RESTORE])
201130803Smarcel  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
202130803Smarcel    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
203130803Smarcel    CFLAGS="$SAVE_CFLAGS"
204130803Smarcel  fi
205130803Smarcel  ;;
206130803Smarcel
207130803Smarcelifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
208130803Smarcel[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
209130803Smarcel  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
210130803Smarcel  AC_CHECK_TOOL(AS, as, false)
211130803Smarcel  AC_CHECK_TOOL(OBJDUMP, objdump, false)
212130803Smarcel
213130803Smarcel  # recent cygwin and mingw systems supply a stub DllMain which the user
214130803Smarcel  # can override, but on older systems we have to supply one
215130803Smarcel  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
216130803Smarcel    [AC_TRY_LINK([],
217130803Smarcel      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
218130803Smarcel      DllMain (0, 0, 0);],
219130803Smarcel      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
220130803Smarcel
221130803Smarcel  case $host/$CC in
222130803Smarcel  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
223130803Smarcel    # old mingw systems require "-dll" to link a DLL, while more recent ones
224130803Smarcel    # require "-mdll"
225130803Smarcel    SAVE_CFLAGS="$CFLAGS"
226130803Smarcel    CFLAGS="$CFLAGS -mdll"
227130803Smarcel    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
228130803Smarcel      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
229130803Smarcel    CFLAGS="$SAVE_CFLAGS" ;;
230130803Smarcel  *-*-cygwin* | *-*-pw32*)
231130803Smarcel    # cygwin systems need to pass --dll to the linker, and not link
232130803Smarcel    # crt.o which will require a WinMain@16 definition.
233130803Smarcel    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
234130803Smarcel  esac
235130803Smarcel  ;;
236130803Smarcel  ])
237130803Smarcelesac
238130803Smarcel])
239130803Smarcel
240130803Smarcel# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
241130803SmarcelAC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
242130803Smarcel
243130803Smarcel# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
244130803SmarcelAC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
245130803Smarcel
246130803Smarcel# AC_ENABLE_SHARED - implement the --enable-shared flag
247130803Smarcel# Usage: AC_ENABLE_SHARED[(DEFAULT)]
248130803Smarcel#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
249130803Smarcel#   `yes'.
250130803SmarcelAC_DEFUN([AC_ENABLE_SHARED],
251130803Smarcel[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
252130803SmarcelAC_ARG_ENABLE(shared,
253130803Smarcelchangequote(<<, >>)dnl
254130803Smarcel<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
255130803Smarcelchangequote([, ])dnl
256130803Smarcel[p=${PACKAGE-default}
257130803Smarcelcase $enableval in
258130803Smarcelyes) enable_shared=yes ;;
259130803Smarcelno) enable_shared=no ;;
260130803Smarcel*)
261130803Smarcel  enable_shared=no
262130803Smarcel  # Look at the argument we got.  We use all the common list separators.
263130803Smarcel  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
264130803Smarcel  for pkg in $enableval; do
265130803Smarcel    if test "X$pkg" = "X$p"; then
266130803Smarcel      enable_shared=yes
267130803Smarcel    fi
268130803Smarcel  done
269130803Smarcel  IFS="$ac_save_ifs"
270130803Smarcel  ;;
271130803Smarcelesac],
272130803Smarcelenable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
273130803Smarcel])
274130803Smarcel
275130803Smarcel# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
276130803SmarcelAC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
277130803SmarcelAC_ENABLE_SHARED(no)])
278130803Smarcel
279130803Smarcel# AC_ENABLE_STATIC - implement the --enable-static flag
280130803Smarcel# Usage: AC_ENABLE_STATIC[(DEFAULT)]
281130803Smarcel#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
282130803Smarcel#   `yes'.
283130803SmarcelAC_DEFUN([AC_ENABLE_STATIC],
284130803Smarcel[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
285130803SmarcelAC_ARG_ENABLE(static,
286130803Smarcelchangequote(<<, >>)dnl
287130803Smarcel<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
288130803Smarcelchangequote([, ])dnl
289130803Smarcel[p=${PACKAGE-default}
290130803Smarcelcase $enableval in
291130803Smarcelyes) enable_static=yes ;;
292130803Smarcelno) enable_static=no ;;
293130803Smarcel*)
294130803Smarcel  enable_static=no
295130803Smarcel  # Look at the argument we got.  We use all the common list separators.
296130803Smarcel  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
297130803Smarcel  for pkg in $enableval; do
298130803Smarcel    if test "X$pkg" = "X$p"; then
299130803Smarcel      enable_static=yes
300130803Smarcel    fi
301130803Smarcel  done
302130803Smarcel  IFS="$ac_save_ifs"
303130803Smarcel  ;;
304130803Smarcelesac],
305130803Smarcelenable_static=AC_ENABLE_STATIC_DEFAULT)dnl
306130803Smarcel])
307130803Smarcel
308130803Smarcel# AC_DISABLE_STATIC - set the default static flag to --disable-static
309130803SmarcelAC_DEFUN([AC_DISABLE_STATIC],
310130803Smarcel[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
311130803SmarcelAC_ENABLE_STATIC(no)])
312130803Smarcel
313130803Smarcel
314130803Smarcel# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
315130803Smarcel# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
316130803Smarcel#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
317130803Smarcel#   `yes'.
318130803SmarcelAC_DEFUN([AC_ENABLE_FAST_INSTALL],
319130803Smarcel[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
320130803SmarcelAC_ARG_ENABLE(fast-install,
321130803Smarcelchangequote(<<, >>)dnl
322130803Smarcel<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
323130803Smarcelchangequote([, ])dnl
324130803Smarcel[p=${PACKAGE-default}
325130803Smarcelcase $enableval in
326130803Smarcelyes) enable_fast_install=yes ;;
327130803Smarcelno) enable_fast_install=no ;;
328130803Smarcel*)
329130803Smarcel  enable_fast_install=no
330130803Smarcel  # Look at the argument we got.  We use all the common list separators.
331130803Smarcel  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
332130803Smarcel  for pkg in $enableval; do
333130803Smarcel    if test "X$pkg" = "X$p"; then
334130803Smarcel      enable_fast_install=yes
335130803Smarcel    fi
336130803Smarcel  done
337130803Smarcel  IFS="$ac_save_ifs"
338130803Smarcel  ;;
339130803Smarcelesac],
340130803Smarcelenable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
341130803Smarcel])
342130803Smarcel
343130803Smarcel# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
344130803SmarcelAC_DEFUN([AC_DISABLE_FAST_INSTALL],
345130803Smarcel[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
346130803SmarcelAC_ENABLE_FAST_INSTALL(no)])
347130803Smarcel
348130803Smarcel# AC_LIBTOOL_PICMODE - implement the --with-pic flag
349130803Smarcel# Usage: AC_LIBTOOL_PICMODE[(MODE)]
350130803Smarcel#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
351130803Smarcel#   `both'.
352130803SmarcelAC_DEFUN([AC_LIBTOOL_PICMODE],
353130803Smarcel[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
354130803Smarcelpic_mode=ifelse($#,1,$1,default)])
355130803Smarcel
356130803Smarcel
357130803Smarcel# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
358130803SmarcelAC_DEFUN([AC_PATH_TOOL_PREFIX],
359130803Smarcel[AC_MSG_CHECKING([for $1])
360130803SmarcelAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
361130803Smarcel[case $MAGIC_CMD in
362130803Smarcel  /*)
363130803Smarcel  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
364130803Smarcel  ;;
365130803Smarcel  ?:/*)
366130803Smarcel  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
367130803Smarcel  ;;
368130803Smarcel  *)
369130803Smarcel  ac_save_MAGIC_CMD="$MAGIC_CMD"
370130803Smarcel  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
371130803Smarceldnl $ac_dummy forces splitting on constant user-supplied paths.
372130803Smarceldnl POSIX.2 word splitting is done only on the output of word expansions,
373130803Smarceldnl not every word.  This closes a longstanding sh security hole.
374130803Smarcel  ac_dummy="ifelse([$2], , $PATH, [$2])"
375130803Smarcel  for ac_dir in $ac_dummy; do
376130803Smarcel    test -z "$ac_dir" && ac_dir=.
377130803Smarcel    if test -f $ac_dir/$1; then
378130803Smarcel      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
379130803Smarcel      if test -n "$file_magic_test_file"; then
380130803Smarcel	case $deplibs_check_method in
381130803Smarcel	"file_magic "*)
382130803Smarcel	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
383130803Smarcel	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
384130803Smarcel	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
385130803Smarcel	    egrep "$file_magic_regex" > /dev/null; then
386130803Smarcel	    :
387130803Smarcel	  else
388130803Smarcel	    cat <<EOF 1>&2
389130803Smarcel
390130803Smarcel*** Warning: the command libtool uses to detect shared libraries,
391130803Smarcel*** $file_magic_cmd, produces output that libtool cannot recognize.
392130803Smarcel*** The result is that libtool may fail to recognize shared libraries
393130803Smarcel*** as such.  This will affect the creation of libtool libraries that
394130803Smarcel*** depend on shared libraries, but programs linked with such libtool
395130803Smarcel*** libraries will work regardless of this problem.  Nevertheless, you
396130803Smarcel*** may want to report the problem to your system manager and/or to
397130803Smarcel*** bug-libtool@gnu.org
398130803Smarcel
399130803SmarcelEOF
400130803Smarcel	  fi ;;
401130803Smarcel	esac
402130803Smarcel      fi
403130803Smarcel      break
404130803Smarcel    fi
405130803Smarcel  done
406130803Smarcel  IFS="$ac_save_ifs"
407130803Smarcel  MAGIC_CMD="$ac_save_MAGIC_CMD"
408130803Smarcel  ;;
409130803Smarcelesac])
410130803SmarcelMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
411130803Smarcelif test -n "$MAGIC_CMD"; then
412130803Smarcel  AC_MSG_RESULT($MAGIC_CMD)
413130803Smarcelelse
414130803Smarcel  AC_MSG_RESULT(no)
415130803Smarcelfi
416130803Smarcel])
417130803Smarcel
418130803Smarcel
419130803Smarcel# AC_PATH_MAGIC - find a file program which can recognise a shared library
420130803SmarcelAC_DEFUN([AC_PATH_MAGIC],
421130803Smarcel[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
422130803SmarcelAC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
423130803Smarcelif test -z "$lt_cv_path_MAGIC_CMD"; then
424130803Smarcel  if test -n "$ac_tool_prefix"; then
425130803Smarcel    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
426130803Smarcel  else
427130803Smarcel    MAGIC_CMD=:
428130803Smarcel  fi
429130803Smarcelfi
430130803Smarcel])
431130803Smarcel
432130803Smarcel
433130803Smarcel# AC_PROG_LD - find the path to the GNU or non-GNU linker
434130803SmarcelAC_DEFUN([AC_PROG_LD],
435130803Smarcel[AC_ARG_WITH(gnu-ld,
436130803Smarcel[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
437130803Smarceltest "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
438130803SmarcelAC_REQUIRE([AC_PROG_CC])dnl
439130803SmarcelAC_REQUIRE([AC_CANONICAL_HOST])dnl
440130803SmarcelAC_REQUIRE([AC_CANONICAL_BUILD])dnl
441130803Smarcelac_prog=ld
442130803Smarcelif test "$GCC" = yes; then
443130803Smarcel  # Check if gcc -print-prog-name=ld gives a path.
444130803Smarcel  AC_MSG_CHECKING([for ld used by GCC])
445130803Smarcel  case $host in
446130803Smarcel  *-*-mingw*)
447130803Smarcel    # gcc leaves a trailing carriage return which upsets mingw
448130803Smarcel    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
449130803Smarcel  *)
450130803Smarcel    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
451130803Smarcel  esac
452130803Smarcel  case $ac_prog in
453130803Smarcel    # Accept absolute paths.
454130803Smarcel    [[\\/]* | [A-Za-z]:[\\/]*)]
455130803Smarcel      re_direlt=['/[^/][^/]*/\.\./']
456130803Smarcel      # Canonicalize the path of ld
457130803Smarcel      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
458130803Smarcel      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
459130803Smarcel	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
460130803Smarcel      done
461130803Smarcel      test -z "$LD" && LD="$ac_prog"
462130803Smarcel      ;;
463130803Smarcel  "")
464130803Smarcel    # If it fails, then pretend we aren't using GCC.
465130803Smarcel    ac_prog=ld
466130803Smarcel    ;;
467130803Smarcel  *)
468130803Smarcel    # If it is relative, then search for the first ld in PATH.
469130803Smarcel    with_gnu_ld=unknown
470130803Smarcel    ;;
471130803Smarcel  esac
472130803Smarcelelif test "$with_gnu_ld" = yes; then
473130803Smarcel  AC_MSG_CHECKING([for GNU ld])
474130803Smarcelelse
475130803Smarcel  AC_MSG_CHECKING([for non-GNU ld])
476130803Smarcelfi
477130803SmarcelAC_CACHE_VAL(lt_cv_path_LD,
478130803Smarcel[if test -z "$LD"; then
479130803Smarcel  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
480130803Smarcel  for ac_dir in $PATH; do
481130803Smarcel    test -z "$ac_dir" && ac_dir=.
482130803Smarcel    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
483130803Smarcel      lt_cv_path_LD="$ac_dir/$ac_prog"
484130803Smarcel      # Check to see if the program is GNU ld.  I'd rather use --version,
485130803Smarcel      # but apparently some GNU ld's only accept -v.
486130803Smarcel      # Break only if it was the GNU/non-GNU ld that we prefer.
487130803Smarcel      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
488130803Smarcel	test "$with_gnu_ld" != no && break
489130803Smarcel      else
490130803Smarcel	test "$with_gnu_ld" != yes && break
491130803Smarcel      fi
492130803Smarcel    fi
493130803Smarcel  done
494130803Smarcel  IFS="$ac_save_ifs"
495130803Smarcelelse
496130803Smarcel  lt_cv_path_LD="$LD" # Let the user override the test with a path.
497130803Smarcelfi])
498130803SmarcelLD="$lt_cv_path_LD"
499130803Smarcelif test -n "$LD"; then
500130803Smarcel  AC_MSG_RESULT($LD)
501130803Smarcelelse
502130803Smarcel  AC_MSG_RESULT(no)
503130803Smarcelfi
504130803Smarceltest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
505130803SmarcelAC_PROG_LD_GNU
506130803Smarcel])
507130803Smarcel
508130803SmarcelAC_DEFUN([AC_PROG_LD_GNU],
509130803Smarcel[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
510130803Smarcel[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
511130803Smarcelif $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
512130803Smarcel  lt_cv_prog_gnu_ld=yes
513130803Smarcelelse
514130803Smarcel  lt_cv_prog_gnu_ld=no
515130803Smarcelfi])
516130803Smarcelwith_gnu_ld=$lt_cv_prog_gnu_ld
517130803Smarcel])
518130803Smarcel
519130803Smarcel# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
520130803Smarcel#   -- PORTME Some linkers may need a different reload flag.
521130803SmarcelAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
522130803Smarcel[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
523130803Smarcel[lt_cv_ld_reload_flag='-r'])
524130803Smarcelreload_flag=$lt_cv_ld_reload_flag
525130803Smarceltest -n "$reload_flag" && reload_flag=" $reload_flag"
526130803Smarcel])
527130803Smarcel
528130803Smarcel# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
529130803Smarcel#  -- PORTME fill in with the dynamic library characteristics
530130803SmarcelAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
531130803Smarcel[AC_CACHE_CHECK([how to recognise dependant libraries],
532130803Smarcellt_cv_deplibs_check_method,
533130803Smarcel[lt_cv_file_magic_cmd='$MAGIC_CMD'
534130803Smarcellt_cv_file_magic_test_file=
535130803Smarcellt_cv_deplibs_check_method='unknown'
536130803Smarcel# Need to set the preceding variable on all platforms that support
537130803Smarcel# interlibrary dependencies.
538130803Smarcel# 'none' -- dependencies not supported.
539130803Smarcel# `unknown' -- same as none, but documents that we really don't know.
540130803Smarcel# 'pass_all' -- all dependencies passed with no checks.
541130803Smarcel# 'test_compile' -- check by making test program.
542130803Smarcel# 'file_magic [regex]' -- check by looking for files in library path
543130803Smarcel# which responds to the $file_magic_cmd with a given egrep regex.
544130803Smarcel# If you have `file' or equivalent on your system and you're not sure
545130803Smarcel# whether `pass_all' will *always* work, you probably want this one.
546130803Smarcel
547130803Smarcelcase $host_os in
548130803Smarcelaix*)
549130803Smarcel  lt_cv_deplibs_check_method=pass_all
550130803Smarcel  ;;
551130803Smarcel
552130803Smarcelbeos*)
553130803Smarcel  lt_cv_deplibs_check_method=pass_all
554130803Smarcel  ;;
555130803Smarcel
556130803Smarcelbsdi4*)
557130803Smarcel  lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
558130803Smarcel  lt_cv_file_magic_cmd='/usr/bin/file -L'
559130803Smarcel  lt_cv_file_magic_test_file=/shlib/libc.so
560130803Smarcel  ;;
561130803Smarcel
562130803Smarcelcygwin* | mingw* |pw32*)
563130803Smarcel  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
564130803Smarcel  lt_cv_file_magic_cmd='$OBJDUMP -f'
565130803Smarcel  ;;
566130803Smarcel
567130803Smarceldarwin* | rhapsody*)
568130803Smarcel  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
569130803Smarcel  lt_cv_file_magic_cmd='/usr/bin/file -L'
570130803Smarcel  case "$host_os" in
571130803Smarcel  rhapsody* | darwin1.[012])
572130803Smarcel    lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
573130803Smarcel    ;;
574130803Smarcel  *) # Darwin 1.3 on
575130803Smarcel    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
576130803Smarcel    ;;
577130803Smarcel  esac
578130803Smarcel  ;;
579130803Smarcel
580130803Smarcelfreebsd* )
581130803Smarcel  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
582130803Smarcel    case $host_cpu in
583130803Smarcel    i*86 )
584130803Smarcel      # Not sure whether the presence of OpenBSD here was a mistake.
585130803Smarcel      # Let's accept both of them until this is cleared up.
586130803Smarcel      lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
587130803Smarcel      lt_cv_file_magic_cmd=/usr/bin/file
588130803Smarcel      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
589130803Smarcel      ;;
590130803Smarcel    esac
591130803Smarcel  else
592130803Smarcel    lt_cv_deplibs_check_method=pass_all
593130803Smarcel  fi
594130803Smarcel  ;;
595130803Smarcel
596130803Smarcelgnu*)
597130803Smarcel  lt_cv_deplibs_check_method=pass_all
598130803Smarcel  ;;
599130803Smarcel
600130803Smarcelhpux10.20*|hpux11*)
601130803Smarcel  case $host_cpu in
602130803Smarcel  hppa*)
603130803Smarcel    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
604130803Smarcel    lt_cv_file_magic_cmd=/usr/bin/file
605130803Smarcel    lt_cv_file_magic_test_file=/usr/lib/libc.sl
606130803Smarcel    ;;
607130803Smarcel  ia64*)
608130803Smarcel    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64']
609130803Smarcel    lt_cv_file_magic_cmd=/usr/bin/file
610130803Smarcel    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
611130803Smarcel    ;;
612130803Smarcel  esac
613130803Smarcel  ;;
614130803Smarcel
615130803Smarcelirix5* | irix6*)
616130803Smarcel  case $host_os in
617130803Smarcel  irix5*)
618130803Smarcel    # this will be overridden with pass_all, but let us keep it just in case
619130803Smarcel    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
620130803Smarcel    ;;
621130803Smarcel  *)
622130803Smarcel    case $LD in
623130803Smarcel    *-32|*"-32 ") libmagic=32-bit;;
624130803Smarcel    *-n32|*"-n32 ") libmagic=N32;;
625130803Smarcel    *-64|*"-64 ") libmagic=64-bit;;
626130803Smarcel    *) libmagic=never-match;;
627130803Smarcel    esac
628130803Smarcel    # this will be overridden with pass_all, but let us keep it just in case
629130803Smarcel    lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
630130803Smarcel    ;;
631130803Smarcel  esac
632130803Smarcel  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
633130803Smarcel  lt_cv_deplibs_check_method=pass_all
634130803Smarcel  ;;
635130803Smarcel
636130803Smarcel# This must be Linux ELF.
637130803Smarcellinux-gnu*)
638130803Smarcel  case $host_cpu in
639130803Smarcel  alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
640130803Smarcel    lt_cv_deplibs_check_method=pass_all ;;
641130803Smarcel  *)
642130803Smarcel    # glibc up to 2.1.1 does not perform some relocations on ARM
643130803Smarcel    lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
644130803Smarcel  esac
645130803Smarcel  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
646130803Smarcel  ;;
647130803Smarcel
648130803Smarcelnetbsd*)
649130803Smarcel  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
650130803Smarcel    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
651130803Smarcel  else
652130803Smarcel    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
653130803Smarcel  fi
654130803Smarcel  ;;
655130803Smarcel
656130803Smarcelnewsos6)
657130803Smarcel  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
658130803Smarcel  lt_cv_file_magic_cmd=/usr/bin/file
659130803Smarcel  lt_cv_file_magic_test_file=/usr/lib/libnls.so
660130803Smarcel  ;;
661130803Smarcel
662130803Smarcelosf3* | osf4* | osf5*)
663130803Smarcel  # this will be overridden with pass_all, but let us keep it just in case
664130803Smarcel  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
665130803Smarcel  lt_cv_file_magic_test_file=/shlib/libc.so
666130803Smarcel  lt_cv_deplibs_check_method=pass_all
667130803Smarcel  ;;
668130803Smarcel
669130803Smarcelsco3.2v5*)
670130803Smarcel  lt_cv_deplibs_check_method=pass_all
671130803Smarcel  ;;
672130803Smarcel
673130803Smarcelsolaris*)
674130803Smarcel  lt_cv_deplibs_check_method=pass_all
675130803Smarcel  lt_cv_file_magic_test_file=/lib/libc.so
676130803Smarcel  ;;
677130803Smarcel
678130803Smarcel[sysv5uw[78]* | sysv4*uw2*)]
679130803Smarcel  lt_cv_deplibs_check_method=pass_all
680130803Smarcel  ;;
681130803Smarcel
682130803Smarcelsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
683130803Smarcel  case $host_vendor in
684130803Smarcel  ncr)
685130803Smarcel    lt_cv_deplibs_check_method=pass_all
686130803Smarcel    ;;
687130803Smarcel  motorola)
688130803Smarcel    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]']
689130803Smarcel    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
690130803Smarcel    ;;
691130803Smarcel  esac
692130803Smarcel  ;;
693130803Smarcelesac
694130803Smarcel])
695130803Smarcelfile_magic_cmd=$lt_cv_file_magic_cmd
696130803Smarceldeplibs_check_method=$lt_cv_deplibs_check_method
697130803Smarcel])
698130803Smarcel
699130803Smarcel
700130803Smarcel# AC_PROG_NM - find the path to a BSD-compatible name lister
701130803SmarcelAC_DEFUN([AC_PROG_NM],
702130803Smarcel[AC_MSG_CHECKING([for BSD-compatible nm])
703130803SmarcelAC_CACHE_VAL(lt_cv_path_NM,
704130803Smarcel[if test -n "$NM"; then
705130803Smarcel  # Let the user override the test.
706130803Smarcel  lt_cv_path_NM="$NM"
707130803Smarcelelse
708130803Smarcel  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
709130803Smarcel  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
710130803Smarcel    test -z "$ac_dir" && ac_dir=.
711130803Smarcel    tmp_nm=$ac_dir/${ac_tool_prefix}nm
712130803Smarcel    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
713130803Smarcel      # Check to see if the nm accepts a BSD-compat flag.
714130803Smarcel      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
715130803Smarcel      #   nm: unknown option "B" ignored
716130803Smarcel      # Tru64's nm complains that /dev/null is an invalid object file
717130803Smarcel      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
718130803Smarcel	lt_cv_path_NM="$tmp_nm -B"
719130803Smarcel	break
720130803Smarcel      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
721130803Smarcel	lt_cv_path_NM="$tmp_nm -p"
722130803Smarcel	break
723130803Smarcel      else
724130803Smarcel	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
725130803Smarcel	continue # so that we can try to find one that supports BSD flags
726130803Smarcel      fi
727130803Smarcel    fi
728130803Smarcel  done
729130803Smarcel  IFS="$ac_save_ifs"
730130803Smarcel  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
731130803Smarcelfi])
732130803SmarcelNM="$lt_cv_path_NM"
733130803SmarcelAC_MSG_RESULT([$NM])
734130803Smarcel])
735130803Smarcel
736130803Smarcel# AC_CHECK_LIBM - check for math library
737130803SmarcelAC_DEFUN([AC_CHECK_LIBM],
738130803Smarcel[AC_REQUIRE([AC_CANONICAL_HOST])dnl
739130803SmarcelLIBM=
740130803Smarcelcase $host in
741130803Smarcel*-*-beos* | *-*-cygwin* | *-*-pw32*)
742130803Smarcel  # These system don't have libm
743130803Smarcel  ;;
744130803Smarcel*-ncr-sysv4.3*)
745130803Smarcel  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
746130803Smarcel  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
747130803Smarcel  ;;
748130803Smarcel*)
749130803Smarcel  AC_CHECK_LIB(m, main, LIBM="-lm")
750130803Smarcel  ;;
751130803Smarcelesac
752130803Smarcel])
753130803Smarcel
754130803Smarcel# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
755130803Smarcel# the libltdl convenience library and INCLTDL to the include flags for
756130803Smarcel# the libltdl header and adds --enable-ltdl-convenience to the
757130803Smarcel# configure arguments.  Note that LIBLTDL and INCLTDL are not
758130803Smarcel# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
759130803Smarcel# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
760130803Smarcel# with '${top_builddir}/' and INCLTDL will be prefixed with
761130803Smarcel# '${top_srcdir}/' (note the single quotes!).  If your package is not
762130803Smarcel# flat and you're not using automake, define top_builddir and
763130803Smarcel# top_srcdir appropriately in the Makefiles.
764130803SmarcelAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
765130803Smarcel[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
766130803Smarcel  case $enable_ltdl_convenience in
767130803Smarcel  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
768130803Smarcel  "") enable_ltdl_convenience=yes
769130803Smarcel      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
770130803Smarcel  esac
771130803Smarcel  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
772130803Smarcel  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
773130803Smarcel])
774130803Smarcel
775130803Smarcel# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
776130803Smarcel# the libltdl installable library and INCLTDL to the include flags for
777130803Smarcel# the libltdl header and adds --enable-ltdl-install to the configure
778130803Smarcel# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
779130803Smarcel# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
780130803Smarcel# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
781130803Smarcel# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
782130803Smarcel# with '${top_srcdir}/' (note the single quotes!).  If your package is
783130803Smarcel# not flat and you're not using automake, define top_builddir and
784130803Smarcel# top_srcdir appropriately in the Makefiles.
785130803Smarcel# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
786130803SmarcelAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
787130803Smarcel[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
788130803Smarcel  AC_CHECK_LIB(ltdl, main,
789130803Smarcel  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
790130803Smarcel  [if test x"$enable_ltdl_install" = xno; then
791130803Smarcel     AC_MSG_WARN([libltdl not installed, but installation disabled])
792130803Smarcel   else
793130803Smarcel     enable_ltdl_install=yes
794130803Smarcel   fi
795130803Smarcel  ])
796130803Smarcel  if test x"$enable_ltdl_install" = x"yes"; then
797130803Smarcel    ac_configure_args="$ac_configure_args --enable-ltdl-install"
798130803Smarcel    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
799130803Smarcel    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
800130803Smarcel  else
801130803Smarcel    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
802130803Smarcel    LIBLTDL="-lltdl"
803130803Smarcel    INCLTDL=
804130803Smarcel  fi
805130803Smarcel])
806130803Smarcel
807130803Smarcel# If this macro is not defined by Autoconf, define it here.
808130803Smarcelifdef([AC_PROVIDE_IFELSE],
809130803Smarcel      [],
810130803Smarcel      [define([AC_PROVIDE_IFELSE],
811130803Smarcel              [ifdef([AC_PROVIDE_$1],
812130803Smarcel                     [$2], [$3])])])
813130803Smarcel
814130803Smarcel# AC_LIBTOOL_CXX - enable support for C++ libraries
815130803SmarcelAC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
816130803Smarcel
817130803SmarcelAC_DEFUN([_AC_LIBTOOL_CXX],
818130803Smarcel[AC_REQUIRE([AC_PROG_CXX])
819130803SmarcelAC_REQUIRE([AC_PROG_CXXCPP])
820130803SmarcelLIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
821130803Smarcellt_save_CC="$CC"
822130803Smarcellt_save_CFLAGS="$CFLAGS"
823130803Smarceldnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
824130803Smarceldnl is set to the C++ compiler.
825130803SmarcelAR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
826130803SmarcelMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
827130803SmarcelLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
828130803SmarcelAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
829130803Smarcelobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
830130803Smarceldeplibs_check_method="$deplibs_check_method" \
831130803Smarcelfile_magic_cmd="$file_magic_cmd" \
832130803Smarcel${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
833130803Smarcel--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
834130803Smarcel|| AC_MSG_ERROR([libtool tag configuration failed])
835130803SmarcelCC="$lt_save_CC"
836130803SmarcelCFLAGS="$lt_save_CFLAGS"
837130803Smarcel
838130803Smarcel# Redirect the config.log output again, so that the ltconfig log is not
839130803Smarcel# clobbered by the next message.
840130803Smarcelexec 5>>./config.log
841130803Smarcel])
842130803Smarcel
843130803Smarcel# AC_LIBTOOL_GCJ - enable support for GCJ libraries
844130803SmarcelAC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
845130803Smarcel
846130803SmarcelAC_DEFUN([_AC_LIBTOOL_GCJ],
847130803Smarcel[AC_REQUIRE([AC_PROG_LIBTOOL])
848130803SmarcelAC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
849130803Smarcel  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
850130803Smarcel    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
851130803Smarcel      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
852130803Smarcel         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
853130803Smarcel           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
854130803SmarcelLIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
855130803Smarcellt_save_CC="$CC"
856130803Smarcellt_save_CFLAGS="$CFLAGS"
857130803Smarceldnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
858130803Smarceldnl is set to the C++ compiler.
859130803SmarcelAR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
860130803SmarcelMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
861130803SmarcelLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
862130803SmarcelAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
863130803Smarcelobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
864130803Smarceldeplibs_check_method="$deplibs_check_method" \
865130803Smarcelfile_magic_cmd="$file_magic_cmd" \
866130803Smarcel${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
867130803Smarcel--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
868130803Smarcel|| AC_MSG_ERROR([libtool tag configuration failed])
869130803SmarcelCC="$lt_save_CC"
870130803SmarcelCFLAGS="$lt_save_CFLAGS"
871130803Smarcel
872130803Smarcel# Redirect the config.log output again, so that the ltconfig log is not
873130803Smarcel# clobbered by the next message.
874130803Smarcelexec 5>>./config.log
875130803Smarcel])
876130803Smarcel
877130803Smarceldnl old names
878130803SmarcelAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
879130803SmarcelAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
880130803SmarcelAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
881130803SmarcelAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
882130803SmarcelAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
883130803SmarcelAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
884130803SmarcelAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
885130803Smarcel
886130803Smarceldnl This is just to silence aclocal about the macro not being used
887130803Smarcelifelse([AC_DISABLE_FAST_INSTALL])dnl
888130803Smarcel
889130803SmarcelAC_DEFUN([LT_AC_PROG_GCJ],
890130803Smarcel[AC_CHECK_TOOL(GCJ, gcj, no)
891130803Smarcel  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
892130803Smarcel  AC_SUBST(GCJFLAGS)
893130803Smarcel])
894