0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# ltconfig - Create a system-specific libtool.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 1996-1999 Free Software Foundation, Inc.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# This file is free software; you can redistribute it and/or modify it
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# under the terms of the GNU General Public License as published by
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# the Free Software Foundation; either version 2 of the License, or
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# (at your option) any later version.
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# This program is distributed in the hope that it will be useful, but
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# WITHOUT ANY WARRANTY; without even the implied warranty of
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# General Public License for more details.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# You should have received a copy of the GNU General Public License
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryver# along with this program; if not, write to the Free Software
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryver# As a special exception to the GNU General Public License, if you
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# distribute this file as part of a program that contains a
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# configuration script generated by Autoconf, you may include it under
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryver# the same distribution terms that you use for the rest of that program.
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# A lot of this script is taken from autoconf-2.10.
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver# Check that we are running under the correct shell.
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver # Discard the --no-reexec flag, and continue.
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver # Avoid inline document here, it may be left over
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryverelif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver # Yippee, $echo works!
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryver # Restart under the correct shell.
afaa290bb6acc504e93a0adbf20b6dd6c64e6d63Vernon Schryver # used as fallback echo
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# Find the correct PATH separator. Usually this is `:', but
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# DJGPP uses `;' like DOS.
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
echo="$dir/echo"
elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
export ORIGINAL_CONFIG_SHELL
export CONFIG_SHELL
test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
export CONFIG_SHELL
export SHELL
echo="$CONFIG_SHELL $0 --fallback-echo"
test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
echo="$CONFIG_SHELL $0 --fallback-echo"
prev=:
export echo_test_string
host=
ac_ext=c
objext=o
libext=a
args=
prev=
for option
*) optarg= ;;
if test -n "$prev"; then
eval "$prev=\$option"
prev=
--debug)
echo "$progname: enabling shell trace mode"
if test -z "$ltmain"; then
elif test -z "$host"; then
if test -z "$ltmain"; then
if test ! -f "$ltmain"; then
for arg
# 5 compiler messages saved in config.log
# e.g. LANG=C (notably SCO).
echo "loading cache $cache_file within ltconfig"
if test -z "$srcdir"; then
# Check for config.guess and config.sub.
if test -z "$ac_aux_dir"; then
# Make sure we can run config.sub.
elif test -z "$host"; then
aix3*)
export COLLECT_NAMES
if test -n "$RANLIB"; then
if test -z "$CC"; then
if test -n "$CC"; then
if test -z "$CC"; then
if test -n "$CC"; then
if test -z "$CC"; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
# Append any warnings to the config.log.
# Append any warnings to the config.log.
wl=
aix*)
amigaos*)
solaris*)
sunos4*)
uts4*)
if test -n "$pic_flag"; then
if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
# Append any warnings to the config.log.
if test -s conftest.err; then
# Append any errors to the config.log.
cd conftest
chmod -w .
if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
# Append any errors to the config.log.
chmod u+w .
if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
if test -s conftest.err; then
# Append any errors to the config.log.
if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
if test -s conftest.err; then
# Append any errors to the config.log.
if test -n "$special_shlib_compile_flags"; then
echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if test -z "$LN_S"; then
if test -z "$LD"; then
[\\/]* | [A-Za-z]:[\\/]*)
if test -z "$LD"; then
if test -n "$LD"; then
if test -z "$LD"; then
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
amigaos*)
archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
beos*)
export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
$DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
$CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
$CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
$CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
netbsd*)
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
sunos4*)
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
aix3*)
archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
aix4*)
if test -f "$collect2name" && \
archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
amigaos*)
archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
freebsd1*)
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
freebsd2*)
freebsd*)
hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
netbsd*)
openbsd*)
os2*)
archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
osf3*)
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
rhapsody*)
solaris*)
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
sunos4*)
sysv5*)
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
uts4*)
dgux*)
if test -z "$NM"; then
aix*)
global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
irix*)
solaris*)
if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if test -z "$global_symbol_pipe"; then
if test -n "$hardcode_libdir_flag_spec" || \
test -n "$runpath_var"; then
# PORTME Fill in your ld.so characteristics
aix3*)
aix4*)
amigaos*)
# Create ${libname}_ixlibrary.a entries in /sys/libs.
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'
beos*)
bsdi4*)
# the default ld.so.conf also contains /usr/contrib/lib and
freebsd1*)
freebsd*)
freebsd-*)
gnu*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
# Give a soname corresponding to the major version so that dld.sl refuses to
library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
irix5*)
# Only the GNU ld.so supports shared libraries on MkLinux.
netbsd*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
openbsd*)
os2*)
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
rhapsody*)
solaris*)
sunos4*)
ncr)
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
uts4*)
dgux*)
# configure.in, otherwise build static only libraries.
aix3*)
if test -n "$RANLIB"; then
aix4*)
if test -d .libs; then
if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
eval "ac_cv_lib_$ac_lib_var=yes"
eval "ac_cv_lib_$ac_lib_var=no"
if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
eval "ac_cv_lib_$ac_lib_var=yes"
eval "ac_cv_lib_$ac_lib_var=no"
if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
eval "ac_cv_lib_$ac_lib_var=yes"
eval "ac_cv_lib_$ac_lib_var=no"
if test -z "$ac_err"; then
eval "ac_cv_header_$ac_safe=yes"
eval "ac_cv_header_$ac_safe=no"
if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
# Only quote variables if we're using ltmain.sh.
*.sh)
eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
echo "creating $ofile"
eval "$var=\\\"\$var\\\""
echo "creating $cfgfile"
*.sh)
echo >> "$ofile"
aix3*)
export COLLECT_NAMES
# Append the ltmain.sh script.
echo "FIXME: would compile $ltmain"
# By default, configure uses ./config.cache as the cache file,
# config.status only pays attention to the cache file if you give it the
*ac_space=\ *)
sed -n \
esac >> confcache
if test -w $cache_file; then
echo "updating cache $cache_file"
echo "not updating unwritable cache $cache_file"