Add --disable-sys-libs configure option.

This allows to disable the use of all system libraries with a single option
instead of having to use --with-{lib{png,jpeg,tiff},regex,zlib,expat}=builtin
or similar.

This is especially useful under OS X where we want to avoid the dependencies
on any locally installed homebrew or similar libraries.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-07-24 11:34:14 +00:00
parent 1a2e0268f0
commit bdc5c6e628
4 changed files with 151 additions and 13 deletions

View File

@@ -367,9 +367,16 @@ dnl this macro checks for a three-valued command line --with argument:
dnl possible arguments are 'yes', 'no', 'sys', or 'builtin' dnl possible arguments are 'yes', 'no', 'sys', or 'builtin'
dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name) dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name)
dnl dnl
dnl the default value (used if the option is not specified at all) is the value dnl the default value (used if the option is not specified at all) is
dnl of wxUSE_ALL_FEATURES (which is "yes" by default but can be changed by dnl determined in the following way:
dnl giving configure --disable-all-features option) dnl 1. If default value for the given library (DEFAULT_wxUSE_LIBXXX) exists,
dnl it is used: this allows to disable some libraries by default.
dnl 2. If wxUSE_ALL_FEATURES is turned off, the use of the library is turned
dnl off as well: this ensures that minimal builds are really minimal.
dnl 3. If wxUSE_SYS_LIBS is turned off, then "builtin" is used: this allows
dnl to prevent system libraries from being used by using a single option.
dnl 4. Otherwise the default value is "yes", meaning that either the system
dnl (preferred) or builtin version of the library will be used.
AC_DEFUN([WX_ARG_SYS_WITH], AC_DEFUN([WX_ARG_SYS_WITH],
[ [
AC_MSG_CHECKING([for --with-$1]) AC_MSG_CHECKING([for --with-$1])
@@ -388,7 +395,17 @@ AC_DEFUN([WX_ARG_SYS_WITH],
fi fi
], ],
[ [
AS_TR_SH(wx_cv_use_$1)='$3=${'DEFAULT_$3":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_$3" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
AS_TR_SH(wx_cv_use_$1)="$3=$value"
]) ])
eval "$AS_TR_SH(wx_cv_use_$1)" eval "$AS_TR_SH(wx_cv_use_$1)"

134
configure vendored
View File

@@ -1070,6 +1070,7 @@ with_flavour
enable_official_build enable_official_build
enable_vendor enable_vendor
enable_all_features enable_all_features
enable_sys_libs
enable_universal enable_universal
with_themes with_themes
with_gtk with_gtk
@@ -2035,6 +2036,7 @@ Optional Features:
--enable-official_build official build of wxWidgets (win32 DLL only) --enable-official_build official build of wxWidgets (win32 DLL only)
--enable-vendor=VENDOR vendor name (win32 DLL only) --enable-vendor=VENDOR vendor name (win32 DLL only)
--disable-all-features disable all optional features to build minimal library --disable-all-features disable all optional features to build minimal library
--disable-sys-libs disable all use of system libraries, use only built-in ones
--enable-universal use wxWidgets GUI controls instead of native ones --enable-universal use wxWidgets GUI controls instead of native ones
--enable-nanox use NanoX --enable-nanox use NanoX
--enable-gpe use GNOME PDA Environment features if possible --enable-gpe use GNOME PDA Environment features if possible
@@ -4377,6 +4379,50 @@ fi
$as_echo "$result" >&6; } $as_echo "$result" >&6; }
enablestring=disable
defaultval=
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --${enablestring:-enable}-sys-libs" >&5
$as_echo_n "checking for --${enablestring:-enable}-sys-libs... " >&6; }
# Check whether --enable-sys-libs was given.
if test "${enable_sys_libs+set}" = set; then :
enableval=$enable_sys_libs;
if test "$enableval" = yes; then
wx_cv_use_sys_libs='wxUSE_SYS_LIBS=yes'
else
wx_cv_use_sys_libs='wxUSE_SYS_LIBS=no'
fi
else
wx_cv_use_sys_libs='wxUSE_SYS_LIBS=${'DEFAULT_wxUSE_SYS_LIBS":-$defaultval}"
fi
eval "$wx_cv_use_sys_libs"
if test x"$enablestring" = xdisable; then
if test $wxUSE_SYS_LIBS = no; then
result=yes
else
result=no
fi
else
result=$wxUSE_SYS_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5
$as_echo "$result" >&6; }
if test "$wxUSE_ALL_FEATURES" = "no"; then if test "$wxUSE_ALL_FEATURES" = "no"; then
DEFAULT_wxUSE_ARTPROVIDER_TANGO=no DEFAULT_wxUSE_ARTPROVIDER_TANGO=no
DEFAULT_wxUSE_MEDIACTRL=no DEFAULT_wxUSE_MEDIACTRL=no
@@ -4723,7 +4769,17 @@ if test "${with_libpng+set}" = set; then :
else else
wx_cv_use_libpng='wxUSE_LIBPNG=${'DEFAULT_wxUSE_LIBPNG":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_LIBPNG" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_libpng="wxUSE_LIBPNG=$value"
fi fi
@@ -4767,7 +4823,17 @@ if test "${with_libjpeg+set}" = set; then :
else else
wx_cv_use_libjpeg='wxUSE_LIBJPEG=${'DEFAULT_wxUSE_LIBJPEG":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_LIBJPEG" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_libjpeg="wxUSE_LIBJPEG=$value"
fi fi
@@ -4811,7 +4877,17 @@ if test "${with_libtiff+set}" = set; then :
else else
wx_cv_use_libtiff='wxUSE_LIBTIFF=${'DEFAULT_wxUSE_LIBTIFF":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_LIBTIFF" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_libtiff="wxUSE_LIBTIFF=$value"
fi fi
@@ -4943,7 +5019,17 @@ if test "${with_libxpm+set}" = set; then :
else else
wx_cv_use_libxpm='wxUSE_LIBXPM=${'DEFAULT_wxUSE_LIBXPM":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_LIBXPM" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_libxpm="wxUSE_LIBXPM=$value"
fi fi
@@ -5386,7 +5472,17 @@ if test "${with_regex+set}" = set; then :
else else
wx_cv_use_regex='wxUSE_REGEX=${'DEFAULT_wxUSE_REGEX":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_REGEX" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_regex="wxUSE_REGEX=$value"
fi fi
@@ -5430,7 +5526,17 @@ if test "${with_zlib+set}" = set; then :
else else
wx_cv_use_zlib='wxUSE_ZLIB=${'DEFAULT_wxUSE_ZLIB":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_ZLIB" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_zlib="wxUSE_ZLIB=$value"
fi fi
@@ -5474,7 +5580,17 @@ if test "${with_expat+set}" = set; then :
else else
wx_cv_use_expat='wxUSE_EXPAT=${'DEFAULT_wxUSE_EXPAT":-$wxUSE_ALL_FEATURES}" if test "DEFAULT_wxUSE_EXPAT" = no; then
value=no
elif test "$wxUSE_ALL_FEATURES" = no; then
value=no
elif test "$wxUSE_SYS_LIBS" = no; then
value=builtin
else
value=yes
fi
wx_cv_use_expat="wxUSE_EXPAT=$value"
fi fi
@@ -36855,9 +36971,9 @@ fi
elif test "$wxUSE_MAC" = 1; then elif test "$wxUSE_MAC" = 1; then
if test "$wxUSE_OSX_IPHONE" = 1; then if test "$wxUSE_OSX_IPHONE" = 1; then
GST_LIBS="-framework AVFoundation -framework CoreMedia" GST_LIBS="-framework AVFoundation -framework CoreMedia"
else else
GST_LIBS="-framework QTKit" GST_LIBS="-framework QTKit"
fi fi
fi fi

View File

@@ -401,6 +401,7 @@ if test "x$VENDOR" = "x"; then
fi fi
WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES) WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
WX_ARG_DISABLE(sys-libs, [ --disable-sys-libs disable all use of system libraries, use only built-in ones], wxUSE_SYS_LIBS)
if test "$wxUSE_ALL_FEATURES" = "no"; then if test "$wxUSE_ALL_FEATURES" = "no"; then
dnl this is a bit ugly but currently we have no choice but to manually dnl this is a bit ugly but currently we have no choice but to manually

View File

@@ -37,6 +37,10 @@ All:
- Define wxOVERRIDE as override for supporting compilers (Thomas Goyne). - Define wxOVERRIDE as override for supporting compilers (Thomas Goyne).
- Allow specifying custom comparator for wxSortedArrayString (Catalin Raceanu). - Allow specifying custom comparator for wxSortedArrayString (Catalin Raceanu).
Unix:
- Add --disable-sys-libs configure option.
All (GUI): All (GUI):
- XRC handler for wxAuiToolBar added (Kinaou Hervé, David Hart). - XRC handler for wxAuiToolBar added (Kinaou Hervé, David Hart).