Removes bundled MiniUPnPc source, it is now a required system library on *nix. NOTE: update-workspaces must be run. See the updated BuildInstructions for details.

Adds precompiled MiniUPnPc 1.9 libs for win32, fixes #2552.
Updates build-osx-libs.sh for these changes, including patch to fix
clang symbol visibility (fixed upstream).
Updates LICENSE.txt.
Fixes bug in build-osx-libs.sh where downloaded files might not have the
expected filename.
Fixes problem with building wxWidgets for 32-bit OS X targets,
apparently ARCH is ignored sometimes, but --enable-macosx_arch works.

This was SVN commit r15870.
This commit is contained in:
historic_bruno 2014-10-15 03:47:13 +00:00
parent 227d828b67
commit 776567d9b2
6 changed files with 72 additions and 40 deletions

View File

@ -496,13 +496,13 @@ extern_lib_defs = {
},
miniupnpc = {
compile_settings = function()
if not _OPTIONS["with-system-miniupnpc"] then
add_source_include_paths("miniupnpc")
if os.is("windows") or os.is("macosx") then
add_default_include_paths("miniupnpc")
end
end,
link_settings = function()
if not _OPTIONS["with-system-miniupnpc"] then
add_source_lib_paths("miniupnpc")
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("miniupnpc")
end
add_default_links({
win_names = { "miniupnpc" },

View File

@ -9,7 +9,6 @@ newoption { trigger = "minimal-flags", description = "Only set compiler/linker f
newoption { trigger = "outpath", description = "Location for generated project files" }
newoption { trigger = "sdl2", description = "Experimental build using SDL 2" }
newoption { trigger = "with-c++11", description = "Enable C++11 on GCC" }
newoption { trigger = "with-system-miniupnpc", description = "Search standard paths for libminiupnpc, instead of using bundled copy" }
newoption { trigger = "with-system-mozjs24", description = "Search standard paths for libmozjs24, instead of using bundled copy" }
newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" }

View File

@ -49,8 +49,7 @@ do
case $i in
--without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;;
--with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;;
--with-system-enet ) echo "NOTE: the --with-system-enet option is deprecated, system ENet is now required"; echo ;;
--with-system-miniupnpc ) with_system_miniupnpc=true; premake_args="${premake_args} --with-system-miniupnpc" ;;
--with-system-miniupnpc ) echo "NOTE: the --with-system-miniupnpc option is deprecated, system miniupnpc is now required"; echo ;;
--with-system-mozjs24 ) with_system_mozjs24=true; premake_args="${premake_args} --with-system-mozjs24" ;;
--enable-atlas ) enable_atlas=true ;;
--disable-atlas ) enable_atlas=false ;;
@ -73,7 +72,6 @@ if [ "`uname -s`" = "Darwin" ]; then
# Set *_CONFIG variables on OS X, to override the path to e.g. sdl2-config
export GLOOX_CONFIG=${GLOOX_CONFIG:="$(pwd)/../../libraries/osx/gloox/bin/gloox-config"}
export ICU_CONFIG=${ICU_CONFIG:="$(pwd)/../../libraries/osx/icu/bin/icu-config"}
export SDL_CONFIG=${SDL_CONFIG:="$(pwd)/../../libraries/osx/sdl/bin/sdl-config"}
export SDL2_CONFIG=${SDL2_CONFIG:="$(pwd)/../../libraries/osx/sdl2/bin/sdl2-config"}
export WX_CONFIG=${WX_CONFIG:="$(pwd)/../../libraries/osx/wxwidgets/bin/wx-config"}
export XML2_CONFIG=${XML2_CONFIG:="$(pwd)/../../libraries/osx/libxml2/bin/xml2-config"}

View File

@ -14,9 +14,6 @@ win32/ contains headers and precompiled static libs for Windows builds.
source/fcollada
MIT (see src/FCollada/Copyright.txt)
source/miniupnpc
BSD
source/nvtt
MIT - see src/NVIDIA_Texture_Tools_LICENSE.txt
@ -53,6 +50,9 @@ win32/ contains headers and precompiled static libs for Windows builds.
win32/libxml2
MIT
win32/miniupnpc
BSD
win32/openal
LGPL v2.0 (or later)

View File

