rename check_status to wait_for_process, and export it; function
[heimdal.git] / ltconfig
blob335271c153d7a53d5bf0c23e9b57b30b7a5a1b78
1 #! /bin/sh
3 # ltconfig - Create a system-specific libtool.
4 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # A lot of this script is taken from autoconf-2.10.
28 # Check that we are running under the correct shell.
29 SHELL=${CONFIG_SHELL-/bin/sh}
30 echo=echo
31 if test "X$1" = X--no-reexec; then
32 # Discard the --no-reexec flag, and continue.
33 shift
34 elif test "X$1" = X--fallback-echo; then
35 # Avoid inline document here, it may be left over
37 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
38 # Yippee, $echo works!
40 else
41 # Restart under the correct shell.
42 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
45 if test "X$1" = X--fallback-echo; then
46 # used as fallback echo
47 shift
48 cat <<EOF
50 EOF
51 exit 0
54 # Find the correct PATH separator. Usually this is `:', but
55 # DJGPP uses `;' like DOS.
56 if test "X${PATH_SEPARATOR+set}" != Xset; then
57 UNAME=${UNAME-`uname 2>/dev/null`}
58 case X$UNAME in
59 *-DOS) PATH_SEPARATOR=';' ;;
60 *) PATH_SEPARATOR=':' ;;
61 esac
64 # The HP-UX ksh and POSIX shell print the target directory to stdout
65 # if CDPATH is set.
66 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
68 if test "X${echo_test_string+set}" != Xset; then
69 # find a string as large as possible, as long as the shell can cope with it
70 for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
71 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
72 if (echo_test_string="`eval $cmd`") 2>/dev/null &&
73 echo_test_string="`eval $cmd`" &&
74 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
75 break
77 done
80 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
81 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
82 test "X$echo_testing_string" = "X$echo_test_string"; then
84 else
85 # The Solaris, AIX, and Digital Unix default echo programs unquote
86 # backslashes. This makes it impossible to quote backslashes using
87 # echo "$something" | sed 's/\\/\\\\/g'
89 # So, first we look for a working echo in the user's PATH.
91 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
92 for dir in $PATH /usr/ucb; do
93 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
94 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
95 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
96 test "X$echo_testing_string" = "X$echo_test_string"; then
97 echo="$dir/echo"
98 break
100 done
101 IFS="$save_ifs"
103 if test "X$echo" = Xecho; then
104 # We didn't find a better echo, so look for alternatives.
105 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
106 echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
107 test "X$echo_testing_string" = "X$echo_test_string"; then
108 # This shell has a builtin print -r that does the trick.
109 echo='print -r'
110 elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
111 test "X$CONFIG_SHELL" != X/bin/ksh; then
112 # If we have ksh, try running ltconfig again with it.
113 ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
114 export ORIGINAL_CONFIG_SHELL
115 CONFIG_SHELL=/bin/ksh
116 export CONFIG_SHELL
117 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
118 else
119 # Try using printf.
120 echo='printf %s\n'
121 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
122 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
123 test "X$echo_testing_string" = "X$echo_test_string"; then
124 # Cool, printf works
126 elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
127 test "X$echo_testing_string" = 'X\t' &&
128 echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
129 test "X$echo_testing_string" = "X$echo_test_string"; then
130 CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
131 export CONFIG_SHELL
132 SHELL="$CONFIG_SHELL"
133 export SHELL
134 echo="$CONFIG_SHELL $0 --fallback-echo"
135 elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
136 test "X$echo_testing_string" = 'X\t' &&
137 echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
138 test "X$echo_testing_string" = "X$echo_test_string"; then
139 echo="$CONFIG_SHELL $0 --fallback-echo"
140 else
141 # maybe with a smaller string...
142 prev=:
144 for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
145 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
146 break
148 prev="$cmd"
149 done
151 if test "$prev" != 'sed 50q "$0"'; then
152 echo_test_string=`eval $prev`
153 export echo_test_string
154 exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"}
155 else
156 # Oops. We lost completely, so just stick with echo.
157 echo=echo
164 # Sed substitution that helps us do robust quoting. It backslashifies
165 # metacharacters that are still active within double-quoted strings.
166 Xsed='sed -e s/^X//'
167 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
169 # Same as above, but do not quote variable references.
170 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
172 # Sed substitution to delay expansion of an escaped shell variable in a
173 # double_quote_subst'ed string.
174 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
176 # The name of this program.
177 progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
179 # Constants:
180 PROGRAM=ltconfig
181 PACKAGE=libtool
182 VERSION=1.3c
183 TIMESTAMP=" (1.731 2000/07/10 09:42:21)"
184 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
185 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
186 rm="rm -f"
188 help="Try \`$progname --help' for more information."
190 # Global variables:
191 default_ofile=libtool
192 can_build_shared=yes
193 enable_shared=yes
194 # All known linkers require a `.a' archive for static linking (except M$VC,
195 # which needs '.lib').
196 enable_static=yes
197 enable_fast_install=yes
198 enable_dlopen=unknown
199 enable_win32_dll=no
200 pic_mode=default
201 ltmain=
202 silent=
203 srcdir=
204 ac_config_guess=
205 ac_config_sub=
206 host=
207 build=NONE
208 nonopt=NONE
209 ofile="$default_ofile"
210 verify_host=yes
211 with_gcc=no
212 with_gnu_ld=no
213 need_locks=yes
214 ac_ext=c
215 libext=a
216 cache_file=
218 old_AR="$AR"
219 old_AR_FLAGS="$AR_FLAGS"
220 old_CC="$CC"
221 old_CFLAGS="$CFLAGS"
222 old_CPPFLAGS="$CPPFLAGS"
223 old_LDFLAGS="$LDFLAGS"
224 old_LIBS="$LIBS"
225 old_MAGIC="$MAGIC"
226 old_LD="$LD"
227 old_LN_S="$LN_S"
228 old_NM="$NM"
229 old_RANLIB="$RANLIB"
230 old_STRIP="$STRIP"
231 old_AS="$AS"
232 old_DLLTOOL="$DLLTOOL"
233 old_OBJDUMP="$OBJDUMP"
234 old_OBJEXT="$OBJEXT"
235 old_EXEEXT="$EXEEXT"
236 old_reload_Flag="$reload_flag"
237 old_deplibs_check_method="$deplibs_check_method"
238 old_file_magic_cmd="$file_magic_cmd"
240 # Parse the command line options.
241 args=
242 prev=
243 for option
245 case "$option" in
246 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
247 *) optarg= ;;
248 esac
250 # If the previous option needs an argument, assign it.
251 if test -n "$prev"; then
252 eval "$prev=\$option"
253 prev=
254 continue
257 case "$option" in
258 --help) cat <<EOM
259 Usage: $progname [OPTION]... LTMAIN [HOST]
261 Generate a system-specific libtool script.
263 --build configure for building on BUILD [BUILD=HOST]
264 --debug enable verbose shell tracing
265 --disable-shared do not build shared libraries
266 --disable-static do not build static libraries
267 --disable-fast-install do not optimize for fast installation
268 --enable-dlopen enable dlopen support
269 --enable-win32-dll enable building dlls on win32 hosts
270 --help display this help and exit
271 --no-verify do not verify that HOST is a valid host type
272 -o, --output=FILE specify the output file [default=$default_ofile]
273 --quiet same as \`--silent'
274 --silent do not print informational messages
275 --srcdir=DIR find \`config.guess' in DIR
276 --version output version information and exit
277 --with-gcc assume that the GNU C compiler will be used
278 --with-gnu-ld assume that the C compiler uses the GNU linker
279 --prefer-pic try to use only PIC objects
280 --prefer-non-pic try to use only non-PIC objects
281 --disable-lock disable file locking
282 --cache-file=FILE configure cache file
284 LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
285 that provides basic libtool functionality.
287 HOST is the canonical host system name [default=guessed].
289 exit 0
292 --build) prev=build ;;
293 --build=*) build="$optarg" ;;
295 --debug)
296 echo "$progname: enabling shell trace mode"
297 set -x
300 --disable-shared) enable_shared=no ;;
302 --disable-static) enable_static=no ;;
304 --disable-fast-install) enable_fast_install=no ;;
306 --enable-dlopen) enable_dlopen=yes ;;
308 --enable-win32-dll) enable_win32_dll=yes ;;
310 --quiet | --silent) silent=yes ;;
312 --srcdir) prev=srcdir ;;
313 --srcdir=*) srcdir="$optarg" ;;
315 --no-verify) verify_host=no ;;
317 --output | -o) prev=ofile ;;
318 --output=*) ofile="$optarg" ;;
320 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
322 --with-gcc) with_gcc=yes ;;
323 --with-gnu-ld) with_gnu_ld=yes ;;
325 --prefer-pic) pic_mode=yes ;;
326 --prefer-non-pic) pic_mode=no ;;
328 --disable-lock) need_locks=no ;;
330 --cache-file=*) cache_file="$optarg" ;;
333 echo "$progname: unrecognized option \`$option'" 1>&2
334 echo "$help" 1>&2
335 exit 1
339 if test -z "$ltmain"; then
340 ltmain="$option"
341 elif test -z "$host"; then
342 # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
343 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
344 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
345 # fi
346 host="$option"
347 else
348 echo "$progname: too many arguments" 1>&2
349 echo "$help" 1>&2
350 exit 1
351 fi ;;
352 esac
353 done
355 if test -z "$ltmain"; then
356 echo "$progname: you must specify a LTMAIN file" 1>&2
357 echo "$help" 1>&2
358 exit 1
361 if test ! -f "$ltmain"; then
362 echo "$progname: \`$ltmain' does not exist" 1>&2
363 echo "$help" 1>&2
364 exit 1
367 # Quote any args containing shell metacharacters.
368 ltconfig_args=
369 for arg
371 case "$arg" in
372 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
373 ltconfig_args="$ltconfig_args '$arg'" ;;
374 *) ltconfig_args="$ltconfig_args $arg" ;;
375 esac
376 done
378 # A relevant subset of AC_INIT.
380 # File descriptor usage:
381 # 0 standard input
382 # 1 file creation
383 # 2 errors and warnings
384 # 3 some systems may open it to /dev/tty
385 # 4 used on the Kubota Titan
386 # 5 compiler messages saved in config.log
387 # 6 checking for... messages and results
388 if test "$silent" = yes; then
389 exec 6>/dev/null
390 else
391 exec 6>&1
393 exec 5>>./config.log
395 # NLS nuisances.
396 # Only set LANG and LC_ALL to C if already set.
397 # These must not be set unconditionally because not all systems understand
398 # e.g. LANG=C (notably SCO).
399 if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
400 if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
402 if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then
403 echo "loading cache $cache_file within ltconfig"
404 . $cache_file
407 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
408 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
409 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
410 ac_n= ac_c='
411 ' ac_t=' '
412 else
413 ac_n=-n ac_c= ac_t=
415 else
416 ac_n= ac_c='\c' ac_t=
419 if test -z "$srcdir"; then
420 # Assume the source directory is the same one as the path to LTMAIN.
421 srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
422 test "$srcdir" = "$ltmain" && srcdir=.
425 trap "$rm conftest*; exit 1" 1 2 15
426 if test "$verify_host" = yes; then
427 # Check for config.guess and config.sub.
428 ac_aux_dir=
429 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
430 if test -f $ac_dir/config.guess; then
431 ac_aux_dir=$ac_dir
432 break
434 done
435 if test -z "$ac_aux_dir"; then
436 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
437 echo "$help" 1>&2
438 exit 1
440 ac_config_guess=$ac_aux_dir/config.guess
441 ac_config_sub=$ac_aux_dir/config.sub
443 # Make sure we can run config.sub.
444 if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
445 else
446 echo "$progname: cannot run $ac_config_sub" 1>&2
447 echo "$help" 1>&2
448 exit 1
451 echo $ac_n "checking host system type""... $ac_c" 1>&6
453 host_alias=$host
454 case "$host_alias" in
456 if host_alias=`$SHELL $ac_config_guess`; then :
457 else
458 echo "$progname: cannot guess host type; you must specify one" 1>&2
459 echo "$help" 1>&2
460 exit 1
461 fi ;;
462 esac
463 host=`$SHELL $ac_config_sub $host_alias`
464 echo "$ac_t$host" 1>&6
466 # Make sure the host verified.
467 test -z "$host" && exit 1
469 # Check for the build system type
470 echo $ac_n "checking build system type... $ac_c" 1>&6
472 build_alias=$build
473 case "$build_alias" in
474 NONE)
475 case $nonopt in
476 NONE) build_alias=$host_alias ;;
477 *) build_alias=$nonopt ;;
478 esac ;;
479 esac
481 build=`$SHELL $ac_config_sub $build_alias`
482 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
483 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
484 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
485 echo "$ac_t""$build" 1>&6
487 elif test -z "$host"; then
488 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
489 echo "$help" 1>&2
490 exit 1
491 else
492 host_alias=$host
493 build_alias=$host_alias
494 build=$host
497 if test x"$host" != x"$build"; then
498 ac_tool_prefix=${host_alias}-
499 else
500 ac_tool_prefix=
503 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
504 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
505 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
507 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
508 case "$host_os" in
509 linux-gnu*) ;;
510 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
511 esac
513 case "$host_os" in
514 aix3*)
515 # AIX sometimes has problems with the GCC collect2 program. For some
516 # reason, if we set the COLLECT_NAMES environment variable, the problems
517 # vanish in a puff of smoke.
518 if test "X${COLLECT_NAMES+set}" != Xset; then
519 COLLECT_NAMES=
520 export COLLECT_NAMES
523 esac
525 # Determine commands to create old-style static archives.
526 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
527 old_postinstall_cmds='chmod 644 $oldlib'
528 old_postuninstall_cmds=
530 if test -n "$RANLIB"; then
531 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
532 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
535 # Set sane defaults for various variables
536 test -z "$AR" && AR=ar
537 test -z "$AR_FLAGS" && AR_FLAGS=cru
538 test -z "$AS" && AS=as
539 test -z "$CC" && CC=cc
540 test -z "$DLLTOOL" && DLLTOOL=dlltool
541 test -z "$MAGIC" && MAGIC=file
542 test -z "$LD" && LD=ld
543 test -z "$LN_S" && LN_S="ln -s"
544 test -z "$NM" && NM=nm
545 test -z "$OBJDUMP" && OBJDUMP=objdump
546 test -z "$RANLIB" && RANLIB=:
547 test -z "$STRIP" && STRIP=:
548 test -z "$objext" && objext=o
550 echo $ac_n "checking for objdir... $ac_c" 1>&6
551 rm -f .libs 2>/dev/null
552 mkdir .libs 2>/dev/null
553 if test -d .libs; then
554 objdir=.libs
555 else
556 # MS-DOS does not allow filenames that begin with a dot.
557 objdir=_libs
559 rmdir .libs 2>/dev/null
560 echo "$ac_t$objdir" 1>&6
562 # Allow CC to be a program name with arguments.
563 set dummy $CC
564 compiler="$2"
566 # We assume here that the value for ac_cv_prog_cc_pic will not be cached
567 # in isolation, and that seeing it set (from the cache) indicates that
568 # the associated values are set (in the cache) correctly too.
569 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
570 echo "$progname:565:checking for $compiler option to produce PIC" 1>&5
571 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
572 echo $ac_n "(cached) $ac_c" 1>&6
573 else
574 ac_cv_prog_cc_pic=
575 ac_cv_prog_cc_shlib=
576 ac_cv_prog_cc_wl=
577 ac_cv_prog_cc_static=
578 ac_cv_prog_cc_no_builtin=
579 ac_cv_prog_cc_can_build_shared=$can_build_shared
581 if test "$with_gcc" = yes; then
582 ac_cv_prog_cc_wl='-Wl,'
583 ac_cv_prog_cc_static='-static'
585 case "$host_os" in
586 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
587 # PIC is the default for these OSes.
589 aix*)
590 # Below there is a dirty hack to force normal static linking with -ldl
591 # The problem is because libdl dynamically linked with both libc and
592 # libC (AIX C++ library), which obviously doesn't included in libraries
593 # list by gcc. This cause undefined symbols with -static flags.
594 # This hack allows C programs to be linked with "-static -ldl", but
595 # we not sure about C++ programs.
596 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
598 cygwin* | mingw* | os2*)
599 # This hack is so that the source file can tell whether it is being
600 # built for inclusion in a dll (and should export symbols for example).
601 ac_cv_prog_cc_pic='-DDLL_EXPORT'
603 amigaos*)
604 # FIXME: we need at least 68020 code to build shared libraries, but
605 # adding the `-m68020' flag to GCC prevents building anything better,
606 # like `-m68040'.
607 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
609 sysv4*MP*)
610 if test -d /usr/nec; then
611 ac_cv_prog_cc_pic=-Kconform_pic
615 ac_cv_prog_cc_pic='-fPIC'
617 esac
618 else
619 # PORTME Check for PIC flags for the system compiler.
620 case "$host_os" in
621 aix3* | aix4*)
622 # All AIX code is PIC.
623 ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
626 hpux9* | hpux10* | hpux11*)
627 # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
628 ac_cv_prog_cc_wl='-Wl,'
629 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
630 ac_cv_prog_cc_pic='+Z'
633 irix5* | irix6*)
634 ac_cv_prog_cc_wl='-Wl,'
635 ac_cv_prog_cc_static='-non_shared'
636 # PIC (with -KPIC) is the default.
639 cygwin* | mingw* | os2*)
640 # This hack is so that the source file can tell whether it is being
641 # built for inclusion in a dll (and should export symbols for example).
642 ac_cv_prog_cc_pic='-DDLL_EXPORT'
645 osf3* | osf4* | osf5*)
646 # All OSF/1 code is PIC.
647 ac_cv_prog_cc_wl='-Wl,'
648 ac_cv_prog_cc_static='-non_shared'
651 sco3.2v5*)
652 ac_cv_prog_cc_pic='-Kpic'
653 ac_cv_prog_cc_static='-dn'
654 ac_cv_prog_cc_shlib='-belf'
657 solaris*)
658 ac_cv_prog_cc_pic='-KPIC'
659 ac_cv_prog_cc_static='-Bstatic'
660 ac_cv_prog_cc_wl='-Wl,'
663 sunos4*)
664 ac_cv_prog_cc_pic='-PIC'
665 ac_cv_prog_cc_static='-Bstatic'
666 ac_cv_prog_cc_wl='-Qoption ld '
669 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
670 ac_cv_prog_cc_pic='-KPIC'
671 ac_cv_prog_cc_static='-Bstatic'
672 ac_cv_prog_cc_wl='-Wl,'
675 uts4*)
676 ac_cv_prog_cc_pic='-pic'
677 ac_cv_prog_cc_static='-Bstatic'
680 sysv4*MP*)
681 if test -d /usr/nec ;then
682 ac_cv_prog_cc_pic='-Kconform_pic'
683 ac_cv_prog_cc_static='-Bstatic'
688 ac_cv_prog_cc_can_build_shared=no
690 esac
693 if test -z "$ac_cv_prog_cc_pic"; then
694 echo "$ac_t"none 1>&6
695 else
696 echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
698 # Check to make sure the pic_flag actually works.
699 echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
700 echo "$progname:695:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
701 if test "X${ac_cv_prog_cc_pic_works+set}" = Xset; then
702 echo $ac_n "(cached) $ac_c" 1>&6
703 else
704 ac_cv_prog_cc_pic_works=yes
705 $rm conftest*
706 echo "int some_variable = 0;" > conftest.c
707 save_CFLAGS="$CFLAGS"
708 CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
709 if { (eval echo $progname:704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
710 # Append any warnings to the config.log.
711 cat conftest.err 1>&5
713 case "$host_os" in
714 hpux9* | hpux10* | hpux11*)
715 # On HP-UX, both CC and GCC only warn that PIC is supported... then
716 # they create non-PIC objects. So, if there were any warnings, we
717 # assume that PIC is not supported.
718 if test -s conftest.err; then
719 ac_cv_prog_cc_pic_works=no
720 ac_cv_prog_cc_can_build_shared=no
721 ac_cv_prog_cc_pic=
722 else
723 ac_cv_prog_cc_pic_works=yes
724 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
728 ac_cv_prog_cc_pic_works=yes
729 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
731 esac
732 else
733 # Append any errors to the config.log.
734 cat conftest.err 1>&5
735 ac_cv_prog_cc_pic_works=no
736 ac_cv_prog_cc_can_build_shared=no
737 ac_cv_prog_cc_pic=
739 CFLAGS="$save_CFLAGS"
740 $rm conftest*
742 # Belt *and* braces to stop my trousers falling down:
743 if test "X$ac_cv_prog_cc_pic_works" = Xno; then
744 ac_cv_prog_cc_pic=
745 ac_cv_prog_cc_can_build_shared=no
747 echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
750 # Check for any special shared library compilation flags.
751 if test -n "$ac_cv_prog_cc_shlib"; then
752 echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
753 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then :
754 else
755 echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
756 ac_cv_prog_cc_can_build_shared=no
760 echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
761 echo "$progname:756: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
762 if test "X${ac_cv_prog_cc_static_works+set}" = Xset; then
763 echo $ac_n "(cached) $ac_c" 1>&6
764 else
765 $rm conftest*
766 echo 'main(){return(0);}' > conftest.c
767 save_LDFLAGS="$LDFLAGS"
768 LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
769 if { (eval echo $progname:764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
770 ac_cv_prog_cc_static_works=yes
771 else
772 ac_cv_prog_cc_static_works=no
773 ac_cv_prog_cc_static=
775 LDFLAGS="$save_LDFLAGS"
776 $rm conftest*
778 # Belt *and* braces to stop my trousers falling down:
779 if test "X$ac_cv_prog_cc_static_works" = Xno; then
780 ac_cv_prog_cc_static=
782 echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
783 pic_flag="$ac_cv_prog_cc_pic"
784 special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
785 wl="$ac_cv_prog_cc_wl"
786 link_static_flag="$ac_cv_prog_cc_static"
787 no_builtin_flag="$ac_cv_prog_cc_no_builtin"
788 can_build_shared="$ac_cv_prog_cc_can_build_shared"
790 # Check to see if options -o and -c are simultaneously supported by compiler
791 echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
792 $rm -r conftest 2>/dev/null
793 mkdir conftest
794 cd conftest
795 $rm conftest*
796 echo "int some_variable = 0;" > conftest.c
797 mkdir out
798 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
799 # that will create temporary files in the current directory regardless of
800 # the output directory. Thus, making CWD read-only will cause this test
801 # to fail, enabling locking or at least warning the user not to do parallel
802 # builds.
803 chmod -w .
804 save_CFLAGS="$CFLAGS"
805 CFLAGS="$CFLAGS -o out/conftest2.o"
806 echo "$progname:801: checking if $compiler supports -c -o file.o" >&5
807 if { (eval echo $progname:802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
809 # The compiler can only warn and ignore the option if not recognized
810 # So say no if there are warnings
811 if test -s out/conftest.err; then
812 echo "$ac_t"no 1>&6
813 compiler_c_o=no
814 else
815 echo "$ac_t"yes 1>&6
816 compiler_c_o=yes
818 else
819 # Append any errors to the config.log.
820 cat out/conftest.err 1>&5
821 compiler_c_o=no
822 echo "$ac_t"no 1>&6
824 CFLAGS="$save_CFLAGS"
825 chmod u+w .
826 $rm conftest* out/*
827 rmdir out
828 cd ..
829 rmdir conftest
830 $rm -r conftest 2>/dev/null
832 if test x"$compiler_c_o" = x"yes"; then
833 # Check to see if we can write to a .lo
834 echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
835 $rm conftest*
836 echo "int some_variable = 0;" > conftest.c
837 save_CFLAGS="$CFLAGS"
838 CFLAGS="$CFLAGS -c -o conftest.lo"
839 echo "$progname:834: checking if $compiler supports -c -o file.lo" >&5
840 if { (eval echo $progname:835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
842 # The compiler can only warn and ignore the option if not recognized
843 # So say no if there are warnings
844 if test -s conftest.err; then
845 echo "$ac_t"no 1>&6
846 compiler_o_lo=no
847 else
848 echo "$ac_t"yes 1>&6
849 compiler_o_lo=yes
851 else
852 # Append any errors to the config.log.
853 cat conftest.err 1>&5
854 compiler_o_lo=no
855 echo "$ac_t"no 1>&6
857 CFLAGS="$save_CFLAGS"
858 $rm conftest*
859 else
860 compiler_o_lo=no
863 # Check to see if we can do hard links to lock some files if needed
864 hard_links="nottested"
865 if test "$compiler_c_o" = no && test "$need_locks" != no; then
866 # do not overwrite the value of need_locks provided by the user
867 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
868 hard_links=yes
869 $rm conftest*
870 ln conftest.a conftest.b 2>/dev/null && hard_links=no
871 touch conftest.a
872 ln conftest.a conftest.b 2>&5 || hard_links=no
873 ln conftest.a conftest.b 2>/dev/null && hard_links=no
874 echo "$ac_t$hard_links" 1>&6
875 $rm conftest*
876 if test "$hard_links" = no; then
877 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
878 need_locks=warn
880 else
881 need_locks=no
884 if test "$with_gcc" = yes; then
885 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
886 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
887 $rm conftest*
888 echo "int some_variable = 0;" > conftest.c
889 save_CFLAGS="$CFLAGS"
890 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
891 echo "$progname:886: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
892 if { (eval echo $progname:887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
894 # The compiler can only warn and ignore the option if not recognized
895 # So say no if there are warnings
896 if test -s conftest.err; then
897 echo "$ac_t"no 1>&6
898 compiler_rtti_exceptions=no
899 else
900 echo "$ac_t"yes 1>&6
901 compiler_rtti_exceptions=yes
903 else
904 # Append any errors to the config.log.
905 cat conftest.err 1>&5
906 compiler_rtti_exceptions=no
907 echo "$ac_t"no 1>&6
909 CFLAGS="$save_CFLAGS"
910 $rm conftest*
912 if test "$compiler_rtti_exceptions" = "yes"; then
913 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
914 else
915 no_builtin_flag=' -fno-builtin'
920 # See if the linker supports building shared libraries.
921 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
923 allow_undefined_flag=
924 no_undefined_flag=
925 need_lib_prefix=unknown
926 need_version=unknown
927 # when you set need_version to no, make sure it does not cause -set_version
928 # flags to be left without arguments
929 archive_cmds=
930 archive_expsym_cmds=
931 old_archive_from_new_cmds=
932 old_archive_from_expsyms_cmds=
933 striplib=
934 old_striplib=
935 export_dynamic_flag_spec=
936 whole_archive_flag_spec=
937 thread_safe_flag_spec=
938 hardcode_into_libs=no
939 hardcode_libdir_flag_spec=
940 hardcode_libdir_separator=
941 hardcode_direct=no
942 hardcode_minus_L=no
943 hardcode_shlibpath_var=unsupported
944 runpath_var=
945 link_all_deplibs=unknown
946 always_export_symbols=no
947 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
948 # include_expsyms should be a list of space-separated symbols to be *always*
949 # included in the symbol list
950 include_expsyms=
951 # exclude_expsyms can be an egrep regular expression of symbols to exclude
952 # it will be wrapped by ` (' and `)$', so one must not match beginning or
953 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
954 # as well as any symbol that contains `d'.
955 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
956 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
957 # platforms (ab)use it in PIC code, but their linkers get confused if
958 # the symbol is explicitly referenced. Since portable code cannot
959 # rely on this symbol name, it's probably fine to never include it in
960 # preloaded symbol tables.
961 extract_expsyms_cmds=
963 case "$host_os" in
964 cygwin* | mingw*)
965 # FIXME: the MSVC++ port hasn't been tested in a loooong time
966 # When not using gcc, we currently assume that we are using
967 # Microsoft Visual C++.
968 if test "$with_gcc" != yes; then
969 with_gnu_ld=no
973 esac
975 ld_shlibs=yes
976 if test "$with_gnu_ld" = yes; then
977 # If archive_cmds runs LD, not CC, wlarc should be empty
978 wlarc='${wl}'
980 # See if GNU ld supports shared libraries.
981 case "$host_os" in
982 aix3* | aix4*)
983 # On AIX, the GNU linker is very broken
984 ld_shlibs=no
985 cat <<EOF 1>&2
987 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
988 *** to be unable to reliably create shared libraries on AIX.
989 *** Therefore, libtool is disabling shared libraries support. If you
990 *** really care for shared libraries, you may want to modify your PATH
991 *** so that a non-GNU linker is found, and then restart.
996 amigaos*)
997 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
998 hardcode_libdir_flag_spec='-L$libdir'
999 hardcode_minus_L=yes
1001 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1002 # that the semantics of dynamic libraries on AmigaOS, at least up
1003 # to version 4, is to share data among multiple programs linked
1004 # with the same dynamic library. Since this doesn't match the
1005 # behavior of shared libraries on other platforms, we can use
1006 # them.
1007 ld_shlibs=no
1010 beos*)
1011 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1012 allow_undefined_flag=unsupported
1013 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1014 # support --undefined. This deserves some investigation. FIXME
1015 archive_cmds='$CC -nostart $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1016 else
1017 ld_shlibs=no
1021 cygwin* | mingw*)
1022 # hardcode_libdir_flag_spec is actually meaningless, as there is
1023 # no search path for DLLs.
1024 hardcode_libdir_flag_spec='-L$libdir'
1025 allow_undefined_flag=unsupported
1026 always_export_symbols=yes
1028 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1029 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
1030 test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1031 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1032 else $CC -o impgen impgen.c ; fi)~
1033 $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
1035 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1037 # cygwin and mingw dlls have different entry points and sets of symbols
1038 # to exclude.
1039 # FIXME: what about values for MSVC?
1040 dll_entry=__cygwin_dll_entry@12
1041 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1042 case "$host_os" in
1043 mingw*)
1044 # mingw values
1045 dll_entry=_DllMainCRTStartup@12
1046 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1048 esac
1050 # mingw and cygwin differ, and it's simplest to just exclude the union
1051 # of the two symbol sets.
1052 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1054 # recent cygwin and mingw systems supply a stub DllMain which the user
1055 # can override, but on older systems we have to supply one (in ltdll.c)
1056 if test "x$lt_cv_need_dllmain" = "xyes"; then
1057 ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
1058 ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~
1059 test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1060 else
1061 ltdll_obj=
1062 ltdll_cmds=
1065 # Extract the symbol export list from an `--export-all' def file,
1066 # then regenerate the def file from the symbol export list, so that
1067 # the compiled dll only exports the symbol export list.
1068 # Be careful not to strip the DATA tag left be newer dlltools.
1069 export_symbols_cmds="$ltdll_cmds"'
1070 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1071 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1073 # If DATA tags from a recent dlltool are present, honour them!
1074 archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
1075 _lt_hint=1;
1076 cat $export_symbols | while read symbol; do
1077 set dummy \$symbol;
1078 case \$# in
1079 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1080 *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
1081 esac;
1082 _lt_hint=`expr 1 + \$_lt_hint`;
1083 done~
1084 '"$ltdll_cmds"'
1085 $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1086 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1087 $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1088 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1089 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1092 netbsd*)
1093 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1094 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1095 wlarc=
1096 else
1097 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1098 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1102 solaris* | sysv5*)
1103 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1104 ld_shlibs=no
1105 cat <<EOF 1>&2
1107 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1108 *** create shared libraries on Solaris systems. Therefore, libtool
1109 *** is disabling shared libraries support. We urge you to upgrade GNU
1110 *** binutils to release 2.9.1 or newer. Another option is to modify
1111 *** your PATH or compiler configuration so that the native linker is
1112 *** used, and then restart.
1115 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1116 archive_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1117 archive_expsym_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1118 else
1119 ld_shlibs=no
1123 sunos4*)
1124 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1125 wlarc=
1126 hardcode_direct=yes
1127 hardcode_shlibpath_var=no
1131 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1132 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1133 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1134 else
1135 ld_shlibs=no
1138 esac
1140 if test "$ld_shlibs" = yes; then
1141 runpath_var=LD_RUN_PATH
1142 hardcode_libdir_flag_spec="$wlarc"'--rpath '"$wlarc"'$libdir'
1143 export_dynamic_flag_spec="$wlarc"'--export-dynamic'
1144 case $host_os in
1145 cygwin* | mingw*)
1146 # dlltool doesn't understand --whole-archive et. al.
1147 whole_archive_flag_spec=
1150 # ancient GNU ld didn't support --whole-archive et. al.
1151 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1152 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1153 else
1154 whole_archive_flag_spec=
1157 esac
1159 else
1160 # PORTME fill in a description of your system's linker (not GNU ld)
1161 case "$host_os" in
1162 aix3*)
1163 allow_undefined_flag=unsupported
1164 always_export_symbols=yes
1165 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
1166 # Note: this linker hardcodes the directories in LIBPATH if there
1167 # are no directories specified by -L.
1168 hardcode_minus_L=yes
1169 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1170 # Neither direct hardcoding nor static linking is supported with a
1171 # broken collect2.
1172 hardcode_direct=unsupported
1176 aix4*)
1177 hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
1178 hardcode_libdir_separator=':'
1179 if test "$with_gcc" = yes; then
1180 collect2name=`${CC} -print-prog-name=collect2`
1181 if test -f "$collect2name" && \
1182 strings "$collect2name" | grep resolve_lib_name >/dev/null
1183 then
1184 # We have reworked collect2
1185 hardcode_direct=yes
1186 else
1187 # We have old collect2
1188 hardcode_direct=unsupported
1189 # It fails to find uninstalled libraries when the uninstalled
1190 # path is not listed in the libpath. Setting hardcode_minus_L
1191 # to unsupported forces relinking
1192 hardcode_minus_L=yes
1193 hardcode_libdir_flag_spec='-L$libdir'
1194 hardcode_libdir_separator=
1196 shared_flag='-shared'
1197 else
1198 shared_flag='${wl}-bM:SRE'
1199 hardcode_direct=yes
1201 allow_undefined_flag=' ${wl}-berok'
1202 archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
1203 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
1204 case "$host_os" in aix4.[01]|aix4.[01].*)
1205 # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
1206 always_export_symbols=yes ;;
1207 esac
1210 amigaos*)
1211 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1212 hardcode_libdir_flag_spec='-L$libdir'
1213 hardcode_minus_L=yes
1214 # see comment about different semantics on the GNU ld section
1215 ld_shlibs=no
1218 cygwin* | mingw*)
1219 # When not using gcc, we currently assume that we are using
1220 # Microsoft Visual C++.
1221 # hardcode_libdir_flag_spec is actually meaningless, as there is
1222 # no search path for DLLs.
1223 hardcode_libdir_flag_spec=' '
1224 allow_undefined_flag=unsupported
1225 # Tell ltmain to make .lib files, not .a files.
1226 libext=lib
1227 # FIXME: Setting linknames here is a bad hack.
1228 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1229 # The linker will automatically build a .lib file if we build a DLL.
1230 old_archive_from_new_cmds='true'
1231 # FIXME: Should let the user specify the lib program.
1232 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1233 fix_srcfile_path='`cygpath -w $srcfile`'
1236 freebsd1*)
1237 ld_shlibs=no
1240 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1241 # support. Future versions do this automatically, but an explicit c++rt0.o
1242 # does not break anything, and helps significantly (at the cost of a little
1243 # extra space).
1244 freebsd2.2*)
1245 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1246 hardcode_libdir_flag_spec='-R$libdir'
1247 hardcode_direct=yes
1248 hardcode_shlibpath_var=no
1251 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1252 freebsd2*)
1253 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1254 hardcode_direct=yes
1255 hardcode_minus_L=yes
1256 hardcode_shlibpath_var=no
1259 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1260 freebsd*)
1261 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1262 hardcode_libdir_flag_spec='-R$libdir'
1263 hardcode_direct=yes
1264 hardcode_shlibpath_var=no
1267 hpux9* | hpux10* | hpux11*)
1268 case "$host_os" in
1269 hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
1270 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1271 esac
1272 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1273 hardcode_libdir_separator=:
1274 hardcode_direct=yes
1275 hardcode_minus_L=yes # Not in the search PATH, but as the default
1276 # location of the library.
1277 export_dynamic_flag_spec='${wl}-E'
1280 irix5* | irix6*)
1281 if test "$with_gcc" = yes; then
1282 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1283 else
1284 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1286 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1287 hardcode_libdir_separator=:
1288 link_all_deplibs=yes
1291 netbsd*)
1292 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1293 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
1294 else
1295 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
1297 hardcode_libdir_flag_spec='${wl}-R$libdir'
1298 hardcode_direct=yes
1299 hardcode_shlibpath_var=no
1302 openbsd*)
1303 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1304 hardcode_libdir_flag_spec='-R$libdir'
1305 hardcode_direct=yes
1306 hardcode_shlibpath_var=no
1309 os2*)
1310 hardcode_libdir_flag_spec='-L$libdir'
1311 hardcode_minus_L=yes
1312 allow_undefined_flag=unsupported
1313 archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
1314 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1317 osf3*)
1318 if test "$with_gcc" = yes; then
1319 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1320 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1321 else
1322 allow_undefined_flag=' -expect_unresolved \*'
1323 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1325 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1326 hardcode_libdir_separator=:
1329 osf4* | osf5*) # as osf3* with the addition of -msym flag
1330 if test "$with_gcc" = yes; then
1331 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1332 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1333 else
1334 allow_undefined_flag=' -expect_unresolved \*'
1335 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1337 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1338 hardcode_libdir_separator=:
1340 rhapsody*)
1341 archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts'
1342 hardcode_libdir_flags_spec='-L$libdir'
1343 hardcode_direct=yes
1344 hardcode_shlibpath_var=no
1347 sco3.2v5*)
1348 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1349 hardcode_shlibpath_var=no
1350 runpath_var=LD_RUN_PATH
1351 hardcode_runpath_var=yes
1354 solaris*)
1355 no_undefined_flag=' -z text'
1356 # $CC -shared without GNU ld will not create a library from C++
1357 # object files and a static libstdc++, better avoid it by now
1358 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1359 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1360 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1361 hardcode_libdir_flag_spec='-R$libdir'
1362 hardcode_shlibpath_var=no
1363 case "$host_os" in
1364 solaris2.[0-5] | solaris2.[0-5].*) ;;
1365 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1366 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1367 esac
1368 link_all_deplibs=yes
1371 sunos4*)
1372 if test "x$host_vendor" = xsequent; then
1373 # Use $CC to link under sequent, because it throws in some extra .o
1374 # files that make .init and .fini sections work.
1375 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts'
1376 else
1377 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1379 hardcode_libdir_flag_spec='-L$libdir'
1380 hardcode_direct=yes
1381 hardcode_minus_L=yes
1382 hardcode_shlibpath_var=no
1385 sysv4)
1386 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1387 runpath_var='LD_RUN_PATH'
1388 hardcode_shlibpath_var=no
1389 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
1392 sysv4.3*)
1393 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1394 hardcode_shlibpath_var=no
1395 export_dynamic_flag_spec='-Bexport'
1398 sysv5*)
1399 no_undefined_flag=' -z text'
1400 # $CC -shared without GNU ld will not create a library from C++
1401 # object files and a static libstdc++, better avoid it by now
1402 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1403 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1404 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1405 hardcode_libdir_flag_spec=
1406 hardcode_shlibpath_var=no
1407 runpath_var='LD_RUN_PATH'
1410 uts4*)
1411 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1412 hardcode_libdir_flag_spec='-L$libdir'
1413 hardcode_shlibpath_var=no
1416 dgux*)
1417 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1418 hardcode_libdir_flag_spec='-L$libdir'
1419 hardcode_shlibpath_var=no
1422 sysv4*MP*)
1423 if test -d /usr/nec; then
1424 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1425 hardcode_shlibpath_var=no
1426 runpath_var=LD_RUN_PATH
1427 hardcode_runpath_var=yes
1428 ld_shlibs=yes
1432 sysv4.2uw2*)
1433 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
1434 hardcode_direct=yes
1435 hardcode_minus_L=no
1436 hardcode_shlibpath_var=no
1437 hardcode_runpath_var=yes
1438 runpath_var=LD_RUN_PATH
1441 unixware7*)
1442 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1443 runpath_var='LD_RUN_PATH'
1444 hardcode_shlibpath_var=no
1448 ld_shlibs=no
1450 esac
1452 echo "$ac_t$ld_shlibs" 1>&6
1453 test "$ld_shlibs" = no && can_build_shared=no
1455 # Check hardcoding attributes.
1456 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1457 hardcode_action=
1458 if test -n "$hardcode_libdir_flag_spec" || \
1459 test -n "$runpath_var"; then
1461 # We can hardcode non-existant directories.
1462 if test "$hardcode_direct" != no &&
1463 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1464 # have to relink, otherwise we might link with an installed library
1465 # when we should be linking with a yet-to-be-installed one
1466 ## test "$hardcode_shlibpath_var" != no &&
1467 test "$hardcode_minus_L" != no; then
1468 # Linking always hardcodes the temporary library directory.
1469 hardcode_action=relink
1470 else
1471 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1472 hardcode_action=immediate
1474 else
1475 # We cannot hardcode anything, or else we can only hardcode existing
1476 # directories.
1477 hardcode_action=unsupported
1479 echo "$ac_t$hardcode_action" 1>&6
1481 echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
1482 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1483 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1484 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1485 echo "${ac_t}yes" 1>&6
1486 else
1487 echo "${ac_t}no" 1>&6
1490 reload_cmds='$LD$reload_flag -o $output$reload_objs'
1491 test -z "$deplibs_check_method" && deplibs_check_method=unknown
1493 # PORTME Fill in your ld.so characteristics
1494 library_names_spec=
1495 libname_spec='lib$name'
1496 soname_spec=
1497 postinstall_cmds=
1498 postuninstall_cmds=
1499 finish_cmds=
1500 finish_eval=
1501 shlibpath_var=
1502 shlibpath_overrides_runpath=unknown
1503 version_type=none
1504 dynamic_linker="$host_os ld.so"
1505 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1506 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1508 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1509 case "$host_os" in
1510 aix3*)
1511 version_type=linux
1512 library_names_spec='${libname}${release}.so$versuffix $libname.a'
1513 shlibpath_var=LIBPATH
1515 # AIX has no versioning support, so we append a major version to the name.
1516 soname_spec='${libname}${release}.so$major'
1519 aix4*)
1520 version_type=linux
1521 # AIX has no versioning support, so currently we can not hardcode correct
1522 # soname into executable. Probably we can add versioning support to
1523 # collect2, so additional links can be useful in future.
1524 # We preserve .a as extension for shared libraries though AIX4.2
1525 # and later linker supports .so
1526 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
1527 shlibpath_var=LIBPATH
1530 amigaos*)
1531 library_names_spec='$libname.ixlibrary $libname.a'
1532 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1533 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
1536 beos*)
1537 library_names_spec='${libname}.so'
1538 dynamic_linker="$host_os ld.so"
1539 shlibpath_var=LIBRARY_PATH
1540 lt_cv_dlopen="load_add_on"
1541 lt_cv_dlopen_libs=
1542 lt_cv_dlopen_self=yes
1545 bsdi4*)
1546 version_type=linux
1547 need_version=no
1548 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1549 soname_spec='${libname}${release}.so$major'
1550 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1551 shlibpath_var=LD_LIBRARY_PATH
1552 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1553 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1554 export_dynamic_flag_spec=-rdynamic
1555 # the default ld.so.conf also contains /usr/contrib/lib and
1556 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1557 # libtool to hard-code these into programs
1560 cygwin* | mingw*)
1561 version_type=windows
1562 need_version=no
1563 need_lib_prefix=no
1564 if test "$with_gcc" = yes; then
1565 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
1566 else
1567 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1569 dynamic_linker='Win32 ld.exe'
1570 # FIXME: first we should search . and the directory the executable is in
1571 shlibpath_var=PATH
1572 lt_cv_dlopen="LoadLibrary"
1573 lt_cv_dlopen_libs=
1576 freebsd1*)
1577 dynamic_linker=no
1580 freebsd*)
1581 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1582 version_type=freebsd-$objformat
1583 case "$version_type" in
1584 freebsd-elf*)
1585 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1586 need_version=no
1587 need_lib_prefix=no
1589 freebsd-*)
1590 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1591 need_version=yes
1593 esac
1594 shlibpath_var=LD_LIBRARY_PATH
1595 case "$host_os" in
1596 freebsd2*)
1597 shlibpath_overrides_runpath=yes
1599 freebsd3.[01]* | freebsdelf3.[01]*)
1600 shlibpath_overrides_runpath=yes
1601 hardcode_into_libs=yes
1603 *) # from 3.2 on
1604 shlibpath_overrides_runpath=no
1605 hardcode_into_libs=yes
1607 esac
1610 gnu*)
1611 version_type=linux
1612 need_lib_prefix=no
1613 need_version=no
1614 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1615 soname_spec='${libname}${release}.so$major'
1616 shlibpath_var=LD_LIBRARY_PATH
1617 hardcode_into_libs=yes
1620 hpux9* | hpux10* | hpux11*)
1621 # Give a soname corresponding to the major version so that dld.sl refuses to
1622 # link against other versions.
1623 dynamic_linker="$host_os dld.sl"
1624 version_type=sunos
1625 need_lib_prefix=no
1626 need_version=no
1627 shlibpath_var=SHLIB_PATH
1628 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1629 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1630 soname_spec='${libname}${release}.sl$major'
1631 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1632 postinstall_cmds='chmod 555 $lib'
1635 irix5* | irix6*)
1636 version_type=irix
1637 need_lib_prefix=no
1638 need_version=no
1639 soname_spec='${libname}${release}.so.$major'
1640 library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
1641 case "$host_os" in
1642 irix5*)
1643 libsuff= shlibsuff=
1646 case "$LD" in # libtool.m4 will add one of these switches to LD
1647 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1648 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1649 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1650 *) libsuff= shlibsuff= libmagic=never-match;;
1651 esac
1653 esac
1654 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1655 shlibpath_overrides_runpath=no
1656 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1657 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1660 # No shared lib support for Linux oldld, aout, or coff.
1661 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1662 dynamic_linker=no
1665 # This must be Linux ELF.
1666 linux-gnu*)
1667 version_type=linux
1668 need_lib_prefix=no
1669 need_version=no
1670 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1671 soname_spec='${libname}${release}.so$major'
1672 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1673 shlibpath_var=LD_LIBRARY_PATH
1674 shlibpath_overrides_runpath=no
1675 # This implies no fast_install, which is unacceptable.
1676 # Some rework will be needed to allow for fast_install
1677 # before this can be enabled.
1678 hardcode_into_libs=yes
1680 # We used to test for /lib/ld.so.1 and disable shared libraries on
1681 # powerpc, because MkLinux only supported shared libraries with the
1682 # GNU dynamic linker. Since this was broken with cross compilers,
1683 # most powerpc-linux boxes support dynamic linking these days and
1684 # people can always --disable-shared, the test was removed, and we
1685 # assume the GNU/Linux dynamic linker is in use.
1686 dynamic_linker='GNU/Linux ld.so'
1689 netbsd*)
1690 version_type=sunos
1691 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1692 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1693 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1694 dynamic_linker='NetBSD (a.out) ld.so'
1695 else
1696 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1697 soname_spec='${libname}${release}.so$major'
1698 dynamic_linker='NetBSD ld.elf_so'
1700 shlibpath_var=LD_LIBRARY_PATH
1703 openbsd*)
1704 version_type=sunos
1705 if test "$with_gnu_ld" = yes; then
1706 need_lib_prefix=no
1707 need_version=no
1709 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1710 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1711 shlibpath_var=LD_LIBRARY_PATH
1714 os2*)
1715 libname_spec='$name'
1716 need_lib_prefix=no
1717 library_names_spec='$libname.dll $libname.a'
1718 dynamic_linker='OS/2 ld.exe'
1719 shlibpath_var=LIBPATH
1722 osf3* | osf4* | osf5*)
1723 version_type=osf
1724 need_version=no
1725 soname_spec='${libname}${release}.so'
1726 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1727 shlibpath_var=LD_LIBRARY_PATH
1728 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1729 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1732 rhapsody*)
1733 version_type=sunos
1734 library_names_spec='${libname}.so'
1735 soname_spec='${libname}.so'
1736 shlibpath_var=DYLD_LIBRARY_PATH
1737 deplibs_check_method=pass_all
1740 sco3.2v5*)
1741 version_type=osf
1742 soname_spec='${libname}${release}.so$major'
1743 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1744 shlibpath_var=LD_LIBRARY_PATH
1747 solaris*)
1748 version_type=linux
1749 need_lib_prefix=no
1750 need_version=no
1751 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1752 soname_spec='${libname}${release}.so$major'
1753 shlibpath_var=LD_LIBRARY_PATH
1754 shlibpath_overrides_runpath=yes
1755 hardcode_into_libs=yes
1756 # ldd complains unless libraries are executable
1757 postinstall_cmds='chmod +x $lib'
1760 sunos4*)
1761 version_type=sunos
1762 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1763 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1764 shlibpath_var=LD_LIBRARY_PATH
1765 shlibpath_overrides_runpath=yes
1766 if test "$with_gnu_ld" = yes; then
1767 need_lib_prefix=no
1769 need_version=yes
1772 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1773 version_type=linux
1774 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1775 soname_spec='${libname}${release}.so$major'
1776 shlibpath_var=LD_LIBRARY_PATH
1777 case "$host_vendor" in
1778 sequent)
1779 file_magic_cmd='/bin/file'
1780 deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
1782 motorola)
1783 need_lib_prefix=no
1784 need_version=no
1785 shlibpath_overrides_runpath=no
1786 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1788 esac
1791 uts4*)
1792 version_type=linux
1793 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1794 soname_spec='${libname}${release}.so$major'
1795 shlibpath_var=LD_LIBRARY_PATH
1798 dgux*)
1799 version_type=linux
1800 need_lib_prefix=no
1801 need_version=no
1802 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1803 soname_spec='${libname}${release}.so$major'
1804 shlibpath_var=LD_LIBRARY_PATH
1807 sysv4*MP*)
1808 if test -d /usr/nec ;then
1809 version_type=linux
1810 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1811 soname_spec='$libname.so.$major'
1812 shlibpath_var=LD_LIBRARY_PATH
1817 dynamic_linker=no
1819 esac
1820 echo "$ac_t$dynamic_linker" 1>&6
1821 test "$dynamic_linker" = no && can_build_shared=no
1823 # Check for command to grab the raw symbol name followed by C symbol from nm.
1824 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1826 # These are sane defaults that work on at least a few old systems.
1827 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1829 # Character class describing NM global symbol codes.
1830 symcode='[BCDEGRST]'
1832 # Regexp to match symbols that can be accessed directly from C.
1833 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1835 # Transform the above into a raw symbol and a C symbol.
1836 symxfrm='\1 \2\3 \3'
1838 # Transform an extracted symbol line into a proper C declaration
1839 global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1841 # Define system-specific variables.
1842 case "$host_os" in
1843 aix*)
1844 symcode='[BCDT]'
1846 cygwin* | mingw*)
1847 symcode='[ABCDGISTW]'
1849 hpux*) # Its linker distinguishes data from code symbols
1850 global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1852 irix*)
1853 symcode='[BCDEGRST]'
1855 solaris* | sysv5*)
1856 symcode='[BDT]'
1858 sysv4)
1859 symcode='[DFNSTU]'
1861 esac
1863 # Handle CRLF in mingw too chain
1864 opt_cr=
1865 case "$host_os" in
1866 mingw*)
1867 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1869 esac
1871 # If we're using GNU nm, then use its standard symbol codes.
1872 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1873 symcode='[ABCDGISTW]'
1876 # Try without a prefix undercore, then with it.
1877 for ac_symprfx in "" "_"; do
1879 # Write the raw and C identifiers.
1880 global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1882 # Check to see that the pipe works correctly.
1883 pipe_works=no
1884 $rm conftest*
1885 cat > conftest.c <<EOF
1886 #ifdef __cplusplus
1887 extern "C" {
1888 #endif
1889 char nm_test_var;
1890 void nm_test_func(){}
1891 #ifdef __cplusplus
1893 #endif
1894 main(){nm_test_var='a';nm_test_func();return(0);}
1897 echo "$progname:1892: checking if global_symbol_pipe works" >&5
1898 if { (eval echo $progname:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1899 # Now try to grab the symbols.
1900 nlist=conftest.nm
1901 if { echo "$progname:1896: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1903 # Try sorting and uniquifying the output.
1904 if sort "$nlist" | uniq > "$nlist"T; then
1905 mv -f "$nlist"T "$nlist"
1906 else
1907 rm -f "$nlist"T
1910 # Make sure that we snagged all the symbols we need.
1911 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1912 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1913 cat <<EOF > conftest.c
1914 #ifdef __cplusplus
1915 extern "C" {
1916 #endif
1919 # Now generate the symbol file.
1920 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
1922 cat <<EOF >> conftest.c
1923 #if defined (__STDC__) && __STDC__
1924 # define lt_ptr_t void *
1925 #else
1926 # define lt_ptr_t char *
1927 # define const
1928 #endif
1930 /* The mapping between symbol names and symbols. */
1931 const struct {
1932 const char *name;
1933 lt_ptr_t address;
1935 lt_preloaded_symbols[] =
1938 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
1939 cat <<\EOF >> conftest.c
1940 {0, (lt_ptr_t) 0}
1943 #ifdef __cplusplus
1945 #endif
1947 # Now try linking the two files.
1948 mv conftest.$objext conftstm.$objext
1949 save_LIBS="$LIBS"
1950 save_CFLAGS="$CFLAGS"
1951 LIBS="conftstm.$objext"
1952 CFLAGS="$CFLAGS$no_builtin_flag"
1953 if { (eval echo $progname:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1954 pipe_works=yes
1955 else
1956 echo "$progname: failed program was:" >&5
1957 cat conftest.c >&5
1959 LIBS="$save_LIBS"
1960 else
1961 echo "cannot find nm_test_func in $nlist" >&5
1963 else
1964 echo "cannot find nm_test_var in $nlist" >&5
1966 else
1967 echo "cannot run $global_symbol_pipe" >&5
1969 else
1970 echo "$progname: failed program was:" >&5
1971 cat conftest.c >&5
1973 $rm conftest* conftst*
1975 # Do not use the global_symbol_pipe unless it works.
1976 if test "$pipe_works" = yes; then
1977 break
1978 else
1979 global_symbol_pipe=
1981 done
1982 if test "$pipe_works" = yes; then
1983 echo "${ac_t}ok" 1>&6
1984 else
1985 echo "${ac_t}failed" 1>&6
1988 if test -z "$global_symbol_pipe"; then
1989 global_symbol_to_cdecl=
1992 # Report the final consequences.
1993 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1995 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1996 # configure.in, otherwise build static only libraries.
1997 case "$host_os" in
1998 cygwin* | mingw* | os2*)
1999 if test x$can_build_shared = xyes; then
2000 test x$enable_win32_dll = xno && can_build_shared=no
2001 echo "checking if package supports dlls... $can_build_shared" 1>&6
2004 esac
2006 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
2007 test "$can_build_shared" = "no" && enable_shared=no
2009 # On AIX, shared libraries and static libraries use the same namespace, and
2010 # are all built from PIC.
2011 case "$host_os" in
2012 aix3*)
2013 test "$enable_shared" = yes && enable_static=no
2014 if test -n "$RANLIB"; then
2015 archive_cmds="$archive_cmds~\$RANLIB \$lib"
2016 postinstall_cmds='$RANLIB $lib'
2020 aix4*)
2021 test "$enable_shared" = yes && enable_static=no
2023 esac
2025 echo "$ac_t$enable_shared" 1>&6
2027 # Make sure either enable_shared or enable_static is yes.
2028 test "$enable_shared" = yes || enable_static=yes
2030 echo "checking whether to build static libraries... $enable_static" 1>&6
2032 if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
2033 # Fast installation is not supported
2034 enable_fast_install=no
2035 elif test "$shlibpath_overrides_runpath" = yes ||
2036 test "$enable_shared" = no; then
2037 # Fast installation is not necessary
2038 enable_fast_install=needless
2041 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2042 if test "$with_gcc" = yes; then
2043 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2046 # Check whether we must set pic_mode to default
2047 test -z "$pic_flag" && pic_mode=default
2049 if test "x$enable_dlopen" != xyes; then
2050 enable_dlopen=unknown
2051 enable_dlopen_self=unknown
2052 enable_dlopen_self_static=unknown
2053 else
2054 if test "X${lt_cv_dlopen+set}" != Xset; then
2055 lt_cv_dlopen=no lt_cv_dlopen_libs=
2056 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2057 echo "$progname:2052: checking for dlopen in -ldl" >&5
2058 if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
2059 echo $ac_n "(cached) $ac_c" 1>&6
2060 else
2061 ac_save_LIBS="$LIBS"
2062 LIBS="-ldl $LIBS"
2063 cat > conftest.$ac_ext <<EOF
2064 #line 2059 "ltconfig"
2065 /* Override any gcc2 internal prototype to avoid an error. */
2066 /* We use char because int might match the return type of a gcc2
2067 builtin and then its argument prototype would still apply. */
2068 #ifdef __cplusplus
2069 extern "C"
2070 #endif
2071 char dlopen();
2073 int main() {
2074 dlopen()
2075 ; return 0; }
2077 if { (eval echo $progname:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2078 rm -rf conftest*
2079 ac_cv_lib_dl_dlopen=yes
2080 else
2081 echo "$progname: failed program was:" >&5
2082 cat conftest.$ac_ext >&5
2083 rm -rf conftest*
2084 ac_cv_lib_dl_dlopen=no
2086 rm -f conftest*
2087 LIBS="$ac_save_LIBS"
2090 if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
2091 echo "$ac_t""yes" 1>&6
2092 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
2093 else
2094 echo "$ac_t""no" 1>&6
2095 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
2096 echo "$progname:2091: checking for dlopen" >&5
2097 if test "X${ac_cv_func_dlopen+set}" = Xset; then
2098 echo $ac_n "(cached) $ac_c" 1>&6
2099 else
2100 cat > conftest.$ac_ext <<EOF
2101 #line 2096 "ltconfig"
2102 /* System header to define __stub macros and hopefully few prototypes,
2103 which can conflict with char dlopen(); below. */
2104 #include <assert.h>
2105 /* Override any gcc2 internal prototype to avoid an error. */
2106 /* We use char because int might match the return type of a gcc2
2107 builtin and then its argument prototype would still apply. */
2108 #ifdef __cplusplus
2109 extern "C"
2110 #endif
2111 char dlopen();
2113 int main() {
2115 /* The GNU C library defines this for functions which it implements
2116 to always fail with ENOSYS. Some functions are actually named
2117 something starting with __ and the normal name is an alias. */
2118 #if defined (__stub_dlopen) || defined (__stub___dlopen)
2119 choke me
2120 #else
2121 dlopen();
2122 #endif
2124 ; return 0; }
2126 if { (eval echo $progname:2121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2127 rm -rf conftest*
2128 ac_cv_func_dlopen=yes
2129 else
2130 echo "$progname: failed program was:" >&5
2131 cat conftest.$ac_ext >&5
2132 rm -rf conftest*
2133 ac_cv_func_dlopen=no
2135 rm -f conftest*
2137 if test "X$ac_cv_func_dlopen" = Xyes; then
2138 echo "$ac_t""yes" 1>&6
2139 lt_cv_dlopen="dlopen"
2140 else
2141 echo "$ac_t""no" 1>&6
2142 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
2143 echo "$progname:2138: checking for dld_link in -ldld" >&5
2144 if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
2145 echo $ac_n "(cached) $ac_c" 1>&6
2146 else
2147 ac_save_LIBS="$LIBS"
2148 LIBS="-ldld $LIBS"
2149 cat > conftest.$ac_ext <<EOF
2150 #line 2145 "ltconfig"
2151 /* Override any gcc2 internal prototype to avoid an error. */
2152 /* We use char because int might match the return type of a gcc2
2153 builtin and then its argument prototype would still apply. */
2154 #ifdef __cplusplus
2155 extern "C"
2156 #endif
2157 char dld_link();
2159 int main() {
2160 dld_link()
2161 ; return 0; }
2163 if { (eval echo $progname:2158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2164 rm -rf conftest*
2165 ac_cv_lib_dld_dld_link=yes
2166 else
2167 echo "$progname: failed program was:" >&5
2168 cat conftest.$ac_ext >&5
2169 rm -rf conftest*
2170 ac_cv_lib_dld_dld_link=no
2172 rm -f conftest*
2173 LIBS="$ac_save_LIBS"
2176 if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
2177 echo "$ac_t""yes" 1>&6
2178 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
2179 else
2180 echo "$ac_t""no" 1>&6
2181 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
2182 echo "$progname:2177: checking for shl_load" >&5
2183 if test "X${ac_cv_func_shl_load+set}" = Xset; then
2184 echo $ac_n "(cached) $ac_c" 1>&6
2185 else
2186 cat > conftest.$ac_ext <<EOF
2187 #line 2182 "ltconfig"
2188 /* System header to define __stub macros and hopefully few prototypes,
2189 which can conflict with char shl_load(); below. */
2190 #include <assert.h>
2191 /* Override any gcc2 internal prototype to avoid an error. */
2192 /* We use char because int might match the return type of a gcc2
2193 builtin and then its argument prototype would still apply. */
2194 #ifdef __cplusplus
2195 extern "C"
2196 #endif
2197 char shl_load();
2199 int main() {
2201 /* The GNU C library defines this for functions which it implements
2202 to always fail with ENOSYS. Some functions are actually named
2203 something starting with __ and the normal name is an alias. */
2204 #if defined (__stub_shl_load) || defined (__stub___shl_load)
2205 choke me
2206 #else
2207 shl_load();
2208 #endif
2210 ; return 0; }
2212 if { (eval echo $progname:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2213 rm -rf conftest*
2214 ac_cv_func_shl_load=yes
2215 else
2216 echo "$progname: failed program was:" >&5
2217 cat conftest.$ac_ext >&5
2218 rm -rf conftest*
2219 ac_cv_func_shl_load=no
2221 rm -f conftest*
2224 if test "X$ac_cv_func_shl_load" = Xyes; then
2225 echo "$ac_t""yes" 1>&6
2226 lt_cv_dlopen="shl_load"
2227 else
2228 echo "$ac_t""no" 1>&6
2229 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2230 echo "$progname:2225: checking for shl_load in -ldld" >&5
2231 if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
2232 echo $ac_n "(cached) $ac_c" 1>&6
2233 else
2234 ac_save_LIBS="$LIBS"
2235 LIBS="-ldld $LIBS"
2236 cat > conftest.$ac_ext <<EOF
2237 #line 2232 "ltconfig"
2238 #include "confdefs.h"
2239 /* Override any gcc2 internal prototype to avoid an error. */
2240 /* We use char because int might match the return type of a gcc2
2241 builtin and then its argument prototype would still apply. */
2242 #ifdef __cplusplus
2243 extern "C"
2244 #endif
2245 char shl_load();
2247 int main() {
2248 shl_load()
2249 ; return 0; }
2251 if { (eval echo $progname:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2252 rm -rf conftest*
2253 ac_cv_lib_dld_shl_load=yes
2254 else
2255 echo "$progname: failed program was:" >&5
2256 cat conftest.$ac_ext >&5
2257 rm -rf conftest*
2258 ac_cv_lib_dld_shl_load=no
2260 rm -f conftest*
2261 LIBS="$ac_save_LIBS"
2264 if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
2265 echo "$ac_t""yes" 1>&6
2266 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
2267 else
2268 echo "$ac_t""no" 1>&6
2285 if test "x$lt_cv_dlopen" != xno; then
2286 enable_dlopen=yes
2289 case "$lt_cv_dlopen" in
2290 dlopen)
2291 for ac_hdr in dlfcn.h; do
2292 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2293 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2294 echo "$progname:2289: checking for $ac_hdr" >&5
2295 if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
2296 echo $ac_n "(cached) $ac_c" 1>&6
2297 else
2298 cat > conftest.$ac_ext <<EOF
2299 #line 2294 "ltconfig"
2300 #include <$ac_hdr>
2301 int fnord = 0;
2302 int main () { return (0); }
2304 ac_try="$ac_compile >/dev/null 2>conftest.out"
2305 { (eval echo $progname:2300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2306 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2307 if test -z "$ac_err"; then
2308 rm -rf conftest*
2309 eval "ac_cv_header_$ac_safe=yes"
2310 else
2311 echo "$ac_err" >&5
2312 echo "$progname: failed program was:" >&5
2313 cat conftest.$ac_ext >&5
2314 rm -rf conftest*
2315 eval "ac_cv_header_$ac_safe=no"
2317 rm -f conftest*
2319 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2320 echo "$ac_t""yes" 1>&6
2321 else
2322 echo "$ac_t""no" 1>&6
2324 done
2326 if test "x$ac_cv_header_dlfcn_h" = xyes; then
2327 CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2329 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2330 LIBS="$lt_cv_dlopen_libs $LIBS"
2332 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
2333 echo "$progname:2328: checking whether a program can dlopen itself" >&5
2334 if test "X${lt_cv_dlopen_self+set}" = Xset; then
2335 echo $ac_n "(cached) $ac_c" 1>&6
2336 else
2337 if test "$cross_compiling" = yes; then
2338 lt_cv_dlopen_self=cross
2339 else
2340 cat > conftest.c <<EOF
2341 #line 2336 "ltconfig"
2343 #if HAVE_DLFCN_H
2344 #include <dlfcn.h>
2345 #endif
2347 #include <stdio.h>
2349 #ifdef RTLD_GLOBAL
2350 # define LTDL_GLOBAL RTLD_GLOBAL
2351 #else
2352 # ifdef DL_GLOBAL
2353 # define LTDL_GLOBAL DL_GLOBAL
2354 # else
2355 # define LTDL_GLOBAL 0
2356 # endif
2357 #endif
2359 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2360 find out it does not work in some platform. */
2361 #ifndef LTDL_LAZY_OR_NOW
2362 # ifdef RTLD_LAZY
2363 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2364 # else
2365 # ifdef DL_LAZY
2366 # define LTDL_LAZY_OR_NOW DL_LAZY
2367 # else
2368 # ifdef RTLD_NOW
2369 # define LTDL_LAZY_OR_NOW RTLD_NOW
2370 # else
2371 # ifdef DL_NOW
2372 # define LTDL_LAZY_OR_NOW DL_NOW
2373 # else
2374 # define LTDL_LAZY_OR_NOW 0
2375 # endif
2376 # endif
2377 # endif
2378 # endif
2379 #endif
2381 fnord() { int i=42;}
2382 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2383 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2384 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2387 if { (eval echo $progname:2382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2388 then
2389 lt_cv_dlopen_self=yes
2390 else
2391 echo "$progname: failed program was:" >&5
2392 cat conftest.$ac_ext >&5
2393 rm -fr conftest*
2394 lt_cv_dlopen_self=no
2396 rm -fr conftest*
2401 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2403 if test "$lt_cv_dlopen_self" = yes; then
2404 LDFLAGS="$LDFLAGS $link_static_flag"
2405 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2406 echo "$progname:2401: checking whether a statically linked program can dlopen itself" >&5
2407 if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
2408 echo $ac_n "(cached) $ac_c" 1>&6
2409 else
2410 if test "$cross_compiling" = yes; then
2411 lt_cv_dlopen_self_static=cross
2412 else
2413 cat > conftest.c <<EOF
2414 #line 2409 "ltconfig"
2416 #if HAVE_DLFCN_H
2417 #include <dlfcn.h>
2418 #endif
2420 #include <stdio.h>
2422 #ifdef RTLD_GLOBAL
2423 # define LTDL_GLOBAL RTLD_GLOBAL
2424 #else
2425 # ifdef DL_GLOBAL
2426 # define LTDL_GLOBAL DL_GLOBAL
2427 # else
2428 # define LTDL_GLOBAL 0
2429 # endif
2430 #endif
2432 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2433 find out it does not work in some platform. */
2434 #ifndef LTDL_LAZY_OR_NOW
2435 # ifdef RTLD_LAZY
2436 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2437 # else
2438 # ifdef DL_LAZY
2439 # define LTDL_LAZY_OR_NOW DL_LAZY
2440 # else
2441 # ifdef RTLD_NOW
2442 # define LTDL_LAZY_OR_NOW RTLD_NOW
2443 # else
2444 # ifdef DL_NOW
2445 # define LTDL_LAZY_OR_NOW DL_NOW
2446 # else
2447 # define LTDL_LAZY_OR_NOW 0
2448 # endif
2449 # endif
2450 # endif
2451 # endif
2452 #endif
2454 fnord() { int i=42;}
2455 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2456 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2457 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2460 if { (eval echo $progname:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2461 then
2462 lt_cv_dlopen_self_static=yes
2463 else
2464 echo "$progname: failed program was:" >&5
2465 cat conftest.$ac_ext >&5
2466 rm -fr conftest*
2467 lt_cv_dlopen_self_static=no
2469 rm -fr conftest*
2474 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2477 esac
2479 case "$lt_cv_dlopen_self" in
2480 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2481 *) enable_dlopen_self=unknown ;;
2482 esac
2484 case "$lt_cv_dlopen_self_static" in
2485 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2486 *) enable_dlopen_self_static=unknown ;;
2487 esac
2490 # Copy echo and quote the copy, instead of the original, because it is
2491 # used later.
2492 ltecho="$echo"
2493 if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2494 ltecho="$CONFIG_SHELL \$0 --fallback-echo"
2496 LTSHELL="$SHELL"
2498 LTCONFIG_VERSION="$VERSION"
2500 # Only quote variables if we're using ltmain.sh.
2501 case "$ltmain" in
2502 *.sh)
2503 # Now quote all the things that may contain metacharacters.
2504 for var in ltecho old_AR old_ARFLAGS old_CC old_CFLAGS old_CPPFLAGS \
2505 old_MAGIC old_LD old_LDFLAGS old_LIBS \
2506 old_LN_S old_NM old_RANLIB old_STRIP \
2507 old_AS old_DLLTOOL old_OBJDUMP \
2508 old_OBJEXT old_EXEEXT old_reload_flag \
2509 old_deplibs_check_method old_file_magic_cmd \
2510 AR AR_FLAGS CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2511 reload_flag reload_cmds wl \
2512 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2513 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2514 library_names_spec soname_spec \
2515 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2516 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2517 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2518 old_striplib striplib file_magic_cmd export_symbols_cmds \
2519 deplibs_check_method allow_undefined_flag no_undefined_flag \
2520 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2521 hardcode_libdir_flag_spec hardcode_libdir_separator \
2522 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2523 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2525 case "$var" in
2526 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2527 old_postinstall_cmds | old_postuninstall_cmds | \
2528 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2529 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2530 postinstall_cmds | postuninstall_cmds | \
2531 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2532 # Double-quote double-evaled strings.
2533 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test
2536 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
2538 esac
2539 done
2541 case "$ltecho" in
2542 *'\$0 --fallback-echo"')
2543 ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2545 esac
2547 trap "$rm \"$ofile\"; exit 1" 1 2 15
2548 echo "creating $ofile"
2549 $rm "$ofile"
2550 cat <<EOF > "$ofile"
2551 #! $SHELL
2553 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2554 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2555 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2557 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2558 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2560 # This program is free software; you can redistribute it and/or modify
2561 # it under the terms of the GNU General Public License as published by
2562 # the Free Software Foundation; either version 2 of the License, or
2563 # (at your option) any later version.
2565 # This program is distributed in the hope that it will be useful, but
2566 # WITHOUT ANY WARRANTY; without even the implied warranty of
2567 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2568 # General Public License for more details.
2570 # You should have received a copy of the GNU General Public License
2571 # along with this program; if not, write to the Free Software
2572 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2574 # As a special exception to the GNU General Public License, if you
2575 # distribute this file as part of a program that contains a
2576 # configuration script generated by Autoconf, you may include it under
2577 # the same distribution terms that you use for the rest of that program.
2579 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2580 Xsed="sed -e s/^X//"
2582 # The HP-UX ksh and POSIX shell print the target directory to stdout
2583 # if CDPATH is set.
2584 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2586 ### BEGIN LIBTOOL CONFIG
2588 cfgfile="$ofile"
2592 # Double-quote the variables that need it (for aesthetics).
2593 for var in old_AR old_AR_FLAGS old_CC old_CFLAGS old_CPPFLAGS \
2594 old_MAGIC old_LD old_LDFLAGS old_LIBS \
2595 old_LN_S old_NM old_RANLIB old_STRIP \
2596 old_AS old_DLLTOOL old_OBJDUMP \
2597 old_OBJEXT old_EXEEXT old_reload_flag \
2598 old_deplibs_check_method old_file_magic_cmd; do
2599 eval "$var=\\\"\$var\\\""
2600 done
2602 # Just create a config file.
2603 cfgfile="$ofile.cfg"
2604 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2605 echo "creating $cfgfile"
2606 $rm "$cfgfile"
2607 cat <<EOF > "$cfgfile"
2608 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2609 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2612 esac
2614 cat <<EOF >> "$cfgfile"
2615 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2617 # AR=$old_AR AR_FLAGS=$old_AR_FLAGS CC=$old_CC CFLAGS=$old_CFLAGS \\
2618 # CPPFLAGS=$old_CPPFLAGS MAGIC=$old_MAGIC LD=$old_LD LDFLAGS=$old_LDFLAGS \\
2619 # LIBS=$old_LIBS LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB \\
2620 # STRIP=$old_STRIP AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2621 # objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2622 # deplibs_check_method=$old_deplibs_check_method file_magic_cmd=$old_file_magic_cmd \\
2623 # $0$ltconfig_args
2625 # Compiler and other test output produced by $progname, useful for
2626 # debugging $progname, is in ./config.log if it exists.
2627 # The version of $progname that generated this script.
2628 LTCONFIG_VERSION=$LTCONFIG_VERSION
2630 # Shell to use when invoking shell scripts.
2631 SHELL=$LTSHELL
2633 # Whether or not to build shared libraries.
2634 build_libtool_libs=$enable_shared
2636 # Whether or not to build static libraries.
2637 build_old_libs=$enable_static
2639 # Whether or not to optimize for fast installation.
2640 fast_install=$enable_fast_install
2642 # The host system.
2643 host_alias=$host_alias
2644 host=$host
2646 # An echo program that does not interpret backslashes.
2647 echo=$ltecho
2649 # The archiver.
2650 AR=$AR
2651 AR_FLAGS=$AR_FLAGS
2653 # The default C compiler.
2654 CC=$CC
2656 # The linker used to build libraries.
2657 LD=$LD
2659 # Whether we need hard or soft links.
2660 LN_S=$LN_S
2662 # A BSD-compatible nm program.
2663 NM=$NM
2665 # A symbol stripping program
2666 STRIP=$STRIP
2668 # Used to examine libraries when file_magic_cmd begins "file"
2669 MAGIC=$MAGIC
2671 # Used on cygwin: DLL creation program.
2672 DLLTOOL="$DLLTOOL"
2674 # Used on cygwin: object dumper.
2675 OBJDUMP="$OBJDUMP"
2677 # Used on cygwin: assembler.
2678 AS="$AS"
2680 # The name of the directory that contains temporary libtool files.
2681 objdir=$objdir
2683 # How to create reloadable object files.
2684 reload_flag=$reload_flag
2685 reload_cmds=$reload_cmds
2687 # How to pass a linker flag through the compiler.
2688 wl=$wl
2690 # Object file suffix (normally "o").
2691 objext="$objext"
2693 # Old archive suffix (normally "a").
2694 libext="$libext"
2696 # Executable file suffix (normally "").
2697 exeext="$exeext"
2699 # Additional compiler flags for building library objects.
2700 pic_flag=$pic_flag
2701 pic_mode=$pic_mode
2703 # Does compiler simultaneously support -c and -o options?
2704 compiler_c_o=$compiler_c_o
2706 # Can we write directly to a .lo ?
2707 compiler_o_lo=$compiler_o_lo
2709 # Must we lock files when doing compilation ?
2710 need_locks=$need_locks
2712 # Do we need the lib prefix for modules?
2713 need_lib_prefix=$need_lib_prefix
2715 # Do we need a version for libraries?
2716 need_version=$need_version
2718 # Whether dlopen is supported.
2719 dlopen_support=$enable_dlopen
2721 # Whether dlopen of programs is supported.
2722 dlopen_self=$enable_dlopen_self
2724 # Whether dlopen of statically linked programs is supported.
2725 dlopen_self_static=$enable_dlopen_self_static
2727 # Compiler flag to prevent dynamic linking.
2728 link_static_flag=$link_static_flag
2730 # Compiler flag to turn off builtin functions.
2731 no_builtin_flag=$no_builtin_flag
2733 # Compiler flag to allow reflexive dlopens.
2734 export_dynamic_flag_spec=$export_dynamic_flag_spec
2736 # Compiler flag to generate shared objects directly from archives.
2737 whole_archive_flag_spec=$whole_archive_flag_spec
2739 # Compiler flag to generate thread-safe objects.
2740 thread_safe_flag_spec=$thread_safe_flag_spec
2742 # Library versioning type.
2743 version_type=$version_type
2745 # Format of library name prefix.
2746 libname_spec=$libname_spec
2748 # List of archive names. First name is the real one, the rest are links.
2749 # The last name is the one that the linker finds with -lNAME.
2750 library_names_spec=$library_names_spec
2752 # The coded name of the library, if different from the real name.
2753 soname_spec=$soname_spec
2755 # Commands used to build and install an old-style archive.
2756 RANLIB=$RANLIB
2757 old_archive_cmds=$old_archive_cmds
2758 old_postinstall_cmds=$old_postinstall_cmds
2759 old_postuninstall_cmds=$old_postuninstall_cmds
2761 # Create an old-style archive from a shared archive.
2762 old_archive_from_new_cmds=$old_archive_from_new_cmds
2764 # Create a temporary old-style archive to link instead of a shared archive.
2765 old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2767 # Commands used to build and install a shared archive.
2768 archive_cmds=$archive_cmds
2769 archive_expsym_cmds=$archive_expsym_cmds
2770 postinstall_cmds=$postinstall_cmds
2771 postuninstall_cmds=$postuninstall_cmds
2773 # Commands to strip libraries.
2774 old_striplib=$old_striplib
2775 striplib=$striplib
2777 # Method to check whether dependent libraries are shared objects.
2778 deplibs_check_method=$deplibs_check_method
2780 # Command to use when deplibs_check_method == file_magic.
2781 file_magic_cmd=$file_magic_cmd
2783 # Flag that allows shared libraries with undefined symbols to be built.
2784 allow_undefined_flag=$allow_undefined_flag
2786 # Flag that forces no undefined symbols.
2787 no_undefined_flag=$no_undefined_flag
2789 # Commands used to finish a libtool library installation in a directory.
2790 finish_cmds=$finish_cmds
2792 # Same as above, but a single script fragment to be evaled but not shown.
2793 finish_eval=$finish_eval
2795 # Take the output of nm and produce a listing of raw symbols and C names.
2796 global_symbol_pipe=$global_symbol_pipe
2798 # Transform the output of nm in a proper C declaration
2799 global_symbol_to_cdecl=$global_symbol_to_cdecl
2801 # This is the shared library runtime path variable.
2802 runpath_var=$runpath_var
2804 # This is the shared library path variable.
2805 shlibpath_var=$shlibpath_var
2807 # Is shlibpath searched before the hard-coded library search path?
2808 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2810 # How to hardcode a shared library path into an executable.
2811 hardcode_action=$hardcode_action
2813 # Whether we should hardcode library paths into libraries.
2814 hardcode_into_libs=$hardcode_into_libs
2816 # Flag to hardcode \$libdir into a binary during linking.
2817 # This must work even if \$libdir does not exist.
2818 hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2820 # Whether we need a single -rpath flag with a separated argument.
2821 hardcode_libdir_separator=$hardcode_libdir_separator
2823 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2824 # resulting binary.
2825 hardcode_direct=$hardcode_direct
2827 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2828 # resulting binary.
2829 hardcode_minus_L=$hardcode_minus_L
2831 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2832 # the resulting binary.
2833 hardcode_shlibpath_var=$hardcode_shlibpath_var
2835 # Variables whose values should be saved in libtool wrapper scripts and
2836 # restored at relink time.
2837 variables_saved_for_relink="$variables_saved_for_relink"
2839 # Whether libtool must link a program against all its dependency libraries.
2840 link_all_deplibs=$link_all_deplibs
2842 # Compile-time system search path for libraries
2843 sys_lib_search_path_spec=$sys_lib_search_path_spec
2845 # Run-time system search path for libraries
2846 sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2848 # Fix the shell variable \$srcfile for the compiler.
2849 fix_srcfile_path="$fix_srcfile_path"
2851 # Set to yes if exported symbols are required.
2852 always_export_symbols=$always_export_symbols
2854 # The commands to list exported symbols.
2855 export_symbols_cmds=$export_symbols_cmds
2857 # The commands to extract the exported symbol list from a shared archive.
2858 extract_expsyms_cmds=$extract_expsyms_cmds
2860 # Symbols that should not be listed in the preloaded symbols.
2861 exclude_expsyms=$exclude_expsyms
2863 # Symbols that must always be exported.
2864 include_expsyms=$include_expsyms
2868 case "$ltmain" in
2869 *.sh)
2870 echo '### END LIBTOOL CONFIG' >> "$ofile"
2871 echo >> "$ofile"
2872 case "$host_os" in
2873 aix3*)
2874 cat <<\EOF >> "$ofile"
2876 # AIX sometimes has problems with the GCC collect2 program. For some
2877 # reason, if we set the COLLECT_NAMES environment variable, the problems
2878 # vanish in a puff of smoke.
2879 if test "X${COLLECT_NAMES+set}" != Xset; then
2880 COLLECT_NAMES=
2881 export COLLECT_NAMES
2885 esac
2886 case "$host" in
2887 *-*-cygwin* | *-*-mingw* | *-*-os2*)
2888 cat <<'EOF' >> "$ofile"
2889 # This is a source program that is used to create dlls on Windows
2890 # Don't remove nor modify the starting and closing comments
2891 # /* ltdll.c starts here */
2892 # #define WIN32_LEAN_AND_MEAN
2893 # #include <windows.h>
2894 # #undef WIN32_LEAN_AND_MEAN
2895 # #include <stdio.h>
2897 # #ifndef __CYGWIN__
2898 # # ifdef __CYGWIN32__
2899 # # define __CYGWIN__ __CYGWIN32__
2900 # # endif
2901 # #endif
2903 # #ifdef __cplusplus
2904 # extern "C" {
2905 # #endif
2906 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2907 # #ifdef __cplusplus
2909 # #endif
2911 # #ifdef __CYGWIN__
2912 # #include <cygwin/cygwin_dll.h>
2913 # DECLARE_CYGWIN_DLL( DllMain );
2914 # #endif
2915 # HINSTANCE __hDllInstance_base;
2917 # BOOL APIENTRY
2918 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2920 # __hDllInstance_base = hInst;
2921 # return TRUE;
2923 # /* ltdll.c ends here */
2924 # This is a source program that is used to create import libraries
2925 # on Windows for dlls which lack them. Don't remove nor modify the
2926 # starting and closing comments
2927 # /* impgen.c starts here */
2928 # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
2930 # This file is part of GNU libtool.
2932 # This program is free software; you can redistribute it and/or modify
2933 # it under the terms of the GNU General Public License as published by
2934 # the Free Software Foundation; either version 2 of the License, or
2935 # (at your option) any later version.
2937 # This program is distributed in the hope that it will be useful,
2938 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2939 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2940 # GNU General Public License for more details.
2942 # You should have received a copy of the GNU General Public License
2943 # along with this program; if not, write to the Free Software
2944 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2945 # */
2947 # #include <stdio.h> /* for printf() */
2948 # #include <unistd.h> /* for open(), lseek(), read() */
2949 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
2950 # #include <string.h> /* for strdup() */
2952 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
2953 # #ifndef O_BINARY
2954 # #define O_BINARY 0
2955 # #endif
2957 # static unsigned int
2958 # pe_get16 (fd, offset)
2959 # int fd;
2960 # int offset;
2962 # unsigned char b[2];
2963 # lseek (fd, offset, SEEK_SET);
2964 # read (fd, b, 2);
2965 # return b[0] + (b[1]<<8);
2968 # static unsigned int
2969 # pe_get32 (fd, offset)
2970 # int fd;
2971 # int offset;
2973 # unsigned char b[4];
2974 # lseek (fd, offset, SEEK_SET);
2975 # read (fd, b, 4);
2976 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2979 # static unsigned int
2980 # pe_as32 (ptr)
2981 # void *ptr;
2983 # unsigned char *b = ptr;
2984 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2987 # int
2988 # main (argc, argv)
2989 # int argc;
2990 # char *argv[];
2992 # int dll;
2993 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2994 # unsigned long export_rva, export_size, nsections, secptr, expptr;
2995 # unsigned long name_rvas, nexp;
2996 # unsigned char *expdata, *erva;
2997 # char *filename, *dll_name;
2999 # filename = argv[1];
3001 # dll = open(filename, O_RDONLY|O_BINARY);
3002 # if (!dll)
3003 # return 1;
3005 # dll_name = filename;
3007 # for (i=0; filename[i]; i++)
3008 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
3009 # dll_name = filename + i +1;
3011 # pe_header_offset = pe_get32 (dll, 0x3c);
3012 # opthdr_ofs = pe_header_offset + 4 + 20;
3013 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
3015 # if (num_entries < 1) /* no exports */
3016 # return 1;
3018 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
3019 # export_size = pe_get32 (dll, opthdr_ofs + 100);
3020 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3021 # secptr = (pe_header_offset + 4 + 20 +
3022 # pe_get16 (dll, pe_header_offset + 4 + 16));
3024 # expptr = 0;
3025 # for (i = 0; i < nsections; i++)
3027 # char sname[8];
3028 # unsigned long secptr1 = secptr + 40 * i;
3029 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3030 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3031 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3032 # lseek(dll, secptr1, SEEK_SET);
3033 # read(dll, sname, 8);
3034 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
3036 # expptr = fptr + (export_rva - vaddr);
3037 # if (export_rva + export_size > vaddr + vsize)
3038 # export_size = vsize - (export_rva - vaddr);
3039 # break;
3043 # expdata = (unsigned char*)malloc(export_size);
3044 # lseek (dll, expptr, SEEK_SET);
3045 # read (dll, expdata, export_size);
3046 # erva = expdata - export_rva;
3048 # nexp = pe_as32 (expdata+24);
3049 # name_rvas = pe_as32 (expdata+32);
3051 # printf ("EXPORTS\n");
3052 # for (i = 0; i<nexp; i++)
3054 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3055 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3058 # return 0;
3060 # /* impgen.c ends here */
3064 esac
3067 # Append the ltmain.sh script.
3068 sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
3069 # We use sed instead of cat because bash on DJGPP gets confused if
3070 # if finds mixed CR/LF and LF-only lines. Since sed operates in
3071 # text mode, it properly converts lines to CR/LF. This bash problem
3072 # is reportedly fixed, but why not run on old versions too?
3074 chmod +x "$ofile"
3078 # Compile the libtool program.
3079 echo "FIXME: would compile $ltmain"
3081 esac
3083 test -n "$cache_file" || exit 0
3085 # AC_CACHE_SAVE
3086 trap '' 1 2 15
3087 cat > confcache <<\EOF
3088 # This file is a shell script that caches the results of configure
3089 # tests run on this system so they can be shared between configure
3090 # scripts and configure runs. It is not useful on other systems.
3091 # If it contains results you don't want to keep, you may remove or edit it.
3093 # By default, configure uses ./config.cache as the cache file,
3094 # creating it if it does not exist already. You can give configure
3095 # the --cache-file=FILE option to use a different cache file; that is
3096 # what configure does when it calls configure scripts in
3097 # subdirectories, so they share the cache.
3098 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3099 # config.status only pays attention to the cache file if you give it the
3100 # --recheck option to rerun configure.
3103 # The following way of writing the cache mishandles newlines in values,
3104 # but we know of no workaround that is simple, portable, and efficient.
3105 # So, don't put newlines in cache variables' values.
3106 # Ultrix sh set writes to stderr and can't be redirected directly,
3107 # and sets the high bit in the cache file unless we assign to the vars.
3108 (set) 2>&1 |
3109 case `(ac_space=' '; set | grep ac_space) 2>&1` in
3110 *ac_space=\ *)
3111 # `set' does not quote correctly, so add quotes (double-quote substitution
3112 # turns \\\\ into \\, and sed turns \\ into \).
3113 sed -n \
3114 -e "s/'/'\\\\''/g" \
3115 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3118 # `set' quotes correctly as required by POSIX, so do not add quotes.
3119 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3121 esac >> confcache
3122 if cmp -s $cache_file confcache; then
3124 else
3125 if test -w $cache_file; then
3126 echo "updating cache $cache_file"
3127 cat confcache > $cache_file
3128 else
3129 echo "not updating unwritable cache $cache_file"
3132 rm -f confcache
3134 exit 0
3136 # Local Variables:
3137 # mode:shell-script
3138 # sh-indentation:2
3139 # End: