+Mon Dec 2 13:57:28 1996 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * tests: Added new subdirectory.
+
+ * doc/libtool.texi: Doc fixes, and finished up the Configuring
+ chapter.
+
+ * ltmain.sh.in (link): Allow *._o and *.l_o to be valid object
+ file suffixes, for Automake's ansi2knr implementation.
+ New option -version-info replaces -version-file.
+
+ [help]: Give a pointer to mode-specific help when appropriate.
+
+ * ltconfig.in: Changed messages to correspond to AM_PROG_CC_STDC.
+
+ * demo: Also test Automake's ansi2knr support.
+
Tue Nov 19 14:09:27 1996 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* ltconfig.in: Bug fixes for AIX 4, and for static platforms.
AC_INIT(ltmain.sh.in)
-AM_INIT_AUTOMAKE(libtool, 0.6a)
+AM_INIT_AUTOMAKE(libtool, 0.6b)
pkgdatadir='${datadir}/libtool'
AC_SUBST(pkgdatadir)
# Global variables:
enable_shared=yes
+# All known linkers require a `.a' archive for static linking.
enable_static=yes
ltmain=NONE
silent=
exit 1
fi
-if test -e "$ltmain"; then :
+if test -f "$ltmain"; then :
else
echo "$progname: warning: \`$ltmain' does not exist" 1>&2
fi
host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+# Determine commands to create old-style static archives.
+old_archive_cmds='ar cru $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+
+# If RANLIB is not set, then run the test.
+if test -z "$RANLIB"; then
+ result=no
+
+ echo $ac_n "checking for ranlib... $ac_c" 1>&6
+ if test "$result" = no; then
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/ranlib; then
+ RANLIB="ranlib"
+ result="ranlib"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ echo $ac_t "$result" 1>&6
+fi
+
+if test -n "$RANLIB"; then
+ old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
+ old_postinstall_cmds='$RANLIB $oldlib'
+fi
+
+# FIXME: this is simplistic, and doesn't allow for cross-compiling.
+echo $ac_n "checking for library strip program... $ac_c" 1>&6
+striplib=
+if strip -x /dev/null 2>&1 | grep '/dev/null' >/dev/null 2>&1; then
+ # strip: /dev/null: Inappropriate file type or format
+ striplib="strip -x"
+fi
+
+if test -n "$striplib"; then
+ echo $ac_t "$striplib" 1>&6
+else
+ echo $ac_t none 1>&6
+fi
+
# Check to see if we are using GCC.
if test "$with_gcc" = no; then
# If CC is not set, then try to find GCC or a usable CC.
profile_flag_pattern='-pg?'
wl='-Wl,'
link_static_flag='-static'
- case "$host" in
- *-*-aix3* | *-*-aix4*)
- # Yippee! All AIX code is position-independent.
- compile_flags='-DPIC'
- ;;
- esac
else
# PORTME Check for PIC flags for the system compiler.
case "$host" in
*-*-aix3* | *-*-aix4*)
- compile_flags='-DPIC'
+ # FIXME compile_flags, or are all AIX platforms PIC?
+ link_static_flags='-bnso -bI:/lib/syscalls.exp'
;;
*-*-hpux10*)
;;
*-*-osf3*)
- # Yippee! Another system with position-independant code by default.
+ # FIXME - compile_flags, link_static_flag?
compile_flags='-DPIC'
;;
*-*-sunos4*)
compile_flags='-PIC -DPIC'
link_static_flag='-Bstatic'
+ wl='-Qoption ld '
;;
*)
esac
fi
+case "$host" in
+rs6000-*-*)
+ # Yippee! All rs/6000 code is position-independent.
+ compile_flags='-DPIC'
+ ;;
+esac
+
if test -n "$compile_flags"; then
echo $ac_t "$compile_flags" 1>&6
compile_flags=" $compile_flags"
# PORTME fill in a description of your system's linker (not GNU ld)
case "$host" in
*-*-aix3*)
- archive_cmds='$rm $lib.exp;/ucb/nm$libobjs | egrep " D " | sed "s/^.* //" > $lib.exp;$LD -o $lib.o$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;ar cru $lib $lib.o'
+ 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'
hardcode_shlibpath_var=yes
hardcode_minus_L=yes
;;
*-*-aix4*)
- archive_cmds='$rm $lib.exp;/bin/nm -B$libobjs | egrep " D " | sed "s/^.* //" > $lib.exp;$cc -o $lib.o$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;ar cru $lib $lib.o'
+ 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'
hardcode_shlibpath_var=yes
hardcode_minus_L=yes
;;
*-*-freebsd*)
archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
hardcode_minus_L=yes
- link_rpath_flag='-L$libdir'
;;
*-*-hpux10*)
soname_spec=
postinstall_cmds=
finish_cmds=
-shlibpath_var=LD_LIBRARY_PATH
+shlibpath_var=
version_type=none
dynamic_linker="$host_os ld.so"
# Shared libraries and static libraries currently use the same namespace.
test "$enable_shared" = no || enable_static=no
- version_type=solaris # But only for show... AIX has no versioning.
+ version_type=linux
lib_names='$libname.so.$versuffix $libname.a'
shlibpath_var=LIBPATH
+
+ # AIX has no versioning support, so we append a major version to the name.
+ soname_spec='$libname.so.$major'
;;
*-*-freebsd*)
version_type=sunos
lib_names='$libname.so.$versuffix $libname.so'
finish_cmds='ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-gnu*)
version_type=sunos
lib_names='$libname.so.$versuffix'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-hpux10*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
dynamic_linker="$host_os dld.sl"
- version_type=hpux
+ version_type=sunos
shlibpath_var=SHLIB_PATH
lib_names='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
soname_spec='$libname.sl.$major'
- postinstall='chmod 555 $lib'
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
;;
# No shared lib support for linuxoldld or linuxaout.
;;
*-*-linux*)
- version_type=solaris
+ version_type=linux
lib_names='$libname.so.$versuffix $libname.so.$major $libname.so'
- finish_cmds='ldconfig $libdir'
+ soname_spec='$libname.so.$major'
+ finish_cmds='ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-netbsd*)
version_type=sunos
lib_names='$libname.so.$versuffix'
finish_cmds='ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-osf3*)
version_type=osf
soname_spec='$libname.so'
lib_names='$libname.so.$versuffix $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-solaris2*)
- version_type=solaris
- lib_names='$libname.so.$versuffix'
+ version_type=linux
+ lib_names='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='$libname.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*-*-sunos4*)
version_type=sunos
lib_names='$libname.so.$versuffix'
finish_cmds='ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
;;
*)
echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
test "$can_build_shared" = "no" && enable_shared=no
-echo "$ac_t""$enable_shared" 1>&6
-
-# All known linkers require a `.a' archive for static linking.
-enable_static=yes
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='ar cru $oldlib$oldobjs'
-old_postinstall_cmds=''
-
-# If RANLIB is not set, then run the test.
-if test -z "$RANLIB"; then
- result=no
-
- echo $ac_n "checking for ranlib... $ac_c" 1>&6
- if test "$result" = no; then
- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/ranlib; then
- RANLIB="ranlib"
- result="ranlib"
- break
- fi
- done
- IFS="$save_ifs"
- fi
- echo $ac_t "$result" 1>&6
+if test "$enable_shared" = yes; then
+ # On AIX, we do not build both static and shared libraries.
+ case "$host_os" in
+ aix*)
+ test "$enable_static" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds;\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ esac
fi
-if test -n "$RANLIB"; then
- old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
- old_postinstall_cmds='$RANLIB $oldlib'
-fi
+echo "$ac_t""$enable_shared" 1>&6
+
ofile=libtool
trap "rm -fr $ofile; exit 1" 1 2 15
# The flag that specifies a runtime search path when linking.
link_rpath_flag='$link_rpath_flag'
+# How to strip a library file.
+striplib='$striplib'
+
# This is the shared library path variable.
shlibpath_var=$shlibpath_var
esac
fi
- if test -n "$link_rpath_flag"; then
- # Check to see that this really is a libtool archive.
- if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then :
- else
- echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
- exit 1
- fi
+ # Check to see that this really is a libtool archive.
+ if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then :
+ else
+ echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
- libdir=
- . $file
+ libdir=
+ . $file
- if test -z "$libdir"; then
- echo "$progname: \`$arg' contains no -rpath information" 1>&2
- exit 1
- fi
+ if test -z "$libdir"; then
+ echo "$progname: \`$arg' contains no -rpath information" 1>&2
+ exit 1
+ fi
+ if test -n "$link_rpath_flag"; then
carg="`eval echo \"$link_rpath_flag\"` $carg"
farg="$carg"
fi
elif test "$hardcode_shlibpath_var" = yes; then
# Give an absolute path to the library.
- dir=`cd $dir && pwd`
case "$dir" in
- /*) carg="-L`cd $dir && pwd`/$objdir $arg" ;;
+ /*) absdir="$dir" ;;
*)
- echo "$progname: cannot determine absolute pathname of \`$dir'" 1>&2
- exit 1
+ absdir=`cd $dir && pwd`
+ if test -z "$absdir"; then
+ echo "$progname: cannot determine absolute pathname of \`$dir'" 1>&2
+ exit 1
+ fi
;;
esac
+ carg="-L$absdir/$objdir $carg"
+ farg="-L$libdir $farg"
fi
else
# Transform directly to old archives if we don't build new libraries.
case "$version_type" in
none) ;;
- hpux)
+ libtool)
+ version_vars="$version_vars versuffix"
+ versuffix="$current.$age.$revision"
+ ;;
+
+ linux)
version_vars="$version_vars major versuffix"
- major="$current"
- versuffix="$current.$revision"
+ major=`expr $current - $age`
+ versuffix="$major.$age.$revision"
;;
osf)
verstring="$verstring:${current}.0"
;;
- solaris)
- version_vars="$version_vars major versuffix"
- major=`expr $current - $age`
- verstring="$major.$age.$revision"
- ;;
-
sunos)
- version_vars="$version_vars versuffix"
+ version_vars="$version_vars major versuffix"
+ major="$current"
versuffix="$current.$revision"
;;
# Maybe add a suffix.
test -n "$suffix" && libname=$libname"_$suffix"
+ # Create the output directory, or remove our outputs if we need to.
+ if test -d $objdir; then
+ $show "$rm $objdir/$libname.*"
+ $run $rm $objdir/$libname.*
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir || exit $?
+ fi
+
if test "$build_libtool_libs" = yes; then
# Get the real and link names of the library.
library_names=`eval echo \"$lib_names\"`
realname="$2"
shift; shift
- if test -n "$soname"; then
+ if test -n "$soname_spec"; then
soname=`eval echo \"$soname_spec\"`
else
soname="$realname"
linknames="$linknames $objdir/$link"
done
- # Create the output directory, or remove our outputs if we need to.
- if test -d $objdir; then
- $show "$rm $objdir/$libname.*"
- $run $rm $objdir/$libname.*
- else
- $show "$mkdir $objdir"
- $run $mkdir $objdir || exit $?
- fi
-
# Do each of the archive commands.
cmds=`eval echo \"$archive_cmds\"`
- IFS=${IFS= }; save_ifs="$IFS"; IFS=';'
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
- $run $cmd || exit $?
+ eval "$run $cmd" || exit $?
done
IFS="$save_ifs"
*)
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
# We have no uninstalled library dependencies, so finalize right now.
- $show "$finalize_command"
- $run $finalize_command
+ compile_command=`echo "$compile_command" | sed "s%-o $objdir/%-o %"`
+ $show "$compile_command"
+ $run $compile_command
exit $?
fi
# Find the directory that this script lives in.
thisdir=\`echo \$0 | sed 's%/[^/]*$%%'\`
test "x\$thisdir" = "x\$0" && thisdir=.
+
+ # Try to get the absolute directory name.
+ absdir=\`cd "\$thisdir" && pwd\`
+ test -n "\$absdir" && thisdir="\$absdir"
+
program="\$thisdir/$objdir/$output"
EOF
cmds=`eval echo \"$old_archive_cmds\"`
# Do each command in the archive commands.
- IFS=${IFS= }; save_ifs="$IFS"; IFS=';'
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
- $run $cmd || exit $?
+ eval "$run $cmd" || exit $?
done
IFS="$save_ifs"
fi
-g) prev="-g" ;;
-m) prev="-m" ;;
-o) prev="-o" ;;
- -s) stripme=" -s" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
-*) ;;
*)
shift
shift
- # FIXME support stripping libraries
- if test -n "$stripme"; then
- echo "$progname: will not strip libraries (yet)" 1>&2
- fi
-
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$realname $destdir/$realname"
- $run $install_prog $dir/$realname $destdir/$realname || exit $?
+ eval "$run $install_prog $dir/$realname $destdir/$realname" || exit $?
+
+ # Support stripping libraries.
+ if test -n "$stripme"; then
+ if test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run $striplib $destdir/$realname || exit $?
+ else
+ echo "$progname: warning: no library stripping program" 1>&2
+ fi
+ fi
if test -n "$1"; then
# Delete the old symlinks.
- $show "$rm $@"
- $run $rm $@
+ rmcmd="$rm"
+ for linkname
+ do
+ rmcmd="$rmcmd $destdir/$linkname"
+ done
+ $show "$rmcmd"
+ $run $rmcmd
# ... and create new ones.
- for linkname; do
+ for linkname
+ do
$show "$ln_s $realname $destdir/$linkname"
$run $ln_s $realname $destdir/$linkname
done
# Do each command in the postinstall commands.
lib="$destdir/$realname"
cmds=`eval echo \"$postinstall_cmds\"`
- IFS=${IFS= }; save_ifs="$IFS"; IFS=';'
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
- $run $cmd || exit $?
+ eval "$run $cmd" || exit $?
done
IFS="$save_ifs"
fi
exit 1
fi
+ finalize=yes
for lib in $link_against_libtool_libs; do
# Check to see that each library is installed.
libdir=
elif test -f "$libfile"; then :
else
echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
fi
done
if test "$hardcode_minus_L" = yes && test "$hardcode_shlibpath_var" = yes; then
- echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker"
- $show "$finalize_command"
- if $run $finalize_command; then :
+ if test "$finalize" = no; then
+ echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker"
else
- echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
- continue
+ echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker"
+ $show "$finalize_command"
+ if $run $finalize_command; then :
+ else
+ echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
+ continue
+ fi
+ file="$objdir/$file"T
fi
- file="$objdir/$file"T
else
# Install the binary that we compiled earlier.
dir=`echo "$file" | sed 's%/[^/]*$%%'`
# Set up the ranlib parameters.
oldlib="$destdir/$name"
- # FIXME support stripping libraries
- if test -n "$stripme"; then
- echo "$progname: will not strip libraries (yet)" 1>&2
- fi
-
$show "$install_prog $file $oldlib"
$run $install_prog $file $oldlib || exit $?
+ # Support stripping libraries.
+ if test -n "$stripme"; then
+ if test -n "$striplib"; then
+ $show "$striplib $oldlib"
+ $run $striplib $oldlib || exit $?
+ else
+ echo "$progname: warning: no library stripping program" 1>&2
+ fi
+ fi
+
# Do each command in the postinstall commands.
cmds=`eval echo \"$old_postinstall_cmds\"`
- IFS=${IFS= }; save_ifs="$IFS"; IFS=';'
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
- $run $cmd || exit $?
+ eval "$run $cmd" || exit $?
done
IFS="$save_ifs"
done
libdirs="$nonopt"
if test -n "$finish_cmds" && test -n "$libdirs"; then
- for dir; do
+ for dir
+ do
libdirs="$libdirs $dir"
done
for libdir in $libdirs; do
# Do each command in the postinstall commands.
cmds=`eval echo \"$finish_cmds\"`
- IFS=${IFS= }; save_ifs="$IFS"; IFS=';'
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
- $run $cmd
+ eval "$run $cmd"
done
IFS="$save_ifs"
done