root/branches/3.00/src/aclocal.m4

Revision 644, 247.6 kB (checked in by fujii, 4 years ago)

Add new netinstall source.

Line 
1 # generated automatically by aclocal 1.9.2 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
15
16 # serial 47 AC_PROG_LIBTOOL
17
18
19 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
20 # -----------------------------------------------------------
21 # If this macro is not defined by Autoconf, define it here.
22 m4_ifdef([AC_PROVIDE_IFELSE],
23          [],
24          [m4_define([AC_PROVIDE_IFELSE],
25                  [m4_ifdef([AC_PROVIDE_$1],
26                            [$2], [$3])])])
27
28
29 # AC_PROG_LIBTOOL
30 # ---------------
31 AC_DEFUN([AC_PROG_LIBTOOL],
32 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
33 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
34 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
35   AC_PROVIDE_IFELSE([AC_PROG_CXX],
36     [AC_LIBTOOL_CXX],
37     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
38   ])])
39 dnl And a similar setup for Fortran 77 support
40   AC_PROVIDE_IFELSE([AC_PROG_F77],
41     [AC_LIBTOOL_F77],
42     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
43 ])])
44
45 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
46 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
47 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
48   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
49     [AC_LIBTOOL_GCJ],
50     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
51       [AC_LIBTOOL_GCJ],
52       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
53         [AC_LIBTOOL_GCJ],
54       [ifdef([AC_PROG_GCJ],
55              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
56        ifdef([A][M_PROG_GCJ],
57              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
58        ifdef([LT_AC_PROG_GCJ],
59              [define([LT_AC_PROG_GCJ],
60                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
61 ])])# AC_PROG_LIBTOOL
62
63
64 # _AC_PROG_LIBTOOL
65 # ----------------
66 AC_DEFUN([_AC_PROG_LIBTOOL],
67 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
68 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
69 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
70 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
71
72 # This can be used to rebuild libtool when needed
73 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
74
75 # Always use our own libtool.
76 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
77 AC_SUBST(LIBTOOL)dnl
78
79 # Prevent multiple expansion
80 define([AC_PROG_LIBTOOL], [])
81 ])# _AC_PROG_LIBTOOL
82
83
84 # AC_LIBTOOL_SETUP
85 # ----------------
86 AC_DEFUN([AC_LIBTOOL_SETUP],
87 [AC_PREREQ(2.50)dnl
88 AC_REQUIRE([AC_ENABLE_SHARED])dnl
89 AC_REQUIRE([AC_ENABLE_STATIC])dnl
90 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
91 AC_REQUIRE([AC_CANONICAL_HOST])dnl
92 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
93 AC_REQUIRE([AC_PROG_CC])dnl
94 AC_REQUIRE([AC_PROG_LD])dnl
95 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
96 AC_REQUIRE([AC_PROG_NM])dnl
97
98 AC_REQUIRE([AC_PROG_LN_S])dnl
99 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
100 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
101 AC_REQUIRE([AC_OBJEXT])dnl
102 AC_REQUIRE([AC_EXEEXT])dnl
103 dnl
104
105 AC_LIBTOOL_SYS_MAX_CMD_LEN
106 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
107 AC_LIBTOOL_OBJDIR
108
109 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
110 _LT_AC_PROG_ECHO_BACKSLASH
111
112 case $host_os in
113 aix3*)
114   # AIX sometimes has problems with the GCC collect2 program.  For some
115   # reason, if we set the COLLECT_NAMES environment variable, the problems
116   # vanish in a puff of smoke.
117   if test "X${COLLECT_NAMES+set}" != Xset; then
118     COLLECT_NAMES=
119     export COLLECT_NAMES
120   fi
121   ;;
122 esac
123
124 # Sed substitution that helps us do robust quoting.  It backslashifies
125 # metacharacters that are still active within double-quoted strings.
126 Xsed='sed -e s/^X//'
127 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
128
129 # Same as above, but do not quote variable references.
130 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
131
132 # Sed substitution to delay expansion of an escaped shell variable in a
133 # double_quote_subst'ed string.
134 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
135
136 # Sed substitution to avoid accidental globbing in evaled expressions
137 no_glob_subst='s/\*/\\\*/g'
138
139 # Constants:
140 rm="rm -f"
141
142 # Global variables:
143 default_ofile=libtool
144 can_build_shared=yes
145
146 # All known linkers require a `.a' archive for static linking (except M$VC,
147 # which needs '.lib').
148 libext=a
149 ltmain="$ac_aux_dir/ltmain.sh"
150 ofile="$default_ofile"
151 with_gnu_ld="$lt_cv_prog_gnu_ld"
152
153 AC_CHECK_TOOL(AR, ar, false)
154 AC_CHECK_TOOL(RANLIB, ranlib, :)
155 AC_CHECK_TOOL(STRIP, strip, :)
156
157 old_CC="$CC"
158 old_CFLAGS="$CFLAGS"
159
160 # Set sane defaults for various variables
161 test -z "$AR" && AR=ar
162 test -z "$AR_FLAGS" && AR_FLAGS=cru
163 test -z "$AS" && AS=as
164 test -z "$CC" && CC=cc
165 test -z "$LTCC" && LTCC=$CC
166 test -z "$DLLTOOL" && DLLTOOL=dlltool
167 test -z "$LD" && LD=ld
168 test -z "$LN_S" && LN_S="ln -s"
169 test -z "$MAGIC_CMD" && MAGIC_CMD=file
170 test -z "$NM" && NM=nm
171 test -z "$SED" && SED=sed
172 test -z "$OBJDUMP" && OBJDUMP=objdump
173 test -z "$RANLIB" && RANLIB=:
174 test -z "$STRIP" && STRIP=:
175 test -z "$ac_objext" && ac_objext=o
176
177 # Determine commands to create old-style static archives.
178 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
179 old_postinstall_cmds='chmod 644 $oldlib'
180 old_postuninstall_cmds=
181
182 if test -n "$RANLIB"; then
183   case $host_os in
184   openbsd*)
185     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
186     ;;
187   *)
188     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
189     ;;
190   esac
191   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
192 fi
193
194 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
195
196 # Only perform the check for file, if the check method requires it
197 case $deplibs_check_method in
198 file_magic*)
199   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
200     AC_PATH_MAGIC
201   fi
202   ;;
203 esac
204
205 AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
206 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
207 enable_win32_dll=yes, enable_win32_dll=no)
208
209 AC_ARG_ENABLE([libtool-lock],
210     [AC_HELP_STRING([--disable-libtool-lock],
211         [avoid locking (might break parallel builds)])])
212 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
213
214 AC_ARG_WITH([pic],
215     [AC_HELP_STRING([--with-pic],
216         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
217     [pic_mode="$withval"],
218     [pic_mode=default])
219 test -z "$pic_mode" && pic_mode=default
220
221 # Use C for the default configuration in the libtool script
222 tagname=
223 AC_LIBTOOL_LANG_C_CONFIG
224 _LT_AC_TAGCONFIG
225 ])# AC_LIBTOOL_SETUP
226
227
228 # _LT_AC_SYS_COMPILER
229 # -------------------
230 AC_DEFUN([_LT_AC_SYS_COMPILER],
231 [AC_REQUIRE([AC_PROG_CC])dnl
232
233 # If no C compiler was specified, use CC.
234 LTCC=${LTCC-"$CC"}
235
236 # Allow CC to be a program name with arguments.
237 compiler=$CC
238 ])# _LT_AC_SYS_COMPILER
239
240
241 # _LT_AC_SYS_LIBPATH_AIX
242 # ----------------------
243 # Links a minimal program and checks the executable
244 # for the system default hardcoded library path. In most cases,
245 # this is /usr/lib:/lib, but when the MPI compilers are used
246 # the location of the communication and MPI libs are included too.
247 # If we don't find anything, use the default library path according
248 # to the aix ld manual.
249 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
250 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
251 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
252 }'`
253 # Check for a 64-bit object if we didn't find anything.
254 if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
255 }'`; fi],[])
256 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
257 ])# _LT_AC_SYS_LIBPATH_AIX
258
259
260 # _LT_AC_SHELL_INIT(ARG)
261 # ----------------------
262 AC_DEFUN([_LT_AC_SHELL_INIT],
263 [ifdef([AC_DIVERSION_NOTICE],
264              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
265          [AC_DIVERT_PUSH(NOTICE)])
266 $1
267 AC_DIVERT_POP
268 ])# _LT_AC_SHELL_INIT
269
270
271 # _LT_AC_PROG_ECHO_BACKSLASH
272 # --------------------------
273 # Add some code to the start of the generated configure script which
274 # will find an echo command which doesn't interpret backslashes.
275 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
276 [_LT_AC_SHELL_INIT([
277 # Check that we are running under the correct shell.
278 SHELL=${CONFIG_SHELL-/bin/sh}
279
280 case X$ECHO in
281 X*--fallback-echo)
282   # Remove one level of quotation (which was required for Make).
283   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
284   ;;
285 esac
286
287 echo=${ECHO-echo}
288 if test "X[$]1" = X--no-reexec; then
289   # Discard the --no-reexec flag, and continue.
290   shift
291 elif test "X[$]1" = X--fallback-echo; then
292   # Avoid inline document here, it may be left over
293   :
294 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
295   # Yippee, $echo works!
296   :
297 else
298   # Restart under the correct shell.
299   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
300 fi
301
302 if test "X[$]1" = X--fallback-echo; then
303   # used as fallback echo
304   shift
305   cat <<EOF
306 [$]*
307 EOF
308   exit 0
309 fi
310
311 # The HP-UX ksh and POSIX shell print the target directory to stdout
312 # if CDPATH is set.
313 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
314
315 if test -z "$ECHO"; then
316 if test "X${echo_test_string+set}" != Xset; then
317 # find a string as large as possible, as long as the shell can cope with it
318   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
319     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
320     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
321        echo_test_string="`eval $cmd`" &&
322        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
323     then
324       break
325     fi
326   done
327 fi
328
329 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
330    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
331    test "X$echo_testing_string" = "X$echo_test_string"; then
332   :
333 else
334   # The Solaris, AIX, and Digital Unix default echo programs unquote
335   # backslashes.  This makes it impossible to quote backslashes using
336   #   echo "$something" | sed 's/\\/\\\\/g'
337   #
338   # So, first we look for a working echo in the user's PATH.
339
340   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
341   for dir in $PATH /usr/ucb; do
342     IFS="$lt_save_ifs"
343     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
344        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
345        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
346        test "X$echo_testing_string" = "X$echo_test_string"; then
347       echo="$dir/echo"
348       break
349     fi
350   done
351   IFS="$lt_save_ifs"
352
353   if test "X$echo" = Xecho; then
354     # We didn't find a better echo, so look for alternatives.
355     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
356        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
357        test "X$echo_testing_string" = "X$echo_test_string"; then
358       # This shell has a builtin print -r that does the trick.
359       echo='print -r'
360     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
361          test "X$CONFIG_SHELL" != X/bin/ksh; then
362       # If we have ksh, try running configure again with it.
363       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
364       export ORIGINAL_CONFIG_SHELL
365       CONFIG_SHELL=/bin/ksh
366       export CONFIG_SHELL
367       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
368     else
369       # Try using printf.
370       echo='printf %s\n'
371       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
372          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
373          test "X$echo_testing_string" = "X$echo_test_string"; then
374         # Cool, printf works
375         :
376       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
377            test "X$echo_testing_string" = 'X\t' &&
378            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
379            test "X$echo_testing_string" = "X$echo_test_string"; then
380         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
381         export CONFIG_SHELL
382         SHELL="$CONFIG_SHELL"
383         export SHELL
384         echo="$CONFIG_SHELL [$]0 --fallback-echo"
385       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
386            test "X$echo_testing_string" = 'X\t' &&
387            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
388            test "X$echo_testing_string" = "X$echo_test_string"; then
389         echo="$CONFIG_SHELL [$]0 --fallback-echo"
390       else
391         # maybe with a smaller string...
392         prev=:
393
394         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
395           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
396           then
397             break
398           fi
399           prev="$cmd"
400         done
401
402         if test "$prev" != 'sed 50q "[$]0"'; then
403           echo_test_string=`eval $prev`
404           export echo_test_string
405           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
406         else
407           # Oops.  We lost completely, so just stick with echo.
408           echo=echo
409         fi
410       fi
411     fi
412   fi
413 fi
414 fi
415
416 # Copy echo and quote the copy suitably for passing to libtool from
417 # the Makefile, instead of quoting the original, which is used later.
418 ECHO=$echo
419 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
420    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
421 fi
422
423 AC_SUBST(ECHO)
424 ])])# _LT_AC_PROG_ECHO_BACKSLASH
425
426
427 # _LT_AC_LOCK
428 # -----------
429 AC_DEFUN([_LT_AC_LOCK],
430 [AC_ARG_ENABLE([libtool-lock],
431     [AC_HELP_STRING([--disable-libtool-lock],
432         [avoid locking (might break parallel builds)])])
433 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
434
435 # Some flags need to be propagated to the compiler or linker for good
436 # libtool support.
437 case $host in
438 ia64-*-hpux*)
439   # Find out which ABI we are using.
440   echo 'int i;' > conftest.$ac_ext
441   if AC_TRY_EVAL(ac_compile); then
442     case `/usr/bin/file conftest.$ac_objext` in
443     *ELF-32*)
444       HPUX_IA64_MODE="32"
445       ;;
446     *ELF-64*)
447       HPUX_IA64_MODE="64"
448       ;;
449     esac
450   fi
451   rm -rf conftest*
452   ;;
453 *-*-irix6*)
454   # Find out which ABI we are using.
455   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
456   if AC_TRY_EVAL(ac_compile); then
457    if test "$lt_cv_prog_gnu_ld" = yes; then
458     case `/usr/bin/file conftest.$ac_objext` in
459     *32-bit*)
460       LD="${LD-ld} -melf32bsmip"
461       ;;
462     *N32*)
463       LD="${LD-ld} -melf32bmipn32"
464       ;;
465     *64-bit*)
466       LD="${LD-ld} -melf64bmip"
467       ;;
468     esac
469    else
470     case `/usr/bin/file conftest.$ac_objext` in
471     *32-bit*)
472       LD="${LD-ld} -32"
473       ;;
474     *N32*)
475       LD="${LD-ld} -n32"
476       ;;
477     *64-bit*)
478       LD="${LD-ld} -64"
479       ;;
480     esac
481    fi
482   fi
483   rm -rf conftest*
484   ;;
485
486 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
487   # Find out which ABI we are using.
488   echo 'int i;' > conftest.$ac_ext
489   if AC_TRY_EVAL(ac_compile); then
490     case "`/usr/bin/file conftest.o`" in
491     *32-bit*)
492       case $host in
493         x86_64-*linux*)
494           LD="${LD-ld} -m elf_i386"
495           ;;
496         ppc64-*linux*|powerpc64-*linux*)
497           LD="${LD-ld} -m elf32ppclinux"
498           ;;
499         s390x-*linux*)
500           LD="${LD-ld} -m elf_s390"
501           ;;
502         sparc64-*linux*)
503           LD="${LD-ld} -m elf32_sparc"
504           ;;
505       esac
506       ;;
507     *64-bit*)
508       case $host in
509         x86_64-*linux*)
510           LD="${LD-ld} -m elf_x86_64"
511           ;;
512         ppc*-*linux*|powerpc*-*linux*)
513           LD="${LD-ld} -m elf64ppc"
514           ;;
515         s390*-*linux*)
516           LD="${LD-ld} -m elf64_s390"
517           ;;
518         sparc*-*linux*)
519           LD="${LD-ld} -m elf64_sparc"
520           ;;
521       esac
522       ;;
523     esac
524   fi
525   rm -rf conftest*
526   ;;
527
528 *-*-sco3.2v5*)
529   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
530   SAVE_CFLAGS="$CFLAGS"
531   CFLAGS="$CFLAGS -belf"
532   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
533     [AC_LANG_PUSH(C)
534      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
535      AC_LANG_POP])
536   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
537     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
538     CFLAGS="$SAVE_CFLAGS"
539   fi
540   ;;
541 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
542 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
543   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
544   AC_CHECK_TOOL(AS, as, false)
545   AC_CHECK_TOOL(OBJDUMP, objdump, false)
546   ;;
547   ])
548 esac
549
550 need_locks="$enable_libtool_lock"
551
552 ])# _LT_AC_LOCK
553
554
555 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
556 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
557 # ----------------------------------------------------------------
558 # Check whether the given compiler option works
559 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
560 [AC_REQUIRE([LT_AC_PROG_SED])
561 AC_CACHE_CHECK([$1], [$2],
562   [$2=no
563   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
564    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
565    lt_compiler_flag="$3"
566    # Insert the option either (1) after the last *FLAGS variable, or
567    # (2) before a word containing "conftest.", or (3) at the end.
568    # Note that $ac_compile itself does not contain backslashes and begins
569    # with a dollar sign (not a hyphen), so the echo should work correctly.
570    # The option is referenced via a variable to avoid confusing sed.
571    lt_compile=`echo "$ac_compile" | $SED \
572    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
573    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
574    -e 's:$: $lt_compiler_flag:'`
575    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
576    (eval "$lt_compile" 2>conftest.err)
577    ac_status=$?
578    cat conftest.err >&AS_MESSAGE_LOG_FD
579    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
580    if (exit $ac_status) && test -s "$ac_outfile"; then
581      # The compiler can only warn and ignore the option if not recognized
582      # So say no if there are warnings
583      if test ! -s conftest.err; then
584        $2=yes
585      fi
586    fi
587    $rm conftest*
588 ])
589
590 if test x"[$]$2" = xyes; then
591     ifelse([$5], , :, [$5])
592 else
593     ifelse([$6], , :, [$6])
594 fi
595 ])# AC_LIBTOOL_COMPILER_OPTION
596
597
598 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
599 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
600 # ------------------------------------------------------------
601 # Check whether the given compiler option works
602 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
603 [AC_CACHE_CHECK([$1], [$2],
604   [$2=no
605    save_LDFLAGS="$LDFLAGS"
606    LDFLAGS="$LDFLAGS $3"
607    printf "$lt_simple_link_test_code" > conftest.$ac_ext
608    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
609      # The compiler can only warn and ignore the option if not recognized
610      # So say no if there are warnings
611      if test -s conftest.err; then
612        # Append any errors to the config.log.
613        cat conftest.err 1>&AS_MESSAGE_LOG_FD
614      else
615        $2=yes
616      fi
617    fi
618    $rm conftest*
619    LDFLAGS="$save_LDFLAGS"
620 ])
621
622 if test x"[$]$2" = xyes; then
623     ifelse([$4], , :, [$4])
624 else
625     ifelse([$5], , :, [$5])
626 fi
627 ])# AC_LIBTOOL_LINKER_OPTION
628
629
630 # AC_LIBTOOL_SYS_MAX_CMD_LEN
631 # --------------------------
632 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
633 [# find the maximum length of command line arguments
634 AC_MSG_CHECKING([the maximum length of command line arguments])
635 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
636   i=0
637   teststring="ABCD"
638
639   case $build_os in
640   msdosdjgpp*)
641     # On DJGPP, this test can blow up pretty badly due to problems in libc
642     # (any single argument exceeding 2000 bytes causes a buffer overrun
643     # during glob expansion).  Even if it were fixed, the result of this
644     # check would be larger than it should be.
645     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
646     ;;
647
648   gnu*)
649     # Under GNU Hurd, this test is not required because there is
650     # no limit to the length of command line arguments.
651     # Libtool will interpret -1 as no limit whatsoever
652     lt_cv_sys_max_cmd_len=-1;
653     ;;
654
655   cygwin* | mingw*)
656     # On Win9x/ME, this test blows up -- it succeeds, but takes
657     # about 5 minutes as the teststring grows exponentially.
658     # Worse, since 9x/ME are not pre-emptively multitasking,
659     # you end up with a "frozen" computer, even though with patience
660     # the test eventually succeeds (with a max line length of 256k).
661     # Instead, let's just punt: use the minimum linelength reported by
662     # all of the supported platforms: 8192 (on NT/2K/XP).
663     lt_cv_sys_max_cmd_len=8192;
664     ;;
665
666   amigaos*)
667     # On AmigaOS with pdksh, this test takes hours, literally.
668     # So we just punt and use a minimum line length of 8192.
669     lt_cv_sys_max_cmd_len=8192;
670     ;;
671
672   netbsd* | freebsd* | openbsd* | darwin* )
673     # This has been around since 386BSD, at least.  Likely further.
674     if test -x /sbin/sysctl; then
675       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
676     elif test -x /usr/sbin/sysctl; then
677       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
678     else
679       lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
680     fi
681     # And add a safety zone
682     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
683     ;;
684
685  *)
686     # If test is not a shell built-in, we'll probably end up computing a
687     # maximum length that is only half of the actual maximum length, but
688     # we can't tell.
689     SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
690     while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
691                = "XX$teststring") >/dev/null 2>&1 &&
692             new_result=`expr "X$teststring" : ".*" 2>&1` &&
693             lt_cv_sys_max_cmd_len=$new_result &&
694             test $i != 17 # 1/2 MB should be enough
695     do
696       i=`expr $i + 1`
697       teststring=$teststring$teststring
698     done
699     teststring=
700     # Add a significant safety factor because C++ compilers can tack on massive
701     # amounts of additional arguments before passing them to the linker.
702     # It appears as though 1/2 is a usable value.
703     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
704     ;;
705   esac
706 ])
707 if test -n $lt_cv_sys_max_cmd_len ; then
708   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
709 else
710   AC_MSG_RESULT(none)
711 fi
712 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
713
714
715 # _LT_AC_CHECK_DLFCN
716 # --------------------
717 AC_DEFUN([_LT_AC_CHECK_DLFCN],
718 [AC_CHECK_HEADERS(dlfcn.h)dnl
719 ])# _LT_AC_CHECK_DLFCN
720
721
722 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
723 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
724 # ------------------------------------------------------------------
725 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
726 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
727 if test "$cross_compiling" = yes; then :
728   [$4]
729 else
730   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
731   lt_status=$lt_dlunknown
732   cat > conftest.$ac_ext <<EOF
733 [#line __oline__ "configure"
734 #include "confdefs.h"
735
736 #if HAVE_DLFCN_H
737 #include <dlfcn.h>
738 #endif
739
740 #include <stdio.h>
741
742 #ifdef RTLD_GLOBAL
743 #  define LT_DLGLOBAL           RTLD_GLOBAL
744 #else
745 #  ifdef DL_GLOBAL
746 #    define LT_DLGLOBAL         DL_GLOBAL
747 #  else
748 #    define LT_DLGLOBAL         0
749 #  endif
750 #endif
751
752 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
753    find out it does not work in some platform. */
754 #ifndef LT_DLLAZY_OR_NOW
755 #  ifdef RTLD_LAZY
756 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
757 #  else
758 #    ifdef DL_LAZY
759 #      define LT_DLLAZY_OR_NOW          DL_LAZY
760 #    else
761 #      ifdef RTLD_NOW
762 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
763 #      else
764 #        ifdef DL_NOW
765 #          define LT_DLLAZY_OR_NOW      DL_NOW
766 #        else
767 #          define LT_DLLAZY_OR_NOW      0
768 #        endif
769 #      endif
770 #    endif
771 #  endif
772 #endif
773
774 #ifdef __cplusplus
775 extern "C" void exit (int);
776 #endif
777
778 void fnord() { int i=42;}
779 int main ()
780 {
781   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
782   int status = $lt_dlunknown;
783
784   if (self)
785     {
786       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
787       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
788       /* dlclose (self); */
789     }
790
791     exit (status);
792 }]
793 EOF
794   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
795     (./conftest; exit; ) 2>/dev/null
796     lt_status=$?
797     case x$lt_status in
798       x$lt_dlno_uscore) $1 ;;
799       x$lt_dlneed_uscore) $2 ;;
800       x$lt_unknown|x*) $3 ;;
801     esac
802   else :
803     # compilation failed
804     $3
805   fi
806 fi
807 rm -fr conftest*
808 ])# _LT_AC_TRY_DLOPEN_SELF
809
810
811 # AC_LIBTOOL_DLOPEN_SELF
812 # -------------------
813 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
814 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
815 if test "x$enable_dlopen" != xyes; then
816   enable_dlopen=unknown
817   enable_dlopen_self=unknown
818   enable_dlopen_self_static=unknown
819 else
820   lt_cv_dlopen=no
821   lt_cv_dlopen_libs=
822
823   case $host_os in
824   beos*)
825     lt_cv_dlopen="load_add_on"
826     lt_cv_dlopen_libs=
827     lt_cv_dlopen_self=yes
828     ;;
829
830   mingw* | pw32*)
831     lt_cv_dlopen="LoadLibrary"
832     lt_cv_dlopen_libs=
833    ;;
834
835   cygwin*)
836     lt_cv_dlopen="dlopen"
837     lt_cv_dlopen_libs=
838    ;;
839
840   darwin*)
841   # if libdl is installed we need to link against it
842     AC_CHECK_LIB([dl], [dlopen],
843                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
844     lt_cv_dlopen="dyld"
845     lt_cv_dlopen_libs=
846     lt_cv_dlopen_self=yes
847     ])
848    ;;
849
850   *)
851     AC_CHECK_FUNC([shl_load],
852           [lt_cv_dlopen="shl_load"],
853       [AC_CHECK_LIB([dld], [shl_load],
854             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
855         [AC_CHECK_FUNC([dlopen],
856               [lt_cv_dlopen="dlopen"],
857           [AC_CHECK_LIB([dl], [dlopen],
858                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
859             [AC_CHECK_LIB([svld], [dlopen],
860                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
861               [AC_CHECK_LIB([dld], [dld_link],
862                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
863               ])
864             ])
865           ])
866         ])
867       ])
868     ;;
869   esac
870
871   if test "x$lt_cv_dlopen" != xno; then
872     enable_dlopen=yes
873   else
874     enable_dlopen=no
875   fi
876
877   case $lt_cv_dlopen in
878   dlopen)
879     save_CPPFLAGS="$CPPFLAGS"
880     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
881
882     save_LDFLAGS="$LDFLAGS"
883     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
884
885     save_LIBS="$LIBS"
886     LIBS="$lt_cv_dlopen_libs $LIBS"
887
888     AC_CACHE_CHECK([whether a program can dlopen itself],
889           lt_cv_dlopen_self, [dnl
890           _LT_AC_TRY_DLOPEN_SELF(
891             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
892             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
893     ])
894
895     if test "x$lt_cv_dlopen_self" = xyes; then
896       LDFLAGS="$LDFLAGS $link_static_flag"
897       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
898           lt_cv_dlopen_self_static, [dnl
899           _LT_AC_TRY_DLOPEN_SELF(
900             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
901             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
902       ])
903     fi
904
905     CPPFLAGS="$save_CPPFLAGS"
906     LDFLAGS="$save_LDFLAGS"
907     LIBS="$save_LIBS"
908     ;;
909   esac
910
911   case $lt_cv_dlopen_self in
912   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
913   *) enable_dlopen_self=unknown ;;
914   esac
915
916   case $lt_cv_dlopen_self_static in
917   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
918   *) enable_dlopen_self_static=unknown ;;
919   esac
920 fi
921 ])# AC_LIBTOOL_DLOPEN_SELF
922
923
924 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
925 # ---------------------------------
926 # Check to see if options -c and -o are simultaneously supported by compiler
927 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
928 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
929 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
930   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
931   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
932    $rm -r conftest 2>/dev/null
933    mkdir conftest
934    cd conftest
935    mkdir out
936    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
937
938    lt_compiler_flag="-o out/conftest2.$ac_objext"
939    # Insert the option either (1) after the last *FLAGS variable, or
940    # (2) before a word containing "conftest.", or (3) at the end.
941    # Note that $ac_compile itself does not contain backslashes and begins
942    # with a dollar sign (not a hyphen), so the echo should work correctly.
943    lt_compile=`echo "$ac_compile" | $SED \
944    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
945    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
946    -e 's:$: $lt_compiler_flag:'`
947    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
948    (eval "$lt_compile" 2>out/conftest.err)
949    ac_status=$?
950    cat out/conftest.err >&AS_MESSAGE_LOG_FD
951    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
952    if (exit $ac_status) && test -s out/conftest2.$ac_objext
953    then
954      # The compiler can only warn and ignore the option if not recognized
955      # So say no if there are warnings
956      if test ! -s out/conftest.err; then
957        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
958      fi
959    fi
960    chmod u+w .
961    $rm conftest*
962    # SGI C++ compiler will create directory out/ii_files/ for
963    # template instantiation
964    test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
965    $rm out/* && rmdir out
966    cd ..
967    rmdir conftest
968    $rm conftest*
969 ])
970 ])# AC_LIBTOOL_PROG_CC_C_O
971
972
973 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
974 # -----------------------------------------
975 # Check to see if we can do hard links to lock some files if needed
976 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
977 [AC_REQUIRE([_LT_AC_LOCK])dnl
978
979 hard_links="nottested"
980 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
981   # do not overwrite the value of need_locks provided by the user
982   AC_MSG_CHECKING([if we can lock with hard links])
983   hard_links=yes
984   $rm conftest*
985   ln conftest.a conftest.b 2>/dev/null && hard_links=no
986   touch conftest.a
987   ln conftest.a conftest.b 2>&5 || hard_links=no
988   ln conftest.a conftest.b 2>/dev/null && hard_links=no
989   AC_MSG_RESULT([$hard_links])
990   if test "$hard_links" = no; then
991     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
992     need_locks=warn
993   fi
994 else
995   need_locks=no
996 fi
997 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
998
999
1000 # AC_LIBTOOL_OBJDIR
1001 # -----------------
1002 AC_DEFUN([AC_LIBTOOL_OBJDIR],
1003 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1004 [rm -f .libs 2>/dev/null
1005 mkdir .libs 2>/dev/null
1006 if test -d .libs; then
1007   lt_cv_objdir=.libs
1008 else
1009   # MS-DOS does not allow filenames that begin with a dot.
1010   lt_cv_objdir=_libs
1011 fi
1012 rmdir .libs 2>/dev/null])
1013 objdir=$lt_cv_objdir
1014 ])# AC_LIBTOOL_OBJDIR
1015
1016
1017 # AC_LIBTOOL_PROG