diff --git a/build/premake/extern_libs4.lua b/build/premake/extern_libs4.lua index 96fefa9413..12e0c43968 100644 --- a/build/premake/extern_libs4.lua +++ b/build/premake/extern_libs4.lua @@ -271,13 +271,13 @@ extern_lib_defs = { }, enet = { compile_settings = function() - if not _OPTIONS["with-system-enet"] then - add_source_include_paths("enet") + if os.is("windows") or os.is("macosx") then + add_default_include_paths("enet") end end, link_settings = function() - if not _OPTIONS["with-system-enet"] then - add_source_lib_paths("enet") + if os.is("windows") or os.is("macosx") then + add_default_lib_paths("enet") end add_default_links({ win_names = { "enet" }, diff --git a/build/workspaces/update-workspaces.sh b/build/workspaces/update-workspaces.sh index f9218ade78..1beba4bf42 100644 --- a/build/workspaces/update-workspaces.sh +++ b/build/workspaces/update-workspaces.sh @@ -40,7 +40,6 @@ premake_args="" without_nvtt=false with_system_nvtt=false -with_system_enet=false with_system_miniupnpc=false with_system_mozjs24=false enable_atlas=true @@ -50,7 +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 ) with_system_enet=true; premake_args="${premake_args} --with-system-enet" ;; + --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-mozjs24 ) with_system_mozjs24=true; premake_args="${premake_args} --with-system-mozjs24" ;; --enable-atlas ) enable_atlas=true ;; @@ -95,10 +94,6 @@ if [ "`uname -s`" != "Darwin" ]; then (cd ../../libraries/source/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed" fi echo - if [ "$with_system_enet" = "false" ]; then - (cd ../../libraries/source/enet && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "ENet build failed" - fi - echo if [ "$with_system_miniupnpc" = "false" ]; then (cd ../../libraries/source/miniupnpc && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "MiniUPnPc build failed" fi diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index 56e5dabf9b..1855e2df07 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -42,10 +42,10 @@ GLOOX_VERSION="gloox-1.0.9" 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" # -------------------------------------------------------------- # Bundled with the game: # * SpiderMonkey 24 -# * ENet 1.3.3 # * NVTT # * FCollada # * MiniUPnPc @@ -595,9 +595,39 @@ else fi popd > /dev/null +# -------------------------------------------------------------- +echo -e "Building ENet..." + +LIB_VERSION="${ENET_VERSION}" +LIB_ARCHIVE="$LIB_VERSION.tar.gz" +LIB_DIRECTORY="$LIB_VERSION" +LIB_URL="http://enet.bespin.org/download/" + +mkdir -p enet +pushd enet > /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 sbin share + tar -xf $LIB_ARCHIVE + pushd $LIB_DIRECTORY + + (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && make ${JOBS} && make install) || die "ENet build failed" + popd + touch .already-built +else + already_built +fi +popd > /dev/null + # -------------------------------------------------------------------- # The following libraries are shared on different OSes and may -# be customzied, so we build and install them from bundled sources +# be customized, so we build and install them from bundled sources # -------------------------------------------------------------------- echo -e "Building Spidermonkey..." @@ -669,25 +699,6 @@ else fi popd > /dev/null -# -------------------------------------------------------------- -echo -e "Building ENet..." - -pushd ../source/enet/ > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] -then - INSTALL_DIR="$(pwd)" - rm -f .already-built - - pushd src - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && make ${JOBS} && make install) || die "ENet build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - # -------------------------------------------------------------- # NVTT - no install echo -e "Building NVTT..."