]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Added the link mode option -objectlist FILE.
authorRobert Boehne <rboehne@ricardo-us.com>
Mon, 5 Mar 2001 15:41:55 +0000 (15:41 +0000)
committerRobert Boehne <rboehne@gnu.org>
Mon, 5 Mar 2001 15:41:55 +0000 (15:41 +0000)
ChangeLog
doc/libtool.texi
ltmain.in

index be9c173e9f93d761522252750c89cc9ef4c2a87c..240954e008f9f2850d9bfb7b566f978fbda8ff9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-03-05  Robert Boehne  <rboehne@ricardo-us.com>
+
+       * 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 <markus@oberhumer.com>,
            Alexandre Oliva <oliva@lsd.ic.unicamp.br>
 
index 9137c406d0ef5f3d89698cb3b15f5de6095862e8..3e5d7e67c9781554e0e2d54bd0790ea3b3d7d485 100644 (file)
@@ -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.
index b510409717c7a6c10ededb5fb7f28923738943eb..4ce4a3aefc6aa82b0b28a03de8e9c666254a243c 100644 (file)
--- 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