]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Do not create `.o' objects when `-shared' is
authorRalph Schleicher <rs@nunatak.allgaeu.org>
Tue, 7 Oct 2003 16:48:23 +0000 (16:48 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 7 Oct 2003 16:48:23 +0000 (16:48 +0000)
specified in compile mode.
Do not make a static library when `-shared' is specified in link
mode.
* doc/libtool.texi (Compile mode): Document it.
* NEWS: Updated.

ChangeLog
NEWS
doc/libtool.texi
ltmain.in

index 67c50e150653148e2cb27659eb5834c31d17802d..6677fb0c0f6bb1bbab3f2a50fb035fe275bc7b2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2003-10-07  Ralph Schleicher  <rs@nunatak.allgaeu.org>
 
+       * ltmain.in: Do not create `.o' objects when `-shared' is
+       specified in compile mode.
+       Do not make a static library when `-shared' is specified in link
+       mode.
+       * doc/libtool.texi (Compile mode): Document it.
+       * NEWS: Updated.
+
        * doc/libtool.texi (Compile mode): Be more specific about the
        effect of `-static'.
        * ltmain.in: Do not create `.lo' objects when `-static' is
diff --git a/NEWS b/NEWS
index 9a60ef329b40fd5133fffeab96c7ca0fd4d4651c..d49cc601fad26aea5f18601ee8c97daf1d51a4b5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,11 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 New in 1.5b: 2003-??-??; CVS version 1.5a, Libtool team:
 * Shared objects (.lo) are no longer created when `-static' is passed in
   compile mode.
+* New compile mode option `-shared' prevents creation of static objects (.o).
+* New link mode option `-shared' creates only shared libraries at link time.
+* If you configure libtool with --disable-shared (or if libtool does not
+  support shared libraries on your platform) trying to build a library using
+  `-shared' is a fatal error.
 * libtoolize installs libtool.m4 (and ltdl.m4 if used) to AC_CONFIG_M4_DIR.
 * Mode inferrence removed, shorthand for choosing modes added.
 * Specifying -allow-undefined is now an error.
index 46db6360d0200873c1d0bf18d99d69373b9bc432..643093e4d0848a8e57bfaa1bb021228651d17b43 100644 (file)
@@ -1155,6 +1155,11 @@ and @samp{-Xcompiler @var{flag}}.
 If the @samp{-static} option is given, then only a @samp{.o} file is
 built, even if libtool was configured with @samp{--disable-static}.
 
+If the @samp{-shared} option is given, then no @samp{.o} file is built,
+even if libtool was configured with @samp{--enable-static}.  Libtool
+will signal an error if it was configured with @samp{--disable-shared},
+or if the host does not support shared libraries.
+
 Note that the @samp{-o} option is now fully supported.  It is emulated
 on the platforms that don't support it (by locking and moving the
 objects), so it is really easy to use libtool, just with minor
@@ -1295,6 +1300,14 @@ path.  If @var{output-file} is a library, add -R@var{libdir} to its
 @var{dependency_libs}, so that, whenever the library is linked into a
 program, @var{libdir} will be added to its run-time path.
 
+@item -shared
+If @var{output-file} is a program, then link it against any
+uninstalled shared libtool libraries (this is the default behavior).
+If @var{output-file} is a library, then only create a shared library.
+In the later case, libtool will signal an error if it was configured
+with @samp{--disable-shared}, or if the host does not support shared
+libraries.
+
 @item -static
 If @var{output-file} is a program, then do not link it against any
 uninstalled shared libtool libraries.  If @var{output-file} is a
index 6ba620e70be0e80f68f2965dfeafe241e8be5352..5ce32f093c412711ce42ddcf1d79d7be24f77997 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -388,6 +388,16 @@ exec_cmd=
          continue
          ;;
 
+       -shared)
+         if test "$build_libtool_libs" != yes; then
+           $echo "$modename: can not build a shared library" 1>&2
+           $echo "Fatal configuration error." 1>&2
+           exit 1
+         fi
+         build_old_libs=no
+         continue
+         ;;
+
        -static)
          build_libtool_libs=no
          build_old_libs=yes
@@ -873,6 +883,15 @@ EOF
     for arg
     do
       case $arg in
+      -shared)
+       if test "$build_libtool_libs" != yes; then
+         $echo "$modename: can not build a shared library" 1>&2
+         $echo "Fatal configuration error." 1>&2
+         exit 1
+       fi
+       build_old_libs=no
+       break
+       ;;
       -all-static | -static)
        if test "X$arg" = "X-all-static"; then
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
@@ -1385,6 +1404,11 @@ EOF
        continue
        ;;
 
+      -shared)
+       # The effects of -shared are defined in a previous loop.
+       continue
+       ;;
+
       -static)
        # The effects of -static are defined in a previous loop.
        # We used to do the same as -all-static on platforms that
@@ -6213,7 +6237,8 @@ This mode accepts the following additional options:
   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
   -prefer-pic       try to building PIC objects only
   -prefer-non-pic   try to building non-PIC objects only
-  -static           always build a \`.o' file suitable for static linking
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
 
 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 from the given SOURCEFILE.
@@ -6300,6 +6325,7 @@ The following components of LINK-COMMAND are treated specially:
   -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
+  -shared           only do dynamic linking of libtool libraries
   -static           do not do any dynamic linking of libtool libraries
   -version-info CURRENT[:REVISION[:AGE]]
                    specify library version info [each variable defaults to 0]