Initial version of KCM daemon
[heimdal.git] / ltconfig
blobcc814fa3a409ac860a2a1ea15b8515805df3096f
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"; 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 # Set sane defaults for various variables
531 test -z "$AR" && AR=ar
532 test -z "$AR_FLAGS" && AR_FLAGS=cru
533 test -z "$AS" && AS=as
534 test -z "$CC" && CC=cc
535 test -z "$DLLTOOL" && DLLTOOL=dlltool
536 test -z "$MAGIC" && MAGIC=file
537 test -z "$LD" && LD=ld
538 test -z "$LN_S" && LN_S="ln -s"
539 test -z "$NM" && NM=nm
540 test -z "$OBJDUMP" && OBJDUMP=objdump
541 test -z "$RANLIB" && RANLIB=:
542 test -z "$STRIP" && STRIP=:
543 test -z "$objext" && objext=o
545 echo $ac_n "checking for objdir... $ac_c" 1>&6
546 rm -f .libs 2>/dev/null
547 mkdir .libs 2>/dev/null
548 if test -d .libs; then
549 objdir=.libs
550 else
551 # MS-DOS does not allow filenames that begin with a dot.
552 objdir=_libs
554 rmdir .libs 2>/dev/null
555 echo "$ac_t$objdir" 1>&6
557 # Allow CC to be a program name with arguments.
558 set dummy $CC
559 compiler="$2"
561 # We assume here that the value for ac_cv_prog_cc_pic will not be cached
562 # in isolation, and that seeing it set (from the cache) indicates that
563 # the associated values are set (in the cache) correctly too.
564 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
565 echo "$progname:565:checking for $compiler option to produce PIC" 1>&5
566 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
567 echo $ac_n "(cached) $ac_c" 1>&6
568 else
569 ac_cv_prog_cc_pic=
570 ac_cv_prog_cc_shlib=
571 ac_cv_prog_cc_wl=
572 ac_cv_prog_cc_static=
573 ac_cv_prog_cc_no_builtin=
574 ac_cv_prog_cc_can_build_shared=$can_build_shared
576 if test "$with_gcc" = yes; then
577 ac_cv_prog_cc_wl='-Wl,'
578 ac_cv_prog_cc_static='-static'
580 case "$host_os" in
581 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
582 # PIC is the default for these OSes.
584 aix*)
585 # Below there is a dirty hack to force normal static linking with -ldl
586 # The problem is because libdl dynamically linked with both libc and
587 # libC (AIX C++ library), which obviously doesn't included in libraries
588 # list by gcc. This cause undefined symbols with -static flags.
589 # This hack allows C programs to be linked with "-static -ldl", but
590 # we not sure about C++ programs.
591 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
593 cygwin* | mingw* | os2*)
594 # This hack is so that the source file can tell whether it is being
595 # built for inclusion in a dll (and should export symbols for example).
596 ac_cv_prog_cc_pic='-DDLL_EXPORT'
598 amigaos*)
599 # FIXME: we need at least 68020 code to build shared libraries, but
600 # adding the `-m68020' flag to GCC prevents building anything better,
601 # like `-m68040'.
602 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
604 sysv4*MP*)
605 if test -d /usr/nec; then
606 ac_cv_prog_cc_pic=-Kconform_pic
610 ac_cv_prog_cc_pic='-fPIC'
612 esac
613 else
614 # PORTME Check for PIC flags for the system compiler.
615 case "$host_os" in
616 aix3* | aix4*)
617 # All AIX code is PIC.
618 ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
621 hpux9* | hpux10* | hpux11*)
622 # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
623 ac_cv_prog_cc_wl='-Wl,'
624 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
625 ac_cv_prog_cc_pic='+Z'
628 irix5* | irix6*)
629 ac_cv_prog_cc_wl='-Wl,'
630 ac_cv_prog_cc_static='-non_shared'
631 # PIC (with -KPIC) is the default.
634 cygwin* | mingw* | os2*)
635 # This hack is so that the source file can tell whether it is being
636 # built for inclusion in a dll (and should export symbols for example).
637 ac_cv_prog_cc_pic='-DDLL_EXPORT'
640 osf3* | osf4* | osf5*)
641 # All OSF/1 code is PIC.
642 ac_cv_prog_cc_wl='-Wl,'
643 ac_cv_prog_cc_static='-non_shared'
646 sco3.2v5*)
647 ac_cv_prog_cc_pic='-Kpic'
648 ac_cv_prog_cc_static='-dn'
649 ac_cv_prog_cc_shlib='-belf'
652 solaris*)
653 ac_cv_prog_cc_pic='-KPIC'
654 ac_cv_prog_cc_static='-Bstatic'
655 ac_cv_prog_cc_wl='-Wl,'
658 sunos4*)
659 ac_cv_prog_cc_pic='-PIC'
660 ac_cv_prog_cc_static='-Bstatic'
661 ac_cv_prog_cc_wl='-Qoption ld '
664 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
665 ac_cv_prog_cc_pic='-KPIC'
666 ac_cv_prog_cc_static='-Bstatic'
667 ac_cv_prog_cc_wl='-Wl,'
670 uts4*)
671 ac_cv_prog_cc_pic='-pic'
672 ac_cv_prog_cc_static='-Bstatic'
675 sysv4*MP*)
676 if test -d /usr/nec ;then
677 ac_cv_prog_cc_pic='-Kconform_pic'
678 ac_cv_prog_cc_static='-Bstatic'
683 ac_cv_prog_cc_can_build_shared=no
685 esac
688 if test -z "$ac_cv_prog_cc_pic"; then
689 echo "$ac_t"none 1>&6
690 else
691 echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
693 # Check to make sure the pic_flag actually works.
694 echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
695 echo "$progname:695:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
696 if test "X${ac_cv_prog_cc_pic_works+set}" = Xset; then
697 echo $ac_n "(cached) $ac_c" 1>&6
698 else
699 ac_cv_prog_cc_pic_works=yes
700 $rm conftest*
701 echo "int some_variable = 0;" > conftest.c
702 save_CFLAGS="$CFLAGS"
703 CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
704 if { (eval echo $progname:704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
705 # Append any warnings to the config.log.
706 cat conftest.err 1>&5
708 case "$host_os" in
709 hpux9* | hpux10* | hpux11*)
710 # On HP-UX, both CC and GCC only warn that PIC is supported... then
711 # they create non-PIC objects. So, if there were any warnings, we
712 # assume that PIC is not supported.
713 if test -s conftest.err; then
714 ac_cv_prog_cc_pic_works=no
715 ac_cv_prog_cc_can_build_shared=no
716 ac_cv_prog_cc_pic=
717 else
718 ac_cv_prog_cc_pic_works=yes
719 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
723 ac_cv_prog_cc_pic_works=yes
724 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
726 esac
727 else
728 # Append any errors to the config.log.
729 cat conftest.err 1>&5
730 ac_cv_prog_cc_pic_works=no
731 ac_cv_prog_cc_can_build_shared=no
732 ac_cv_prog_cc_pic=
734 CFLAGS="$save_CFLAGS"
735 $rm conftest*
737 # Belt *and* braces to stop my trousers falling down:
738 if test "X$ac_cv_prog_cc_pic_works" = Xno; then
739 ac_cv_prog_cc_pic=
740 ac_cv_prog_cc_can_build_shared=no
742 echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
745 # Check for any special shared library compilation flags.
746 if test -n "$ac_cv_prog_cc_shlib"; then
747 echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
748 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then :
749 else
750 echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
751 ac_cv_prog_cc_can_build_shared=no
755 echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
756 echo "$progname:756: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
757 if test "X${ac_cv_prog_cc_static_works+set}" = Xset; then
758 echo $ac_n "(cached) $ac_c" 1>&6
759 else
760 $rm conftest*
761 echo 'main(){return(0);}' > conftest.c
762 save_LDFLAGS="$LDFLAGS"
763 LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
764 if { (eval echo $progname:764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
765 ac_cv_prog_cc_static_works=yes
766 else
767 ac_cv_prog_cc_static_works=no
768 ac_cv_prog_cc_static=
770 LDFLAGS="$save_LDFLAGS"
771 $rm conftest*
773 # Belt *and* braces to stop my trousers falling down:
774 if test "X$ac_cv_prog_cc_static_works" = Xno; then
775 ac_cv_prog_cc_static=
777 echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
778 pic_flag="$ac_cv_prog_cc_pic"
779 special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
780 wl="$ac_cv_prog_cc_wl"
781 link_static_flag="$ac_cv_prog_cc_static"
782 no_builtin_flag="$ac_cv_prog_cc_no_builtin"
783 can_build_shared="$ac_cv_prog_cc_can_build_shared"
785 # Check to see if options -o and -c are simultaneously supported by compiler
786 echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
787 $rm -r conftest 2>/dev/null
788 mkdir conftest
789 cd conftest
790 $rm conftest*
791 echo "int some_variable = 0;" > conftest.c
792 mkdir out
793 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
794 # that will create temporary files in the current directory regardless of
795 # the output directory. Thus, making CWD read-only will cause this test
796 # to fail, enabling locking or at least warning the user not to do parallel
797 # builds.
798 chmod -w .
799 save_CFLAGS="$CFLAGS"
800 CFLAGS="$CFLAGS -o out/conftest2.o"
801 echo "$progname:801: checking if $compiler supports -c -o file.o" >&5
802 if { (eval echo $progname:802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
804 # The compiler can only warn and ignore the option if not recognized
805 # So say no if there are warnings
806 if test -s out/conftest.err; then
807 echo "$ac_t"no 1>&6
808 compiler_c_o=no
809 else
810 echo "$ac_t"yes 1>&6
811 compiler_c_o=yes
813 else
814 # Append any errors to the config.log.
815 cat out/conftest.err 1>&5
816 compiler_c_o=no
817 echo "$ac_t"no 1>&6
819 CFLAGS="$save_CFLAGS"
820 chmod u+w .
821 $rm conftest* out/*
822 rmdir out
823 cd ..
824 rmdir conftest
825 $rm -r conftest 2>/dev/null
827 if test x"$compiler_c_o" = x"yes"; then
828 # Check to see if we can write to a .lo
829 echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
830 $rm conftest*
831 echo "int some_variable = 0;" > conftest.c
832 save_CFLAGS="$CFLAGS"
833 CFLAGS="$CFLAGS -c -o conftest.lo"
834 echo "$progname:834: checking if $compiler supports -c -o file.lo" >&5
835 if { (eval echo $progname:835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
837 # The compiler can only warn and ignore the option if not recognized
838 # So say no if there are warnings
839 if test -s conftest.err; then
840 echo "$ac_t"no 1>&6
841 compiler_o_lo=no
842 else
843 echo "$ac_t"yes 1>&6
844 compiler_o_lo=yes
846 else
847 # Append any errors to the config.log.
848 cat conftest.err 1>&5
849 compiler_o_lo=no
850 echo "$ac_t"no 1>&6
852 CFLAGS="$save_CFLAGS"
853 $rm conftest*
854 else
855 compiler_o_lo=no
858 # Check to see if we can do hard links to lock some files if needed
859 hard_links="nottested"
860 if test "$compiler_c_o" = no && test "$need_locks" != no; then
861 # do not overwrite the value of need_locks provided by the user
862 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
863 hard_links=yes
864 $rm conftest*
865 ln conftest.a conftest.b 2>/dev/null && hard_links=no
866 touch conftest.a
867 ln conftest.a conftest.b 2>&5 || hard_links=no
868 ln conftest.a conftest.b 2>/dev/null && hard_links=no
869 echo "$ac_t$hard_links" 1>&6
870 $rm conftest*
871 if test "$hard_links" = no; then
872 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
873 need_locks=warn
875 else
876 need_locks=no
879 if test "$with_gcc" = yes; then
880 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
881 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
882 $rm conftest*
883 echo "int some_variable = 0;" > conftest.c
884 save_CFLAGS="$CFLAGS"
885 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
886 echo "$progname:886: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
887 if { (eval echo $progname:887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
889 # The compiler can only warn and ignore the option if not recognized
890 # So say no if there are warnings
891 if test -s conftest.err; then
892 echo "$ac_t"no 1>&6
893 compiler_rtti_exceptions=no
894 else
895 echo "$ac_t"yes 1>&6
896 compiler_rtti_exceptions=yes
898 else
899 # Append any errors to the config.log.
900 cat conftest.err 1>&5
901 compiler_rtti_exceptions=no
902 echo "$ac_t"no 1>&6
904 CFLAGS="$save_CFLAGS"
905 $rm conftest*
907 if test "$compiler_rtti_exceptions" = "yes"; then
908 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
909 else
910 no_builtin_flag=' -fno-builtin'
915 # See if the linker supports building shared libraries.
916 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
918 allow_undefined_flag=
919 no_undefined_flag=
920 need_lib_prefix=unknown
921 need_version=unknown
922 # when you set need_version to no, make sure it does not cause -set_version
923 # flags to be left without arguments
924 archive_cmds=
925 archive_expsym_cmds=
926 old_archive_from_new_cmds=
927 old_archive_from_expsyms_cmds=
928 striplib=
929 old_striplib=
930 export_dynamic_flag_spec=
931 whole_archive_flag_spec=
932 thread_safe_flag_spec=
933 hardcode_into_libs=no
934 hardcode_libdir_flag_spec=
935 hardcode_libdir_separator=
936 hardcode_direct=no
937 hardcode_minus_L=no
938 hardcode_shlibpath_var=unsupported
939 runpath_var=
940 link_all_deplibs=unknown
941 always_export_symbols=no
942 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
943 # include_expsyms should be a list of space-separated symbols to be *always*
944 # included in the symbol list
945 include_expsyms=
946 # exclude_expsyms can be an egrep regular expression of symbols to exclude
947 # it will be wrapped by ` (' and `)$', so one must not match beginning or
948 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
949 # as well as any symbol that contains `d'.
950 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
951 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
952 # platforms (ab)use it in PIC code, but their linkers get confused if
953 # the symbol is explicitly referenced. Since portable code cannot
954 # rely on this symbol name, it's probably fine to never include it in
955 # preloaded symbol tables.
956 extract_expsyms_cmds=
958 case "$host_os" in
959 cygwin* | mingw*)
960 # FIXME: the MSVC++ port hasn't been tested in a loooong time
961 # When not using gcc, we currently assume that we are using
962 # Microsoft Visual C++.
963 if test "$with_gcc" != yes; then
964 with_gnu_ld=no
968 esac
970 ld_shlibs=yes
971 if test "$with_gnu_ld" = yes; then
972 # If archive_cmds runs LD, not CC, wlarc should be empty
973 wlarc='${wl}'
975 # See if GNU ld supports shared libraries.
976 case "$host_os" in
977 aix3* | aix4*)
978 # On AIX, the GNU linker is very broken
979 ld_shlibs=no
980 cat <<EOF 1>&2
982 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
983 *** to be unable to reliably create shared libraries on AIX.
984 *** Therefore, libtool is disabling shared libraries support. If you
985 *** really care for shared libraries, you may want to modify your PATH
986 *** so that a non-GNU linker is found, and then restart.
991 amigaos*)
992 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)'
993 hardcode_libdir_flag_spec='-L$libdir'
994 hardcode_minus_L=yes
996 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
997 # that the semantics of dynamic libraries on AmigaOS, at least up
998 # to version 4, is to share data among multiple programs linked
999 # with the same dynamic library. Since this doesn't match the
1000 # behavior of shared libraries on other platforms, we can use
1001 # them.
1002 ld_shlibs=no
1005 beos*)
1006 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1007 allow_undefined_flag=unsupported
1008 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1009 # support --undefined. This deserves some investigation. FIXME
1010 archive_cmds='$CC -nostart $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1011 else
1012 ld_shlibs=no
1016 cygwin* | mingw*)
1017 # hardcode_libdir_flag_spec is actually meaningless, as there is
1018 # no search path for DLLs.
1019 hardcode_libdir_flag_spec='-L$libdir'
1020 allow_undefined_flag=unsupported
1021 always_export_symbols=yes
1023 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1024 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
1025 test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1026 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1027 else $CC -o impgen impgen.c ; fi)~
1028 $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
1030 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1032 # cygwin and mingw dlls have different entry points and sets of symbols
1033 # to exclude.
1034 # FIXME: what about values for MSVC?
1035 dll_entry=__cygwin_dll_entry@12
1036 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1037 case "$host_os" in
1038 mingw*)
1039 # mingw values
1040 dll_entry=_DllMainCRTStartup@12
1041 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1043 esac
1045 # mingw and cygwin differ, and it's simplest to just exclude the union
1046 # of the two symbol sets.
1047 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1049 # recent cygwin and mingw systems supply a stub DllMain which the user
1050 # can override, but on older systems we have to supply one (in ltdll.c)
1051 if test "x$lt_cv_need_dllmain" = "xyes"; then
1052 ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
1053 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~
1054 test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1055 else
1056 ltdll_obj=
1057 ltdll_cmds=
1060 # Extract the symbol export list from an `--export-all' def file,
1061 # then regenerate the def file from the symbol export list, so that
1062 # the compiled dll only exports the symbol export list.
1063 # Be careful not to strip the DATA tag left be newer dlltools.
1064 export_symbols_cmds="$ltdll_cmds"'
1065 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1066 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1068 # If DATA tags from a recent dlltool are present, honour them!
1069 archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
1070 _lt_hint=1;
1071 cat $export_symbols | while read symbol; do
1072 set dummy \$symbol;
1073 case \$# in
1074 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1075 *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
1076 esac;
1077 _lt_hint=`expr 1 + \$_lt_hint`;
1078 done~
1079 '"$ltdll_cmds"'
1080 $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~
1081 $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~
1082 $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~
1083 $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~
1084 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1087 netbsd*)
1088 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1089 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1090 wlarc=
1091 else
1092 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1093 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1097 solaris* | sysv5*)
1098 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1099 ld_shlibs=no
1100 cat <<EOF 1>&2
1102 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1103 *** create shared libraries on Solaris systems. Therefore, libtool
1104 *** is disabling shared libraries support. We urge you to upgrade GNU
1105 *** binutils to release 2.9.1 or newer. Another option is to modify
1106 *** your PATH or compiler configuration so that the native linker is
1107 *** used, and then restart.
1110 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1111 archive_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1112 archive_expsym_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1113 else
1114 ld_shlibs=no
1118 sunos4*)
1119 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1120 wlarc=
1121 hardcode_direct=yes
1122 hardcode_shlibpath_var=no
1126 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1127 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1128 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1129 else
1130 ld_shlibs=no
1133 esac
1135 if test "$ld_shlibs" = yes; then
1136 runpath_var=LD_RUN_PATH
1137 hardcode_libdir_flag_spec="$wlarc"'--rpath '"$wlarc"'$libdir'
1138 export_dynamic_flag_spec="$wlarc"'--export-dynamic'
1139 case $host_os in
1140 cygwin* | mingw*)
1141 # dlltool doesn't understand --whole-archive et. al.
1142 whole_archive_flag_spec=
1145 # ancient GNU ld didn't support --whole-archive et. al.
1146 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1147 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1148 else
1149 whole_archive_flag_spec=
1152 esac
1154 else
1155 # PORTME fill in a description of your system's linker (not GNU ld)
1156 case "$host_os" in
1157 aix3*)
1158 allow_undefined_flag=unsupported
1159 always_export_symbols=yes
1160 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'
1161 # Note: this linker hardcodes the directories in LIBPATH if there
1162 # are no directories specified by -L.
1163 hardcode_minus_L=yes
1164 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1165 # Neither direct hardcoding nor static linking is supported with a
1166 # broken collect2.
1167 hardcode_direct=unsupported
1171 aix4*)
1172 hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
1173 hardcode_libdir_separator=':'
1174 if test "$with_gcc" = yes; then
1175 collect2name=`${CC} -print-prog-name=collect2`
1176 if test -f "$collect2name" && \
1177 strings "$collect2name" | grep resolve_lib_name >/dev/null
1178 then
1179 # We have reworked collect2
1180 hardcode_direct=yes
1181 else
1182 # We have old collect2
1183 hardcode_direct=unsupported
1184 # It fails to find uninstalled libraries when the uninstalled
1185 # path is not listed in the libpath. Setting hardcode_minus_L
1186 # to unsupported forces relinking
1187 hardcode_minus_L=yes
1188 hardcode_libdir_flag_spec='-L$libdir'
1189 hardcode_libdir_separator=
1191 shared_flag='-shared'
1192 else
1193 shared_flag='${wl}-bM:SRE'
1194 hardcode_direct=yes
1196 allow_undefined_flag=' ${wl}-berok'
1197 archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
1198 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
1199 case "$host_os" in aix4.[01]|aix4.[01].*)
1200 # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
1201 always_export_symbols=yes ;;
1202 esac
1205 amigaos*)
1206 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)'
1207 hardcode_libdir_flag_spec='-L$libdir'
1208 hardcode_minus_L=yes
1209 # see comment about different semantics on the GNU ld section
1210 ld_shlibs=no
1213 cygwin* | mingw*)
1214 # When not using gcc, we currently assume that we are using
1215 # Microsoft Visual C++.
1216 # hardcode_libdir_flag_spec is actually meaningless, as there is
1217 # no search path for DLLs.
1218 hardcode_libdir_flag_spec=' '
1219 allow_undefined_flag=unsupported
1220 # Tell ltmain to make .lib files, not .a files.
1221 libext=lib
1222 # FIXME: Setting linknames here is a bad hack.
1223 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1224 # The linker will automatically build a .lib file if we build a DLL.
1225 old_archive_from_new_cmds='true'
1226 # FIXME: Should let the user specify the lib program.
1227 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1228 fix_srcfile_path='`cygpath -w $srcfile`'
1231 freebsd1*)
1232 ld_shlibs=no
1235 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1236 # support. Future versions do this automatically, but an explicit c++rt0.o
1237 # does not break anything, and helps significantly (at the cost of a little
1238 # extra space).
1239 freebsd2.2*)
1240 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1241 hardcode_libdir_flag_spec='-R$libdir'
1242 hardcode_direct=yes
1243 hardcode_shlibpath_var=no
1246 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1247 freebsd2*)
1248 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1249 hardcode_direct=yes
1250 hardcode_minus_L=yes
1251 hardcode_shlibpath_var=no
1254 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1255 freebsd*)
1256 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1257 hardcode_libdir_flag_spec='-R$libdir'
1258 hardcode_direct=yes
1259 hardcode_shlibpath_var=no
1262 hpux9* | hpux10* | hpux11*)
1263 case "$host_os" in
1264 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' ;;
1265 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1266 esac
1267 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1268 hardcode_libdir_separator=:
1269 hardcode_direct=yes
1270 hardcode_minus_L=yes # Not in the search PATH, but as the default
1271 # location of the library.
1272 export_dynamic_flag_spec='${wl}-E'
1275 irix5* | irix6*)
1276 if test "$with_gcc" = yes; then
1277 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'
1278 else
1279 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'
1281 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1282 hardcode_libdir_separator=:
1283 link_all_deplibs=yes
1286 netbsd*)
1287 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1288 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
1289 else
1290 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
1292 hardcode_libdir_flag_spec='${wl}-R$libdir'
1293 hardcode_direct=yes
1294 hardcode_shlibpath_var=no
1297 openbsd*)
1298 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1299 hardcode_libdir_flag_spec='-R$libdir'
1300 hardcode_direct=yes
1301 hardcode_shlibpath_var=no
1304 os2*)
1305 hardcode_libdir_flag_spec='-L$libdir'
1306 hardcode_minus_L=yes
1307 allow_undefined_flag=unsupported
1308 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'
1309 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1312 osf3*)
1313 if test "$with_gcc" = yes; then
1314 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1315 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'
1316 else
1317 allow_undefined_flag=' -expect_unresolved \*'
1318 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'
1320 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1321 hardcode_libdir_separator=:
1324 osf4* | osf5*) # as osf3* with the addition of -msym flag
1325 if test "$with_gcc" = yes; then
1326 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1327 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'
1328 else
1329 allow_undefined_flag=' -expect_unresolved \*'
1330 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'
1332 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1333 hardcode_libdir_separator=:
1335 rhapsody*)
1336 archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts'
1337 hardcode_libdir_flags_spec='-L$libdir'
1338 hardcode_direct=yes
1339 hardcode_shlibpath_var=no
1342 sco3.2v5*)
1343 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1344 hardcode_shlibpath_var=no
1345 runpath_var=LD_RUN_PATH
1346 hardcode_runpath_var=yes
1349 solaris*)
1350 no_undefined_flag=' -z text'
1351 # $CC -shared without GNU ld will not create a library from C++
1352 # object files and a static libstdc++, better avoid it by now
1353 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1354 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1355 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1356 hardcode_libdir_flag_spec='-R$libdir'
1357 hardcode_shlibpath_var=no
1358 case "$host_os" in
1359 solaris2.[0-5] | solaris2.[0-5].*) ;;
1360 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1361 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1362 esac
1363 link_all_deplibs=yes
1366 sunos4*)
1367 if test "x$host_vendor" = xsequent; then
1368 # Use $CC to link under sequent, because it throws in some extra .o
1369 # files that make .init and .fini sections work.
1370 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts'
1371 else
1372 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1374 hardcode_libdir_flag_spec='-L$libdir'
1375 hardcode_direct=yes
1376 hardcode_minus_L=yes
1377 hardcode_shlibpath_var=no
1380 sysv4)
1381 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1382 runpath_var='LD_RUN_PATH'
1383 hardcode_shlibpath_var=no
1384 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
1387 sysv4.3*)
1388 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1389 hardcode_shlibpath_var=no
1390 export_dynamic_flag_spec='-Bexport'
1393 sysv5*)
1394 no_undefined_flag=' -z text'
1395 # $CC -shared without GNU ld will not create a library from C++
1396 # object files and a static libstdc++, better avoid it by now
1397 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1398 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1399 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1400 hardcode_libdir_flag_spec=
1401 hardcode_shlibpath_var=no
1402 runpath_var='LD_RUN_PATH'
1405 uts4*)
1406 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1407 hardcode_libdir_flag_spec='-L$libdir'
1408 hardcode_shlibpath_var=no
1411 dgux*)
1412 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1413 hardcode_libdir_flag_spec='-L$libdir'
1414 hardcode_shlibpath_var=no
1417 sysv4*MP*)
1418 if test -d /usr/nec; then
1419 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1420 hardcode_shlibpath_var=no
1421 runpath_var=LD_RUN_PATH
1422 hardcode_runpath_var=yes
1423 ld_shlibs=yes
1427 sysv4.2uw2*)
1428 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
1429 hardcode_direct=yes
1430 hardcode_minus_L=no
1431 hardcode_shlibpath_var=no
1432 hardcode_runpath_var=yes
1433 runpath_var=LD_RUN_PATH
1436 unixware7*)
1437 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1438 runpath_var='LD_RUN_PATH'
1439 hardcode_shlibpath_var=no
1443 ld_shlibs=no
1445 esac
1447 echo "$ac_t$ld_shlibs" 1>&6
1448 test "$ld_shlibs" = no && can_build_shared=no
1450 # Check hardcoding attributes.
1451 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1452 hardcode_action=
1453 if test -n "$hardcode_libdir_flag_spec" || \
1454 test -n "$runpath_var"; then
1456 # We can hardcode non-existant directories.
1457 if test "$hardcode_direct" != no &&
1458 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1459 # have to relink, otherwise we might link with an installed library
1460 # when we should be linking with a yet-to-be-installed one
1461 ## test "$hardcode_shlibpath_var" != no &&
1462 test "$hardcode_minus_L" != no; then
1463 # Linking always hardcodes the temporary library directory.
1464 hardcode_action=relink
1465 else
1466 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1467 hardcode_action=immediate
1469 else
1470 # We cannot hardcode anything, or else we can only hardcode existing
1471 # directories.
1472 hardcode_action=unsupported
1474 echo "$ac_t$hardcode_action" 1>&6
1476 echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
1477 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1478 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1479 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1480 echo "${ac_t}yes" 1>&6
1481 else
1482 echo "${ac_t}no" 1>&6
1485 reload_cmds='$LD$reload_flag -o $output$reload_objs'
1486 test -z "$deplibs_check_method" && deplibs_check_method=unknown
1488 # PORTME Fill in your ld.so characteristics
1489 library_names_spec=
1490 libname_spec='lib$name'
1491 soname_spec=
1492 postinstall_cmds=
1493 postuninstall_cmds=
1494 finish_cmds=
1495 finish_eval=
1496 shlibpath_var=
1497 shlibpath_overrides_runpath=unknown
1498 version_type=none
1499 dynamic_linker="$host_os ld.so"
1500 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1501 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1503 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1504 case "$host_os" in
1505 aix3*)
1506 version_type=linux
1507 library_names_spec='${libname}${release}.so$versuffix $libname.a'
1508 shlibpath_var=LIBPATH
1510 # AIX has no versioning support, so we append a major version to the name.
1511 soname_spec='${libname}${release}.so$major'
1514 aix4*)
1515 version_type=linux
1516 # AIX has no versioning support, so currently we can not hardcode correct
1517 # soname into executable. Probably we can add versioning support to
1518 # collect2, so additional links can be useful in future.
1519 # We preserve .a as extension for shared libraries though AIX4.2
1520 # and later linker supports .so
1521 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
1522 shlibpath_var=LIBPATH
1525 amigaos*)
1526 library_names_spec='$libname.ixlibrary $libname.a'
1527 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1528 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'
1531 beos*)
1532 library_names_spec='${libname}.so'
1533 dynamic_linker="$host_os ld.so"
1534 shlibpath_var=LIBRARY_PATH
1535 lt_cv_dlopen="load_add_on"
1536 lt_cv_dlopen_libs=
1537 lt_cv_dlopen_self=yes
1540 bsdi4*)
1541 version_type=linux
1542 need_version=no
1543 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1544 soname_spec='${libname}${release}.so$major'
1545 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1546 shlibpath_var=LD_LIBRARY_PATH
1547 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1548 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1549 export_dynamic_flag_spec=-rdynamic
1550 # the default ld.so.conf also contains /usr/contrib/lib and
1551 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1552 # libtool to hard-code these into programs
1555 cygwin* | mingw*)
1556 version_type=windows
1557 need_version=no
1558 need_lib_prefix=no
1559 if test "$with_gcc" = yes; then
1560 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
1561 else
1562 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1564 dynamic_linker='Win32 ld.exe'
1565 # FIXME: first we should search . and the directory the executable is in
1566 shlibpath_var=PATH
1567 lt_cv_dlopen="LoadLibrary"
1568 lt_cv_dlopen_libs=
1571 freebsd1*)
1572 dynamic_linker=no
1575 freebsd*)
1576 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1577 version_type=freebsd-$objformat
1578 case "$version_type" in
1579 freebsd-elf*)
1580 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1581 need_version=no
1582 need_lib_prefix=no
1584 freebsd-*)
1585 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1586 need_version=yes
1588 esac
1589 shlibpath_var=LD_LIBRARY_PATH
1590 case "$host_os" in
1591 freebsd2*)
1592 shlibpath_overrides_runpath=yes
1594 freebsd3.[01]* | freebsdelf3.[01]*)
1595 shlibpath_overrides_runpath=yes
1596 hardcode_into_libs=yes
1598 *) # from 3.2 on
1599 shlibpath_overrides_runpath=no
1600 hardcode_into_libs=yes
1602 esac
1605 gnu*)
1606 version_type=linux
1607 need_lib_prefix=no
1608 need_version=no
1609 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1610 soname_spec='${libname}${release}.so$major'
1611 shlibpath_var=LD_LIBRARY_PATH
1612 hardcode_into_libs=yes
1615 hpux9* | hpux10* | hpux11*)
1616 # Give a soname corresponding to the major version so that dld.sl refuses to
1617 # link against other versions.
1618 dynamic_linker="$host_os dld.sl"
1619 version_type=sunos
1620 need_lib_prefix=no
1621 need_version=no
1622 shlibpath_var=SHLIB_PATH
1623 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1624 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1625 soname_spec='${libname}${release}.sl$major'
1626 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1627 postinstall_cmds='chmod 555 $lib'
1630 irix5* | irix6*)
1631 version_type=irix
1632 need_lib_prefix=no
1633 need_version=no
1634 soname_spec='${libname}${release}.so.$major'
1635 library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
1636 case "$host_os" in
1637 irix5*)
1638 libsuff= shlibsuff=
1641 case "$LD" in # libtool.m4 will add one of these switches to LD
1642 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1643 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1644 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1645 *) libsuff= shlibsuff= libmagic=never-match;;
1646 esac
1648 esac
1649 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1650 shlibpath_overrides_runpath=no
1651 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1652 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1655 # No shared lib support for Linux oldld, aout, or coff.
1656 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1657 dynamic_linker=no
1660 # This must be Linux ELF.
1661 linux-gnu*)
1662 version_type=linux
1663 need_lib_prefix=no
1664 need_version=no
1665 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1666 soname_spec='${libname}${release}.so$major'
1667 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1668 shlibpath_var=LD_LIBRARY_PATH
1669 shlibpath_overrides_runpath=no
1670 # This implies no fast_install, which is unacceptable.
1671 # Some rework will be needed to allow for fast_install
1672 # before this can be enabled.
1673 hardcode_into_libs=yes
1675 # We used to test for /lib/ld.so.1 and disable shared libraries on
1676 # powerpc, because MkLinux only supported shared libraries with the
1677 # GNU dynamic linker. Since this was broken with cross compilers,
1678 # most powerpc-linux boxes support dynamic linking these days and
1679 # people can always --disable-shared, the test was removed, and we
1680 # assume the GNU/Linux dynamic linker is in use.
1681 dynamic_linker='GNU/Linux ld.so'
1684 netbsd*)
1685 version_type=sunos
1686 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1687 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1688 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1689 dynamic_linker='NetBSD (a.out) ld.so'
1690 else
1691 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1692 soname_spec='${libname}${release}.so$major'
1693 dynamic_linker='NetBSD ld.elf_so'
1695 shlibpath_var=LD_LIBRARY_PATH
1698 openbsd*)
1699 version_type=sunos
1700 if test "$with_gnu_ld" = yes; then
1701 need_lib_prefix=no
1702 need_version=no
1704 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1705 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1706 shlibpath_var=LD_LIBRARY_PATH
1709 os2*)
1710 libname_spec='$name'
1711 need_lib_prefix=no
1712 library_names_spec='$libname.dll $libname.a'
1713 dynamic_linker='OS/2 ld.exe'
1714 shlibpath_var=LIBPATH
1717 osf3* | osf4* | osf5*)
1718 version_type=osf
1719 need_version=no
1720 soname_spec='${libname}${release}.so'
1721 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1722 shlibpath_var=LD_LIBRARY_PATH
1723 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1724 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1727 rhapsody*)
1728 version_type=sunos
1729 library_names_spec='${libname}.so'
1730 soname_spec='${libname}.so'
1731 shlibpath_var=DYLD_LIBRARY_PATH
1732 deplibs_check_method=pass_all
1735 sco3.2v5*)
1736 version_type=osf
1737 soname_spec='${libname}${release}.so$major'
1738 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1739 shlibpath_var=LD_LIBRARY_PATH
1742 solaris*)
1743 version_type=linux
1744 need_lib_prefix=no
1745 need_version=no
1746 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1747 soname_spec='${libname}${release}.so$major'
1748 shlibpath_var=LD_LIBRARY_PATH
1749 shlibpath_overrides_runpath=yes
1750 hardcode_into_libs=yes
1751 # ldd complains unless libraries are executable
1752 postinstall_cmds='chmod +x $lib'
1755 sunos4*)
1756 version_type=sunos
1757 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1758 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1759 shlibpath_var=LD_LIBRARY_PATH
1760 shlibpath_overrides_runpath=yes
1761 if test "$with_gnu_ld" = yes; then
1762 need_lib_prefix=no
1764 need_version=yes
1767 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1768 version_type=linux
1769 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1770 soname_spec='${libname}${release}.so$major'
1771 shlibpath_var=LD_LIBRARY_PATH
1772 case "$host_vendor" in
1773 sequent)
1774 file_magic_cmd='/bin/file'
1775 deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
1777 motorola)
1778 need_lib_prefix=no
1779 need_version=no
1780 shlibpath_overrides_runpath=no
1781 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1783 esac
1786 uts4*)
1787 version_type=linux
1788 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1789 soname_spec='${libname}${release}.so$major'
1790 shlibpath_var=LD_LIBRARY_PATH
1793 dgux*)
1794 version_type=linux
1795 need_lib_prefix=no
1796 need_version=no
1797 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1798 soname_spec='${libname}${release}.so$major'
1799 shlibpath_var=LD_LIBRARY_PATH
1802 sysv4*MP*)
1803 if test -d /usr/nec ;then
1804 version_type=linux
1805 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1806 soname_spec='$libname.so.$major'
1807 shlibpath_var=LD_LIBRARY_PATH
1812 dynamic_linker=no
1814 esac
1815 echo "$ac_t$dynamic_linker" 1>&6
1816 test "$dynamic_linker" = no && can_build_shared=no
1818 # Check for command to grab the raw symbol name followed by C symbol from nm.
1819 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1821 # These are sane defaults that work on at least a few old systems.
1822 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1824 # Character class describing NM global symbol codes.
1825 symcode='[BCDEGRST]'
1827 # Regexp to match symbols that can be accessed directly from C.
1828 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1830 # Transform the above into a raw symbol and a C symbol.
1831 symxfrm='\1 \2\3 \3'
1833 # Transform an extracted symbol line into a proper C declaration
1834 global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1836 # Define system-specific variables.
1837 case "$host_os" in
1838 aix*)
1839 symcode='[BCDT]'
1841 cygwin* | mingw*)
1842 symcode='[ABCDGISTW]'
1844 hpux*) # Its linker distinguishes data from code symbols
1845 global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1847 irix*)
1848 symcode='[BCDEGRST]'
1850 solaris* | sysv5*)
1851 symcode='[BDT]'
1853 sysv4)
1854 symcode='[DFNSTU]'
1856 esac
1858 # Handle CRLF in mingw too chain
1859 opt_cr=
1860 case "$host_os" in
1861 mingw*)
1862 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1864 esac
1866 # If we're using GNU nm, then use its standard symbol codes.
1867 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1868 symcode='[ABCDGISTW]'
1871 # Try without a prefix undercore, then with it.
1872 for ac_symprfx in "" "_"; do
1874 # Write the raw and C identifiers.
1875 global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1877 # Check to see that the pipe works correctly.
1878 pipe_works=no
1879 $rm conftest*
1880 cat > conftest.c <<EOF
1881 #ifdef __cplusplus
1882 extern "C" {
1883 #endif
1884 char nm_test_var;
1885 void nm_test_func(){}
1886 #ifdef __cplusplus
1888 #endif
1889 main(){nm_test_var='a';nm_test_func();return(0);}
1892 echo "$progname:1892: checking if global_symbol_pipe works" >&5
1893 if { (eval echo $progname:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1894 # Now try to grab the symbols.
1895 nlist=conftest.nm
1896 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
1898 # Try sorting and uniquifying the output.
1899 if sort "$nlist" | uniq > "$nlist"T; then
1900 mv -f "$nlist"T "$nlist"
1901 else
1902 rm -f "$nlist"T
1905 # Make sure that we snagged all the symbols we need.
1906 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1907 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1908 cat <<EOF > conftest.c
1909 #ifdef __cplusplus
1910 extern "C" {
1911 #endif
1914 # Now generate the symbol file.
1915 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
1917 cat <<EOF >> conftest.c
1918 #if defined (__STDC__) && __STDC__
1919 # define lt_ptr_t void *
1920 #else
1921 # define lt_ptr_t char *
1922 # define const
1923 #endif
1925 /* The mapping between symbol names and symbols. */
1926 const struct {
1927 const char *name;
1928 lt_ptr_t address;
1930 lt_preloaded_symbols[] =
1933 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
1934 cat <<\EOF >> conftest.c
1935 {0, (lt_ptr_t) 0}
1938 #ifdef __cplusplus
1940 #endif
1942 # Now try linking the two files.
1943 mv conftest.$objext conftstm.$objext
1944 save_LIBS="$LIBS"
1945 save_CFLAGS="$CFLAGS"
1946 LIBS="conftstm.$objext"
1947 CFLAGS="$CFLAGS$no_builtin_flag"
1948 if { (eval echo $progname:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1949 pipe_works=yes
1950 else
1951 echo "$progname: failed program was:" >&5
1952 cat conftest.c >&5
1954 LIBS="$save_LIBS"
1955 else
1956 echo "cannot find nm_test_func in $nlist" >&5
1958 else
1959 echo "cannot find nm_test_var in $nlist" >&5
1961 else
1962 echo "cannot run $global_symbol_pipe" >&5
1964 else
1965 echo "$progname: failed program was:" >&5
1966 cat conftest.c >&5
1968 $rm conftest* conftst*
1970 # Do not use the global_symbol_pipe unless it works.
1971 if test "$pipe_works" = yes; then
1972 break
1973 else
1974 global_symbol_pipe=
1976 done
1977 if test "$pipe_works" = yes; then
1978 echo "${ac_t}ok" 1>&6
1979 else
1980 echo "${ac_t}failed" 1>&6
1983 if test -z "$global_symbol_pipe"; then
1984 global_symbol_to_cdecl=
1987 # Report the final consequences.
1988 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1990 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1991 # configure.in, otherwise build static only libraries.
1992 case "$host_os" in
1993 cygwin* | mingw* | os2*)
1994 if test x$can_build_shared = xyes; then
1995 test x$enable_win32_dll = xno && can_build_shared=no
1996 echo "checking if package supports dlls... $can_build_shared" 1>&6
1999 esac
2001 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
2002 test "$can_build_shared" = "no" && enable_shared=no
2004 # On AIX, shared libraries and static libraries use the same namespace, and
2005 # are all built from PIC.
2006 case "$host_os" in
2007 aix3*)
2008 test "$enable_shared" = yes && enable_static=no
2009 if test -n "$RANLIB"; then
2010 archive_cmds="$archive_cmds~\$RANLIB \$lib"
2011 postinstall_cmds='$RANLIB $lib'
2015 aix4*)
2016 test "$enable_shared" = yes && enable_static=no
2018 esac
2020 echo "$ac_t$enable_shared" 1>&6
2022 # Make sure either enable_shared or enable_static is yes.
2023 test "$enable_shared" = yes || enable_static=yes
2025 echo "checking whether to build static libraries... $enable_static" 1>&6
2027 if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
2028 # Fast installation is not supported
2029 enable_fast_install=no
2030 elif test "$shlibpath_overrides_runpath" = yes ||
2031 test "$enable_shared" = no; then
2032 # Fast installation is not necessary
2033 enable_fast_install=needless
2036 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2037 if test "$with_gcc" = yes; then
2038 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2041 # Check whether we must set pic_mode to default
2042 test -z "$pic_flag" && pic_mode=default
2044 if test "x$enable_dlopen" != xyes; then
2045 enable_dlopen=unknown
2046 enable_dlopen_self=unknown
2047 enable_dlopen_self_static=unknown
2048 else
2049 if test "X${lt_cv_dlopen+set}" != Xset; then
2050 lt_cv_dlopen=no lt_cv_dlopen_libs=
2051 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2052 echo "$progname:2052: checking for dlopen in -ldl" >&5
2053 if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
2054 echo $ac_n "(cached) $ac_c" 1>&6
2055 else
2056 ac_save_LIBS="$LIBS"
2057 LIBS="-ldl $LIBS"
2058 cat > conftest.$ac_ext <<EOF
2059 #line 2059 "ltconfig"
2060 /* Override any gcc2 internal prototype to avoid an error. */
2061 /* We use char because int might match the return type of a gcc2
2062 builtin and then its argument prototype would still apply. */
2063 #ifdef __cplusplus
2064 extern "C"
2065 #endif
2066 char dlopen();
2068 int main() {
2069 dlopen()
2070 ; return 0; }
2072 if { (eval echo $progname:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2073 rm -rf conftest*
2074 ac_cv_lib_dl_dlopen=yes
2075 else
2076 echo "$progname: failed program was:" >&5
2077 cat conftest.$ac_ext >&5
2078 rm -rf conftest*
2079 ac_cv_lib_dl_dlopen=no
2081 rm -f conftest*
2082 LIBS="$ac_save_LIBS"
2085 if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
2086 echo "$ac_t""yes" 1>&6
2087 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
2088 else
2089 echo "$ac_t""no" 1>&6
2090 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
2091 echo "$progname:2091: checking for dlopen" >&5
2092 if test "X${ac_cv_func_dlopen+set}" = Xset; then
2093 echo $ac_n "(cached) $ac_c" 1>&6
2094 else
2095 cat > conftest.$ac_ext <<EOF
2096 #line 2096 "ltconfig"
2097 /* System header to define __stub macros and hopefully few prototypes,
2098 which can conflict with char dlopen(); below. */
2099 #include <assert.h>
2100 /* Override any gcc2 internal prototype to avoid an error. */
2101 /* We use char because int might match the return type of a gcc2
2102 builtin and then its argument prototype would still apply. */
2103 #ifdef __cplusplus
2104 extern "C"
2105 #endif
2106 char dlopen();
2108 int main() {
2110 /* The GNU C library defines this for functions which it implements
2111 to always fail with ENOSYS. Some functions are actually named
2112 something starting with __ and the normal name is an alias. */
2113 #if defined (__stub_dlopen) || defined (__stub___dlopen)
2114 choke me
2115 #else
2116 dlopen();
2117 #endif
2119 ; return 0; }
2121 if { (eval echo $progname:2121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2122 rm -rf conftest*
2123 ac_cv_func_dlopen=yes
2124 else
2125 echo "$progname: failed program was:" >&5
2126 cat conftest.$ac_ext >&5
2127 rm -rf conftest*
2128 ac_cv_func_dlopen=no
2130 rm -f conftest*
2132 if test "X$ac_cv_func_dlopen" = Xyes; then
2133 echo "$ac_t""yes" 1>&6
2134 lt_cv_dlopen="dlopen"
2135 else
2136 echo "$ac_t""no" 1>&6
2137 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
2138 echo "$progname:2138: checking for dld_link in -ldld" >&5
2139 if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
2140 echo $ac_n "(cached) $ac_c" 1>&6
2141 else
2142 ac_save_LIBS="$LIBS"
2143 LIBS="-ldld $LIBS"
2144 cat > conftest.$ac_ext <<EOF
2145 #line 2145 "ltconfig"
2146 /* Override any gcc2 internal prototype to avoid an error. */
2147 /* We use char because int might match the return type of a gcc2
2148 builtin and then its argument prototype would still apply. */
2149 #ifdef __cplusplus
2150 extern "C"
2151 #endif
2152 char dld_link();
2154 int main() {
2155 dld_link()
2156 ; return 0; }
2158 if { (eval echo $progname:2158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2159 rm -rf conftest*
2160 ac_cv_lib_dld_dld_link=yes
2161 else
2162 echo "$progname: failed program was:" >&5
2163 cat conftest.$ac_ext >&5
2164 rm -rf conftest*
2165 ac_cv_lib_dld_dld_link=no
2167 rm -f conftest*
2168 LIBS="$ac_save_LIBS"
2171 if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
2172 echo "$ac_t""yes" 1>&6
2173 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
2174 else
2175 echo "$ac_t""no" 1>&6
2176 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
2177 echo "$progname:2177: checking for shl_load" >&5
2178 if test "X${ac_cv_func_shl_load+set}" = Xset; then
2179 echo $ac_n "(cached) $ac_c" 1>&6
2180 else
2181 cat > conftest.$ac_ext <<EOF
2182 #line 2182 "ltconfig"
2183 /* System header to define __stub macros and hopefully few prototypes,
2184 which can conflict with char shl_load(); below. */
2185 #include <assert.h>
2186 /* Override any gcc2 internal prototype to avoid an error. */
2187 /* We use char because int might match the return type of a gcc2
2188 builtin and then its argument prototype would still apply. */
2189 #ifdef __cplusplus
2190 extern "C"
2191 #endif
2192 char shl_load();
2194 int main() {
2196 /* The GNU C library defines this for functions which it implements
2197 to always fail with ENOSYS. Some functions are actually named
2198 something starting with __ and the normal name is an alias. */
2199 #if defined (__stub_shl_load) || defined (__stub___shl_load)
2200 choke me
2201 #else
2202 shl_load();
2203 #endif
2205 ; return 0; }
2207 if { (eval echo $progname:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2208 rm -rf conftest*
2209 ac_cv_func_shl_load=yes
2210 else
2211 echo "$progname: failed program was:" >&5
2212 cat conftest.$ac_ext >&5
2213 rm -rf conftest*
2214 ac_cv_func_shl_load=no
2216 rm -f conftest*
2219 if test "X$ac_cv_func_shl_load" = Xyes; then
2220 echo "$ac_t""yes" 1>&6
2221 lt_cv_dlopen="shl_load"
2222 else
2223 echo "$ac_t""no" 1>&6
2224 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2225 echo "$progname:2225: checking for shl_load in -ldld" >&5
2226 if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
2227 echo $ac_n "(cached) $ac_c" 1>&6
2228 else
2229 ac_save_LIBS="$LIBS"
2230 LIBS="-ldld $LIBS"
2231 cat > conftest.$ac_ext <<EOF
2232 #line 2232 "ltconfig"
2233 #include "confdefs.h"
2234 /* Override any gcc2 internal prototype to avoid an error. */
2235 /* We use char because int might match the return type of a gcc2
2236 builtin and then its argument prototype would still apply. */
2237 #ifdef __cplusplus
2238 extern "C"
2239 #endif
2240 char shl_load();
2242 int main() {
2243 shl_load()
2244 ; return 0; }
2246 if { (eval echo $progname:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2247 rm -rf conftest*
2248 ac_cv_lib_dld_shl_load=yes
2249 else
2250 echo "$progname: failed program was:" >&5
2251 cat conftest.$ac_ext >&5
2252 rm -rf conftest*
2253 ac_cv_lib_dld_shl_load=no
2255 rm -f conftest*
2256 LIBS="$ac_save_LIBS"
2259 if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
2260 echo "$ac_t""yes" 1>&6
2261 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
2262 else
2263 echo "$ac_t""no" 1>&6
2280 if test "x$lt_cv_dlopen" != xno; then
2281 enable_dlopen=yes
2284 case "$lt_cv_dlopen" in
2285 dlopen)
2286 for ac_hdr in dlfcn.h; do
2287 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2288 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2289 echo "$progname:2289: checking for $ac_hdr" >&5
2290 if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
2291 echo $ac_n "(cached) $ac_c" 1>&6
2292 else
2293 cat > conftest.$ac_ext <<EOF
2294 #line 2294 "ltconfig"
2295 #include <$ac_hdr>
2296 int fnord = 0;
2297 int main () { return (0); }
2299 ac_try="$ac_compile >/dev/null 2>conftest.out"
2300 { (eval echo $progname:2300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2301 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2302 if test -z "$ac_err"; then
2303 rm -rf conftest*
2304 eval "ac_cv_header_$ac_safe=yes"
2305 else
2306 echo "$ac_err" >&5
2307 echo "$progname: failed program was:" >&5
2308 cat conftest.$ac_ext >&5
2309 rm -rf conftest*
2310 eval "ac_cv_header_$ac_safe=no"
2312 rm -f conftest*
2314 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2315 echo "$ac_t""yes" 1>&6
2316 else
2317 echo "$ac_t""no" 1>&6
2319 done
2321 if test "x$ac_cv_header_dlfcn_h" = xyes; then
2322 CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2324 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2325 LIBS="$lt_cv_dlopen_libs $LIBS"
2327 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
2328 echo "$progname:2328: checking whether a program can dlopen itself" >&5
2329 if test "X${lt_cv_dlopen_self+set}" = Xset; then
2330 echo $ac_n "(cached) $ac_c" 1>&6
2331 else
2332 if test "$cross_compiling" = yes; then
2333 lt_cv_dlopen_self=cross
2334 else
2335 cat > conftest.c <<EOF
2336 #line 2336 "ltconfig"
2338 #if HAVE_DLFCN_H
2339 #include <dlfcn.h>
2340 #endif
2342 #include <stdio.h>
2344 #ifdef RTLD_GLOBAL
2345 # define LTDL_GLOBAL RTLD_GLOBAL
2346 #else
2347 # ifdef DL_GLOBAL
2348 # define LTDL_GLOBAL DL_GLOBAL
2349 # else
2350 # define LTDL_GLOBAL 0
2351 # endif
2352 #endif
2354 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2355 find out it does not work in some platform. */
2356 #ifndef LTDL_LAZY_OR_NOW
2357 # ifdef RTLD_LAZY
2358 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2359 # else
2360 # ifdef DL_LAZY
2361 # define LTDL_LAZY_OR_NOW DL_LAZY
2362 # else
2363 # ifdef RTLD_NOW
2364 # define LTDL_LAZY_OR_NOW RTLD_NOW
2365 # else
2366 # ifdef DL_NOW
2367 # define LTDL_LAZY_OR_NOW DL_NOW
2368 # else
2369 # define LTDL_LAZY_OR_NOW 0
2370 # endif
2371 # endif
2372 # endif
2373 # endif
2374 #endif
2376 fnord() { int i=42;}
2377 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2378 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2379 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2382 if { (eval echo $progname:2382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2383 then
2384 lt_cv_dlopen_self=yes
2385 else
2386 echo "$progname: failed program was:" >&5
2387 cat conftest.$ac_ext >&5
2388 rm -fr conftest*
2389 lt_cv_dlopen_self=no
2391 rm -fr conftest*
2396 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2398 if test "$lt_cv_dlopen_self" = yes; then
2399 LDFLAGS="$LDFLAGS $link_static_flag"
2400 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2401 echo "$progname:2401: checking whether a statically linked program can dlopen itself" >&5
2402 if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
2403 echo $ac_n "(cached) $ac_c" 1>&6
2404 else
2405 if test "$cross_compiling" = yes; then
2406 lt_cv_dlopen_self_static=cross
2407 else
2408 cat > conftest.c <<EOF
2409 #line 2409 "ltconfig"
2411 #if HAVE_DLFCN_H
2412 #include <dlfcn.h>
2413 #endif
2415 #include <stdio.h>
2417 #ifdef RTLD_GLOBAL
2418 # define LTDL_GLOBAL RTLD_GLOBAL
2419 #else
2420 # ifdef DL_GLOBAL
2421 # define LTDL_GLOBAL DL_GLOBAL
2422 # else
2423 # define LTDL_GLOBAL 0
2424 # endif
2425 #endif
2427 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2428 find out it does not work in some platform. */
2429 #ifndef LTDL_LAZY_OR_NOW
2430 # ifdef RTLD_LAZY
2431 # define LTDL_LAZY_OR_NOW RTLD_LAZY
2432 # else
2433 # ifdef DL_LAZY
2434 # define LTDL_LAZY_OR_NOW DL_LAZY
2435 # else
2436 # ifdef RTLD_NOW
2437 # define LTDL_LAZY_OR_NOW RTLD_NOW
2438 # else
2439 # ifdef DL_NOW
2440 # define LTDL_LAZY_OR_NOW DL_NOW
2441 # else
2442 # define LTDL_LAZY_OR_NOW 0
2443 # endif
2444 # endif
2445 # endif
2446 # endif
2447 #endif
2449 fnord() { int i=42;}
2450 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2451 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2452 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2455 if { (eval echo $progname:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2456 then
2457 lt_cv_dlopen_self_static=yes
2458 else
2459 echo "$progname: failed program was:" >&5
2460 cat conftest.$ac_ext >&5
2461 rm -fr conftest*
2462 lt_cv_dlopen_self_static=no
2464 rm -fr conftest*
2469 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2472 esac
2474 case "$lt_cv_dlopen_self" in
2475 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2476 *) enable_dlopen_self=unknown ;;
2477 esac
2479 case "$lt_cv_dlopen_self_static" in
2480 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2481 *) enable_dlopen_self_static=unknown ;;
2482 esac
2485 # Copy echo and quote the copy, instead of the original, because it is
2486 # used later.
2487 ltecho="$echo"
2488 if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2489 ltecho="$CONFIG_SHELL \$0 --fallback-echo"
2491 LTSHELL="$SHELL"
2493 LTCONFIG_VERSION="$VERSION"
2495 # Only quote variables if we're using ltmain.sh.
2496 case "$ltmain" in
2497 *.sh)
2498 # Now quote all the things that may contain metacharacters.
2499 for var in ltecho old_AR old_ARFLAGS old_CC old_CFLAGS old_CPPFLAGS \
2500 old_MAGIC old_LD old_LDFLAGS old_LIBS \
2501 old_LN_S old_NM old_RANLIB old_STRIP \
2502 old_AS old_DLLTOOL old_OBJDUMP \
2503 old_OBJEXT old_EXEEXT old_reload_flag \
2504 old_deplibs_check_method old_file_magic_cmd \
2505 AR AR_FLAGS CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2506 reload_flag reload_cmds wl \
2507 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2508 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2509 library_names_spec soname_spec \
2510 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2511 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2512 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2513 old_striplib striplib file_magic_cmd export_symbols_cmds \
2514 deplibs_check_method allow_undefined_flag no_undefined_flag \
2515 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2516 hardcode_libdir_flag_spec hardcode_libdir_separator \
2517 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2518 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2520 case "$var" in
2521 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2522 old_postinstall_cmds | old_postuninstall_cmds | \
2523 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2524 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2525 postinstall_cmds | postuninstall_cmds | \
2526 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2527 # Double-quote double-evaled strings.
2528 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test
2531 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
2533 esac
2534 done
2536 case "$ltecho" in
2537 *'\$0 --fallback-echo"')
2538 ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2540 esac
2542 trap "$rm \"$ofile\"; exit 1" 1 2 15
2543 echo "creating $ofile"
2544 $rm "$ofile"
2545 cat <<EOF > "$ofile"
2546 #! $SHELL
2548 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2549 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2550 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2552 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2553 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2555 # This program is free software; you can redistribute it and/or modify
2556 # it under the terms of the GNU General Public License as published by
2557 # the Free Software Foundation; either version 2 of the License, or
2558 # (at your option) any later version.
2560 # This program is distributed in the hope that it will be useful, but
2561 # WITHOUT ANY WARRANTY; without even the implied warranty of
2562 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2563 # General Public License for more details.
2565 # You should have received a copy of the GNU General Public License
2566 # along with this program; if not, write to the Free Software
2567 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2569 # As a special exception to the GNU General Public License, if you
2570 # distribute this file as part of a program that contains a
2571 # configuration script generated by Autoconf, you may include it under
2572 # the same distribution terms that you use for the rest of that program.
2574 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2575 Xsed="sed -e s/^X//"
2577 # The HP-UX ksh and POSIX shell print the target directory to stdout
2578 # if CDPATH is set.
2579 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2581 ### BEGIN LIBTOOL CONFIG
2583 cfgfile="$ofile"
2587 # Double-quote the variables that need it (for aesthetics).
2588 for var in old_AR old_AR_FLAGS old_CC old_CFLAGS old_CPPFLAGS \
2589 old_MAGIC old_LD old_LDFLAGS old_LIBS \
2590 old_LN_S old_NM old_RANLIB old_STRIP \
2591 old_AS old_DLLTOOL old_OBJDUMP \
2592 old_OBJEXT old_EXEEXT old_reload_flag \
2593 old_deplibs_check_method old_file_magic_cmd; do
2594 eval "$var=\\\"\$var\\\""
2595 done
2597 # Just create a config file.
2598 cfgfile="$ofile.cfg"
2599 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2600 echo "creating $cfgfile"
2601 $rm "$cfgfile"
2602 cat <<EOF > "$cfgfile"
2603 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2604 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2607 esac
2609 cat <<EOF >> "$cfgfile"
2610 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2612 # AR=$old_AR AR_FLAGS=$old_AR_FLAGS CC=$old_CC CFLAGS=$old_CFLAGS \\
2613 # CPPFLAGS=$old_CPPFLAGS MAGIC=$old_MAGIC LD=$old_LD LDFLAGS=$old_LDFLAGS \\
2614 # LIBS=$old_LIBS LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB \\
2615 # STRIP=$old_STRIP AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2616 # objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2617 # deplibs_check_method=$old_deplibs_check_method file_magic_cmd=$old_file_magic_cmd \\
2618 # $0$ltconfig_args
2620 # Compiler and other test output produced by $progname, useful for
2621 # debugging $progname, is in ./config.log if it exists.
2622 # The version of $progname that generated this script.
2623 LTCONFIG_VERSION=$LTCONFIG_VERSION
2625 # Shell to use when invoking shell scripts.
2626 SHELL=$LTSHELL
2628 # Whether or not to build shared libraries.
2629 build_libtool_libs=$enable_shared
2631 # Whether or not to build static libraries.
2632 build_old_libs=$enable_static
2634 # Whether or not to optimize for fast installation.
2635 fast_install=$enable_fast_install
2637 # The host system.
2638 host_alias=$host_alias
2639 host=$host
2641 # An echo program that does not interpret backslashes.
2642 echo=$ltecho
2644 # The archiver.
2645 AR=$AR
2646 AR_FLAGS=$AR_FLAGS
2648 # The default C compiler.
2649 CC=$CC
2651 # The linker used to build libraries.
2652 LD=$LD
2654 # Whether we need hard or soft links.
2655 LN_S=$LN_S
2657 # A BSD-compatible nm program.
2658 NM=$NM
2660 # A symbol stripping program
2661 STRIP=$STRIP
2663 # Used to examine libraries when file_magic_cmd begins "file"
2664 MAGIC=$MAGIC
2666 # Used on cygwin: DLL creation program.
2667 DLLTOOL="$DLLTOOL"
2669 # Used on cygwin: object dumper.
2670 OBJDUMP="$OBJDUMP"
2672 # Used on cygwin: assembler.
2673 AS="$AS"
2675 # The name of the directory that contains temporary libtool files.
2676 objdir=$objdir
2678 # How to create reloadable object files.
2679 reload_flag=$reload_flag
2680 reload_cmds=$reload_cmds
2682 # How to pass a linker flag through the compiler.
2683 wl=$wl
2685 # Object file suffix (normally "o").
2686 objext="$objext"
2688 # Old archive suffix (normally "a").
2689 libext="$libext"
2691 # Executable file suffix (normally "").
2692 exeext="$exeext"
2694 # Additional compiler flags for building library objects.
2695 pic_flag=$pic_flag
2696 pic_mode=$pic_mode
2698 # Does compiler simultaneously support -c and -o options?
2699 compiler_c_o=$compiler_c_o
2701 # Can we write directly to a .lo ?
2702 compiler_o_lo=$compiler_o_lo
2704 # Must we lock files when doing compilation ?
2705 need_locks=$need_locks
2707 # Do we need the lib prefix for modules?
2708 need_lib_prefix=$need_lib_prefix
2710 # Do we need a version for libraries?
2711 need_version=$need_version
2713 # Whether dlopen is supported.
2714 dlopen_support=$enable_dlopen
2716 # Whether dlopen of programs is supported.
2717 dlopen_self=$enable_dlopen_self
2719 # Whether dlopen of statically linked programs is supported.
2720 dlopen_self_static=$enable_dlopen_self_static
2722 # Compiler flag to prevent dynamic linking.
2723 link_static_flag=$link_static_flag
2725 # Compiler flag to turn off builtin functions.
2726 no_builtin_flag=$no_builtin_flag
2728 # Compiler flag to allow reflexive dlopens.
2729 export_dynamic_flag_spec=$export_dynamic_flag_spec
2731 # Compiler flag to generate shared objects directly from archives.
2732 whole_archive_flag_spec=$whole_archive_flag_spec
2734 # Compiler flag to generate thread-safe objects.
2735 thread_safe_flag_spec=$thread_safe_flag_spec
2737 # Library versioning type.
2738 version_type=$version_type
2740 # Format of library name prefix.
2741 libname_spec=$libname_spec
2743 # List of archive names. First name is the real one, the rest are links.
2744 # The last name is the one that the linker finds with -lNAME.
2745 library_names_spec=$library_names_spec
2747 # The coded name of the library, if different from the real name.
2748 soname_spec=$soname_spec
2750 # Commands used to build and install an old-style archive.
2751 RANLIB=$RANLIB
2752 old_archive_cmds=$old_archive_cmds
2753 old_postinstall_cmds=$old_postinstall_cmds
2754 old_postuninstall_cmds=$old_postuninstall_cmds
2756 # Create an old-style archive from a shared archive.
2757 old_archive_from_new_cmds=$old_archive_from_new_cmds
2759 # Create a temporary old-style archive to link instead of a shared archive.
2760 old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2762 # Commands used to build and install a shared archive.
2763 archive_cmds=$archive_cmds
2764 archive_expsym_cmds=$archive_expsym_cmds
2765 postinstall_cmds=$postinstall_cmds
2766 postuninstall_cmds=$postuninstall_cmds
2768 # Commands to strip libraries.
2769 old_striplib=$old_striplib
2770 striplib=$striplib
2772 # Method to check whether dependent libraries are shared objects.
2773 deplibs_check_method=$deplibs_check_method
2775 # Command to use when deplibs_check_method == file_magic.
2776 file_magic_cmd=$file_magic_cmd
2778 # Flag that allows shared libraries with undefined symbols to be built.
2779 allow_undefined_flag=$allow_undefined_flag
2781 # Flag that forces no undefined symbols.
2782 no_undefined_flag=$no_undefined_flag
2784 # Commands used to finish a libtool library installation in a directory.
2785 finish_cmds=$finish_cmds
2787 # Same as above, but a single script fragment to be evaled but not shown.
2788 finish_eval=$finish_eval
2790 # Take the output of nm and produce a listing of raw symbols and C names.
2791 global_symbol_pipe=$global_symbol_pipe
2793 # Transform the output of nm in a proper C declaration
2794 global_symbol_to_cdecl=$global_symbol_to_cdecl
2796 # This is the shared library runtime path variable.
2797 runpath_var=$runpath_var
2799 # This is the shared library path variable.
2800 shlibpath_var=$shlibpath_var
2802 # Is shlibpath searched before the hard-coded library search path?
2803 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2805 # How to hardcode a shared library path into an executable.
2806 hardcode_action=$hardcode_action
2808 # Whether we should hardcode library paths into libraries.
2809 hardcode_into_libs=$hardcode_into_libs
2811 # Flag to hardcode \$libdir into a binary during linking.
2812 # This must work even if \$libdir does not exist.
2813 hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2815 # Whether we need a single -rpath flag with a separated argument.
2816 hardcode_libdir_separator=$hardcode_libdir_separator
2818 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2819 # resulting binary.
2820 hardcode_direct=$hardcode_direct
2822 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2823 # resulting binary.
2824 hardcode_minus_L=$hardcode_minus_L
2826 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2827 # the resulting binary.
2828 hardcode_shlibpath_var=$hardcode_shlibpath_var
2830 # Variables whose values should be saved in libtool wrapper scripts and
2831 # restored at relink time.
2832 variables_saved_for_relink="$variables_saved_for_relink"
2834 # Whether libtool must link a program against all its dependency libraries.
2835 link_all_deplibs=$link_all_deplibs
2837 # Compile-time system search path for libraries
2838 sys_lib_search_path_spec=$sys_lib_search_path_spec
2840 # Run-time system search path for libraries
2841 sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2843 # Fix the shell variable \$srcfile for the compiler.
2844 fix_srcfile_path="$fix_srcfile_path"
2846 # Set to yes if exported symbols are required.
2847 always_export_symbols=$always_export_symbols
2849 # The commands to list exported symbols.
2850 export_symbols_cmds=$export_symbols_cmds
2852 # The commands to extract the exported symbol list from a shared archive.
2853 extract_expsyms_cmds=$extract_expsyms_cmds
2855 # Symbols that should not be listed in the preloaded symbols.
2856 exclude_expsyms=$exclude_expsyms
2858 # Symbols that must always be exported.
2859 include_expsyms=$include_expsyms
2863 case "$ltmain" in
2864 *.sh)
2865 echo '### END LIBTOOL CONFIG' >> "$ofile"
2866 echo >> "$ofile"
2867 case "$host_os" in
2868 aix3*)
2869 cat <<\EOF >> "$ofile"
2871 # AIX sometimes has problems with the GCC collect2 program. For some
2872 # reason, if we set the COLLECT_NAMES environment variable, the problems
2873 # vanish in a puff of smoke.
2874 if test "X${COLLECT_NAMES+set}" != Xset; then
2875 COLLECT_NAMES=
2876 export COLLECT_NAMES
2880 esac
2881 case "$host" in
2882 *-*-cygwin* | *-*-mingw* | *-*-os2*)
2883 cat <<'EOF' >> "$ofile"
2884 # This is a source program that is used to create dlls on Windows
2885 # Don't remove nor modify the starting and closing comments
2886 # /* ltdll.c starts here */
2887 # #define WIN32_LEAN_AND_MEAN
2888 # #include <windows.h>
2889 # #undef WIN32_LEAN_AND_MEAN
2890 # #include <stdio.h>
2892 # #ifndef __CYGWIN__
2893 # # ifdef __CYGWIN32__
2894 # # define __CYGWIN__ __CYGWIN32__
2895 # # endif
2896 # #endif
2898 # #ifdef __cplusplus
2899 # extern "C" {
2900 # #endif
2901 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2902 # #ifdef __cplusplus
2904 # #endif
2906 # #ifdef __CYGWIN__
2907 # #include <cygwin/cygwin_dll.h>
2908 # DECLARE_CYGWIN_DLL( DllMain );
2909 # #endif
2910 # HINSTANCE __hDllInstance_base;
2912 # BOOL APIENTRY
2913 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2915 # __hDllInstance_base = hInst;
2916 # return TRUE;
2918 # /* ltdll.c ends here */
2919 # This is a source program that is used to create import libraries
2920 # on Windows for dlls which lack them. Don't remove nor modify the
2921 # starting and closing comments
2922 # /* impgen.c starts here */
2923 # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
2925 # This file is part of GNU libtool.
2927 # This program is free software; you can redistribute it and/or modify
2928 # it under the terms of the GNU General Public License as published by
2929 # the Free Software Foundation; either version 2 of the License, or
2930 # (at your option) any later version.
2932 # This program is distributed in the hope that it will be useful,
2933 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2934 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2935 # GNU General Public License for more details.
2937 # You should have received a copy of the GNU General Public License
2938 # along with this program; if not, write to the Free Software
2939 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2940 # */
2942 # #include <stdio.h> /* for printf() */
2943 # #include <unistd.h> /* for open(), lseek(), read() */
2944 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
2945 # #include <string.h> /* for strdup() */
2947 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
2948 # #ifndef O_BINARY
2949 # #define O_BINARY 0
2950 # #endif
2952 # static unsigned int
2953 # pe_get16 (fd, offset)
2954 # int fd;
2955 # int offset;
2957 # unsigned char b[2];
2958 # lseek (fd, offset, SEEK_SET);
2959 # read (fd, b, 2);
2960 # return b[0] + (b[1]<<8);
2963 # static unsigned int
2964 # pe_get32 (fd, offset)
2965 # int fd;
2966 # int offset;
2968 # unsigned char b[4];
2969 # lseek (fd, offset, SEEK_SET);
2970 # read (fd, b, 4);
2971 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2974 # static unsigned int
2975 # pe_as32 (ptr)
2976 # void *ptr;
2978 # unsigned char *b = ptr;
2979 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2982 # int
2983 # main (argc, argv)
2984 # int argc;
2985 # char *argv[];
2987 # int dll;
2988 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2989 # unsigned long export_rva, export_size, nsections, secptr, expptr;
2990 # unsigned long name_rvas, nexp;
2991 # unsigned char *expdata, *erva;
2992 # char *filename, *dll_name;
2994 # filename = argv[1];
2996 # dll = open(filename, O_RDONLY|O_BINARY);
2997 # if (!dll)
2998 # return 1;
3000 # dll_name = filename;
3002 # for (i=0; filename[i]; i++)
3003 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
3004 # dll_name = filename + i +1;
3006 # pe_header_offset = pe_get32 (dll, 0x3c);
3007 # opthdr_ofs = pe_header_offset + 4 + 20;
3008 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
3010 # if (num_entries < 1) /* no exports */
3011 # return 1;
3013 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
3014 # export_size = pe_get32 (dll, opthdr_ofs + 100);
3015 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3016 # secptr = (pe_header_offset + 4 + 20 +
3017 # pe_get16 (dll, pe_header_offset + 4 + 16));
3019 # expptr = 0;
3020 # for (i = 0; i < nsections; i++)
3022 # char sname[8];
3023 # unsigned long secptr1 = secptr + 40 * i;
3024 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3025 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3026 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3027 # lseek(dll, secptr1, SEEK_SET);
3028 # read(dll, sname, 8);
3029 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
3031 # expptr = fptr + (export_rva - vaddr);
3032 # if (export_rva + export_size > vaddr + vsize)
3033 # export_size = vsize - (export_rva - vaddr);
3034 # break;
3038 # expdata = (unsigned char*)malloc(export_size);
3039 # lseek (dll, expptr, SEEK_SET);
3040 # read (dll, expdata, export_size);
3041 # erva = expdata - export_rva;
3043 # nexp = pe_as32 (expdata+24);
3044 # name_rvas = pe_as32 (expdata+32);
3046 # printf ("EXPORTS\n");
3047 # for (i = 0; i<nexp; i++)
3049 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3050 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3053 # return 0;
3055 # /* impgen.c ends here */
3059 esac
3062 # Append the ltmain.sh script.
3063 sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
3064 # We use sed instead of cat because bash on DJGPP gets confused if
3065 # if finds mixed CR/LF and LF-only lines. Since sed operates in
3066 # text mode, it properly converts lines to CR/LF. This bash problem
3067 # is reportedly fixed, but why not run on old versions too?
3069 chmod +x "$ofile"
3073 # Compile the libtool program.
3074 echo "FIXME: would compile $ltmain"
3076 esac
3078 test -n "$cache_file" || exit 0
3080 # AC_CACHE_SAVE
3081 trap '' 1 2 15
3082 cat > confcache <<\EOF
3083 # This file is a shell script that caches the results of configure
3084 # tests run on this system so they can be shared between configure
3085 # scripts and configure runs. It is not useful on other systems.
3086 # If it contains results you don't want to keep, you may remove or edit it.
3088 # By default, configure uses ./config.cache as the cache file,
3089 # creating it if it does not exist already. You can give configure
3090 # the --cache-file=FILE option to use a different cache file; that is
3091 # what configure does when it calls configure scripts in
3092 # subdirectories, so they share the cache.
3093 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3094 # config.status only pays attention to the cache file if you give it the
3095 # --recheck option to rerun configure.
3098 # The following way of writing the cache mishandles newlines in values,
3099 # but we know of no workaround that is simple, portable, and efficient.
3100 # So, don't put newlines in cache variables' values.
3101 # Ultrix sh set writes to stderr and can't be redirected directly,
3102 # and sets the high bit in the cache file unless we assign to the vars.
3103 (set) 2>&1 |
3104 case `(ac_space=' '; set | grep ac_space) 2>&1` in
3105 *ac_space=\ *)
3106 # `set' does not quote correctly, so add quotes (double-quote substitution
3107 # turns \\\\ into \\, and sed turns \\ into \).
3108 sed -n \
3109 -e "s/'/'\\\\''/g" \
3110 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3113 # `set' quotes correctly as required by POSIX, so do not add quotes.
3114 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3116 esac >> confcache
3117 if cmp -s $cache_file confcache; then
3119 else
3120 if test -w $cache_file; then
3121 echo "updating cache $cache_file"
3122 cat confcache > $cache_file
3123 else
3124 echo "not updating unwritable cache $cache_file"
3127 rm -f confcache
3129 exit 0
3131 # Local Variables:
3132 # mode:shell-script
3133 # sh-indentation:2
3134 # End: