source: trunk/MagicSoft/AMC/activemirrorcontrol/admin/ltconfig@ 9463

Last change on this file since 9463 was 3403, checked in by merck, 21 years ago
initial check-in of AMC software
File size: 78.7 KB
Line 
1#! /bin/sh
2
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
6#
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.
11#
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.
16#
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.
20#
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.
25
26# A lot of this script is taken from autoconf-2.10.
27
28# Check that we are running under the correct shell.
29SHELL=${CONFIG_SHELL-/bin/sh}
30echo=echo
31if test "X$1" = X--no-reexec; then
32 # Discard the --no-reexec flag, and continue.
33 shift
34elif test "X$1" = X--fallback-echo; then
35 # Avoid inline document here, it may be left over
36 :
37elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
38 # Yippee, $echo works!
39 :
40else
41 # Restart under the correct shell.
42 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
43fi
44
45if test "X$1" = X--fallback-echo; then
46 # used as fallback echo
47 shift
48 cat <<EOF
49$*
50EOF
51 exit 0
52fi
53
54# Find the correct PATH separator. Usually this is `:', but
55# DJGPP uses `;' like DOS.
56if 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
62fi
63
64# The HP-UX ksh and POSIX shell print the target directory to stdout
65# if CDPATH is set.
66if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
67
68if 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
76 fi
77 done
78fi
79
80if 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
83 :
84else
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'
88 #
89 # So, first we look for a working echo in the user's PATH.
90
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
99 fi
100 done
101 IFS="$save_ifs"
102
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
125 :
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=:
143
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
147 fi
148 prev="$cmd"
149 done
150
151 if test "$prev" != 'sed 50q "$0"'; then
152 echo_test_string=`eval $prev`
153
154 export echo_test_string
155 exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"}
156 else
157 # Oops. We lost completely, so just stick with echo.
158 echo=echo
159 fi
160 fi
161 fi
162 fi
163fi
164
165# Sed substitution that helps us do robust quoting. It backslashifies
166# metacharacters that are still active within double-quoted strings.
167Xsed='sed -e s/^X//'
168sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
169
170# Same as above, but do not quote variable references.
171double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
172
173# Sed substitution to delay expansion of an escaped shell variable in a
174# double_quote_subst'ed string.
175delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
176
177# The name of this program.
178progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
179
180# Constants:
181PROGRAM=ltconfig
182PACKAGE=libtool
183VERSION=1.4a
184TIMESTAMP=" (1.641.2.179mm 2001/01/08 01:59:19)"
185ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
186ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
187rm="rm -f"
188
189help="Try \`$progname --help' for more information."
190
191# Global variables:
192default_ofile=libtool
193can_build_shared=yes
194enable_shared=yes
195# All known linkers require a `.a' archive for static linking (except M$VC,
196# which needs '.lib').
197enable_static=yes
198enable_fast_install=yes
199enable_dlopen=unknown
200enable_win32_dll=no
201pic_mode=default
202ltmain=
203silent=
204srcdir=
205ac_config_guess=
206ac_config_sub=
207host=
208build=NONE
209nonopt=NONE
210ofile="$default_ofile"
211verify_host=yes
212tagname=
213with_gcc=no
214with_gnu_ld=no
215need_locks=yes
216ac_ext=c
217libext=a
218cache_file=
219
220## Dependencies to place before and after the object being linked:
221predep_objects=
222postdep_objects=
223predeps=
224postdeps=
225compiler_lib_search_path=
226
227## Link characteristics:
228allow_undefined_flag=
229no_undefined_flag=
230need_lib_prefix=unknown
231need_version=unknown
232# when you set need_version to no, make sure it does not cause -set_version
233# flags to be left without arguments
234archive_cmds=
235archive_expsym_cmds=
236old_archive_from_new_cmds=
237old_archive_from_expsyms_cmds=
238striplib=
239old_striplib=
240export_dynamic_flag_spec=
241whole_archive_flag_spec=
242thread_safe_flag_spec=
243hardcode_into_libs=no
244hardcode_libdir_flag_spec=
245hardcode_libdir_separator=
246hardcode_direct=no
247hardcode_minus_L=no
248hardcode_shlibpath_var=unsupported
249runpath_var=
250link_all_deplibs=unknown
251always_export_symbols=no
252export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
253# include_expsyms should be a list of space-separated symbols to be *always*
254# included in the symbol list
255include_expsyms=
256# exclude_expsyms can be an egrep regular expression of symbols to exclude
257# it will be wrapped by ` (' and `)$', so one must not match beginning or
258# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
259# as well as any symbol that contains `d'.
260exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
261# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
262# platforms (ab)use it in PIC code, but their linkers get confused if
263# the symbol is explicitly referenced. Since portable code cannot
264# rely on this symbol name, it's probably fine to never include it in
265# preloaded symbol tables.
266extract_expsyms_cmds=
267
268## Tools:
269old_AR="$AR"
270old_AR_FLAGS="$AR_FLAGS"
271old_CC="$CC"
272old_CFLAGS="$CFLAGS"
273old_CPPFLAGS="$CPPFLAGS"
274old_LDFLAGS="$LDFLAGS"
275old_LIBS="$LIBS"
276old_MAGIC_CMD="$MAGIC_CMD"
277old_LD="$LD"
278old_LN_S="$LN_S"
279old_LTCC="$LTCC"
280old_NM="$NM"
281old_RANLIB="$RANLIB"
282old_STRIP="$STRIP"
283old_AS="$AS"
284old_DLLTOOL="$DLLTOOL"
285old_OBJDUMP="$OBJDUMP"
286old_OBJEXT="$OBJEXT"
287old_EXEEXT="$EXEEXT"
288old_reload_flag="$reload_flag"
289old_deplibs_check_method="$deplibs_check_method"
290old_file_magic_cmd="$file_magic_cmd"
291
292# Parse the command line options.
293args=
294prev=
295for option
296do
297 case "$option" in
298 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
299 *) optarg= ;;
300 esac
301
302 # If the previous option needs an argument, assign it.
303 if test -n "$prev"; then
304 eval "$prev=\$option"
305 prev=
306 continue
307 fi
308
309 case "$option" in
310 --help) cat <<EOM
311Usage: $progname [OPTION]... LTMAIN [HOST]
312
313Generate a system-specific libtool script.
314
315 --build configure for building on BUILD [BUILD=HOST]
316 --debug enable verbose shell tracing
317 --disable-shared do not build shared libraries
318 --disable-static do not build static libraries
319 --disable-fast-install do not optimize for fast installation
320 --enable-dlopen enable dlopen support
321 --enable-win32-dll enable building dlls on win32 hosts
322 --help display this help and exit
323 --no-verify do not verify that HOST is a valid host type
324-o, --output=FILE specify the output file [default=$default_ofile]
325 --quiet same as \`--silent'
326 --silent do not print informational messages
327 --srcdir=DIR find \`config.guess' in DIR
328 --version output version information and exit
329 --add-tag=TAG append an alternate configuration
330 --with-gcc assume that the GNU C compiler will be used
331 --with-gnu-ld assume that the C compiler uses the GNU linker
332 --prefer-pic try to use only PIC objects
333 --prefer-non-pic try to use only non-PIC objects
334 --disable-lock disable file locking
335 --cache-file=FILE configure cache file
336
337LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
338that provides basic libtool functionality.
339
340HOST is the canonical host system name [default=guessed].
341EOM
342 exit 0
343 ;;
344
345 --build) prev=build ;;
346 --build=*) build="$optarg" ;;
347
348 --debug)
349 echo "$progname: enabling shell trace mode"
350 set -x
351 ;;
352
353 --disable-shared) enable_shared=no ;;
354
355 --disable-static) enable_static=no ;;
356
357 --disable-fast-install) enable_fast_install=no ;;
358
359 --enable-dlopen) enable_dlopen=yes ;;
360
361 --enable-win32-dll) enable_win32_dll=yes ;;
362
363 --quiet | --silent) silent=yes ;;
364
365 --srcdir) prev=srcdir ;;
366 --srcdir=*) srcdir="$optarg" ;;
367
368 --no-verify) verify_host=no ;;
369
370 --output | -o) prev=ofile ;;
371 --output=*) ofile="$optarg" ;;
372
373 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
374
375 --add-tag) prev=tagname ;;
376 --add-tag=*) tagname="$optarg" ;;
377
378 --with-gcc) with_gcc=yes ;;
379 --with-gnu-ld) with_gnu_ld=yes ;;
380
381 --prefer-pic) pic_mode=yes ;;
382 --prefer-non-pic) pic_mode=no ;;
383
384 --disable-lock) need_locks=no ;;
385
386 --cache-file=*) cache_file="$optarg" ;;
387
388 -*)
389 echo "$progname: unrecognized option \`$option'" 1>&2
390 echo "$help" 1>&2
391 exit 1
392 ;;
393
394 *)
395 if test -z "$ltmain"; then
396 ltmain="$option"
397 elif test -z "$host"; then
398# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
399# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
400# echo "$progname: warning \`$option' is not a valid host type" 1>&2
401# fi
402 host="$option"
403 else
404 echo "$progname: too many arguments" 1>&2
405 echo "$help" 1>&2
406 exit 1
407 fi ;;
408 esac
409done
410
411if test -z "$ltmain"; then
412 echo "$progname: you must specify a LTMAIN file" 1>&2
413 echo "$help" 1>&2
414 exit 1
415fi
416
417if test ! -f "$ltmain"; then
418 echo "$progname: \`$ltmain' does not exist" 1>&2
419 echo "$help" 1>&2
420 exit 1
421fi
422
423if test -n "$tagname"; then
424 # Check whether tagname contains only valid characters
425 case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in
426 "") ;;
427 *)
428 echo "$progname: invalid tag name: $tagname" 1>&2
429 exit 1
430 ;;
431 esac
432
433 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then
434 echo "$progname: tag name $tagname already exists" 1>&2
435 exit 1
436 fi
437
438 if test ! -f "$ofile"; then
439 echo "$progname: warning: output file \`$ofile' does not exist" 1>&2
440 fi
441
442 if test -z "$LTCC"; then
443 eval "`$SHELL $ofile --config | grep '^LTCC='`"
444 if test -z "$LTCC"; then
445 echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2
446 else
447 echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2
448 fi
449 fi
450fi
451
452# Quote any args containing shell metacharacters.
453ltconfig_args=
454for arg
455do
456 case "$arg" in
457 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
458 ltconfig_args="$ltconfig_args '$arg'" ;;
459 *) ltconfig_args="$ltconfig_args $arg" ;;
460 esac
461done
462
463# A relevant subset of AC_INIT.
464
465# File descriptor usage:
466# 0 standard input
467# 1 file creation
468# 2 errors and warnings
469# 3 some systems may open it to /dev/tty
470# 4 used on the Kubota Titan
471# 5 compiler messages saved in config.log
472# 6 checking for... messages and results
473if test "$silent" = yes; then
474 exec 6>/dev/null
475else
476 exec 6>&1
477fi
478exec 5>>./config.log
479
480# NLS nuisances.
481# Only set LANG and LC_ALL to C if already set.
482# These must not be set unconditionally because not all systems understand
483# e.g. LANG=C (notably SCO).
484if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
485if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
486
487if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then
488 echo "loading cache $cache_file within ltconfig"
489 . $cache_file
490fi
491
492if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
493 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
494 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
495 ac_n= ac_c='
496' ac_t=' '
497 else
498 ac_n=-n ac_c= ac_t=
499 fi
500else
501 ac_n= ac_c='\c' ac_t=
502fi
503
504if test -z "$srcdir"; then
505 # Assume the source directory is the same one as the path to LTMAIN.
506 srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
507 test "$srcdir" = "$ltmain" && srcdir=.
508fi
509
510trap "$rm conftest*; exit 1" 1 2 15
511if test "$verify_host" = yes; then
512 # Check for config.guess and config.sub.
513 ac_aux_dir=
514 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
515 if test -f $ac_dir/config.guess; then
516 ac_aux_dir=$ac_dir
517 break
518 fi
519 done
520 if test -z "$ac_aux_dir"; then
521 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
522 echo "$help" 1>&2
523 exit 1
524 fi
525 ac_config_guess=$ac_aux_dir/config.guess
526 ac_config_sub=$ac_aux_dir/config.sub
527
528 # Make sure we can run config.sub.
529 if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
530 else
531 echo "$progname: cannot run $ac_config_sub" 1>&2
532 echo "$help" 1>&2
533 exit 1
534 fi
535
536 echo $ac_n "checking host system type""... $ac_c" 1>&6
537
538 host_alias=$host
539 case "$host_alias" in
540 "")
541 # Force config.guess to use the C compiler.
542 # CC_FOR_BUILD overrides the CC variable in config.guess but I had
543 # problems with it so do it this way for now.
544 CC="$LTCC"
545
546 if host_alias=`$SHELL $ac_config_guess`; then :
547 else
548 echo "$progname: cannot guess host type; you must specify one" 1>&2
549 echo "$help" 1>&2
550 exit 1
551 fi
552
553 # Restore the C compiler.
554 CC="$old_CC"
555 ;;
556 esac
557 host=`$SHELL $ac_config_sub $host_alias`
558 echo "$ac_t$host" 1>&6
559
560 # Make sure the host verified.
561 test -z "$host" && exit 1
562
563 # Check for the build system type
564 echo $ac_n "checking build system type... $ac_c" 1>&6
565
566 build_alias=$build
567 case "$build_alias" in
568 NONE)
569 case $nonopt in
570 NONE) build_alias=$host_alias ;;
571 *) build_alias=$nonopt ;;
572 esac ;;
573 esac
574
575 build=`$SHELL $ac_config_sub $build_alias`
576 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
577 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
578 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
579 echo "$ac_t""$build" 1>&6
580
581elif test -z "$host"; then
582 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
583 echo "$help" 1>&2
584 exit 1
585else
586 host_alias=$host
587 build_alias=$host_alias
588 build=$host
589fi
590
591if test x"$host" != x"$build"; then
592 ac_tool_prefix=${host_alias}-
593else
594 ac_tool_prefix=
595fi
596
597host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
598host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
599host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
600
601# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
602case "$host_os" in
603linux-gnu*) ;;
604linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
605esac
606
607case "$host_os" in
608aix3*)
609 # AIX sometimes has problems with the GCC collect2 program. For some
610 # reason, if we set the COLLECT_NAMES environment variable, the problems
611 # vanish in a puff of smoke.
612 if test "X${COLLECT_NAMES+set}" != Xset; then
613 COLLECT_NAMES=
614 export COLLECT_NAMES
615 fi
616 ;;
617esac
618
619# Determine commands to create old-style static archives.
620old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
621old_postinstall_cmds='chmod 644 $oldlib'
622old_postuninstall_cmds=
623
624if test -n "$RANLIB"; then
625 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
626 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
627fi
628
629# Source the script associated with the $tagname tag configuration.
630if test -n "$tagname"; then
631 . $ltmain
632else
633 # FIXME: We should use a variable here
634 # Configure for a C compiler
635 . $srcdir/ltcf-c.sh
636fi
637
638# Set sane defaults for various variables
639test -z "$AR" && AR=ar
640test -z "$AR_FLAGS" && AR_FLAGS=cru
641test -z "$AS" && AS=as
642test -z "$CC" && CC=cc
643test -z "$DLLTOOL" && DLLTOOL=dlltool
644test -z "$MAGIC_CMD" && MAGIC_CMD=file
645test -z "$LD" && LD=ld
646test -z "$LN_S" && LN_S="ln -s"
647test -z "$NM" && NM=nm
648test -z "$OBJDUMP" && OBJDUMP=objdump
649test -z "$RANLIB" && RANLIB=:
650test -z "$STRIP" && STRIP=:
651test -z "$objext" && objext=o
652
653echo $ac_n "checking for objdir... $ac_c" 1>&6
654rm -f .libs 2>/dev/null
655mkdir .libs 2>/dev/null
656if test -d .libs; then
657 objdir=.libs
658else
659 # MS-DOS does not allow filenames that begin with a dot.
660 objdir=_libs
661fi
662rmdir .libs 2>/dev/null
663echo "$ac_t$objdir" 1>&6
664
665# If no C compiler was specified, use CC.
666LTCC=${LTCC-"$CC"}
667
668# Allow CC to be a program name with arguments.
669set dummy $CC
670compiler="$2"
671
672# We assume here that the value for ac_cv_prog_cc_pic will not be cached
673# in isolation, and that seeing it set (from the cache) indicates that
674# the associated values are set (in the cache) correctly too.
675echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
676echo "$progname:676:checking for $compiler option to produce PIC" 1>&5
677
678if test -z "$ac_cv_prog_cc_pic"; then
679 echo "$ac_t"none 1>&6
680else
681 echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
682
683 # Check to make sure the pic_flag actually works.
684 echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
685 echo "$progname:685:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
686 if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \
687 test "X${ac_cv_prog_cc_pic_works}" != X; then
688 echo $ac_n "(cached) $ac_c" 1>&6
689 else
690 ac_cv_prog_cc_pic_works=yes
691 $rm conftest*
692 echo $lt_simple_compile_test_code > conftest.$ac_ext
693 save_CFLAGS="$CFLAGS"
694 CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
695 if { (eval echo $progname:695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
696 # Append any warnings to the config.log.
697 cat conftest.err 1>&5
698
699 case "$host_os" in
700 hpux9* | hpux10* | hpux11*)
701 # On HP-UX, both CC and GCC only warn that PIC is supported... then
702 # they create non-PIC objects. So, if there were any warnings, we
703 # assume that PIC is not supported.
704 if test -s conftest.err; then
705 ac_cv_prog_cc_pic_works=no
706 ac_cv_prog_cc_can_build_shared=no
707 ac_cv_prog_cc_pic=
708 else
709 ac_cv_prog_cc_pic_works=yes
710 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
711 fi
712 ;;
713 *)
714 ac_cv_prog_cc_pic_works=yes
715 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
716 ;;
717 esac
718 else
719 # Append any errors to the config.log.
720 cat conftest.err 1>&5
721 ac_cv_prog_cc_pic_works=no
722 ac_cv_prog_cc_can_build_shared=no
723 ac_cv_prog_cc_pic=
724 fi
725 CFLAGS="$save_CFLAGS"
726 $rm conftest*
727 fi
728 # Belt *and* braces to stop my trousers falling down:
729 if test "X$ac_cv_prog_cc_pic_works" = Xno; then
730 ac_cv_prog_cc_pic=
731 ac_cv_prog_cc_can_build_shared=no
732 fi
733 echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
734fi
735
736# Check for any special shared library compilation flags.
737if test -n "$ac_cv_prog_cc_shlib"; then
738 echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
739 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then :
740 else
741 echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
742 ac_cv_prog_cc_can_build_shared=no
743 fi
744fi
745
746echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
747echo "$progname:747: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
748if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \
749 test "X${ac_cv_prog_cc_static_works}" != X; then
750 echo $ac_n "(cached) $ac_c" 1>&6
751else
752 $rm conftest*
753 echo $lt_simple_link_test_code > conftest.$ac_ext
754 save_LDFLAGS="$LDFLAGS"
755 LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
756 if { (eval echo $progname:756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
757 ac_cv_prog_cc_static_works=yes
758 else
759 ac_cv_prog_cc_static_works=no
760 ac_cv_prog_cc_static=
761 fi
762 LDFLAGS="$save_LDFLAGS"
763 $rm conftest*
764fi
765# Belt *and* braces to stop my trousers falling down:
766if test "X$ac_cv_prog_cc_static_works" = Xno; then
767 ac_cv_prog_cc_static=
768fi
769echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
770pic_flag="$ac_cv_prog_cc_pic"
771special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
772wl="$ac_cv_prog_cc_wl"
773link_static_flag="$ac_cv_prog_cc_static"
774no_builtin_flag="$ac_cv_prog_cc_no_builtin"
775can_build_shared="$ac_cv_prog_cc_can_build_shared"
776
777# Check to see if options -o and -c are simultaneously supported by compiler
778echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
779$rm -r conftest 2>/dev/null
780mkdir conftest
781cd conftest
782$rm conftest*
783echo $lt_simple_compile_test_code > conftest.$ac_ext
784mkdir out
785# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
786# that will create temporary files in the current directory regardless of
787# the output directory. Thus, making CWD read-only will cause this test
788# to fail, enabling locking or at least warning the user not to do parallel
789# builds.
790chmod -w .
791save_CFLAGS="$CFLAGS"
792CFLAGS="$CFLAGS -o out/conftest2.$objext"
793echo "$progname:793: checking if $compiler supports -c -o file.$objext" >&5
794if { (eval echo $progname:794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
795
796 # The compiler can only warn and ignore the option if not recognized
797 # So say no if there are warnings
798 if test -s out/conftest.err; then
799 echo "$ac_t"no 1>&6
800 compiler_c_o=no
801 else
802 echo "$ac_t"yes 1>&6
803 compiler_c_o=yes
804 fi
805else
806 # Append any errors to the config.log.
807 cat out/conftest.err 1>&5
808 compiler_c_o=no
809 echo "$ac_t"no 1>&6
810fi
811CFLAGS="$save_CFLAGS"
812chmod u+w .
813$rm conftest* out/*
814rmdir out
815cd ..
816rmdir conftest
817$rm -r conftest 2>/dev/null
818
819# Check to see if we can do hard links to lock some files if needed
820hard_links="nottested"
821if test "$compiler_c_o" = no && test "$need_locks" != no; then
822 # do not overwrite the value of need_locks provided by the user
823 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
824 hard_links=yes
825 $rm conftest*
826 ln conftest.a conftest.b 2>/dev/null && hard_links=no
827 touch conftest.a
828 ln conftest.a conftest.b 2>&5 || hard_links=no
829 ln conftest.a conftest.b 2>/dev/null && hard_links=no
830 echo "$ac_t$hard_links" 1>&6
831 $rm conftest*
832 if test "$hard_links" = no; then
833 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
834 need_locks=warn
835 fi
836else
837 need_locks=no
838fi
839
840if test "$with_gcc" = yes; then
841 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
842 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
843 $rm conftest*
844 echo $lt_simple_compile_test_code > conftest.$ac_ext
845 save_CFLAGS="$CFLAGS"
846 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
847 echo "$progname:847: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
848 if { (eval echo $progname:848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
849
850 # The compiler can only warn and ignore the option if not recognized
851 # So say no if there are warnings
852 if test -s conftest.err; then
853 echo "$ac_t"no 1>&6
854 compiler_rtti_exceptions=no
855 else
856 echo "$ac_t"yes 1>&6
857 compiler_rtti_exceptions=yes
858 fi
859 else
860 # Append any errors to the config.log.
861 cat conftest.err 1>&5
862 compiler_rtti_exceptions=no
863 echo "$ac_t"no 1>&6
864 fi
865 CFLAGS="$save_CFLAGS"
866 $rm conftest*
867
868 if test "$compiler_rtti_exceptions" = "yes"; then
869 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
870 else
871 no_builtin_flag=' -fno-builtin'
872 fi
873
874fi
875
876# See if the linker supports building shared libraries.
877echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
878
879echo "$ac_t$ld_shlibs" 1>&6
880test "$ld_shlibs" = no && can_build_shared=no
881
882# Check hardcoding attributes.
883echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
884hardcode_action=
885if test -n "$hardcode_libdir_flag_spec" || \
886 test -n "$runpath_var"; then
887
888 # We can hardcode non-existant directories.
889 if test "$hardcode_direct" != no &&
890 # If the only mechanism to avoid hardcoding is shlibpath_var, we
891 # have to relink, otherwise we might link with an installed library
892 # when we should be linking with a yet-to-be-installed one
893 ## test "$hardcode_shlibpath_var" != no &&
894 test "$hardcode_minus_L" != no; then
895 # Linking always hardcodes the temporary library directory.
896 hardcode_action=relink
897 else
898 # We can link without hardcoding, and we can hardcode nonexisting dirs.
899 hardcode_action=immediate
900 fi
901else
902 # We cannot hardcode anything, or else we can only hardcode existing
903 # directories.
904 hardcode_action=unsupported
905fi
906echo "$ac_t$hardcode_action" 1>&6
907
908echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
909if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
910 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
911 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
912 echo "${ac_t}yes" 1>&6
913else
914 echo "${ac_t}no" 1>&6
915fi
916
917reload_cmds='$LD$reload_flag -o $output$reload_objs'
918test -z "$deplibs_check_method" && deplibs_check_method=unknown
919
920# PORTME Fill in your ld.so characteristics
921library_names_spec=
922libname_spec='lib$name'
923soname_spec=
924postinstall_cmds=
925postuninstall_cmds=
926finish_cmds=
927finish_eval=
928shlibpath_var=
929shlibpath_overrides_runpath=unknown
930version_type=none
931dynamic_linker="$host_os ld.so"
932sys_lib_dlsearch_path_spec="/lib /usr/lib"
933sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
934
935echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
936case "$host_os" in
937aix3*)
938 version_type=linux
939 library_names_spec='${libname}${release}.so$versuffix $libname.a'
940 shlibpath_var=LIBPATH
941
942 # AIX has no versioning support, so we append a major version to the name.
943 soname_spec='${libname}${release}.so$major'
944 ;;
945
946aix4*)
947 version_type=linux
948 # AIX has no versioning support, so currently we can not hardcode correct
949 # soname into executable. Probably we can add versioning support to
950 # collect2, so additional links can be useful in future.
951 # We preserve .a as extension for shared libraries though AIX4.2
952 # and later linker supports .so
953 # (MM) we changed it to .so, as we now use runtime linking (-brtl) and this
954 # prevents people from linking it as normal .a archive
955 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
956 shlibpath_var=LIBPATH
957 # the following is may be not correct. I need to check with the source of
958 # this patch (its arbab@austin.ibm.com) (MM)
959 hardcode_into_libs=all
960 ;;
961
962amigaos*)
963 library_names_spec='$libname.ixlibrary $libname.a'
964 # Create ${libname}_ixlibrary.a entries in /sys/libs.
965 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'
966 ;;
967
968beos*)
969 library_names_spec='${libname}.so'
970 dynamic_linker="$host_os ld.so"
971 shlibpath_var=LIBRARY_PATH
972 lt_cv_dlopen="load_add_on"
973 lt_cv_dlopen_libs=
974 lt_cv_dlopen_self=yes
975 ;;
976
977bsdi4*)
978 version_type=linux
979 need_version=no
980 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
981 soname_spec='${libname}${release}.so$major'
982 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
983 shlibpath_var=LD_LIBRARY_PATH
984 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
985 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
986 export_dynamic_flag_spec=-rdynamic
987 # the default ld.so.conf also contains /usr/contrib/lib and
988 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
989 # libtool to hard-code these into programs
990 ;;
991
992cygwin* | mingw* | pw32*)
993 version_type=windows
994 need_version=no
995 need_lib_prefix=no
996 if test "$with_gcc" = yes; then
997 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
998 else
999 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1000 fi
1001 dynamic_linker='Win32 ld.exe'
1002 # FIXME: first we should search . and the directory the executable is in
1003 shlibpath_var=PATH
1004 lt_cv_dlopen="LoadLibrary"
1005 lt_cv_dlopen_libs=
1006 ;;
1007
1008darwin* | rhapsody*)
1009 library_names_spec='${libname}.`if test "$module" = "yes"; then echo so; else echo dylib; fi`'
1010 need_lib_prefix=no
1011 need_version=no
1012 postinstall_cmds='chmod +x $lib'
1013 shlibpath_overrides_runpath=yes
1014 shlibpath_var=DYLD_LIBRARY_PATH
1015 ;;
1016
1017freebsd1*)
1018 dynamic_linker=no
1019 ;;
1020
1021freebsd*)
1022 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1023 version_type=freebsd-$objformat
1024 case "$version_type" in
1025 freebsd-elf*)
1026 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1027 need_version=no
1028 need_lib_prefix=no
1029 ;;
1030 freebsd-*)
1031 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1032 need_version=yes
1033 ;;
1034 esac
1035 shlibpath_var=LD_LIBRARY_PATH
1036 case "$host_os" in
1037 freebsd2*)
1038 shlibpath_overrides_runpath=yes
1039 ;;
1040 freebsd3.[01]* | freebsdelf3.[01]*)
1041 shlibpath_overrides_runpath=yes
1042 hardcode_into_libs=yes
1043 ;;
1044 *) # from 3.2 on
1045 shlibpath_overrides_runpath=no
1046 hardcode_into_libs=yes
1047 ;;
1048 esac
1049 ;;
1050
1051gnu*)
1052 version_type=linux
1053 need_lib_prefix=no
1054 need_version=no
1055 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1056 soname_spec='${libname}${release}.so$major'
1057 shlibpath_var=LD_LIBRARY_PATH
1058 hardcode_into_libs=yes
1059 ;;
1060
1061hpux9* | hpux10* | hpux11*)
1062 # Give a soname corresponding to the major version so that dld.sl refuses to
1063 # link against other versions.
1064 dynamic_linker="$host_os dld.sl"
1065 version_type=sunos
1066 need_lib_prefix=no
1067 need_version=no
1068 shlibpath_var=SHLIB_PATH
1069 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1070 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1071 soname_spec='${libname}${release}.sl$major'
1072 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1073 postinstall_cmds='chmod 555 $lib'
1074 ;;
1075
1076irix5* | irix6*)
1077 version_type=irix
1078 need_lib_prefix=no
1079 need_version=no
1080 soname_spec='${libname}${release}.so$major'
1081 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
1082 case "$host_os" in
1083 irix5*)
1084 libsuff= shlibsuff=
1085 ;;
1086 *)
1087 case "$LD" in # libtool.m4 will add one of these switches to LD
1088 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1089 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1090 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1091 *) libsuff= shlibsuff= libmagic=never-match;;
1092 esac
1093 ;;
1094 esac
1095 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1096 shlibpath_overrides_runpath=no
1097 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1098 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1099 ;;
1100
1101# No shared lib support for Linux oldld, aout, or coff.
1102linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1103 dynamic_linker=no
1104 ;;
1105
1106# This must be Linux ELF.
1107linux-gnu*)
1108 version_type=linux
1109 need_lib_prefix=no
1110 need_version=no
1111 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1112 soname_spec='${libname}${release}.so$major'
1113 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1114 shlibpath_var=LD_LIBRARY_PATH
1115 shlibpath_overrides_runpath=no
1116 # This implies no fast_install, which is unacceptable.
1117 # Some rework will be needed to allow for fast_install
1118 # before this can be enabled.
1119 hardcode_into_libs=yes
1120
1121 # We used to test for /lib/ld.so.1 and disable shared libraries on
1122 # powerpc, because MkLinux only supported shared libraries with the
1123 # GNU dynamic linker. Since this was broken with cross compilers,
1124 # most powerpc-linux boxes support dynamic linking these days and
1125 # people can always --disable-shared, the test was removed, and we
1126 # assume the GNU/Linux dynamic linker is in use.
1127 dynamic_linker='GNU/Linux ld.so'
1128 ;;
1129
1130netbsd*)
1131 version_type=sunos
1132 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1133 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1134 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1135 dynamic_linker='NetBSD (a.out) ld.so'
1136 need_version=yes
1137 else
1138 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1139 soname_spec='${libname}${release}.so$major'
1140 dynamic_linker='NetBSD ld.elf_so'
1141 fi
1142 shlibpath_var=LD_LIBRARY_PATH
1143 shlibpath_overrides_runpath=yes
1144 hardcode_into_libs=yes
1145 ;;
1146
1147newsos6)
1148 version_type=linux
1149 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1150 shlibpath_var=LD_LIBRARY_PATH
1151 shlibpath_overrides_runpath=yes
1152 ;;
1153
1154openbsd*)
1155 version_type=sunos
1156 if test "$with_gnu_ld" = yes; then
1157 need_lib_prefix=no
1158 need_version=no
1159 fi
1160 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1161 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1162 shlibpath_var=LD_LIBRARY_PATH
1163 # OpenBSD 2.7 the overriding is needed for fast-install
1164 shlibpath_overrides_runpath=yes
1165 ;;
1166
1167os2*)
1168 libname_spec='$name'
1169 need_lib_prefix=no
1170 library_names_spec='$libname.dll $libname.a'
1171 dynamic_linker='OS/2 ld.exe'
1172 shlibpath_var=LIBPATH
1173 ;;
1174
1175osf3* | osf4* | osf5*)
1176 version_type=osf
1177 need_version=no
1178 soname_spec='${libname}${release}.so'
1179 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1180 shlibpath_var=LD_LIBRARY_PATH
1181 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1182 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1183 ;;
1184
1185sco3.2v5*)
1186 version_type=osf
1187 soname_spec='${libname}${release}.so$major'
1188 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1189 shlibpath_var=LD_LIBRARY_PATH
1190 ;;
1191
1192solaris*)
1193 version_type=linux
1194 need_lib_prefix=no
1195 need_version=no
1196 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1197 soname_spec='${libname}${release}.so$major'
1198 shlibpath_var=LD_LIBRARY_PATH
1199 shlibpath_overrides_runpath=yes
1200 hardcode_into_libs=yes
1201 # ldd complains unless libraries are executable
1202 postinstall_cmds='chmod +x $lib'
1203 ;;
1204
1205sunos4*)
1206 version_type=sunos
1207 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1208 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1209 shlibpath_var=LD_LIBRARY_PATH
1210 shlibpath_overrides_runpath=yes
1211 if test "$with_gnu_ld" = yes; then
1212 need_lib_prefix=no
1213 fi
1214 need_version=yes
1215 ;;
1216
1217sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1218 version_type=linux
1219 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1220 soname_spec='${libname}${release}.so$major'
1221 shlibpath_var=LD_LIBRARY_PATH
1222 case "$host_vendor" in
1223 motorola)
1224 need_lib_prefix=no
1225 need_version=no
1226 shlibpath_overrides_runpath=no
1227 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1228 ;;
1229 esac
1230 ;;
1231
1232uts4*)
1233 version_type=linux
1234 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1235 soname_spec='${libname}${release}.so$major'
1236 shlibpath_var=LD_LIBRARY_PATH
1237 ;;
1238
1239dgux*)
1240 version_type=linux
1241 need_lib_prefix=no
1242 need_version=no
1243 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1244 soname_spec='${libname}${release}.so$major'
1245 shlibpath_var=LD_LIBRARY_PATH
1246 ;;
1247
1248sysv4*MP*)
1249 if test -d /usr/nec ;then
1250 version_type=linux
1251 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1252 soname_spec='$libname.so.$major'
1253 shlibpath_var=LD_LIBRARY_PATH
1254 fi
1255 ;;
1256
1257*)
1258 dynamic_linker=no
1259 ;;
1260esac
1261echo "$ac_t$dynamic_linker" 1>&6
1262test "$dynamic_linker" = no && can_build_shared=no
1263
1264# Check for command to grab the raw symbol name followed by C symbol from nm.
1265echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1266
1267# These are sane defaults that work on at least a few old systems.
1268# [They come from Ultrix. What could be older than Ultrix?!! ;)]
1269
1270# Character class describing NM global symbol codes.
1271symcode='[BCDEGRST]'
1272
1273# Regexp to match symbols that can be accessed directly from C.
1274sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1275
1276# Transform the above into a raw symbol and a C symbol.
1277symxfrm='\1 \2\3 \3'
1278
1279# Transform an extracted symbol line into a proper C declaration
1280global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1281
1282# Define system-specific variables.
1283case "$host_os" in
1284aix*)
1285 symcode='[BCDT]'
1286 ;;
1287cygwin* | mingw* | pw32*)
1288 symcode='[ABCDGISTW]'
1289 ;;
1290hpux*) # Its linker distinguishes data from code symbols
1291 global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1292 ;;
1293irix*)
1294 symcode='[BCDEGRST]'
1295 ;;
1296solaris* | sysv5*)
1297 symcode='[BDT]'
1298 ;;
1299sysv4)
1300 symcode='[DFNSTU]'
1301 ;;
1302esac
1303
1304# Handle CRLF in mingw too chain
1305opt_cr=
1306case "$host_os" in
1307mingw*)
1308 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1309 ;;
1310esac
1311
1312# If we're using GNU nm, then use its standard symbol codes.
1313if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1314 symcode='[ABCDGISTW]'
1315fi
1316
1317# Try without a prefix undercore, then with it.
1318for ac_symprfx in "" "_"; do
1319
1320 # Write the raw and C identifiers.
1321global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1322
1323 # Check to see that the pipe works correctly.
1324 pipe_works=no
1325 $rm conftest*
1326 cat > conftest.$ac_ext <<EOF
1327#ifdef __cplusplus
1328extern "C" {
1329#endif
1330char nm_test_var;
1331void nm_test_func(){}
1332#ifdef __cplusplus
1333}
1334#endif
1335int main(){nm_test_var='a';nm_test_func();return(0);}
1336EOF
1337
1338 echo "$progname:1326: checking if global_symbol_pipe works" >&5
1339 if { (eval echo $progname:1327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1340 # Now try to grab the symbols.
1341 nlist=conftest.nm
1342 if { echo "$progname:1330: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1343
1344 # Try sorting and uniquifying the output.
1345 if sort "$nlist" | uniq > "$nlist"T; then
1346 mv -f "$nlist"T "$nlist"
1347 else
1348 rm -f "$nlist"T
1349 fi
1350
1351 # Make sure that we snagged all the symbols we need.
1352 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1353 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1354 cat <<EOF > conftest.$ac_ext
1355#ifdef __cplusplus
1356extern "C" {
1357#endif
1358
1359EOF
1360 # Now generate the symbol file.
1361 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1362
1363 cat <<EOF >> conftest.$ac_ext
1364#if defined (__STDC__) && __STDC__
1365# define lt_ptr_t void *
1366#else
1367# define lt_ptr_t char *
1368# define const
1369#endif
1370
1371/* The mapping between symbol names and symbols. */
1372const struct {
1373 const char *name;
1374 lt_ptr_t address;
1375}
1376lt_preloaded_symbols[] =
1377{
1378EOF
1379 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext
1380 cat <<\EOF >> conftest.$ac_ext
1381 {0, (lt_ptr_t) 0}
1382};
1383
1384#ifdef __cplusplus
1385}
1386#endif
1387EOF
1388 # Now try linking the two files.
1389 mv conftest.$objext conftstm.$objext
1390 save_LIBS="$LIBS"
1391 save_CFLAGS="$CFLAGS"
1392 LIBS="conftstm.$objext"
1393 CFLAGS="$CFLAGS$no_builtin_flag"
1394 if { (eval echo $progname:1404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1395 pipe_works=yes
1396 else
1397 echo "$progname: failed program was:" >&5
1398 cat conftest.$ac_ext >&5
1399 fi
1400 LIBS="$save_LIBS"
1401 else
1402 echo "cannot find nm_test_func in $nlist" >&5
1403 fi
1404 else
1405 echo "cannot find nm_test_var in $nlist" >&5
1406 fi
1407 else
1408 echo "cannot run $global_symbol_pipe" >&5
1409 fi
1410 else
1411 echo "$progname: failed program was:" >&5
1412 cat conftest.$ac_ext >&5
1413 fi
1414 $rm conftest* conftst*
1415
1416 # Do not use the global_symbol_pipe unless it works.
1417 if test "$pipe_works" = yes; then
1418 break
1419 else
1420 global_symbol_pipe=
1421 fi
1422done
1423if test "$pipe_works" = yes; then
1424 echo "${ac_t}ok" 1>&6
1425else
1426 echo "${ac_t}failed" 1>&6
1427fi
1428
1429if test -z "$global_symbol_pipe"; then
1430 global_symbol_to_cdecl=
1431fi
1432
1433# Report the final consequences.
1434echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1435
1436# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1437# configure.in, otherwise build static only libraries.
1438case "$host_os" in
1439cygwin* | mingw* | pw32* | os2*)
1440 if test x$can_build_shared = xyes; then
1441 test x$enable_win32_dll = xno && can_build_shared=no
1442 echo "checking if package supports dlls... $can_build_shared" 1>&6
1443 fi
1444;;
1445esac
1446
1447echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1448test "$can_build_shared" = "no" && enable_shared=no
1449
1450# On AIX, shared libraries and static libraries use the same namespace, and
1451# are all built from PIC.
1452case "$host_os" in
1453aix3*)
1454 test "$enable_shared" = yes && enable_static=no
1455 if test -n "$RANLIB"; then
1456 archive_cmds="$archive_cmds~\$RANLIB \$lib"
1457 postinstall_cmds='$RANLIB $lib'
1458 fi
1459 ;;
1460
1461aix4*)
1462 test "$enable_shared" = yes && enable_static=no
1463 ;;
1464esac
1465
1466echo "$ac_t$enable_shared" 1>&6
1467
1468# Make sure either enable_shared or enable_static is yes.
1469test "$enable_shared" = yes || enable_static=yes
1470
1471echo "checking whether to build static libraries... $enable_static" 1>&6
1472
1473if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
1474 # Fast installation is not supported
1475 enable_fast_install=no
1476elif test "$shlibpath_overrides_runpath" = yes ||
1477 test "$enable_shared" = no; then
1478 # Fast installation is not necessary
1479 enable_fast_install=needless
1480fi
1481
1482variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1483if test "$with_gcc" = yes; then
1484 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1485fi
1486
1487# Check whether we must set pic_mode to default
1488test -z "$pic_flag" && pic_mode=default
1489
1490if test "x$enable_dlopen" != xyes; then
1491 enable_dlopen=unknown
1492 enable_dlopen_self=unknown
1493 enable_dlopen_self_static=unknown
1494else
1495if test "X${lt_cv_dlopen+set}" != Xset; then
1496 lt_cv_dlopen=no lt_cv_dlopen_libs=
1497echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
1498echo "$progname:1508: checking for dlopen in -ldl" >&5
1499if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
1500 echo $ac_n "(cached) $ac_c" 1>&6
1501else
1502 ac_save_LIBS="$LIBS"
1503LIBS="-ldl $LIBS"
1504cat > conftest.$ac_ext <<EOF
1505/*#line 1515 "ltconfig"*/
1506/* Override any gcc2 internal prototype to avoid an error. */
1507/* We use char because int might match the return type of a gcc2
1508 builtin and then its argument prototype would still apply. */
1509#ifdef __cplusplus
1510extern "C"
1511#endif
1512char dlopen();
1513
1514int main() {
1515dlopen()
1516; return 0; }
1517EOF
1518if { (eval echo $progname:1528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1519 rm -rf conftest*
1520 ac_cv_lib_dl_dlopen=yes
1521else
1522 echo "$progname: failed program was:" >&5
1523 cat conftest.$ac_ext >&5
1524 rm -rf conftest*
1525 ac_cv_lib_dl_dlopen=no
1526fi
1527rm -f conftest*
1528LIBS="$ac_save_LIBS"
1529
1530fi
1531if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
1532 echo "$ac_t""yes" 1>&6
1533 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
1534else
1535 echo "$ac_t""no" 1>&6
1536echo $ac_n "checking for dlopen""... $ac_c" 1>&6
1537echo "$progname:1547: checking for dlopen" >&5
1538if test "X${ac_cv_func_dlopen+set}" = Xset; then
1539 echo $ac_n "(cached) $ac_c" 1>&6
1540else
1541 cat > conftest.$ac_ext <<EOF
1542/*#line 1552 "ltconfig"*/
1543/* System header to define __stub macros and hopefully few prototypes,
1544 which can conflict with char dlopen(); below. */
1545#include <assert.h>
1546/* Override any gcc2 internal prototype to avoid an error. */
1547/* We use char because int might match the return type of a gcc2
1548 builtin and then its argument prototype would still apply. */
1549#ifdef __cplusplus
1550extern "C"
1551#endif
1552char dlopen();
1553
1554int main() {
1555
1556/* The GNU C library defines this for functions which it implements
1557 to always fail with ENOSYS. Some functions are actually named
1558 something starting with __ and the normal name is an alias. */
1559#if defined (__stub_dlopen) || defined (__stub___dlopen)
1560choke me
1561#else
1562dlopen();
1563#endif
1564
1565; return 0; }
1566EOF
1567if { (eval echo $progname:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1568 rm -rf conftest*
1569 ac_cv_func_dlopen=yes
1570else
1571 echo "$progname: failed program was:" >&5
1572 cat conftest.$ac_ext >&5
1573 rm -rf conftest*
1574 ac_cv_func_dlopen=no
1575fi
1576rm -f conftest*
1577fi
1578if test "X$ac_cv_func_dlopen" = Xyes; then
1579 echo "$ac_t""yes" 1>&6
1580 lt_cv_dlopen="dlopen"
1581else
1582 echo "$ac_t""no" 1>&6
1583echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
1584echo "$progname:1594: checking for dlopen in -lsvld" >&5
1585if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then
1586 echo $ac_n "(cached) $ac_c" 1>&6
1587else
1588 ac_save_LIBS="$LIBS"
1589LIBS="-lsvld $LIBS"
1590cat > conftest.$ac_ext <<EOF
1591/* #line 1601 "ltconfig" */
1592/* Override any gcc2 internal prototype to avoid an error. */
1593/* We use char because int might match the return type of a gcc2
1594 builtin and then its argument prototype would still apply. */
1595#ifdef __cplusplus
1596extern "C"
1597#endif
1598char dlopen();
1599
1600int main() {
1601dlopen()
1602; return 0; }
1603EOF
1604if { (eval echo $progname:1614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1605 rm -rf conftest*
1606 ac_cv_lib_svld_dlopen=yes
1607else
1608 echo "$progname: failed program was:" >&5
1609 cat conftest.$ac_ext >&5
1610 rm -rf conftest*
1611 ac_cv_lib_svld_dlopen=no
1612fi
1613rm -f conftest*
1614LIBS="$ac_save_LIBS"
1615
1616fi
1617if test "X$ac_cv_lib_svld_dlopen" = Xyes; then
1618 echo "$ac_t""yes" 1>&6
1619 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
1620else
1621 echo "$ac_t""no" 1>&6
1622echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
1623echo "$progname:1633: checking for dld_link in -ldld" >&5
1624if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
1625 echo $ac_n "(cached) $ac_c" 1>&6
1626else
1627 ac_save_LIBS="$LIBS"
1628LIBS="-ldld $LIBS"
1629cat > conftest.$ac_ext <<EOF
1630/* #line 1640 "ltconfig" */
1631/* Override any gcc2 internal prototype to avoid an error. */
1632/* We use char because int might match the return type of a gcc2
1633 builtin and then its argument prototype would still apply. */
1634#ifdef __cplusplus
1635extern "C"
1636#endif
1637char dld_link();
1638
1639int main() {
1640dld_link()
1641; return 0; }
1642EOF
1643if { (eval echo $progname:1653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1644 rm -rf conftest*
1645 ac_cv_lib_dld_dld_link=yes
1646else
1647 echo "$progname: failed program was:" >&5
1648 cat conftest.$ac_ext >&5
1649 rm -rf conftest*
1650 ac_cv_lib_dld_dld_link=no
1651fi
1652rm -f conftest*
1653LIBS="$ac_save_LIBS"
1654
1655fi
1656if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
1657 echo "$ac_t""yes" 1>&6
1658 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
1659else
1660 echo "$ac_t""no" 1>&6
1661echo $ac_n "checking for shl_load""... $ac_c" 1>&6
1662echo "$progname:1672: checking for shl_load" >&5
1663if test "X${ac_cv_func_shl_load+set}" = Xset; then
1664 echo $ac_n "(cached) $ac_c" 1>&6
1665else
1666 cat > conftest.$ac_ext <<EOF
1667/*#line 1677 "ltconfig"*/
1668/* System header to define __stub macros and hopefully few prototypes,
1669 which can conflict with char shl_load(); below. */
1670#include <assert.h>
1671/* Override any gcc2 internal prototype to avoid an error. */
1672/* We use char because int might match the return type of a gcc2
1673 builtin and then its argument prototype would still apply. */
1674#ifdef __cplusplus
1675extern "C"
1676#endif
1677char shl_load();
1678
1679int main() {
1680
1681/* The GNU C library defines this for functions which it implements
1682 to always fail with ENOSYS. Some functions are actually named
1683 something starting with __ and the normal name is an alias. */
1684#if defined (__stub_shl_load) || defined (__stub___shl_load)
1685choke me
1686#else
1687shl_load();
1688#endif
1689
1690; return 0; }
1691EOF
1692if { (eval echo $progname:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1693 rm -rf conftest*
1694 ac_cv_func_shl_load=yes
1695else
1696 echo "$progname: failed program was:" >&5
1697 cat conftest.$ac_ext >&5
1698 rm -rf conftest*
1699 ac_cv_func_shl_load=no
1700fi
1701rm -f conftest*
1702fi
1703
1704if test "X$ac_cv_func_shl_load" = Xyes; then
1705 echo "$ac_t""yes" 1>&6
1706 lt_cv_dlopen="shl_load"
1707else
1708 echo "$ac_t""no" 1>&6
1709echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
1710echo "$progname:1720: checking for shl_load in -ldld" >&5
1711if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
1712 echo $ac_n "(cached) $ac_c" 1>&6
1713else
1714 ac_save_LIBS="$LIBS"
1715LIBS="-ldld $LIBS"
1716cat > conftest.$ac_ext <<EOF
1717/*#line 1727 "ltconfig"*/
1718#include "confdefs.h"
1719/* Override any gcc2 internal prototype to avoid an error. */
1720/* We use char because int might match the return type of a gcc2
1721 builtin and then its argument prototype would still apply. */
1722#ifdef __cplusplus
1723extern "C"
1724#endif
1725char shl_load();
1726
1727int main() {
1728shl_load()
1729; return 0; }
1730EOF
1731if { (eval echo $progname:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1732 rm -rf conftest*
1733 ac_cv_lib_dld_shl_load=yes
1734else
1735 echo "$progname: failed program was:" >&5
1736 cat conftest.$ac_ext >&5
1737 rm -rf conftest*
1738 ac_cv_lib_dld_shl_load=no
1739fi
1740rm -f conftest*
1741LIBS="$ac_save_LIBS"
1742
1743fi
1744if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
1745 echo "$ac_t""yes" 1>&6
1746 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
1747else
1748 echo "$ac_t""no" 1>&6
1749fi
1750
1751
1752fi
1753
1754
1755fi
1756
1757
1758fi
1759
1760
1761fi
1762
1763fi
1764
1765fi
1766
1767 if test "x$lt_cv_dlopen" != xno; then
1768 enable_dlopen=yes
1769 else
1770 enable_dlopen=no
1771 fi
1772
1773 case "$lt_cv_dlopen" in
1774 dlopen)
1775for ac_hdr in dlfcn.h; do
1776ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1777echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1778echo "$progname:1788: checking for $ac_hdr" >&5
1779if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
1780 echo $ac_n "(cached) $ac_c" 1>&6
1781else
1782 cat > conftest.$ac_ext <<EOF
1783/*#line 1793 "ltconfig"*/
1784#include <$ac_hdr>
1785int fnord = 0;
1786int main () { return(0); }
1787EOF
1788ac_try="$ac_compile >/dev/null 2>conftest.out"
1789{ (eval echo $progname:1799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1790ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1791if test -z "$ac_err"; then
1792 rm -rf conftest*
1793 eval "ac_cv_header_$ac_safe=yes"
1794else
1795 echo "$ac_err" >&5
1796 echo "$progname: failed program was:" >&5
1797 cat conftest.$ac_ext >&5
1798 rm -rf conftest*
1799 eval "ac_cv_header_$ac_safe=no"
1800fi
1801rm -f conftest*
1802fi
1803if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1804 echo "$ac_t""yes" 1>&6
1805else
1806 echo "$ac_t""no" 1>&6
1807fi
1808done
1809
1810 if test "x$ac_cv_header_dlfcn_h" = xyes; then
1811 CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1812 fi
1813 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1814 LIBS="$lt_cv_dlopen_libs $LIBS"
1815
1816 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
1817echo "$progname:1827: checking whether a program can dlopen itself" >&5
1818if test "X${lt_cv_dlopen_self+set}" = Xset; then
1819 echo $ac_n "(cached) $ac_c" 1>&6
1820else
1821 if test "$cross_compiling" = yes; then
1822 lt_cv_dlopen_self=cross
1823 else
1824 cat > conftest.$ac_ext <<EOF
1825/*#line 1835 "ltconfig"*/
1826
1827#if HAVE_DLFCN_H
1828#include <dlfcn.h>
1829#endif
1830
1831#include <stdio.h>
1832
1833#ifdef RTLD_GLOBAL
1834# define LTDL_GLOBAL RTLD_GLOBAL
1835#else
1836# ifdef DL_GLOBAL
1837# define LTDL_GLOBAL DL_GLOBAL
1838# else
1839# define LTDL_GLOBAL 0
1840# endif
1841#endif
1842
1843/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1844 find out it does not work in some platform. */
1845#ifndef LTDL_LAZY_OR_NOW
1846# ifdef RTLD_LAZY
1847# define LTDL_LAZY_OR_NOW RTLD_LAZY
1848# else
1849# ifdef DL_LAZY
1850# define LTDL_LAZY_OR_NOW DL_LAZY
1851# else
1852# ifdef RTLD_NOW
1853# define LTDL_LAZY_OR_NOW RTLD_NOW
1854# else
1855# ifdef DL_NOW
1856# define LTDL_LAZY_OR_NOW DL_NOW
1857# else
1858# define LTDL_LAZY_OR_NOW 0
1859# endif
1860# endif
1861# endif
1862# endif
1863#endif
1864
1865void fnord() { int i=42;}
1866int main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1867 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
1868 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); return 1; }
1869
1870EOF
1871if { (eval echo $progname:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1872then
1873 lt_cv_dlopen_self=yes
1874else
1875 echo "$progname: failed program was:" >&5
1876 cat conftest.$ac_ext >&5
1877 rm -fr conftest*
1878 lt_cv_dlopen_self=no
1879fi
1880rm -fr conftest*
1881fi
1882
1883fi
1884
1885echo "$ac_t""$lt_cv_dlopen_self" 1>&6
1886
1887 if test "$lt_cv_dlopen_self" = yes; then
1888 LDFLAGS="$LDFLAGS $link_static_flag"
1889 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
1890echo "$progname:1900: checking whether a statically linked program can dlopen itself" >&5
1891if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
1892 echo $ac_n "(cached) $ac_c" 1>&6
1893else
1894 if test "$cross_compiling" = yes; then
1895 lt_cv_dlopen_self_static=cross
1896 else
1897 cat > conftest.$ac_ext <<EOF
1898/* #line 1908 "ltconfig" */
1899
1900#if HAVE_DLFCN_H
1901#include <dlfcn.h>
1902#endif
1903
1904#include <stdio.h>
1905
1906#ifdef RTLD_GLOBAL
1907# define LTDL_GLOBAL RTLD_GLOBAL
1908#else
1909# ifdef DL_GLOBAL
1910# define LTDL_GLOBAL DL_GLOBAL
1911# else
1912# define LTDL_GLOBAL 0
1913# endif
1914#endif
1915
1916/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1917 find out it does not work in some platform. */
1918#ifndef LTDL_LAZY_OR_NOW
1919# ifdef RTLD_LAZY
1920# define LTDL_LAZY_OR_NOW RTLD_LAZY
1921# else
1922# ifdef DL_LAZY
1923# define LTDL_LAZY_OR_NOW DL_LAZY
1924# else
1925# ifdef RTLD_NOW
1926# define LTDL_LAZY_OR_NOW RTLD_NOW
1927# else
1928# ifdef DL_NOW
1929# define LTDL_LAZY_OR_NOW DL_NOW
1930# else
1931# define LTDL_LAZY_OR_NOW 0
1932# endif
1933# endif
1934# endif
1935# endif
1936#endif
1937
1938void fnord() { int i=42;}
1939int main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1940 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
1941 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); return 1; }
1942
1943EOF
1944if { (eval echo $progname:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1945then
1946 lt_cv_dlopen_self_static=yes
1947else
1948 echo "$progname: failed program was:" >&5
1949 cat conftest.$ac_ext >&5
1950 rm -fr conftest*
1951 lt_cv_dlopen_self_static=no
1952fi
1953rm -fr conftest*
1954fi
1955
1956fi
1957
1958echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
1959fi
1960 ;;
1961 esac
1962
1963 case "$lt_cv_dlopen_self" in
1964 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1965 *) enable_dlopen_self=unknown ;;
1966 esac
1967
1968 case "$lt_cv_dlopen_self_static" in
1969 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1970 *) enable_dlopen_self_static=unknown ;;
1971 esac
1972fi
1973
1974# Copy echo and quote the copy, instead of the original, because it is
1975# used later.
1976ltecho="$echo"
1977if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
1978 ltecho="$CONFIG_SHELL \$0 --fallback-echo"
1979fi
1980LTSHELL="$SHELL"
1981
1982LTCONFIG_VERSION="$VERSION"
1983
1984# Only quote variables if we're using ltmain.sh.
1985case "$ltmain" in
1986*.sh)
1987 # Now quote all the things that may contain metacharacters.
1988 for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
1989 old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \
1990 old_LN_S old_NM old_RANLIB old_STRIP \
1991 old_AS old_DLLTOOL old_OBJDUMP \
1992 old_OBJEXT old_EXEEXT old_reload_flag \
1993 old_deplibs_check_method old_file_magic_cmd \
1994 AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \
1995 reload_flag reload_cmds wl \
1996 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
1997 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
1998 library_names_spec soname_spec \
1999 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2000 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2001 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2002 predep_objects postdep_objects predeps postdeps compiler_lib_search_path \
2003 old_striplib striplib file_magic_cmd export_symbols_cmds \
2004 deplibs_check_method allow_undefined_flag no_undefined_flag \
2005 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2006 hardcode_libdir_flag_spec hardcode_libdir_separator \
2007 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2008 compiler_c_o need_locks exclude_expsyms include_expsyms; do
2009
2010 case "$var" in
2011 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2012 old_postinstall_cmds | old_postuninstall_cmds | \
2013 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2014 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2015 postinstall_cmds | postuninstall_cmds | \
2016 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2017 # Double-quote double-evaled strings.
2018 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test
2019 ;;
2020 *)
2021 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
2022 ;;
2023 esac
2024 done
2025
2026 case "$ltecho" in
2027 *'\$0 --fallback-echo"')
2028 ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2029 ;;
2030 esac
2031
2032 if test -z "$tagname"; then
2033 trap "$rm \"$ofile\"; exit 1" 1 2 15
2034 echo "creating $ofile"
2035 $rm "$ofile"
2036 cat <<EOF > "$ofile"
2037#! $SHELL
2038
2039# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2040# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2041# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2042#
2043# Copyright (C) 1996-2000 Free Software Foundation, Inc.
2044# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2045#
2046# This program is free software; you can redistribute it and/or modify
2047# it under the terms of the GNU General Public License as published by
2048# the Free Software Foundation; either version 2 of the License, or
2049# (at your option) any later version.
2050#
2051# This program is distributed in the hope that it will be useful, but
2052# WITHOUT ANY WARRANTY; without even the implied warranty of
2053# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2054# General Public License for more details.
2055#
2056# You should have received a copy of the GNU General Public License
2057# along with this program; if not, write to the Free Software
2058# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2059#
2060# As a special exception to the GNU General Public License, if you
2061# distribute this file as part of a program that contains a
2062# configuration script generated by Autoconf, you may include it under
2063# the same distribution terms that you use for the rest of that program.
2064
2065# Sed that helps us avoid accidentally triggering echo(1) options like -n.
2066Xsed="sed -e s/^X//"
2067
2068# The HP-UX ksh and POSIX shell print the target directory to stdout
2069# if CDPATH is set.
2070if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2071
2072# The names of the tagged configurations supported by this script.
2073available_tags=
2074
2075### BEGIN LIBTOOL CONFIG
2076EOF
2077 else
2078 echo "appending configuration tag \"$tagname\" to $ofile"
2079 echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2080 fi
2081 cfgfile="$ofile"
2082 ;;
2083
2084*)
2085 # Double-quote the variables that need it (for aesthetics).
2086 for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
2087 old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \
2088 old_LN_S old_NM old_RANLIB old_STRIP \
2089 old_AS old_DLLTOOL old_OBJDUMP \
2090 old_OBJEXT old_EXEEXT old_reload_flag \
2091 old_deplibs_check_method old_file_magic_cmd; do
2092 eval "$var=\\\"\$var\\\""
2093 done
2094
2095 # Just create a config file.
2096 cfgfile="$ofile.cfg"
2097 if test -z "$tagname"; then
2098 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2099 echo "creating $cfgfile"
2100 $rm "$cfgfile"
2101 cat <<EOF > "$cfgfile"
2102# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2103# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2104
2105### BEGIN LIBTOOL CONFIG
2106EOF
2107 else
2108 echo "appending to $cfgfile"
2109 echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2110 fi
2111 ;;
2112esac
2113
2114cat <<EOF >> "$cfgfile"
2115# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2116#
2117# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\
2118# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2119# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
2120# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\
2121# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2122# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2123# deplibs_check_method=$old_deplibs_check_method \\
2124# file_magic_cmd=$old_file_magic_cmd \\
2125# $0$ltconfig_args
2126#
2127# Compiler and other test output produced by $progname, useful for
2128# debugging $progname, is in ./config.log if it exists.
2129
2130# The version of $progname that generated this script.
2131LTCONFIG_VERSION=$LTCONFIG_VERSION
2132
2133# Shell to use when invoking shell scripts.
2134SHELL=$LTSHELL
2135
2136# Whether or not to build shared libraries.
2137build_libtool_libs=$enable_shared
2138
2139# Whether or not to add -lc for building shared libraries.
2140build_libtool_need_lc=$need_lc
2141
2142# Whether or not to build static libraries.
2143build_old_libs=$enable_static
2144
2145# Whether or not to optimize for fast installation.
2146fast_install=$enable_fast_install
2147
2148# The host system.
2149host_alias=$host_alias
2150host=$host
2151
2152# An echo program that does not interpret backslashes.
2153echo=$ltecho
2154
2155# The archiver.
2156AR=$AR
2157AR_FLAGS=$AR_FLAGS
2158
2159# A C compiler.
2160LTCC=$LTCC
2161
2162# A language-specific compiler.
2163CC=$CC
2164
2165# Is the compiler the GNU C compiler?
2166with_gcc=$with_gcc
2167
2168# The linker used to build libraries.
2169LD=$LD
2170
2171# Whether we need hard or soft links.
2172LN_S=$LN_S
2173
2174# A BSD-compatible nm program.
2175NM=$NM
2176
2177# A symbol stripping program
2178STRIP=$STRIP
2179
2180# Used to examine libraries when file_magic_cmd begins "file"
2181MAGIC_CMD=$MAGIC_CMD
2182
2183# Used on cygwin: DLL creation program.
2184DLLTOOL="$DLLTOOL"
2185
2186# Used on cygwin: object dumper.
2187OBJDUMP="$OBJDUMP"
2188
2189# Used on cygwin: assembler.
2190AS="$AS"
2191
2192# The name of the directory that contains temporary libtool files.
2193objdir=$objdir
2194
2195# How to create reloadable object files.
2196reload_flag=$reload_flag
2197reload_cmds=$reload_cmds
2198
2199# How to pass a linker flag through the compiler.
2200wl=$wl
2201
2202# Object file suffix (normally "o").
2203objext="$objext"
2204
2205# Old archive suffix (normally "a").
2206libext="$libext"
2207
2208# Executable file suffix (normally "").
2209exeext="$exeext"
2210
2211# Additional compiler flags for building library objects.
2212pic_flag=$pic_flag
2213pic_mode=$pic_mode
2214
2215# Does compiler simultaneously support -c and -o options?
2216compiler_c_o=$compiler_c_o
2217
2218# Must we lock files when doing compilation ?
2219need_locks=$need_locks
2220
2221# Do we need the lib prefix for modules?
2222need_lib_prefix=$need_lib_prefix
2223
2224# Do we need a version for libraries?
2225need_version=$need_version
2226
2227# Whether dlopen is supported.
2228dlopen_support=$enable_dlopen
2229
2230# Whether dlopen of programs is supported.
2231dlopen_self=$enable_dlopen_self
2232
2233# Whether dlopen of statically linked programs is supported.
2234dlopen_self_static=$enable_dlopen_self_static
2235
2236# Compiler flag to prevent dynamic linking.
2237link_static_flag=$link_static_flag
2238
2239# Compiler flag to turn off builtin functions.
2240no_builtin_flag=$no_builtin_flag
2241
2242# Compiler flag to allow reflexive dlopens.
2243export_dynamic_flag_spec=$export_dynamic_flag_spec
2244
2245# Compiler flag to generate shared objects directly from archives.
2246whole_archive_flag_spec=$whole_archive_flag_spec
2247
2248# Compiler flag to generate thread-safe objects.
2249thread_safe_flag_spec=$thread_safe_flag_spec
2250
2251# Library versioning type.
2252version_type=$version_type
2253
2254# Format of library name prefix.
2255libname_spec=$libname_spec
2256
2257# List of archive names. First name is the real one, the rest are links.
2258# The last name is the one that the linker finds with -lNAME.
2259library_names_spec=$library_names_spec
2260
2261# The coded name of the library, if different from the real name.
2262soname_spec=$soname_spec
2263
2264# Commands used to build and install an old-style archive.
2265RANLIB=$RANLIB
2266old_archive_cmds=$old_archive_cmds
2267old_postinstall_cmds=$old_postinstall_cmds
2268old_postuninstall_cmds=$old_postuninstall_cmds
2269
2270# Create an old-style archive from a shared archive.
2271old_archive_from_new_cmds=$old_archive_from_new_cmds
2272
2273# Create a temporary old-style archive to link instead of a shared archive.
2274old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2275
2276# Commands used to build and install a shared archive.
2277archive_cmds=$archive_cmds
2278archive_expsym_cmds=$archive_expsym_cmds
2279postinstall_cmds=$postinstall_cmds
2280postuninstall_cmds=$postuninstall_cmds
2281
2282# Commands to strip libraries.
2283old_striplib=$old_striplib
2284striplib=$striplib
2285
2286# Dependencies to place before the objects being linked to create a
2287# shared library.
2288predep_objects=$predep_objects
2289
2290# Dependencies to place after the objects being linked to create a
2291# shared library.
2292postdep_objects=$postdep_objects
2293
2294# Dependencies to place before the objects being linked to create a
2295# shared library.
2296predeps=$predeps
2297
2298# Dependencies to place after the objects being linked to create a
2299# shared library.
2300postdeps=$postdeps
2301
2302# The library search path used internally by the compiler when linking
2303# a shared library.
2304compiler_lib_search_path=$compiler_lib_search_path
2305
2306# Method to check whether dependent libraries are shared objects.
2307deplibs_check_method=$deplibs_check_method
2308
2309# Command to use when deplibs_check_method == file_magic.
2310file_magic_cmd=$file_magic_cmd
2311
2312# Flag that allows shared libraries with undefined symbols to be built.
2313allow_undefined_flag=$allow_undefined_flag
2314
2315# Flag that forces no undefined symbols.
2316no_undefined_flag=$no_undefined_flag
2317
2318# Commands used to finish a libtool library installation in a directory.
2319finish_cmds=$finish_cmds
2320
2321# Same as above, but a single script fragment to be evaled but not shown.
2322finish_eval=$finish_eval
2323
2324# Take the output of nm and produce a listing of raw symbols and C names.
2325global_symbol_pipe=$global_symbol_pipe
2326
2327# Transform the output of nm in a proper C declaration
2328global_symbol_to_cdecl=$global_symbol_to_cdecl
2329
2330# This is the shared library runtime path variable.
2331runpath_var=$runpath_var
2332
2333# This is the shared library path variable.
2334shlibpath_var=$shlibpath_var
2335
2336# Is shlibpath searched before the hard-coded library search path?
2337shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2338
2339# How to hardcode a shared library path into an executable.
2340hardcode_action=$hardcode_action
2341
2342# Whether we should hardcode library paths into libraries.
2343hardcode_into_libs=$hardcode_into_libs
2344
2345# Flag to hardcode \$libdir into a binary during linking.
2346# This must work even if \$libdir does not exist.
2347hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2348
2349# Whether we need a single -rpath flag with a separated argument.
2350hardcode_libdir_separator=$hardcode_libdir_separator
2351
2352# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2353# resulting binary.
2354hardcode_direct=$hardcode_direct
2355
2356# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2357# resulting binary.
2358hardcode_minus_L=$hardcode_minus_L
2359
2360# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2361# the resulting binary.
2362hardcode_shlibpath_var=$hardcode_shlibpath_var
2363
2364# Variables whose values should be saved in libtool wrapper scripts and
2365# restored at relink time.
2366variables_saved_for_relink="$variables_saved_for_relink"
2367
2368# Whether libtool must link a program against all its dependency libraries.
2369link_all_deplibs=$link_all_deplibs
2370
2371# Compile-time system search path for libraries
2372sys_lib_search_path_spec=$sys_lib_search_path_spec
2373
2374# Run-time system search path for libraries
2375sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2376
2377# Fix the shell variable \$srcfile for the compiler.
2378fix_srcfile_path="$fix_srcfile_path"
2379
2380# Set to yes if exported symbols are required.
2381always_export_symbols=$always_export_symbols
2382
2383# The commands to list exported symbols.
2384export_symbols_cmds=$export_symbols_cmds
2385
2386# The commands to extract the exported symbol list from a shared archive.
2387extract_expsyms_cmds=$extract_expsyms_cmds
2388
2389# Symbols that should not be listed in the preloaded symbols.
2390exclude_expsyms=$exclude_expsyms
2391
2392# Symbols that must always be exported.
2393include_expsyms=$include_expsyms
2394
2395EOF
2396
2397if test -z "$tagname"; then
2398 echo '### END LIBTOOL CONFIG' >> "$ofile"
2399else
2400 echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2401fi
2402
2403case "$ltmain" in
2404*.sh)
2405 echo >> "$ofile"
2406 if test -z "$tagname"; then
2407 case "$host_os" in
2408 aix3*)
2409 cat <<\EOF >> "$ofile"
2410
2411# AIX sometimes has problems with the GCC collect2 program. For some
2412# reason, if we set the COLLECT_NAMES environment variable, the problems
2413# vanish in a puff of smoke.
2414if test "X${COLLECT_NAMES+set}" != Xset; then
2415 COLLECT_NAMES=
2416 export COLLECT_NAMES
2417fi
2418EOF
2419 ;;
2420 esac
2421 case "$host" in
2422 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2423 cat <<'EOF' >> "$ofile"
2424 # This is a source program that is used to create dlls on Windows
2425 # Don't remove nor modify the starting and closing comments
2426# /* ltdll.c starts here */
2427# #define WIN32_LEAN_AND_MEAN
2428# #include <windows.h>
2429# #undef WIN32_LEAN_AND_MEAN
2430# #include <stdio.h>
2431#
2432# #ifndef __CYGWIN__
2433# # ifdef __CYGWIN32__
2434# # define __CYGWIN__ __CYGWIN32__
2435# # endif
2436# #endif
2437#
2438# #ifdef __cplusplus
2439# extern "C" {
2440# #endif
2441# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2442# #ifdef __cplusplus
2443# }
2444# #endif
2445#
2446# #ifdef __CYGWIN__
2447# #include <cygwin/cygwin_dll.h>
2448# DECLARE_CYGWIN_DLL( DllMain );
2449# #endif
2450# HINSTANCE __hDllInstance_base;
2451#
2452# BOOL APIENTRY
2453# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2454# {
2455# __hDllInstance_base = hInst;
2456# return TRUE;
2457# }
2458# /* ltdll.c ends here */
2459 # This is a source program that is used to create import libraries
2460 # on Windows for dlls which lack them. Don't remove nor modify the
2461 # starting and closing comments
2462# /* impgen.c starts here */
2463# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
2464#
2465# This file is part of GNU libtool.
2466#
2467# This program is free software; you can redistribute it and/or modify
2468# it under the terms of the GNU General Public License as published by
2469# the Free Software Foundation; either version 2 of the License, or
2470# (at your option) any later version.
2471#
2472# This program is distributed in the hope that it will be useful,
2473# but WITHOUT ANY WARRANTY; without even the implied warranty of
2474# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2475# GNU General Public License for more details.
2476#
2477# You should have received a copy of the GNU General Public License
2478# along with this program; if not, write to the Free Software
2479# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2480# */
2481#
2482# #include <stdio.h> /* for printf() */
2483# #include <unistd.h> /* for open(), lseek(), read() */
2484# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
2485# #include <string.h> /* for strdup() */
2486#
2487# /* O_BINARY isn't required (or even defined sometimes) under Unix */
2488# #ifndef O_BINARY
2489# #define O_BINARY 0
2490# #endif
2491#
2492# static unsigned int
2493# pe_get16 (fd, offset)
2494# int fd;
2495# int offset;
2496# {
2497# unsigned char b[2];
2498# lseek (fd, offset, SEEK_SET);
2499# read (fd, b, 2);
2500# return b[0] + (b[1]<<8);
2501# }
2502#
2503# static unsigned int
2504# pe_get32 (fd, offset)
2505# int fd;
2506# int offset;
2507# {
2508# unsigned char b[4];
2509# lseek (fd, offset, SEEK_SET);
2510# read (fd, b, 4);
2511# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2512# }
2513#
2514# static unsigned int
2515# pe_as32 (ptr)
2516# void *ptr;
2517# {
2518# unsigned char *b = ptr;
2519# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2520# }
2521#
2522# int
2523# main (argc, argv)
2524# int argc;
2525# char *argv[];
2526# {
2527# int dll;
2528# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2529# unsigned long export_rva, export_size, nsections, secptr, expptr;
2530# unsigned long name_rvas, nexp;
2531# unsigned char *expdata, *erva;
2532# char *filename, *dll_name;
2533#
2534# filename = argv[1];
2535#
2536# dll = open(filename, O_RDONLY|O_BINARY);
2537# if (!dll)
2538# return 1;
2539#
2540# dll_name = filename;
2541#
2542# for (i=0; filename[i]; i++)
2543# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
2544# dll_name = filename + i +1;
2545#
2546# pe_header_offset = pe_get32 (dll, 0x3c);
2547# opthdr_ofs = pe_header_offset + 4 + 20;
2548# num_entries = pe_get32 (dll, opthdr_ofs + 92);
2549#
2550# if (num_entries < 1) /* no exports */
2551# return 1;
2552#
2553# export_rva = pe_get32 (dll, opthdr_ofs + 96);
2554# export_size = pe_get32 (dll, opthdr_ofs + 100);
2555# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
2556# secptr = (pe_header_offset + 4 + 20 +
2557# pe_get16 (dll, pe_header_offset + 4 + 16));
2558#
2559# expptr = 0;
2560# for (i = 0; i < nsections; i++)
2561# {
2562# char sname[8];
2563# unsigned long secptr1 = secptr + 40 * i;
2564# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
2565# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
2566# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
2567# lseek(dll, secptr1, SEEK_SET);
2568# read(dll, sname, 8);
2569# if (vaddr <= export_rva && vaddr+vsize > export_rva)
2570# {
2571# expptr = fptr + (export_rva - vaddr);
2572# if (export_rva + export_size > vaddr + vsize)
2573# export_size = vsize - (export_rva - vaddr);
2574# break;
2575# }
2576# }
2577#
2578# expdata = (unsigned char*)malloc(export_size);
2579# lseek (dll, expptr, SEEK_SET);
2580# read (dll, expdata, export_size);
2581# erva = expdata - export_rva;
2582#
2583# nexp = pe_as32 (expdata+24);
2584# name_rvas = pe_as32 (expdata+32);
2585#
2586# printf ("EXPORTS\n");
2587# for (i = 0; i<nexp; i++)
2588# {
2589# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
2590# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
2591# }
2592#
2593# return 0;
2594# }
2595# /* impgen.c ends here */
2596
2597EOF
2598 ;;
2599 esac
2600
2601
2602 # Append the ltmain.sh script.
2603 sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
2604 # We use sed instead of cat because bash on DJGPP gets confused if
2605 # if finds mixed CR/LF and LF-only lines. Since sed operates in
2606 # text mode, it properly converts lines to CR/LF. This bash problem
2607 # is reportedly fixed, but why not run on old versions too?
2608
2609 chmod +x "$ofile"
2610 fi
2611 ;;
2612
2613*)
2614 # Compile the libtool program.
2615 echo "FIXME: would compile $ltmain"
2616 ;;
2617esac
2618
2619# Update the list of available tags.
2620if test -n "$tagname"; then
2621
2622 # Extract list of available tagged configurations in $ofile.
2623 # Note that this assumes the entire list is on one line.
2624 available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2625
2626 # Append the new tag name to the list of available tags.
2627 available_tags="$available_tags $tagname"
2628
2629 # Now substitute the updated of available tags.
2630 if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then
2631 mv ${ofile}.new ${ofile}
2632 chmod +x "$ofile"
2633 else
2634 rm -f ${ofile}.new
2635 echo "$progname: unable to update list of available tagged configurations."
2636 exit 1
2637 fi
2638fi
2639
2640# Don't cache tagged configuration!
2641test -n "$cache_file" && test -z "$tagname" || exit 0
2642
2643# AC_CACHE_SAVE
2644trap '' 1 2 15
2645cat > confcache <<\EOF
2646# This file is a shell script that caches the results of configure
2647# tests run on this system so they can be shared between configure
2648# scripts and configure runs. It is not useful on other systems.
2649# If it contains results you don't want to keep, you may remove or edit it.
2650#
2651# By default, configure uses ./config.cache as the cache file,
2652# creating it if it does not exist already. You can give configure
2653# the --cache-file=FILE option to use a different cache file; that is
2654# what configure does when it calls configure scripts in
2655# subdirectories, so they share the cache.
2656# Giving --cache-file=/dev/null disables caching, for debugging configure.
2657# config.status only pays attention to the cache file if you give it the
2658# --recheck option to rerun configure.
2659#
2660EOF
2661# The following way of writing the cache mishandles newlines in values,
2662# but we know of no workaround that is simple, portable, and efficient.
2663# So, don't put newlines in cache variables' values.
2664# Ultrix sh set writes to stderr and can't be redirected directly,
2665# and sets the high bit in the cache file unless we assign to the vars.
2666(set) 2>&1 |
2667 case `(ac_space=' '; set | grep ac_space) 2>&1` in
2668 *ac_space=\ *)
2669 # `set' does not quote correctly, so add quotes (double-quote substitution
2670 # turns \\\\ into \\, and sed turns \\ into \).
2671 sed -n \
2672 -e "s/'/'\\\\''/g" \
2673 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2674 ;;
2675 *)
2676 # `set' quotes correctly as required by POSIX, so do not add quotes.
2677 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2678 ;;
2679 esac >> confcache
2680if cmp -s $cache_file confcache; then
2681 :
2682else
2683 if test -w $cache_file; then
2684 echo "updating cache $cache_file"
2685 cat confcache > $cache_file
2686 else
2687 echo "not updating unwritable cache $cache_file"
2688 fi
2689fi
2690rm -f confcache
2691
2692exit 0
2693
2694# Local Variables:
2695# mode:shell-script
2696# sh-indentation:2
2697# End:
Note: See TracBrowser for help on using the repository browser.