1
0
forked from 0ad/0ad

Adds SDL2 to build-osx-libs.sh, but leave SDL1 as the default while we test, refs #2041.

Note: SDL2_CONFIG is now the variable to override the path to
sdl2-config, SDL_CONFIG remains to override the path to sdl-config

This was SVN commit r15774.
This commit is contained in:
historic_bruno 2014-09-20 19:02:24 +00:00
parent a8d8c6d101
commit 8f61e36352
3 changed files with 50 additions and 11 deletions

View File

@ -576,18 +576,19 @@ extern_lib_defs = {
includedirs { libraries_dir .. "sdl/include/SDL" }
end
elseif not _OPTIONS["android"] then
-- Support SDL_CONFIG for overriding for the default PATH-based sdl-config
sdl_config_path = os.getenv("SDL_CONFIG")
if not sdl_config_path then
if _OPTIONS["sdl2"] then
-- Support SDL*_CONFIG for overriding the default PATH-based sdl*-config
if _OPTIONS["sdl2"] then
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
else
end
else
sdl_config_path = os.getenv("SDL_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl-config"
end
end
-- "pkg-config sdl --libs" appears to include both static and dynamic libs
-- when on MacPorts, which is bad, so use sdl-config instead
pkgconfig_cflags(nil, sdl_config_path.." --cflags")
end
end,
@ -599,11 +600,14 @@ extern_lib_defs = {
add_default_lib_paths("sdl")
end
elseif not _OPTIONS["android"] then
sdl_config_path = os.getenv("SDL_CONFIG")
if not sdl_config_path then
if _OPTIONS["sdl2"] then
if _OPTIONS["sdl2"] then
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
else
end
else
sdl_config_path = os.getenv("SDL_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl-config"
end
end

View File

@ -73,6 +73,7 @@ if [ "`uname -s`" = "Darwin" ]; then
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"}
fi

View File

@ -26,6 +26,7 @@ ICONV_VERSION="libiconv-1.14"
XML2_VERSION="libxml2-2.9.1"
# * SDL 1.2.15+ required for Lion support
SDL_VERSION="SDL-1.2.15"
SDL2_VERSION="SDL2-2.0.3"
BOOST_VERSION="boost_1_52_0"
# * wxWidgets 2.9+ is necessary for 64-bit OS X build w/ OpenGL support
WXWIDGETS_VERSION="wxWidgets-3.0.1"
@ -295,6 +296,39 @@ else
fi
popd > /dev/null
# --------------------------------------------------------------
echo -e "Building SDL2..."
LIB_VERSION="${SDL2_VERSION}"
LIB_ARCHIVE="$LIB_VERSION.tar.gz"
LIB_DIRECTORY=$LIB_VERSION
LIB_URL="http://www.libsdl.org/release/"
mkdir -p sdl2
pushd sdl2 > /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
# We don't want SDL2 to pull in system iconv, force it to detect ours with flags.
# Don't use X11 - we don't need it and Mountain Lion removed it
(./configure CPPFLAGS="-I${ICONV_DIR}/include" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS -L${ICONV_DIR}/lib" --prefix="$INSTALL_DIR" --disable-video-x11 --without-x --enable-shared=no && make $JOBS && make install) || die "SDL build failed"
popd
touch .already-built
else
already_built
fi
popd > /dev/null
# --------------------------------------------------------------
echo -e "Building Boost..."