]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: Don't fall back to static libraries if building them was disabled
authorVadim Zeitlin <vz-libtool@zeitlins.org>
Thu, 10 Oct 2013 00:35:13 +0000 (17:35 -0700)
committerBrooks Moses <bmoses@google.com>
Thu, 10 Oct 2013 00:35:13 +0000 (17:35 -0700)
If -no-undefined was not specified but the platform didn't
support shared libraries with undefined symbols (e.g. Cygwin/
MinGW), static libraries were built instead of shared ones,
even if building them was explicitly disabled with --disable-
static configure option.

Fix this by stopping with a fatal error if a shared library
can't be built in this case instead of unexpectedly building a
static library instead.

* libltdl/config/ltmain.m4sh (func_mode_link()): Stop with
fatal error when trying to build a shared library without -no-
undefined on a platform not supporting undefined symbols in
shared libraries.

Copyright-paperwork-exempt: Yes

build-aux/ltmain.in

index 363ce9bb346163ea42c5d647bdd2899170f07d30..58b443cd43c209ece8c02340aa50253be078297c 100644 (file)
@@ -6984,9 +6984,12 @@ func_mode_link ()
        # Check to see if the archive will have undefined symbols.
        if test yes = "$allow_undefined"; then
          if test unsupported = "$allow_undefined_flag"; then
-           func_warning "undefined symbols not allowed in $host shared libraries"
-           build_libtool_libs=no
-           build_old_libs=yes
+           if test "$build_old_libs" = yes; then
+             func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+             build_libtool_libs=no
+           else
+             func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+           fi
          fi
        else
          # Don't allow undefined symbols.