Propagate --disable-shared correctly on Unix

The --disable-shared option is not presently possible on the native
Windows ports, though this isn't (yet) enforced by configure.
master
David Allsopp 2019-01-15 09:22:44 +00:00 committed by Damien Doligez
parent 432fd739aa
commit 0f0d8e2d76
2 changed files with 69 additions and 46 deletions

55
configure vendored
View File

@ -3318,6 +3318,11 @@ esac
fi
fi
# libtool expects host_os=mingw for native Windows
old_host_os=$host_os
if test x"$host_os" = "xwindows"; then :
host_os=mingw
fi
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@ -12163,6 +12168,7 @@ CC=$lt_save_CC
# Only expand once:
host_os=$old_host_os
# Extracting information from libtool's configuration
if test -n "$RANLIB" ; then :
@ -12516,6 +12522,16 @@ esac
# Adjust according to target
# On Windows we do not take $enable_shared because it does not seem
# to work. This should be better understood later
#AS_CASE([$target],
# [*-pc-windows],
# [enable_shared=yes])
if test x"$enable_shared" = "xno"; then :
with_sharedlibs=false
fi
case $CC,$host in #(
*,*-*-darwin*) :
mkexe="$mkexe -Wl,-no_compact_unwind";
@ -13360,6 +13376,18 @@ if test x"$enable_shared" != "xno"; then :
mksharedlib="$CC -shared -flat_namespace -undefined suppress \
-Wl,-no_compact_unwind"
shared_libraries_supported=true ;; #(
*-*-mingw32) :
mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs ;; #(
*-pc-windows) :
mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs ;; #(
*-*-cygwin*) :
mksharedlib="$flexlink"
mkmaindll="$flexlink -maindll"
shared_libraries_supported=true ;; #(
*-*-linux*|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*\
|*-*-openbsd*|*-*-netbsd*|*-*-dragonfly*|*-*-gnu*|*-*-haiku*) :
sharedlib_cflags="-fPIC"
@ -13374,25 +13402,6 @@ if test x"$enable_shared" != "xno"; then :
esac
fi
# On Windows we do not take $enable_shared because it does not seem
# to work. This should be better understood later
case $host in #(
*-*-cygwin*) :
mksharedlib="$flexlink"
mkmaindll="$flexlink -maindll"
shared_libraries_supported=$with_sharedlibs ;; #(
*-*-mingw32) :
mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs ;; #(
*-pc-windows) :
mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs ;; #(
*) :
;;
esac
if test -z "$mkmaindll"; then :
mkmaindll=$mksharedlib
fi
@ -13401,7 +13410,7 @@ fi
natdynlink=false
if test x"$enable_shared" != "no"; then :
if test x"$enable_shared" != "xno"; then :
case "$host" in #(
*-*-cygwin*) :
natdynlink=true ;; #(
@ -14672,7 +14681,8 @@ fi
esac
## shared library support
case $host in #(
if $shared_libraries_supported; then :
case $host in #(
*-*-mingw32|*-pc-windows) :
supports_shared_libraries=$shared_libraries_supported; dllibs="" ;; #(
*) :
@ -14725,6 +14735,9 @@ fi
fi
;;
esac
else
supports_shared_libraries=false
fi
if $supports_shared_libraries; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: Dynamic loading of shared libraries is supported." >&5

View File

@ -365,7 +365,11 @@ AS_IF([test x"$enable_unix_lib" = "xno" -o x"$enable_str_lib" = "xno"],
# Allow the MSVC linker to be found even if ld isn't installed.
# User-specified LD still takes precedence.
AC_CHECK_TOOLS([LD],[ld link])
# libtool expects host_os=mingw for native Windows
old_host_os=$host_os
AS_IF([test x"$host_os" = "xwindows"],[host_os=mingw])
LT_INIT
host_os=$old_host_os
# Extracting information from libtool's configuration
AS_IF([test -n "$RANLIB" ],
@ -536,6 +540,14 @@ AS_CASE([$host],
# Adjust according to target
# On Windows we do not take $enable_shared because it does not seem
# to work. This should be better understood later
#AS_CASE([$target],
# [*-pc-windows],
# [enable_shared=yes])
AS_IF([test x"$enable_shared" = "xno"],[with_sharedlibs=false])
AS_CASE([$CC,$host],
[*,*-*-darwin*],
[mkexe="$mkexe -Wl,-no_compact_unwind";
@ -697,6 +709,18 @@ AS_IF([test x"$enable_shared" != "xno"],
[mksharedlib="$CC -shared -flat_namespace -undefined suppress \
-Wl,-no_compact_unwind"
shared_libraries_supported=true],
[*-*-mingw32],
[mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs],
[*-pc-windows],
[mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs],
[*-*-cygwin*],
[mksharedlib="$flexlink"
mkmaindll="$flexlink -maindll"
shared_libraries_supported=true],
[[*-*-linux*|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*\
|*-*-openbsd*|*-*-netbsd*|*-*-dragonfly*|*-*-gnu*|*-*-haiku*]],
[sharedlib_cflags="-fPIC"
@ -707,29 +731,13 @@ AS_IF([test x"$enable_shared" != "xno"],
natdynlinkopts="-Wl,-E"
shared_libraries_supported=true])])
# On Windows we do not take $enable_shared because it does not seem
# to work. This should be better understood later
AS_CASE([$host],
[*-*-cygwin*],
[mksharedlib="$flexlink"
mkmaindll="$flexlink -maindll"
shared_libraries_supported=$with_sharedlibs],
[*-*-mingw32],
[mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs],
[*-pc-windows],
[mksharedlib='$(FLEXLINK)'
mkmaindll='$(FLEXLINK) -maindll'
shared_libraries_supported=$with_sharedlibs])
AS_IF([test -z "$mkmaindll"], [mkmaindll=$mksharedlib])
# Configure native dynlink
natdynlink=false
AS_IF([test x"$enable_shared" != "no"],
AS_IF([test x"$enable_shared" != "xno"],
[AS_CASE(["$host"],
[*-*-cygwin*], [natdynlink=true],
[*-*-mingw32], [natdynlink=true],
@ -1302,14 +1310,16 @@ AS_CASE([$host],
[AC_CHECK_FUNC([strtod_l], [AC_DEFINE([HAS_STRTOD_L])])])
## shared library support
AS_CASE([$host],
[*-*-mingw32|*-pc-windows],
[supports_shared_libraries=$shared_libraries_supported; dllibs=""],
[AC_CHECK_FUNC([dlopen],
[supports_shared_libraries=true dllibs=""],
[AC_CHECK_LIB([dl], [dlopen],
[supports_shared_libraries=true dllibs="-ldl $otherdllibs"],
[supports_shared_libraries=false])])])
AS_IF([$shared_libraries_supported],
[AS_CASE([$host],
[*-*-mingw32|*-pc-windows],
[supports_shared_libraries=$shared_libraries_supported; dllibs=""],
[AC_CHECK_FUNC([dlopen],
[supports_shared_libraries=true dllibs=""],
[AC_CHECK_LIB([dl], [dlopen],
[supports_shared_libraries=true dllibs="-ldl $otherdllibs"],
[supports_shared_libraries=false])])])],
[supports_shared_libraries=false])
AS_IF([$supports_shared_libraries],
[AC_MSG_NOTICE([Dynamic loading of shared libraries is supported.])