source: vendor/gcc/current/libjava/libltdl/aclocal.m4

Last change on this file was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 43.6 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13
14# serial 45 AC_PROG_LIBTOOL
15AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
16dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
17dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
18 AC_PROVIDE_IFELSE([AC_PROG_CXX],
19 [AC_LIBTOOL_CXX],
20 [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
21])])
22
23dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
24dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
25dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
26 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
27 [AC_LIBTOOL_GCJ],
28 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
29 [AC_LIBTOOL_GCJ],
30 [ifdef([AC_PROG_GCJ],
31 [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
32])])
33 ifdef([A][M_PROG_GCJ],
34 [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
35])])])])])
36
37AC_DEFUN(_AC_PROG_LIBTOOL,
38[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
39AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
40AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
41
42# Save cache, so that ltconfig can load it
43AC_CACHE_SAVE
44
45# Actually configure libtool. ac_aux_dir is where install-sh is found.
46AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
47MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
48LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
49AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
50objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
51deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
52${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
53$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
54|| AC_MSG_ERROR([libtool configure failed])
55
56# Reload cache, that may have been modified by ltconfig
57AC_CACHE_LOAD
58
59# This can be used to rebuild libtool when needed
60LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
61
62# Always use our own libtool.
63LIBTOOL='$(SHELL) $(top_builddir)/libtool'
64AC_SUBST(LIBTOOL)dnl
65
66# Redirect the config.log output again, so that the ltconfig log is not
67# clobbered by the next message.
68exec 5>>./config.log
69])
70
71AC_DEFUN(AC_LIBTOOL_SETUP,
72[AC_PREREQ(2.13)dnl
73AC_REQUIRE([AC_ENABLE_SHARED])dnl
74AC_REQUIRE([AC_ENABLE_STATIC])dnl
75AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
76AC_REQUIRE([AC_CANONICAL_HOST])dnl
77AC_REQUIRE([AC_CANONICAL_BUILD])dnl
78AC_REQUIRE([AC_PROG_CC])dnl
79AC_REQUIRE([AC_PROG_LD])dnl
80AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
81AC_REQUIRE([AC_PROG_NM])dnl
82AC_REQUIRE([AC_PROG_LN_S])dnl
83AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
84# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
85AC_REQUIRE([AC_OBJEXT])dnl
86AC_REQUIRE([AC_EXEEXT])dnl
87dnl
88
89# Only perform the check for file, if the check method requires it
90case "$deplibs_check_method" in
91file_magic*)
92 if test "$file_magic_cmd" = '${MAGIC}'; then
93 AC_PATH_MAGIC
94 fi
95 ;;
96esac
97
98AC_CHECK_TOOL(RANLIB, ranlib, :)
99AC_CHECK_TOOL(STRIP, strip, :)
100
101# Check for any special flags to pass to ltconfig.
102libtool_flags="--cache-file=$cache_file"
103test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
104test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
105test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
106test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
107test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
108ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
109[libtool_flags="$libtool_flags --enable-dlopen"])
110ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
111[libtool_flags="$libtool_flags --enable-win32-dll"])
112AC_ARG_ENABLE(libtool-lock,
113 [ --disable-libtool-lock avoid locking (might break parallel builds)])
114test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
115test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
116
117AC_ARG_WITH(pic,
118 [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
119 pic_mode="$withval", pic_mode=default)
120test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
121test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
122
123# Some flags need to be propagated to the compiler or linker for good
124# libtool support.
125case "$host" in
126*-*-irix6*)
127 # Find out which ABI we are using.
128 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
129 if AC_TRY_EVAL(ac_compile); then
130 case "`/usr/bin/file conftest.o`" in
131 *32-bit*)
132 LD="${LD-ld} -32"
133 ;;
134 *N32*)
135 LD="${LD-ld} -n32"
136 ;;
137 *64-bit*)
138 LD="${LD-ld} -64"
139 ;;
140 esac
141 fi
142 rm -rf conftest*
143 ;;
144
145*-*-sco3.2v5*)
146 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
147 SAVE_CFLAGS="$CFLAGS"
148 CFLAGS="$CFLAGS -belf"
149 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
150 [AC_LANG_SAVE
151 AC_LANG_C
152 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
153 AC_LANG_RESTORE])
154 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
155 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
156 CFLAGS="$SAVE_CFLAGS"
157 fi
158 ;;
159
160ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
161[*-*-cygwin* | *-*-mingw*)
162 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
163 AC_CHECK_TOOL(AS, as, false)
164 AC_CHECK_TOOL(OBJDUMP, objdump, false)
165
166 # recent cygwin and mingw systems supply a stub DllMain which the user
167 # can override, but on older systems we have to supply one
168 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
169 [AC_TRY_LINK([],
170 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
171 DllMain (0, 0, 0);],
172 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
173
174 case "$host/$CC" in
175 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
176 # old mingw systems require "-dll" to link a DLL, while more recent ones
177 # require "-mdll"
178 SAVE_CFLAGS="$CFLAGS"
179 CFLAGS="$CFLAGS -mdll"
180 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
181 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
182 CFLAGS="$SAVE_CFLAGS" ;;
183 *-*-cygwin*)
184 # cygwin systems need to pass --dll to the linker, and not link
185 # crt.o which will require a WinMain@16 definition.
186 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
187 esac
188 ;;
189 ])
190esac
191])
192
193# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
194AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
195
196# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
197AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
198
199# AC_ENABLE_SHARED - implement the --enable-shared flag
200# Usage: AC_ENABLE_SHARED[(DEFAULT)]
201# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
202# `yes'.
203AC_DEFUN(AC_ENABLE_SHARED, [dnl
204define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
205AC_ARG_ENABLE(shared,
206changequote(<<, >>)dnl
207<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
208changequote([, ])dnl
209[p=${PACKAGE-default}
210case "$enableval" in
211yes) enable_shared=yes ;;
212no) enable_shared=no ;;
213*)
214 enable_shared=no
215 # Look at the argument we got. We use all the common list separators.
216 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
217 for pkg in $enableval; do
218 if test "X$pkg" = "X$p"; then
219 enable_shared=yes
220 fi
221 done
222 IFS="$ac_save_ifs"
223 ;;
224esac],
225enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
226])
227
228# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
229AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
230AC_ENABLE_SHARED(no)])
231
232# AC_ENABLE_STATIC - implement the --enable-static flag
233# Usage: AC_ENABLE_STATIC[(DEFAULT)]
234# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
235# `yes'.
236AC_DEFUN(AC_ENABLE_STATIC, [dnl
237define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
238AC_ARG_ENABLE(static,
239changequote(<<, >>)dnl
240<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
241changequote([, ])dnl
242[p=${PACKAGE-default}
243case "$enableval" in
244yes) enable_static=yes ;;
245no) enable_static=no ;;
246*)
247 enable_static=no
248 # Look at the argument we got. We use all the common list separators.
249 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
250 for pkg in $enableval; do
251 if test "X$pkg" = "X$p"; then
252 enable_static=yes
253 fi
254 done
255 IFS="$ac_save_ifs"
256 ;;
257esac],
258enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
259])
260
261# AC_DISABLE_STATIC - set the default static flag to --disable-static
262AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
263AC_ENABLE_STATIC(no)])
264
265
266# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
267# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
268# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
269# `yes'.
270AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
271define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
272AC_ARG_ENABLE(fast-install,
273changequote(<<, >>)dnl
274<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
275changequote([, ])dnl
276[p=${PACKAGE-default}
277case "$enableval" in
278yes) enable_fast_install=yes ;;
279no) enable_fast_install=no ;;
280*)
281 enable_fast_install=no
282 # Look at the argument we got. We use all the common list separators.
283 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
284 for pkg in $enableval; do
285 if test "X$pkg" = "X$p"; then
286 enable_fast_install=yes
287 fi
288 done
289 IFS="$ac_save_ifs"
290 ;;
291esac],
292enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
293])
294
295# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
296AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
297AC_ENABLE_FAST_INSTALL(no)])
298
299# AC_LIBTOOL_PICMODE - implement the --with-pic flag
300# Usage: AC_LIBTOOL_PICMODE[(MODE)]
301# Where MODE is either `yes' or `no'. If omitted, it defaults to
302# `both'.
303AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
304pic_mode=ifelse($#,1,$1,default)])
305
306
307# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
308AC_DEFUN(AC_PATH_TOOL_PREFIX,
309[AC_MSG_CHECKING([for $1])
310AC_CACHE_VAL(lt_cv_path_MAGIC,
311[case "$MAGIC" in
312 /*)
313 lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
314 ;;
315 ?:/*)
316 ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
317 ;;
318 *)
319 ac_save_MAGIC="$MAGIC"
320 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
321dnl $ac_dummy forces splitting on constant user-supplied paths.
322dnl POSIX.2 word splitting is done only on the output of word expansions,
323dnl not every word. This closes a longstanding sh security hole.
324 ac_dummy="ifelse([$2], , $PATH, [$2])"
325 for ac_dir in $ac_dummy; do
326 test -z "$ac_dir" && ac_dir=.
327 if test -f $ac_dir/$1; then
328 lt_cv_path_MAGIC="$ac_dir/$1"
329 if test -n "$file_magic_test_file"; then
330 case "$deplibs_check_method" in
331 "file_magic "*)
332 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
333 MAGIC="$lt_cv_path_MAGIC"
334 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
335 egrep "$file_magic_regex" > /dev/null; then
336 :
337 else
338 cat <<EOF 1>&2
339
340*** Warning: the command libtool uses to detect shared libraries,
341*** $file_magic_cmd, produces output that libtool cannot recognize.
342*** The result is that libtool may fail to recognize shared libraries
343*** as such. This will affect the creation of libtool libraries that
344*** depend on shared libraries, but programs linked with such libtool
345*** libraries will work regardless of this problem. Nevertheless, you
346*** may want to report the problem to your system manager and/or to
347*** bug-libtool@gnu.org
348
349EOF
350 fi ;;
351 esac
352 fi
353 break
354 fi
355 done
356 IFS="$ac_save_ifs"
357 MAGIC="$ac_save_MAGIC"
358 ;;
359esac])
360MAGIC="$lt_cv_path_MAGIC"
361if test -n "$MAGIC"; then
362 AC_MSG_RESULT($MAGIC)
363else
364 AC_MSG_RESULT(no)
365fi
366])
367
368
369# AC_PATH_MAGIC - find a file program which can recognise a shared library
370AC_DEFUN(AC_PATH_MAGIC,
371[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
372AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
373if test -z "$lt_cv_path_MAGIC"; then
374 if test -n "$ac_tool_prefix"; then
375 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
376 else
377 MAGIC=:
378 fi
379fi
380])
381
382
383# AC_PROG_LD - find the path to the GNU or non-GNU linker
384AC_DEFUN(AC_PROG_LD,
385[AC_ARG_WITH(gnu-ld,
386[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
387test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
388AC_REQUIRE([AC_PROG_CC])dnl
389AC_REQUIRE([AC_CANONICAL_HOST])dnl
390AC_REQUIRE([AC_CANONICAL_BUILD])dnl
391ac_prog=ld
392if test "$ac_cv_prog_gcc" = yes; then
393 # Check if gcc -print-prog-name=ld gives a path.
394 AC_MSG_CHECKING([for ld used by GCC])
395 case $host in
396 *-*-mingw*)
397 # gcc leaves a trailing carriage return which upsets mingw
398 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
399 *)
400 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
401 esac
402 case "$ac_prog" in
403 # Accept absolute paths.
404changequote(,)dnl
405 [\\/]* | [A-Za-z]:[\\/]*)
406 re_direlt='/[^/][^/]*/\.\./'
407changequote([,])dnl
408 # Canonicalize the path of ld
409 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
410 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
411 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
412 done
413 test -z "$LD" && LD="$ac_prog"
414 ;;
415 "")
416 # If it fails, then pretend we aren't using GCC.
417 ac_prog=ld
418 ;;
419 *)
420 # If it is relative, then search for the first ld in PATH.
421 with_gnu_ld=unknown
422 ;;
423 esac
424elif test "$with_gnu_ld" = yes; then
425 AC_MSG_CHECKING([for GNU ld])
426else
427 AC_MSG_CHECKING([for non-GNU ld])
428fi
429AC_CACHE_VAL(ac_cv_path_LD,
430[if test -z "$LD"; then
431 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
432 for ac_dir in $PATH; do
433 test -z "$ac_dir" && ac_dir=.
434 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
435 ac_cv_path_LD="$ac_dir/$ac_prog"
436 # Check to see if the program is GNU ld. I'd rather use --version,
437 # but apparently some GNU ld's only accept -v.
438 # Break only if it was the GNU/non-GNU ld that we prefer.
439 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
440 test "$with_gnu_ld" != no && break
441 else
442 test "$with_gnu_ld" != yes && break
443 fi
444 fi
445 done
446 IFS="$ac_save_ifs"
447else
448 ac_cv_path_LD="$LD" # Let the user override the test with a path.
449fi])
450LD="$ac_cv_path_LD"
451if test -n "$LD"; then
452 AC_MSG_RESULT($LD)
453else
454 AC_MSG_RESULT(no)
455fi
456test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
457AC_PROG_LD_GNU
458])
459
460AC_DEFUN(AC_PROG_LD_GNU,
461[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
462[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
463if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
464 ac_cv_prog_gnu_ld=yes
465else
466 ac_cv_prog_gnu_ld=no
467fi])
468with_gnu_ld=$ac_cv_prog_gnu_ld
469])
470
471# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
472# -- PORTME Some linkers may need a different reload flag.
473AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
474[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
475[lt_cv_ld_reload_flag='-r'])
476reload_flag=$lt_cv_ld_reload_flag
477test -n "$reload_flag" && reload_flag=" $reload_flag"
478])
479
480# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
481# -- PORTME fill in with the dynamic library characteristics
482AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
483[AC_CACHE_CHECK([how to recognise dependant libraries],
484lt_cv_deplibs_check_method,
485[lt_cv_file_magic_cmd='${MAGIC}'
486lt_cv_file_magic_test_file=
487lt_cv_deplibs_check_method='unknown'
488# Need to set the preceding variable on all platforms that support
489# interlibrary dependencies.
490# 'none' -- dependencies not supported.
491# `unknown' -- same as none, but documents that we really don't know.
492# 'pass_all' -- all dependencies passed with no checks.
493# 'test_compile' -- check by making test program.
494# 'file_magic [regex]' -- check by looking for files in library path
495# which responds to the $file_magic_cmd with a given egrep regex.
496# If you have `file' or equivalent on your system and you're not sure
497# whether `pass_all' will *always* work, you probably want this one.
498
499case "$host_os" in
500aix4*)
501 lt_cv_deplibs_check_method=pass_all
502 ;;
503
504beos*)
505 lt_cv_deplibs_check_method=pass_all
506 ;;
507
508bsdi4*)
509 changequote(,)dnl
510 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
511 changequote([, ])dnl
512 lt_cv_file_magic_cmd='/usr/bin/file -L'
513 lt_cv_file_magic_test_file=/shlib/libc.so
514 ;;
515
516cygwin* | mingw*)
517 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
518 lt_cv_file_magic_cmd='${OBJDUMP} -f'
519 ;;
520
521freebsd* )
522 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
523 case "$host_cpu" in
524 i*86 )
525 # Not sure whether the presence of OpenBSD here was a mistake.
526 # Let's accept both of them until this is cleared up.
527 changequote(,)dnl
528 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
529 changequote([, ])dnl
530 lt_cv_file_magic_cmd=/usr/bin/file
531 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
532 ;;
533 esac
534 else
535 lt_cv_deplibs_check_method=pass_all
536 fi
537 ;;
538
539gnu*)
540 lt_cv_deplibs_check_method=pass_all
541 ;;
542
543hpux10.20*)
544 # TODO: Does this work for hpux-11 too?
545 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
546 lt_cv_file_magic_cmd=/usr/bin/file
547 lt_cv_file_magic_test_file=/usr/lib/libc.sl
548 ;;
549
550irix5* | irix6*)
551 case "$host_os" in
552 irix5*)
553 # this will be overridden with pass_all, but let us keep it just in case
554 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
555 ;;
556 *)
557 case "$LD" in
558 *-32|*"-32 ") libmagic=32-bit;;
559 *-n32|*"-n32 ") libmagic=N32;;
560 *-64|*"-64 ") libmagic=64-bit;;
561 *) libmagic=never-match;;
562 esac
563 # this will be overridden with pass_all, but let us keep it just in case
564 changequote(,)dnl
565 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
566 changequote([, ])dnl
567 ;;
568 esac
569 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
570 lt_cv_deplibs_check_method=pass_all
571 ;;
572
573# This must be Linux ELF.
574linux-gnu*)
575 case "$host_cpu" in
576 alpha* | i*86 | powerpc* | sparc* | ia64* )
577 lt_cv_deplibs_check_method=pass_all ;;
578 *)
579 # glibc up to 2.1.1 does not perform some relocations on ARM
580 changequote(,)dnl
581 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
582 changequote([, ])dnl
583 esac
584 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
585 ;;
586
587netbsd*)
588 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
589 else
590 changequote(,)dnl
591 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
592 changequote([, ])dnl
593 lt_cv_file_magic_cmd='/usr/bin/file -L'
594 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
595 fi
596 ;;
597
598osf3* | osf4* | osf5*)
599 # this will be overridden with pass_all, but let us keep it just in case
600 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
601 lt_cv_file_magic_test_file=/shlib/libc.so
602 lt_cv_deplibs_check_method=pass_all
603 ;;
604
605sco3.2v5*)
606 lt_cv_deplibs_check_method=pass_all
607 ;;
608
609solaris*)
610 lt_cv_deplibs_check_method=pass_all
611 lt_cv_file_magic_test_file=/lib/libc.so
612 ;;
613
614sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
615 case "$host_vendor" in
616 ncr)
617 lt_cv_deplibs_check_method=pass_all
618 ;;
619 motorola)
620 changequote(,)dnl
621 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]'
622 changequote([, ])dnl
623 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
624 ;;
625 esac
626 ;;
627esac
628])
629file_magic_cmd=$lt_cv_file_magic_cmd
630deplibs_check_method=$lt_cv_deplibs_check_method
631])
632
633
634# AC_PROG_NM - find the path to a BSD-compatible name lister
635AC_DEFUN(AC_PROG_NM,
636[AC_MSG_CHECKING([for BSD-compatible nm])
637AC_CACHE_VAL(ac_cv_path_NM,
638[if test -n "$NM"; then
639 # Let the user override the test.
640 ac_cv_path_NM="$NM"
641else
642 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
643 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
644 test -z "$ac_dir" && ac_dir=.
645 tmp_nm=$ac_dir/${ac_tool_prefix}nm
646 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
647 # Check to see if the nm accepts a BSD-compat flag.
648 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
649 # nm: unknown option "B" ignored
650 # Tru64's nm complains that /dev/null is an invalid object file
651 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
652 ac_cv_path_NM="$tmp_nm -B"
653 break
654 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
655 ac_cv_path_NM="$tmp_nm -p"
656 break
657 else
658 ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
659 continue # so that we can try to find one that supports BSD flags
660 fi
661 fi
662 done
663 IFS="$ac_save_ifs"
664 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
665fi])
666NM="$ac_cv_path_NM"
667AC_MSG_RESULT([$NM])
668])
669
670# AC_CHECK_LIBM - check for math library
671AC_DEFUN(AC_CHECK_LIBM,
672[AC_REQUIRE([AC_CANONICAL_HOST])dnl
673LIBM=
674case "$host" in
675*-*-beos* | *-*-cygwin*)
676 # These system don't have libm
677 ;;
678*-ncr-sysv4.3*)
679 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
680 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
681 ;;
682*)
683 AC_CHECK_LIB(m, main, LIBM="-lm")
684 ;;
685esac
686])
687
688# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
689# the libltdl convenience library and INCLTDL to the include flags for
690# the libltdl header and adds --enable-ltdl-convenience to the
691# configure arguments. Note that LIBLTDL and INCLTDL are not
692# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
693# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
694# with '${top_builddir}/' and INCLTDL will be prefixed with
695# '${top_srcdir}/' (note the single quotes!). If your package is not
696# flat and you're not using automake, define top_builddir and
697# top_srcdir appropriately in the Makefiles.
698AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
699 case "$enable_ltdl_convenience" in
700 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
701 "") enable_ltdl_convenience=yes
702 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
703 esac
704 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
705 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
706])
707
708# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
709# the libltdl installable library and INCLTDL to the include flags for
710# the libltdl header and adds --enable-ltdl-install to the configure
711# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
712# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
713# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
714# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
715# with '${top_srcdir}/' (note the single quotes!). If your package is
716# not flat and you're not using automake, define top_builddir and
717# top_srcdir appropriately in the Makefiles.
718# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
719AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
720 AC_CHECK_LIB(ltdl, main,
721 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
722 [if test x"$enable_ltdl_install" = xno; then
723 AC_MSG_WARN([libltdl not installed, but installation disabled])
724 else
725 enable_ltdl_install=yes
726 fi
727 ])
728 if test x"$enable_ltdl_install" = x"yes"; then
729 ac_configure_args="$ac_configure_args --enable-ltdl-install"
730 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
731 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
732 else
733 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
734 LIBLTDL="-lltdl"
735 INCLTDL=
736 fi
737])
738
739# If this macro is not defined by Autoconf, define it here.
740ifdef([AC_PROVIDE_IFELSE],
741 [],
742 [define([AC_PROVIDE_IFELSE],
743 [ifdef([AC_PROVIDE_$1],
744 [$2], [$3])])])
745
746# AC_LIBTOOL_CXX - enable support for C++ libraries
747AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])])
748AC_DEFUN(_AC_LIBTOOL_CXX,
749[AC_REQUIRE([AC_PROG_LIBTOOL])
750AC_REQUIRE([AC_PROG_CXX])
751AC_REQUIRE([AC_PROG_CXXCPP])
752LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
753lt_save_CC="$CC"
754lt_save_CFLAGS="$CFLAGS"
755dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
756dnl is set to the C++ compiler.
757AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
758MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
759LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
760AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
761objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
762deplibs_check_method="$deplibs_check_method" \
763file_magic_cmd="$file_magic_cmd" \
764${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
765--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
766|| AC_MSG_ERROR([libtool tag configuration failed])
767CC="$lt_save_CC"
768CFLAGS="$lt_save_CFLAGS"
769
770# Redirect the config.log output again, so that the ltconfig log is not
771# clobbered by the next message.
772exec 5>>./config.log
773])
774
775# AC_LIBTOOL_GCJ - enable support for GCJ libraries
776AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
777AC_DEFUN(_AC_LIBTOOL_GCJ,
778[AC_REQUIRE([AC_PROG_LIBTOOL])
779AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
780 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
781 [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
782 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
783 [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])
784LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
785lt_save_CC="$CC"
786lt_save_CFLAGS="$CFLAGS"
787dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
788dnl is set to the C++ compiler.
789AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="" \
790MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
791LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
792AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
793objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
794deplibs_check_method="$deplibs_check_method" \
795file_magic_cmd="$file_magic_cmd" \
796${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
797--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
798|| AC_MSG_ERROR([libtool tag configuration failed])
799CC="$lt_save_CC"
800CFLAGS="$lt_save_CFLAGS"
801
802# Redirect the config.log output again, so that the ltconfig log is not
803# clobbered by the next message.
804exec 5>>./config.log
805])
806
807dnl old names
808AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
809AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
810AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
811AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
812AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
813AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
814AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
815
816dnl This is just to silence aclocal about the macro not being used
817ifelse([AC_DISABLE_FAST_INSTALL])dnl
818
819AC_DEFUN([LT_AC_PROG_GCJ],[
820 AC_CHECK_TOOL(GCJ, gcj, no)
821 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
822 AC_SUBST(GCJFLAGS)
823])
824
825# serial 1 AC_LIB_LTDL
826
827AC_DEFUN(AC_LIB_LTDL,
828[AC_PREREQ(2.13)dnl
829AC_REQUIRE([AC_PROG_CC])dnl
830AC_REQUIRE([AC_C_CONST])dnl
831AC_REQUIRE([AC_C_INLINE])dnl
832
833dnl AC_LIB_LTDL must perform all the checks necessary for compilation
834dnl of the ltdl objects -- including compiler checks (above) and header
835dnl checks (below).
836AC_REQUIRE([AC_HEADER_STDC])dnl
837
838AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
839AC_CHECK_HEADERS(string.h strings.h, break)
840AC_CHECK_FUNCS(strchr index, break)
841AC_CHECK_FUNCS(strrchr rindex, break)
842AC_CHECK_FUNCS(strcmp)
843
844AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
845AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
846AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
847AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
848AC_REQUIRE([AC_LTDL_OBJDIR])dnl
849AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
850AC_REQUIRE([AC_LTDL_DLLIB])dnl
851AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
852])
853
854AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
855[AC_ARG_ENABLE(ltdl-install,
856[ --enable-ltdl-install install libltdl])
857
858AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
859AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
860])])
861
862
863AC_DEFUN(AC_LTDL_SNARF_CONFIG,
864[# Read the libtool configuration
865rm -f conftest
866./libtool --config > conftest
867. ./conftest
868rm -f conftest
869])
870
871AC_DEFUN(AC_LTDL_SHLIBEXT,
872[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
873AC_CACHE_CHECK([which extension is used for shared libraries],
874 libltdl_cv_shlibext, [dnl
875(
876 last=
877 for spec in $library_names_spec; do
878 last="$spec"
879 done
880changequote(, )
881 echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
882changequote([, ])
883)
884libltdl_cv_shlibext=`cat conftest`
885rm -f conftest
886])
887if test -n "$libltdl_cv_shlibext"; then
888 AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
889 [Define to the extension used for shared libraries, say, ".so". ])
890fi
891])
892
893AC_DEFUN(AC_LTDL_SHLIBPATH,
894[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
895AC_CACHE_CHECK([which variable specifies run-time library path],
896 libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
897if test -n "$libltdl_cv_shlibpath_var"; then
898 AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
899 [Define to the name of the environment variable that determines the dynamic library search path. ])
900fi
901])
902
903AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
904[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
905AC_CACHE_CHECK([for the default library search path],
906 libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
907if test -n "$libltdl_cv_sys_search_path"; then
908 case "$host" in
909 *-*-mingw*) pathsep=";" ;;
910 *) pathsep=":" ;;
911 esac
912 sys_search_path=
913 for dir in $libltdl_cv_sys_search_path; do
914 if test -z "$sys_search_path"; then
915 sys_search_path="$dir"
916 else
917 sys_search_path="$sys_search_path$pathsep$dir"
918 fi
919 done
920 AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
921 [Define to the system default library search path. ])
922fi
923])
924
925AC_DEFUN(AC_LTDL_OBJDIR,
926[AC_CACHE_CHECK([for objdir],
927 libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
928if test -n "$objdir"; then
929 :
930else
931 rm -f .libs 2>/dev/null
932 mkdir .libs 2>/dev/null
933 if test -d .libs; then
934 libltdl_cv_objdir=.libs
935 else
936 # MS-DOS does not allow filenames that begin with a dot.
937 libltdl_cv_objdir=_libs
938 fi
939rmdir .libs 2>/dev/null
940fi])
941AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
942 [Define to the sub-directory in which libtool stores uninstalled libraries. ])
943])
944
945AC_DEFUN(AC_LTDL_DLPREOPEN,
946[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
947AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
948 libltdl_cv_preloaded_symbols, [dnl
949 if test -n "$global_symbol_pipe"; then
950 libltdl_cv_preloaded_symbols=yes
951 else
952 libltdl_cv_preloaded_symbols=no
953 fi
954])
955if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
956 AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
957 [Define if libtool can extract symbol lists from object files. ])
958fi
959])
960
961AC_DEFUN(AC_LTDL_DLLIB,
962[LIBADD_DL=
963AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
964 [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
965[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
966 [Define if you have the libdl library or equivalent.])],
967[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
968 [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
969)])])
970AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
971 [Define if you have the shl_load function.])],
972[AC_CHECK_LIB(dld, shl_load,
973 [AC_DEFINE(HAVE_SHL_LOAD, 1,
974 [Define if you have the shl_load function.])
975 LIBADD_DL="$LIBADD_DL -ldld"])
976])
977AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
978 [Define if you have the GNU dld library.])dnl
979test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
980AC_SUBST(LIBADD_DL)
981
982if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
983 LIBS_SAVE="$LIBS"
984 LIBS="$LIBS $LIBADD_DL"
985 AC_CHECK_FUNCS(dlerror)
986 LIBS="$LIBS_SAVE"
987fi
988])
989
990AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
991[dnl Check for command to grab the raw symbol name followed
992dnl by C symbol name from nm.
993AC_REQUIRE([AC_CANONICAL_HOST])dnl
994AC_REQUIRE([AC_PROG_NM])dnl
995# Check for command to grab the raw symbol name followed by C symbol from nm.
996AC_MSG_CHECKING([command to parse $NM output])
997AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
998[# These are sane defaults that work on at least a few old systems.
999# {They come from Ultrix. What could be older than Ultrix?!! ;)}
1000
1001changequote(,)dnl
1002# Character class describing NM global symbol codes.
1003ac_symcode='[BCDEGRST]'
1004
1005# Regexp to match symbols that can be accessed directly from C.
1006ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1007
1008# Transform the above into a raw symbol and a C symbol.
1009ac_symxfrm='\1 \2\3 \3'
1010
1011# Transform an extracted symbol line into a proper C declaration
1012ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1013
1014# Define system-specific variables.
1015case "$host_os" in
1016aix*)
1017 ac_symcode='[BCDT]'
1018 ;;
1019cygwin* | mingw*)
1020 ac_symcode='[ABCDGISTW]'
1021 ;;
1022hpux*)
1023 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1024 ;;
1025irix*)
1026 ac_symcode='[BCDEGRST]'
1027 ;;
1028solaris*)
1029 ac_symcode='[BDT]'
1030 ;;
1031esac
1032
1033# If we're using GNU nm, then use its standard symbol codes.
1034if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1035 ac_symcode='[ABCDGISTW]'
1036fi
1037changequote([,])dnl
1038
1039# Try without a prefix undercore, then with it.
1040for ac_symprfx in "" "_"; do
1041
1042 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
1043
1044 # Check to see that the pipe works correctly.
1045 ac_pipe_works=no
1046 rm -f conftest.$ac_ext
1047 cat > conftest.$ac_ext <<EOF
1048#ifdef __cplusplus
1049extern "C" {
1050#endif
1051char nm_test_var;
1052void nm_test_func(){}
1053#ifdef __cplusplus
1054}
1055#endif
1056int main(){nm_test_var='a';nm_test_func;return 0;}
1057EOF
1058
1059 if AC_TRY_EVAL(ac_compile); then
1060 # Now try to grab the symbols.
1061 ac_nlist=conftest.nm
1062
1063 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
1064
1065 # Try sorting and uniquifying the output.
1066 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
1067 mv -f "$ac_nlist"T "$ac_nlist"
1068 else
1069 rm -f "$ac_nlist"T
1070 fi
1071
1072 # Make sure that we snagged all the symbols we need.
1073 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
1074 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
1075 cat <<EOF > conftest.c
1076#ifdef __cplusplus
1077extern "C" {
1078#endif
1079
1080EOF
1081 # Now generate the symbol file.
1082 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
1083
1084 cat <<EOF >> conftest.c
1085#if defined (__STDC__) && __STDC__
1086# define lt_ptr_t void *
1087#else
1088# define lt_ptr_t char *
1089# define const
1090#endif
1091
1092/* The mapping between symbol names and symbols. */
1093const struct {
1094 const char *name;
1095 lt_ptr_t address;
1096}
1097changequote(,)dnl
1098lt_preloaded_symbols[] =
1099changequote([,])dnl
1100{
1101EOF
1102 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
1103 cat <<\EOF >> conftest.c
1104 {0, (lt_ptr_t) 0}
1105};
1106
1107#ifdef __cplusplus
1108}
1109#endif
1110EOF
1111 # Now try linking the two files.
1112 mv conftest.$ac_objext conftstm.$ac_objext
1113 ac_save_LIBS="$LIBS"
1114 ac_save_CFLAGS="$CFLAGS"
1115 LIBS="conftstm.$ac_objext"
1116 CFLAGS="$CFLAGS$no_builtin_flag"
1117 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1118 ac_pipe_works=yes
1119 else
1120 echo "configure: failed program was:" >&AC_FD_CC
1121 cat conftest.c >&AC_FD_CC
1122 fi
1123 LIBS="$ac_save_LIBS"
1124 CFLAGS="$ac_save_CFLAGS"
1125 else
1126 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
1127 fi
1128 else
1129 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
1130 fi
1131 else
1132 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
1133 fi
1134 else
1135 echo "$progname: failed program was:" >&AC_FD_CC
1136 cat conftest.c >&AC_FD_CC
1137 fi
1138 rm -rf conftest* conftst*
1139
1140 # Do not use the global_symbol_pipe unless it works.
1141 if test "$ac_pipe_works" = yes; then
1142 if test x"$ac_symprfx" = x"_"; then
1143 ac_cv_sys_symbol_underscore=yes
1144 else
1145 ac_cv_sys_symbol_underscore=no
1146 fi
1147 break
1148 else
1149 ac_cv_sys_global_symbol_pipe=
1150 fi
1151done
1152])
1153
1154ac_result=yes
1155if test -z "$ac_cv_sys_global_symbol_pipe"; then
1156 ac_result=no
1157fi
1158AC_MSG_RESULT($ac_result)
1159])
1160
1161AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
1162[dnl does the compiler prefix global symbols with an underscore?
1163AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
1164AC_MSG_CHECKING([for _ prefix in compiled symbols])
1165AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
1166[ac_cv_sys_symbol_underscore=no
1167cat > conftest.$ac_ext <<EOF
1168void nm_test_func(){}
1169int main(){nm_test_func;return 0;}
1170EOF
1171if AC_TRY_EVAL(ac_compile); then
1172 # Now try to grab the symbols.
1173 ac_nlist=conftest.nm
1174 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
1175 # See whether the symbols have a leading underscore.
1176 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
1177 ac_cv_sys_symbol_underscore=yes
1178 else
1179 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
1180 :
1181 else
1182 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
1183 fi
1184 fi
1185 else
1186 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
1187 fi
1188else
1189 echo "configure: failed program was:" >&AC_FD_CC
1190 cat conftest.c >&AC_FD_CC
1191fi
1192rm -rf conftest*
1193])
1194AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
1195AC_LTDL_DLSYM_USCORE
1196])
1197
1198AC_DEFUN(AC_LTDL_DLSYM_USCORE,
1199[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
1200if test x"$ac_cv_sys_symbol_underscore" = xyes; then
1201 if test x"$ac_cv_func_dlopen" = xyes ||
1202 test x"$ac_cv_lib_dl_dlopen" = xyes ; then
1203 AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
1204 libltdl_cv_need_uscore, [dnl
1205 AC_TRY_RUN([
1206#if HAVE_DLFCN_H
1207#include <dlfcn.h>
1208#endif
1209
1210#include <stdio.h>
1211
1212#ifdef RTLD_GLOBAL
1213# define LTDL_GLOBAL RTLD_GLOBAL
1214#else
1215# ifdef DL_GLOBAL
1216# define LTDL_GLOBAL DL_GLOBAL
1217# else
1218# define LTDL_GLOBAL 0
1219# endif
1220#endif
1221
1222/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1223 find out it does not work in some platform. */
1224#ifndef LTDL_LAZY_OR_NOW
1225# ifdef RTLD_LAZY
1226# define LTDL_LAZY_OR_NOW RTLD_LAZY
1227# else
1228# ifdef DL_LAZY
1229# define LTDL_LAZY_OR_NOW DL_LAZY
1230# else
1231# ifdef RTLD_NOW
1232# define LTDL_LAZY_OR_NOW RTLD_NOW
1233# else
1234# ifdef DL_NOW
1235# define LTDL_LAZY_OR_NOW DL_NOW
1236# else
1237# define LTDL_LAZY_OR_NOW 0
1238# endif
1239# endif
1240# endif
1241# endif
1242#endif
1243
1244fnord() { int i=42;}
1245main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1246 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
1247 if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
1248], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
1249 libltdl_cv_need_uscore=cross
1250)])
1251 fi
1252fi
1253
1254if test x"$libltdl_cv_need_uscore" = xyes; then
1255 AC_DEFINE(NEED_USCORE, 1,
1256 [Define if dlsym() requires a leading underscode in symbol names. ])
1257fi
1258])
1259
1260# Define a conditional.
1261
1262AC_DEFUN(AM_CONDITIONAL,
1263[AC_SUBST($1_TRUE)
1264AC_SUBST($1_FALSE)
1265if $2; then
1266 $1_TRUE=
1267 $1_FALSE='#'
1268else
1269 $1_TRUE='#'
1270 $1_FALSE=
1271fi])
1272
1273# Do all the work for Automake. This macro actually does too much --
1274# some checks are only needed if your package does certain things.
1275# But this isn't really a big deal.
1276
1277# serial 1
1278
1279dnl Usage:
1280dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1281
1282AC_DEFUN(AM_INIT_AUTOMAKE,
1283[AC_REQUIRE([AC_PROG_INSTALL])
1284PACKAGE=[$1]
1285AC_SUBST(PACKAGE)
1286VERSION=[$2]
1287AC_SUBST(VERSION)
1288dnl test to see if srcdir already configured
1289if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1290 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1291fi
1292ifelse([$3],,
1293AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1294AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1295AC_REQUIRE([AM_SANITY_CHECK])
1296AC_REQUIRE([AC_ARG_PROGRAM])
1297dnl FIXME This is truly gross.
1298missing_dir=`cd $ac_aux_dir && pwd`
1299AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1300AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1301AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1302AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1303AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1304AC_REQUIRE([AC_PROG_MAKE_SET])])
1305
1306#
1307# Check to make sure that the build environment is sane.
1308#
1309
1310AC_DEFUN(AM_SANITY_CHECK,
1311[AC_MSG_CHECKING([whether build environment is sane])
1312# Just in case
1313sleep 1
1314echo timestamp > conftestfile
1315# Do `set' in a subshell so we don't clobber the current shell's
1316# arguments. Must try -L first in case configure is actually a
1317# symlink; some systems play weird games with the mod time of symlinks
1318# (eg FreeBSD returns the mod time of the symlink's containing
1319# directory).
1320if (
1321 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1322 if test "[$]*" = "X"; then
1323 # -L didn't work.
1324 set X `ls -t $srcdir/configure conftestfile`
1325 fi
1326 if test "[$]*" != "X $srcdir/configure conftestfile" \
1327 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1328
1329 # If neither matched, then we have a broken ls. This can happen
1330 # if, for instance, CONFIG_SHELL is bash and it inherits a
1331 # broken ls alias from the environment. This has actually
1332 # happened. Such a system could not be considered "sane".
1333 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1334alias in your environment])
1335 fi
1336
1337 test "[$]2" = conftestfile
1338 )
1339then
1340 # Ok.
1341 :
1342else
1343 AC_MSG_ERROR([newly created file is older than distributed files!
1344Check your system clock])
1345fi
1346rm -f conftest*
1347AC_MSG_RESULT(yes)])
1348
1349dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1350dnl The program must properly implement --version.
1351AC_DEFUN(AM_MISSING_PROG,
1352[AC_MSG_CHECKING(for working $2)
1353# Run test in a subshell; some versions of sh will print an error if
1354# an executable is not found, even if stderr is redirected.
1355# Redirect stdin to placate older versions of autoconf. Sigh.
1356if ($2 --version) < /dev/null > /dev/null 2>&1; then
1357 $1=$2
1358 AC_MSG_RESULT(found)
1359else
1360 $1="$3/missing $2"
1361 AC_MSG_RESULT(missing)
1362fi
1363AC_SUBST($1)])
1364
1365# Like AC_CONFIG_HEADER, but automatically create stamp file.
1366
1367AC_DEFUN(AM_CONFIG_HEADER,
1368[AC_PREREQ([2.12])
1369AC_CONFIG_HEADER([$1])
1370dnl When config.status generates a header, we must update the stamp-h file.
1371dnl This file resides in the same directory as the config header
1372dnl that is generated. We must strip everything past the first ":",
1373dnl and everything past the last "/".
1374AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1375ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1376<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1377<<am_indx=1
1378for am_file in <<$1>>; do
1379 case " <<$>>CONFIG_HEADERS " in
1380 *" <<$>>am_file "*<<)>>
1381 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1382 ;;
1383 esac
1384 am_indx=`expr "<<$>>am_indx" + 1`
1385done<<>>dnl>>)
1386changequote([,]))])
1387
1388# Add --enable-maintainer-mode option to configure.
1389# From Jim Meyering
1390
1391# serial 1
1392
1393AC_DEFUN(AM_MAINTAINER_MODE,
1394[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1395 dnl maintainer-mode is disabled by default
1396 AC_ARG_ENABLE(maintainer-mode,
1397[ --enable-maintainer-mode enable make rules and dependencies not useful
1398 (and sometimes confusing) to the casual installer],
1399 USE_MAINTAINER_MODE=$enableval,
1400 USE_MAINTAINER_MODE=no)
1401 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1402 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1403 MAINT=$MAINTAINER_MODE_TRUE
1404 AC_SUBST(MAINT)dnl
1405]
1406)
1407
Note: See TracBrowser for help on using the repository browser.