@ -42,12 +42,12 @@ NSPR_VERSION="4.10.3"
# OS X only includes part of ICU, and only the dylib
ICU_VERSION="icu4c-52_1"
ENET_VERSION="enet-1.3.12"
MINIUPNPC_VERSION="miniupnpc-1.9"
# --------------------------------------------------------------
# Bundled with the game:
# * SpiderMonkey 24
# * NVTT
# * FCollada
# * MiniUPnPc
# --------------------------------------------------------------
# Provided by OS X:
# * OpenAL
@ -112,7 +112,7 @@ download_lib()
if [ ! -e $filename ]; then
echo "Downloading $filename"
curl -L -O ${url}${filename} || die "Download of $url$filename failed"
curl -L -o ${filename} ${url}${filename} || die "Download of $url$filename failed"
fi
}
@ -352,7 +352,7 @@ then
mkdir -p build-release
pushd build-release
CONF_OPTS="--prefix=$INSTALL_DIR --disable-shared --enable-unicode --with-cocoa --with-opengl --with-libiconv-prefix=${ICONV_DIR} --with-expat=builtin --with-libjpeg=builtin --with-png=builtin --without-libtiff --without-sdl --without-x"
CONF_OPTS="--prefix=$INSTALL_DIR --disable-shared --enable-macosx_arch=$ARCH --enable-unicode --with-cocoa --with-opengl --with-libiconv-prefix=${ICONV_DIR} --with-expat=builtin --with-libjpeg=builtin --with-png=builtin --without-libtiff --without-sdl --without-x"
# wxWidgets configure now defaults to targeting 10.5, if not specified,
# but that conflicts with our flags
if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then
@ -549,7 +549,7 @@ then
popd
# TODO: how can we not build the dylibs?
rm -f lib/*.dylib
touch .already-built
touch .already-built
else
already_built
fi
@ -619,6 +619,39 @@ else
fi
popd > /dev/null
# --------------------------------------------------------------
echo -e "Building MiniUPnPc..."
LIB_VERSION="${MINIUPNPC_VERSION}"
LIB_ARCHIVE="$LIB_VERSION.tar.gz"
LIB_DIRECTORY="$LIB_VERSION"
LIB_URL="http://miniupnp.tuxfamily.org/files/download.php?file="
mkdir -p miniupnpc
pushd miniupnpc > /dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]]
then
INSTALL_DIR="$(pwd)"
rm -f .already-built
download_lib $LIB_URL $LIB_ARCHIVE
rm -rf $LIB_DIRECTORY bin include lib share
tar -xf $LIB_ARCHIVE
pushd $LIB_DIRECTORY
# patch miniupnpc to fix symbol visibility (fixed upstream, see https://github.com/miniupnp/miniupnp/issues/63 )
(patch -p0 -i../../patches/miniupnpc-clang-fix.patch && make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && INSTALLPREFIX="$INSTALL_DIR" make install) || die "MiniUPnPc build failed"
popd
# TODO: how can we not build the dylibs?
rm -f lib/*.dylib
touch .already-built
else
already_built
fi
popd > /dev/null
# --------------------------------------------------------------------
# The following libraries are shared on different OSes and may
# be customized, so we build and install them from bundled sources
@ -751,28 +784,3 @@ else
already_built
fi
popd > /dev/null
# --------------------------------------------------------------
# MiniUPnPc - no install
echo -e "Building MiniUPnPc..."
pushd ../source/miniupnpc > /dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]]
then
rm -f .already-built
rm -f lib/*.a
pushd src
rm -rf output
mkdir -p ../lib
(make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS}) || die "MiniUPnPc build failed"
cp libminiupnpc.a ../lib/
popd
touch .already-built
else
already_built
fi
popd > /dev/null

View File

@ -0,0 +1,27 @@
Index: declspec.h
===================================================================
--- declspec.h
+++ declspec.h
@@ -5,11 +5,15 @@
#ifdef MINIUPNP_EXPORTS
#define LIBSPEC __declspec(dllexport)
#else
- #define LIBSPEC __declspec(dllimport)
- #endif
-#else
- #define LIBSPEC
-#endif
+ #define LIBSPEC __declspec(dllimport)
+ #endif
+#else
+ #if defined(__GNUC__) && __GNUC__ >= 4
+ #define LIBSPEC __attribute__ ((visibility ("default")))
+ #else
+ #define LIBSPEC
+ #endif
+#endif
+
+#endif
-#endif
-