3 # ltconfig - Create a system-specific libtool.
4 # When updating this script, search for LINENUM and fix line number refs.
5 # Generated automatically from ltconfig.in by configure.
6 # Copyright (C) 1996, 1997, Free Software Foundation, Inc.
7 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This file is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
28 # A lot of this script is taken from autoconf-2.10.
30 # The name of this program.
31 progname
=`echo "$0" | sed 's%^.*/%%'`
37 ac_compile
='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
40 help="Try \`$progname --help' for more information."
45 # All known linkers require a `.a' archive for static linking.
59 old_CPPFLAGS
="$CPPFLAGS"
63 # Parse the command line options.
69 -*=*) optarg
=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73 # If the previous option needs an argument, assign it.
74 if test -n "$prev"; then
82 Usage: $progname [OPTION]... LTMAIN [HOST]
84 Generate a system-specific libtool script.
86 --disable-shared do not build shared libraries
87 --help display this help and exit
88 --no-verify do not verify that HOST is a valid host type
89 --quiet same as \`--silent'
90 --silent don't print informational messages
91 --srcdir=DIR find \`config.guess' in DIR
92 --version output version information and exit
93 --with-gcc assume that the GNU C compiler will be used
95 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
98 HOST is the canonical host system name [default=guessed].
103 --disable-shared) enable_shared
=no
;;
105 --quiet |
--silent) silent
=yes ;;
107 --srcdir) prev
=srcdir
;;
108 --srcdir=*) srcdir
="$optarg" ;;
110 --no-verify) verify_host
=no
;;
112 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
114 --with-gcc) with_gcc
=yes ;;
117 echo "$progname: unrecognized option \`$option'" 1>&2
123 if test "$ltmain" = NONE
; then
125 elif test "$host" = NONE
; then
126 # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
127 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
128 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
132 echo "$progname: too many arguments" 1>&2
139 if test "$ltmain" = NONE
; then
140 echo "$progname: you must specify a LTMAIN file" 1>&2
145 if test -f "$ltmain"; then :
147 echo "$progname: warning: \`$ltmain' does not exist" 1>&2
150 # Quote any args containing shell metacharacters.
155 *" "*|
*" "*|
*[\
[\
]\~\
#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
156 ltconfig_args
="$ltconfig_args '$arg'" ;;
157 *) ltconfig_args
="$ltconfig_args $arg" ;;
161 # A relevant subset of AC_INIT.
163 # File descriptor usage:
166 # 2 errors and warnings
167 # 3 some systems may open it to /dev/tty
168 # 4 used on the Kubota Titan
169 # 5 compiler messages saved in config.log
170 # 6 checking for... messages and results
171 if test "$silent" = yes; then
179 # Only set LANG and LC_ALL to C if already set.
180 # These must not be set unconditionally because not all systems understand
181 # e.g. LANG=C (notably SCO).
182 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
183 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
185 if (echo "testing\c"; echo 1,2,3) |
grep c
>/dev
/null
; then
186 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
187 if (echo -n testing
; echo 1,2,3) |
sed s
/-n/xn
/ |
grep xn
>/dev
/null
; then
194 ac_n
= ac_c
='\c' ac_t
=
197 if test -z "$srcdir"; then
198 # Assume the source directory is the same one as the path to ltmain.sh.
199 srcdir
=`echo "$ltmain" | sed 's%/[^/]*$%%'`
200 test "$srcdir" = "$ltmain" && srcdir
=.
203 if test "$verify_host" = yes; then
204 # Check for config.guess and config.sub.
206 for ac_dir
in $srcdir $srcdir/..
$srcdir/..
/..
; do
207 if test -f $ac_dir/config.guess
; then
212 if test -z "$ac_aux_dir"; then
213 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
217 ac_config_guess
=$ac_aux_dir/config.guess
218 ac_config_sub
=$ac_aux_dir/config.sub
220 # Make sure we can run config.sub.
221 if $ac_config_sub sun4
>/dev
/null
2>&1; then :
223 echo "$progname: cannot run $ac_config_sub" 1>&2
228 echo $ac_n "checking host system type""... $ac_c" 1>&6
231 case "$host_alias" in
233 if host_alias
=`$ac_config_guess`; then :
235 echo "$progname: cannot guess host type; you must specify one" 1>&2
240 host=`$ac_config_sub $host_alias`
241 echo "$ac_t""$host" 1>&6
243 elif test "$host" = NONE
; then
244 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
251 host_cpu
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
252 host_vendor
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
253 host_os
=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
255 # Determine commands to create old-style static archives.
256 old_archive_cmds
='ar cru $oldlib$oldobjs'
257 old_postinstall_cmds
='chmod 644 $oldlib'
259 # If RANLIB is not set, then run the test.
260 if test "${RANLIB+set}" != "set"; then
263 echo $ac_n "checking for ranlib... $ac_c" 1>&6
264 if test "$result" = no
; then
265 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
267 test -z "$dir" && dir
=.
268 if test -f $dir/ranlib
; then
277 echo $ac_t "$result" 1>&6
280 if test -n "$RANLIB"; then
281 old_archive_cmds
="$old_archive_cmds;\$RANLIB \$oldlib"
282 old_postinstall_cmds
="$old_postinstall_cmds;\$RANLIB \$oldlib"
285 # Check to see if we are using GCC.
286 if test "$with_gcc" = no
; then
287 # If CC is not set, then try to find GCC or a usable CC.
288 if test -z "$CC"; then
289 echo $ac_n "checking for gcc... $ac_c" 1>&6
290 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
293 test -z "$dir" && dir
=.
294 if test -f $dir/gcc
; then
301 if test -n "$CC"; then
302 echo "$ac_t""$CC" 1>&6
304 echo "$ac_t""no" 1>&6
308 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
309 if test -z "$CC"; then
310 echo $ac_n "checking for cc... $ac_c" 1>&6
311 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
314 test -z "$dir" && dir
=.
315 if test -f $dir/cc
; then
316 if test "$dir/cc" = "/usr/ucb/cc"; then
325 if test $cc_rejected = yes; then
326 # We found a bogon in the path, so make sure we never use it.
329 if test $# -gt 0; then
330 # We chose a different compiler from the bogus one.
331 # However, it has the same name, so the bogon will be chosen
332 # first if we set CC to just the name; use the full file name.
334 set dummy
"$dir/cc" "$@"
340 if test -n "$CC"; then
341 echo "$ac_t""$CC" 1>&6
343 echo "$ac_t""no" 1>&6
346 if test -z "$CC"; then
347 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
352 # Now see if the compiler is really GCC.
354 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
356 trap "$rm conftest.c; exit 1" 1 2 15
358 cat > conftest.c
<<EOF
364 if { ac_try
='${CC-cc} -E conftest.c'; { (eval echo $progname:364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } |
egrep yes >/dev
/null
2>&1; then
368 echo $ac_t "$with_gcc" 1>&6
371 # Allow CC to be a program name with arguments.
375 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
377 profile_flag_pattern
=
378 special_shlib_compile_flags
=
382 if test "$with_gcc" = yes; then
384 profile_flag_pattern
='-pg?'
386 link_static_flag
='-static'
388 # PORTME Check for PIC flags for the system compiler.
390 *-*-aix3* |
*-*-aix4*)
391 # FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform?
393 link_static_flag
='-bnso -bI:/lib/syscalls.exp'
396 *-*-hpux9* |
*-*-hpux10*)
397 # FIXME is there a better link_static_flag that works with the bundled CC?
399 link_static_flag
='${wl}-a ${wl}archive'
403 *-*-irix5* |
*-*-irix6*)
405 link_static_flag
='-non_shared'
406 # PIC (with -KPIC) is the default.
411 # FIXME - pic_flag is probably required for hppa*-osf* and i860-osf*
413 link_static_flag
='-non_shared'
418 link_static_flag
='-dn'
419 special_shlib_compile_flags
='-belf'
424 link_static_flag
='-Bstatic'
429 link_static_flag
='-Bstatic'
440 rs6000-
*-* | powerpc-
*-* | powerpcle-
*-*)
441 # Yippee! All RS/6000 and PowerPC code is position-independent.
446 if test -n "$pic_flag"; then
447 echo $ac_t "$pic_flag" 1>&6
448 pic_flag
=" $pic_flag"
453 # Check for any special shared library compilation flags.
454 if test -n "$special_shlib_compile_flags"; then
455 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
456 if echo "$old_CC $old_CFLAGS " |
egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev
/null
; then :
458 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
463 echo $ac_n "checking for $compiler option to statically link programs... $ac_c" 1>&6
464 if test -n "$link_static_flag"; then
465 echo $ac_t "$link_static_flag" 1>&6
470 # See if we're really using GNU ld.
471 test -z "$LD" && LD
="ld"
473 # Allow LD to be a program name with arguments.
476 echo $ac_n "checking if $LD is GNU ld... $ac_c" 1>&6
477 if $LD --version 2>&1 |
egrep 'with BFD' > /dev
/null
; then
481 echo $ac_t "$with_gnu_ld" 1>&6
483 # See if the linker supports building shared libraries.
484 echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6
487 hardcode_libdir_flag
=
490 hardcode_shlibpath_var
=unsupported
493 if test "$with_gnu_ld" = yes; then
494 # See if GNU ld supports shared libraries.
500 hardcode_shlibpath_var
=no
504 if $LD --help 2>&1 |
egrep ': supported targets:.* elf' > /dev
/null
; then
512 if test "$ld_shlibs" = yes; then
513 archive_cmds
='$cc -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
514 hardcode_libdir_flag
='${wl}-rpath $wl$libdir'
517 # PORTME fill in a description of your system's linker (not GNU ld)
520 archive_cmds
='/usr/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'
521 test "$with_gcc" != yes && hardcode_direct
=yes
526 archive_cmds
='/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'
527 test "$with_gcc" != yes && hardcode_direct
=yes
532 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
535 hardcode_shlibpath_var
=no
539 archive_cmds
='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib'
540 hardcode_libdir_flag
='${wl}+b ${wl}$libdir'
546 archive_cmds
='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
547 hardcode_libdir_flag
='${wl}+b ${wl}$libdir'
552 *-*-irix5* |
*-*-irix6*)
553 archive_cmds
='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
554 hardcode_libdir_flag
='${wl}-rpath ${wl}$libdir'
558 # Tested with NetBSD 1.2 ld
559 archive_cmds
='$LD -Bshareable -o $lib$libobjs$deplibs'
560 hardcode_libdir_flag
='-R$libdir'
562 hardcode_shlibpath_var
=no
566 archive_cmds
='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
567 hardcode_libdir_flag
='${wl}-rpath ${wl}$libdir'
571 archive_cmds
='$LD -G -o $lib$libobjs$deplibs'
576 archive_cmds
='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
577 hardcode_libdir_flag
='-R$libdir'
578 hardcode_shlibpath_var
=no
582 archive_cmds
='$LD -assert pure-text -Bstatic -o $lib$libobjs'
583 hardcode_libdir_flag
='-L$libdir'
586 hardcode_shlibpath_var
=no
595 echo $ac_t "$ld_shlibs" 1>&6
597 # Check hardcoding attributes.
598 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
600 if test -n "$hardcode_libdir_flag"; then
601 # We can hardcode non-existant directories.
602 if test "$hardcode_direct" != no
&&
603 test "$hardcode_minus_L" != no
&&
604 test "$hardcode_shlibpath_var" != no
; then
606 # Can't link without hardcoding.
607 hardcode_action
=relink
609 hardcode_action
=rpath
611 elif test "$hardcode_direct" = yes ||
612 test "$hardcode_minus_L" = yes ||
613 test "$hardcode_shlibpath_var" = yes; then
615 # We can't hardcode non-existant directories, but we can existing ones.
616 hardcode_action
=relink
618 # We can't hardcode anything.
619 hardcode_action
=unsupported
621 echo $ac_t "$hardcode_action" 1>&6
622 test "$hardcode_action" = unsupported
&& can_build_shared
=no
626 reload_cmds
='$LD$reload_flag -o $output$reload_objs'
627 echo $ac_n "checking for $linker option to reload object files... $ac_c" 1>&6
628 # PORTME Some linker may need a different reload flag.
630 echo $ac_t "$reload_flag"
631 test -n "$reload_flag" && reload_flag
=" $reload_flag"
633 # PORTME Fill in your ld.so characteristics
640 dynamic_linker
="$host_os ld.so"
642 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
644 *-*-aix3* |
*-*-aix4*)
645 # Shared libraries and static libraries currently use the same namespace.
646 test "$enable_shared" = no || enable_static
=no
649 lib_names
='$libname.so.$versuffix $libname.a'
650 shlibpath_var
=LIBPATH
652 # AIX has no versioning support, so we append a major version to the name.
653 soname_spec
='$libname.so.$major'
658 lib_names
='$libname.so.$versuffix $libname.so'
659 finish_cmds
='ldconfig -m $libdir'
660 shlibpath_var
=LD_LIBRARY_PATH
665 lib_names
='$libname.so.$versuffix'
666 shlibpath_var
=LD_LIBRARY_PATH
669 *-*-hpux9* |
*-*-hpux10*)
670 # Give a soname corresponding to the major version so that dld.sl refuses to
671 # link against other versions.
672 dynamic_linker
="$host_os dld.sl"
674 shlibpath_var
=SHLIB_PATH
675 lib_names
='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
676 soname_spec
='$libname.sl.$major'
677 # HP-UX runs *really* slowly unless shared libraries are mode 555.
678 postinstall_cmds
='chmod 555 $lib'
681 *-*-irix5* |
*-*-irix6*)
683 soname_spec
='$libname.so'
684 lib_names
='$libname.so.$versuffix $libname.so'
685 shlibpath_var
=LD_LIBRARY_PATH
688 # No shared lib support for linuxoldld or linuxaout.
689 *-*-linuxoldld* |
*-*-linuxaout*)
696 lib_names
='$libname.so.$versuffix $libname.so.$major $libname.so'
697 soname_spec
='$libname.so.$major'
698 finish_cmds
='ldconfig -n $libdir'
699 shlibpath_var
=LD_LIBRARY_PATH
704 lib_names
='$libname.so.$versuffix'
705 finish_cmds
='ldconfig -m $libdir'
706 shlibpath_var
=LD_LIBRARY_PATH
711 soname_spec
='$libname.so'
712 lib_names
='$libname.so.$versuffix $libname.so'
713 shlibpath_var
=LD_LIBRARY_PATH
718 soname_spec
='$libname.so.$major'
719 lib_names
='$libname.so.$versuffix $libname.so.$major $libname.so'
720 shlibpath_var
=LD_LIBRARY_PATH
725 lib_names
='$libname.so.$versuffix $libname.so.$major $libname.so'
726 soname_spec
='$libname.so.$major'
727 shlibpath_var
=LD_LIBRARY_PATH
732 lib_names
='$libname.so.$versuffix'
733 finish_cmds
='ldconfig $libdir'
734 shlibpath_var
=LD_LIBRARY_PATH
742 echo "$ac_t""$dynamic_linker"
745 # FIXME need to add library stripping features
746 # strip -x works for most platforms, though not for static libraries on NetBSD
747 # HP-UX requires "-r" for library stripping
751 #echo $ac_n "checking for static library strip program... $ac_c" 1>&6
752 #if test -n "$old_striplib"; then
753 # echo $ac_t "$old_striplib" 1>&6
755 # echo $ac_t none 1>&6
758 #if test "$can_build_shared" = yes; then
759 # echo $ac_n "checking for shared library strip program... $ac_c" 1>&6
761 # if test -n "$striplib"; then
762 # echo $ac_t "$striplib" 1>&6
764 # echo $ac_t none 1>&6
768 # Report the consequences.
769 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
771 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
772 test "$can_build_shared" = "no" && enable_shared
=no
774 if test "$enable_shared" = yes; then
775 # On AIX, we do not build both static and shared libraries.
778 test "$enable_static" = yes && enable_static
=no
779 if test -n "$RANLIB"; then
780 archive_cmds
="$archive_cmds;\$RANLIB \$lib"
781 postinstall_cmds
='$RANLIB $lib'
787 echo "$ac_t""$enable_shared" 1>&6
791 trap "$rm $ofile; exit 1" 1 2 15
797 # libtool - Provide generalized library-building support services.
799 # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
800 # This program was configured as follows,
801 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
803 # CC="$old_CC" CFLAGS="$old_CFLAGS" LD="$old_LD" RANLIB="$old_RANLIB" \\
806 # Compiler and other test output produced by $progname, useful for
807 # debugging $progname, is in ./config.log if it exists.
809 # The version of $progname that generated this script.
810 LTCONFIG_VERSION="$VERSION"
812 # Whether or not to build libtool libraries.
813 build_libtool_libs=$enable_shared
815 # Whether or not to build old-style libraries.
816 build_old_libs=$enable_static
819 host_alias="$host_alias"
822 # The linker used to build libraries.
825 # How to create reloadable object files.
826 reload_flag='$reload_flag'
827 reload_cmds='$reload_cmds'
829 # How to pass a linker flag through the compiler.
832 # Additional compiler flags for building library objects.
835 # Compiler flag to prevent dynamic linking.
836 link_static_flag='$link_static_flag'
838 # Pattern to match compiler flags for creating libNAME_p libraries:
839 profile_flag_pattern='$profile_flag_pattern'
841 # Library versioning type.
842 version_type=$version_type
844 # List of archive names. First name is the real one, the rest are links.
845 # The last name is the one that the linker finds with -lNAME.
846 lib_names='$lib_names'
848 # The coded name of the library, if different from the real name.
849 soname_spec='$soname_spec'
851 # Commands used to build and install an old-style archive.
853 old_archive_cmds='$old_archive_cmds'
854 old_postinstall_cmds='$old_postinstall_cmds'
856 # Commands used to build and install a shared archive.
857 archive_cmds='$archive_cmds'
858 postinstall_cmds='$postinstall_cmds'
860 # Commands used to finish a libtool library installation in a directory.
861 finish_cmds='$finish_cmds'
863 # How to strip a library file.
865 old_striplib='$old_striplib'
867 # This is the shared library path variable.
868 shlibpath_var=$shlibpath_var
870 # How to hardcode a shared library path into an executable.
871 hardcode_action=$hardcode_action
873 # Flag to hardcode \$libdir into a binary during linking.
874 # This must work even if \$libdir does not exist.
875 hardcode_libdir_flag='$hardcode_libdir_flag'
877 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
879 hardcode_direct=$hardcode_direct
881 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
883 hardcode_minus_L=$hardcode_minus_L
885 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the
886 # the resulting binary.
887 hardcode_shlibpath_var=$hardcode_shlibpath_var
891 # Detect if we are using a relative or absolute path to ltmain.sh.
893 /*) cat <<EOF2 >> $ofile
894 # Execute the libtool backend.
898 *) cat <<EOF3 >> $ofile
899 # Find the path to this script.
900 thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\`
901 test "X\$0" = "X\$thisdir" && thisdir=.
903 # Execute the libtool backend.
909 echo 'exit 1' >> $ofile