3 # ltconfig - Create a system-specific libtool.
4 # Generated automatically from ltconfig.in by configure.
5 # Copyright (C) 1996, Free Software Foundation, Inc.
6 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # A lot of this script is taken from autoconf-2.10.
29 # The name of this program.
30 progname
=`echo "$0" | sed 's%^.*/%%'`
36 ac_compile
='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
39 help="Try \`$progname --help' for more information."
43 # All known linkers require a `.a' archive for static linking.
57 old_CPPFLAGS
="$CPPFLAGS"
61 # Parse the command line options.
67 -*=*) optarg
=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
71 # If the previous option needs an argument, assign it.
72 if test -n "$prev"; then
80 Usage: $progname [OPTION]... LTMAIN [HOST]
82 Generate a system-specific libtool script.
84 --disable-shared do not build shared libraries
85 --help display this help and exit
86 --no-verify do not verify that HOST is a valid host type
87 --quiet same as \`--silent'
88 --silent don't print informational messages
89 --srcdir=DIR find \`config.guess' in DIR
90 --version output version information and exit
91 --with-gcc assume that the GNU C compiler will be used
93 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
96 HOST is the canonical host system name [default=guessed].
101 --disable-shared) enable_shared
=no
;;
103 --quiet |
--silent) silent
=yes ;;
105 --srcdir) prev
=srcdir
;;
106 --srcdir=*) srcdir
="$optarg" ;;
108 --no-verify) verify_host
=no
;;
110 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
112 --with-gcc) with_gcc
=yes ;;
115 echo "$progname: unrecognized option \`$option'" 1>&2
121 if test "$ltmain" = NONE
; then
123 elif test "$host" = NONE
; then
124 # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
125 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
126 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
130 echo "$progname: too many arguments" 1>&2
137 if test "$ltmain" = NONE
; then
138 echo "$progname: you must specify a LTMAIN file" 1>&2
143 if test -f "$ltmain"; then :
145 echo "$progname: warning: \`$ltmain' does not exist" 1>&2
148 # Quote any args containing shell metacharacters.
153 *" "*|
*" "*|
*[\
[\
]\~\
#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
154 ltconfig_args
="$ltconfig_args '$arg'" ;;
155 *) ltconfig_args
="$ltconfig_args $arg" ;;
159 # A relevant subset of AC_INIT.
161 # File descriptor usage:
164 # 2 errors and warnings
165 # 3 some systems may open it to /dev/tty
166 # 4 used on the Kubota Titan
167 # 5 compiler messages saved in config.log
168 # 6 checking for... messages and results
169 if test "$silent" = yes; then
177 # Only set LANG and LC_ALL to C if already set.
178 # These must not be set unconditionally because not all systems understand
179 # e.g. LANG=C (notably SCO).
180 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
181 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
183 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
184 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
185 if (echo -n testing
; echo 1,2,3) |
sed s
/-n/xn
/ |
grep xn
>/dev
/null
; then
192 ac_n
= ac_c
='\c' ac_t
=
195 if test -z "$srcdir"; then
196 # Assume the source directory is the same one as the path to ltmain.sh.
197 srcdir
=`echo "$ltmain" | sed 's%/[^/]*$%%'`
198 test "$srcdir" = "$ltmain" && srcdir
=.
201 if test "$verify_host" = yes; then
202 # Check for config.guess and config.sub.
204 for ac_dir
in $srcdir $srcdir/..
$srcdir/..
/..
; do
205 if test -f $ac_dir/config.guess
; then
210 if test -z "$ac_aux_dir"; then
211 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
215 ac_config_guess
=$ac_aux_dir/config.guess
216 ac_config_sub
=$ac_aux_dir/config.sub
218 # Make sure we can run config.sub.
219 if $ac_config_sub sun4
>/dev
/null
2>&1; then :
221 echo "$progname: cannot run $ac_config_sub" 1>&2
226 echo $ac_n "checking host system type""... $ac_c" 1>&6
229 case "$host_alias" in
231 if host_alias
=`$ac_config_guess`; then :
233 echo "$progname: cannot guess host type; you must specify one" 1>&2
238 host=`$ac_config_sub $host_alias`
239 echo "$ac_t""$host" 1>&6
241 elif test "$host" = NONE
; then
242 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
249 host_cpu
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
250 host_vendor
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
251 host_os
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
253 # Determine commands to create old-style static archives.
254 old_archive_cmds
='ar cru $oldlib$oldobjs'
255 old_postinstall_cmds
='chmod 644 $oldlib'
257 # If RANLIB is not set, then run the test.
258 if test "${RANLIB+set}" != "set"; then
261 echo $ac_n "checking for ranlib... $ac_c" 1>&6
262 if test "$result" = no
; then
263 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
265 test -z "$dir" && dir
=.
266 if test -f $dir/ranlib
; then
275 echo $ac_t "$result" 1>&6
278 if test -n "$RANLIB"; then
279 old_archive_cmds
="$old_archive_cmds;\$RANLIB \$oldlib"
280 old_postinstall_cmds
="$old_postinstall_cmds;\$RANLIB \$oldlib"
283 # FIXME: this is simplistic, and doesn't allow for cross-compiling.
284 echo $ac_n "checking for library strip program... $ac_c" 1>&6
286 if strip
-x /dev
/null
2>&1 |
grep '/dev/null' >/dev
/null
2>&1; then
287 # strip: /dev/null: Inappropriate file type or format
291 if test -n "$striplib"; then
292 echo $ac_t "$striplib" 1>&6
298 # Check if old-style libraries may be stripped.
300 if test -n "$striplib"; then
301 echo $ac_n "checking if $striplib works for static archives... $ac_c" 1>&6
302 old_striplib
="$striplib"
303 trap 'rm -rf conftest*; exit 1' 1 2 15
304 cat > conftest.c
<<EOF
305 #line 305 "$progname"
306 int external_func() { return 1; }
307 static int hidden_func() { return 2; }
309 if { (eval echo $progname:308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
311 oldobjs
=' conftest.o'
313 # Do each of the archive commands.
314 cmds
=`eval echo \"$old_archive_cmds\"`
315 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
318 if { (echo $progname:317: \"$cmd\") 1>&5; ($cmd) 2>&5; }; then :
326 if test -n "$old_striplib"; then
327 if { (echo $progname:326: \"$old_striplib conftest.a
\") 1>&5; ($old_striplib conftest.a
) 2>&5; }; then :
338 if test -n "$old_striplib"; then
339 echo "$ac_t""yes" 1>&6
341 echo "$ac_t""no" 1>&6
346 # Check to see if we are using GCC.
347 if test "$with_gcc" = no
; then
348 # If CC is not set, then try to find GCC or a usable CC.
349 if test -z "$CC"; then
350 echo $ac_n "checking for gcc... $ac_c" 1>&6
351 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
354 test -z "$dir" && dir
=.
355 if test -f $dir/gcc
; then
362 if test -n "$CC"; then
363 echo "$ac_t""$CC" 1>&6
365 echo "$ac_t""no" 1>&6
369 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
370 if test -z "$CC"; then
371 echo $ac_n "checking for cc... $ac_c" 1>&6
372 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
375 test -z "$dir" && dir
=.
376 if test -f $dir/cc
; then
377 if test "$dir/cc" = "/usr/ucb/cc"; then
386 if test $cc_rejected = yes; then
387 # We found a bogon in the path, so make sure we never use it.
390 if test $# -gt 0; then
391 # We chose a different compiler from the bogus one.
392 # However, it has the same name, so the bogon will be chosen
393 # first if we set CC to just the name; use the full file name.
395 set dummy
"$dir/cc" "$@"
401 if test -n "$CC"; then
402 echo "$ac_t""$CC" 1>&6
404 echo "$ac_t""no" 1>&6
407 if test -z "$CC"; then
408 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
413 # Now see if the compiler is really GCC.
415 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
417 trap "$rm conftest.c; exit 1" 1 2 15
419 cat > conftest.c
<<EOF
424 if eval "$CC -E conftest.c" |
egrep yes >/dev
/null
2>&1; then :
428 echo $ac_t "$with_gcc" 1>&6
431 # Allow CC to be a program name with arguments.
435 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
437 profile_flag_pattern
=
441 if test "$with_gcc" = yes; then
443 profile_flag_pattern
='-pg?'
445 link_static_flag
='-static'
447 # PORTME Check for PIC flags for the system compiler.
449 *-*-aix3* |
*-*-aix4*)
450 # FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform?
451 link_static_flag
='-bnso -bI:/lib/syscalls.exp'
455 # FIXME link_static_flag?
460 # FIXME - pic_flag, link_static_flag?
465 link_static_flag
='-Bstatic'
470 link_static_flag
='-Bstatic'
482 # Yippee! All rs/6000 code is position-independent.
487 if test -n "$pic_flag"; then
488 echo $ac_t "$pic_flag" 1>&6
489 pic_flag
=" $pic_flag"
494 echo $ac_n "checking for $compiler option to statically link programs... $ac_c" 1>&6
495 if test -n "$link_static_flag"; then
496 echo $ac_t "$link_static_flag" 1>&6
501 # See if we're really using GNU ld.
502 test -z "$LD" && LD
="ld"
504 # Allow LD to be a program name with arguments.
507 echo $ac_n "checking if $LD is GNU ld... $ac_c" 1>&6
508 if $LD --version 2>&1 |
egrep 'with BFD' > /dev
/null
; then
512 echo $ac_t "$with_gnu_ld" 1>&6
514 # See if the linker supports building shared libraries.
515 echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6
520 hardcode_shlibpath_var
=no
523 if test "$with_gnu_ld" = yes; then
524 # See if GNU ld supports shared libraries.
532 if $LD --help 2>&1 |
egrep ': supported targets:.* elf' > /dev
/null
; then
540 if test "$ld_shlibs" = yes; then
541 archive_cmds
='$cc -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
542 link_rpath_flag
='${wl}-rpath $wl$libdir'
545 # PORTME fill in a description of your system's linker (not GNU ld)
548 archive_cmds
='$rm $lib.exp;/ucb/nm$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;ar cru $lib $objdir/$soname'
549 hardcode_shlibpath_var
=yes
554 archive_cmds
='$rm $lib.exp;/bin/nm -B$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;ar cru $lib $objdir/$soname'
555 hardcode_shlibpath_var
=yes
560 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
565 archive_cmds
='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
566 link_rpath_flag
='${wl}+b ${wl}$libdir'
568 hardcode_shlibpath_var
=yes
572 # Tested with NetBSD 1.2 ld
573 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
574 link_rpath_flag
='-R$libdir'
578 archive_cmds
='$LD -shared -o $lib -rpath $install_libdir -soname $soname -set_version $verstring$libobjs -lc$deplibs'
579 link_rpath_flag
='${wl}-rpath ${wl}$libdir'
583 archive_cmds
='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
584 link_rpath_flag
='-R$libdir'
588 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
589 link_rpath_flag
='-L$libdir'
599 echo $ac_t "$ld_shlibs" 1>&6
601 if test "$hardcode_shlibpath_var" = yes && test "$hardcode_minus_L" = yes; then
602 echo "$progname: warning: $LD needlessly hardcodes library paths into binaries" 1>&2
603 echo "$PACKAGE will compensate by relinking binaries at install time." 1>&2
607 reload_cmds
='$LD$reload_flag -o $output$reload_objs'
608 echo $ac_n "checking for $linker option to reload object files... $ac_c" 1>&6
609 # PORTME Some linker may need a different reload flag.
611 echo $ac_t "$reload_flag"
612 test -n "$reload_flag" && reload_flag
=" $reload_flag"
614 # PORTME Fill in your ld.so characteristics
622 dynamic_linker
="$host_os ld.so"
624 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
626 *-*-aix3* |
*-*-aix4*)
627 # Shared libraries and static libraries currently use the same namespace.
628 test "$enable_shared" = no || enable_static
=no
631 lib_names
='$libname.so.$versuffix $libname.a'
632 shlibpath_var
=LIBPATH
634 # AIX has no versioning support, so we append a major version to the name.
635 soname_spec
='$libname.so.$major'
640 lib_names
='$libname.so.$versuffix $libname.so'
641 finish_cmds
='ldconfig -m $libdir'
642 shlibpath_var
=LD_LIBRARY_PATH
647 lib_names
='$libname.so.$versuffix'
648 shlibpath_var
=LD_LIBRARY_PATH
652 # Give a soname corresponding to the major version so that dld.sl refuses to
653 # link against other versions.
654 dynamic_linker
="$host_os dld.sl"
656 shlibpath_var
=SHLIB_PATH
657 lib_names
='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
658 soname_spec
='$libname.sl.$major'
659 # HP-UX runs *really* slowly unless shared libraries are mode 555.
660 postinstall_cmds
='chmod 555 $lib'
663 # No shared lib support for linuxoldld or linuxaout.
664 *-*-linuxoldld* |
*-*-linuxaout*)
671 lib_names
='$libname.so.$versuffix $libname.so.$major $libname.so'
672 soname_spec
='$libname.so.$major'
673 finish_cmds
='ldconfig -n $libdir'
674 shlibpath_var
=LD_LIBRARY_PATH
679 lib_names
='$libname.so.$versuffix'
680 finish_cmds
='ldconfig -m $libdir'
681 shlibpath_var
=LD_LIBRARY_PATH
686 soname_spec
='$libname.so'
687 lib_names
='$libname.so.$versuffix $libname.so'
688 shlibpath_var
=LD_LIBRARY_PATH
693 lib_names
='$libname.so.$versuffix $libname.so.$major $libname.so'
694 soname_spec
='$libname.so.$major'
695 shlibpath_var
=LD_LIBRARY_PATH
700 lib_names
='$libname.so.$versuffix'
701 finish_cmds
='ldconfig $libdir'
702 shlibpath_var
=LD_LIBRARY_PATH
710 echo "$ac_t""$dynamic_linker"
713 # Report the consequences.
714 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
716 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
717 test "$can_build_shared" = "no" && enable_shared
=no
719 if test "$enable_shared" = yes; then
720 # On AIX, we do not build both static and shared libraries.
723 test "$enable_static" = yes && enable_static
=no
724 if test -n "$RANLIB"; then
725 archive_cmds
="$archive_cmds;\$RANLIB \$lib"
726 postinstall_cmds
='$RANLIB $lib'
732 echo "$ac_t""$enable_shared" 1>&6
736 trap "$rm $ofile; exit 1" 1 2 15
742 # libtool - Provide generalized library-building support services.
744 # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
745 # This program was configured as follows,
746 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
748 # CC="$old_CC" CFLAGS="$old_CFLAGS" LD="$old_LD" RANLIB="$old_RANLIB" \\
751 # Compiler and other test output produced by $progname, useful for
752 # debugging $progname, is in ./config.log if it exists.
754 # The version of $progname that generated this script.
755 LTCONFIG_VERSION="$VERSION"
757 # Whether or not to build libtool libraries.
758 build_libtool_libs=$enable_shared
760 # Whether or not to build old-style libraries.
761 build_old_libs=$enable_static
764 host_alias="$host_alias"
767 # The linker used to build libraries.
770 # How to create reloadable object files.
771 reload_flag='$reload_flag'
772 reload_cmds='$reload_cmds'
774 # How to pass a linker flag through the compiler.
777 # Additional compiler flags for building library objects.
780 # Compiler flag to prevent dynamic linking.
781 link_static_flag='$link_static_flag'
783 # Pattern to match compiler flags for creating libNAME_p libraries:
784 profile_flag_pattern='$profile_flag_pattern'
786 # Library versioning type.
787 version_type=$version_type
789 # List of archive names. First name is the real one, the rest are links.
790 lib_names='$lib_names'
792 # The coded name of the library, if different from the real name.
793 soname_spec='$soname_spec'
795 # Commands used to build and install an old-style archive.
797 old_archive_cmds='$old_archive_cmds'
798 old_postinstall_cmds='$old_postinstall_cmds'
800 # Commands used to build and install a shared archive.
801 archive_cmds='$archive_cmds'
802 postinstall_cmds='$postinstall_cmds'
804 # Commands used to finish a libtool library installation in a directory.
805 finish_cmds='$finish_cmds'
807 # The flag that specifies a runtime search path when linking.
808 link_rpath_flag='$link_rpath_flag'
810 # How to strip a library file.
812 old_striplib='$old_striplib'
814 # This is the shared library path variable.
815 shlibpath_var=$shlibpath_var
817 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the
818 # the resulting binary.
819 hardcode_shlibpath_var=$hardcode_shlibpath_var
821 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
823 hardcode_minus_L=$hardcode_minus_L
827 # Detect if we are using a relative or absolute path to ltmain.sh.
829 /*) cat <<EOF2 >> $ofile
830 # Execute the libtool backend.
834 *) cat <<EOF3 >> $ofile
835 # Find the path to this script.
836 thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\`
837 test "X\$0" = "X\$thisdir" && thisdir=.
839 # Execute the libtool backend.
845 echo 'exit 1' >> $ofile