From: Robert Boehne Date: Mon, 5 Mar 2001 15:41:55 +0000 (+0000) Subject: Added the link mode option -objectlist FILE. X-Git-Tag: multi-language-merge-point~68 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a21a251320f46b5a6c9bd0d26983290c71fc5d78;p=thirdparty%2Flibtool.git Added the link mode option -objectlist FILE. --- diff --git a/ChangeLog b/ChangeLog index be9c173e9..240954e00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-03-05 Robert Boehne + + * ltmain.in: Add support for the -objectlist option in + link mode. The option behaves identically to the IRIX + 6.5 linker option of the same name. Added a description + of the -objectlist option to the output of + libtool --mode=link --help + * doc/libtool.texi (Link mode): Added documentation for + the -objectlist option in libtool link mode. + 2001-03-03 Markus F.X.J. Oberhumer , Alexandre Oliva diff --git a/doc/libtool.texi b/doc/libtool.texi index 9137c406d..3e5d7e67c 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1237,6 +1237,17 @@ Same as @samp{-export-symbols}, except that only symbols matching the regular expression @var{regex} are exported. By default all symbols are exported. +@item -objectlist @var{input-file} +Tells libtool to read a text file to determine the object files +to be linked. The @var{input-file} is a text file containing a list +of libtool objects (@samp{.lo} files), one per line. This option is +used to build arbitrarily large libraries when the libtool command +becomes too large for the system to execute. Creating this file can +be automated with a command like the following: +@example +@kbd{find ./ -name \*.lo -print | sed 's/.\///g' > inputfile.txt} +@end example + @item -L@var{libdir} Search @var{libdir} for required libraries that have already been installed. diff --git a/ltmain.in b/ltmain.in index b51040971..4ce4a3aef 100644 --- a/ltmain.in +++ b/ltmain.in @@ -950,6 +950,113 @@ EOF prev= continue ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case "$arg" in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; rpath | xrpath) # We need an absolute path. case "$arg" in @@ -1153,6 +1260,11 @@ EOF continue ;; + -objectlist) + prev=objectlist + continue + ;; + -o) prev=output ;; -release) @@ -5072,6 +5184,7 @@ The following components of LINK-COMMAND are treated specially: -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries