Index: ps/trunk/build/workspaces/clean-workspaces.sh =================================================================== --- ps/trunk/build/workspaces/clean-workspaces.sh +++ ps/trunk/build/workspaces/clean-workspaces.sh @@ -31,7 +31,9 @@ echo "Cleaning bundled third-party dependencies..." (cd ../../libraries/source/fcollada/src && rm -rf ./output) + (cd ../../libraries/source/fcollada && rm -f .already-built) (cd ../../libraries/source/nvtt/src && rm -rf ./build) + (cd ../../libraries/source/nvtt && rm -f .already-built) (cd ../../libraries/source/spidermonkey && rm -f .already-built) (cd ../../libraries/source/spidermonkey && rm -rf ./lib/*.a && rm -rf ./lib/*.so) (cd ../../libraries/source/spidermonkey && rm -rf ./include-unix-debug) Index: ps/trunk/build/workspaces/update-workspaces.sh =================================================================== --- ps/trunk/build/workspaces/update-workspaces.sh +++ ps/trunk/build/workspaces/update-workspaces.sh @@ -85,7 +85,7 @@ echo # Build/update bundled external libraries - (cd ../../libraries/source/fcollada/src && ${MAKE} ${JOBS}) || die "FCollada build failed" + (cd ../../libraries/source/fcollada && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "FCollada build failed" echo if [ "$with_system_mozjs" = "false" ]; then (cd ../../libraries/source/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed" Index: ps/trunk/libraries/osx/build-osx-libs.sh =================================================================== --- ps/trunk/libraries/osx/build-osx-libs.sh +++ ps/trunk/libraries/osx/build-osx-libs.sh @@ -52,11 +52,7 @@ # * SpiderMonkey # * NVTT # * FCollada -# -------------------------------------------------------------- -# We use suffixes here in order to force rebuilding when patching these libs -NVTT_VERSION="nvtt-2.1.1+wildfiregames.2" -FCOLLADA_VERSION="fcollada-3.05+wildfiregames.2" -# -------------------------------------------------------------- + # Provided by OS X: # * OpenAL # * OpenGL @@ -956,73 +952,26 @@ # -------------------------------------------------------------- # NVTT - bundled, no download -echo -e "Building NVTT..." - -LIB_VERSION="${NVTT_VERSION}" - pushd ../source/nvtt > /dev/null -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] +if [[ "$force_rebuild" = "true" ]] then rm -f .already-built - rm -f lib/*.a - pushd src - rm -rf build - mkdir -p build - - pushd build +fi - # Could use CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT - # but they're not as flexible for cross-compiling - # Disable png support (avoids some conflicts with MacPorts) - (cmake .. \ - -DCMAKE_LINK_FLAGS="$LDFLAGS" \ - -DCMAKE_C_FLAGS="$CFLAGS" \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ - -DCMAKE_BUILD_TYPE=Release \ - -DBINDIR=bin \ - -DLIBDIR=lib \ - -DPNG=0 \ - -G "Unix Makefiles" \ - && make clean && make nvtt ${JOBS}) || die "NVTT build failed" - popd +CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" JOBS="$JOBS" ./build.sh || die "Error building NVTT" - mkdir -p ../lib - cp build/src/bc*/libbc*.a ../lib/ - cp build/src/nv*/libnv*.a ../lib/ - cp build/src/nvtt/squish/libsquish.a ../lib/ - popd - echo "$LIB_VERSION" > .already-built -else - already_built -fi popd > /dev/null # -------------------------------------------------------------- # FCollada - bundled, no download -echo -e "Building FCollada..." - -LIB_VERSION="${FCOLLADA_VERSION}" +pushd ../source/fcollada/ > /dev/null -pushd ../source/fcollada > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] +if [[ "$force_rebuild" = "true" ]] then rm -f .already-built - rm -f lib/*.a - pushd src - rm -rf output - mkdir -p ../lib - - # The Makefile refers to pkg-config for libxml2, but we - # don't have that (replace with xml2-config instead) - sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' Makefile - (make clean && CXXFLAGS=$CXXFLAGS make ${JOBS}) || die "FCollada build failed" - # Undo Makefile change - mv Makefile.bak Makefile - popd - echo "$LIB_VERSION" > .already-built -else - already_built fi + +CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" JOBS="$JOBS" ./build.sh || die "Error building FCollada" + popd > /dev/null Index: ps/trunk/libraries/source/fcollada/build.sh =================================================================== --- ps/trunk/libraries/source/fcollada/build.sh +++ ps/trunk/libraries/source/fcollada/build.sh @@ -0,0 +1,35 @@ +#!/bin/sh +set -e +LIB_VERSION="fcollada-3.05+wildfiregames.3" +JOBS=${JOBS:="-j2"} +MAKE=${MAKE:="make"} +LDFLAGS=${LDFLAGS:=""} +CFLAGS=${CFLAGS:=""} +CXXFLAGS=${CXXFLAGS:=""} + +if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] +then + echo "FCollada is already up to date." + exit +fi + +echo "Building FCollada..." +echo + +if [ "$(uname -s)" = "Darwin" ]; then + # The Makefile refers to pkg-config for libxml2, but we + # don't have that (replace with xml2-config instead). + sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' src/Makefile +fi + +rm -f .already-built +rm -f lib/*.a +mkdir -p lib +(cd src && rm -rf "output/" && "${MAKE}" clean && CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" && LDFLAGS="$LDFLAGS" "${MAKE}" "${JOBS}") || die "FCollada build failed" + +if [ "$(uname -s)" = "Darwin" ]; then + # Undo Makefile change as we don't want to have it when creating patches. + mv src/Makefile.bak src/Makefile +fi + +echo "$LIB_VERSION" > .already-built Index: ps/trunk/libraries/source/nvtt/build.sh =================================================================== --- ps/trunk/libraries/source/nvtt/build.sh +++ ps/trunk/libraries/source/nvtt/build.sh @@ -1,25 +1,68 @@ #!/bin/sh - set -e - +LIB_VERSION="nvtt-2.1.1+wildfiregames.3" JOBS=${JOBS:="-j2"} MAKE=${MAKE:="make"} +LDFLAGS=${LDFLAGS:=""} +CFLAGS=${CFLAGS:=""} +CXXFLAGS=${CXXFLAGS:=""} + +if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] +then + echo "NVTT is already up to date." + exit +fi echo "Building NVTT..." echo +rm -f .already-built +rm -f lib/*.a +rm -rf src/build/ mkdir -p src/build/ cd src/build/ -cmake .. -DNVTT_SHARED=1 -DOpenGL_GL_PREFERENCE=GLVND -DCMAKE_BUILD_TYPE=Release -DBINDIR=bin -DLIBDIR=lib -G "Unix Makefiles" - -${MAKE} nvtt ${JOBS} +if [ "$(uname -s)" = "Darwin" ]; then + # Could use CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT + # but they're not as flexible for cross-compiling + # Disable png support (avoids some conflicts with MacPorts) + cmake .. \ + -DCMAKE_LINK_FLAGS="$LDFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBINDIR=bin \ + -DLIBDIR=lib \ + -DPNG=0 \ + -G "Unix Makefiles" +else + cmake .. \ + -DCMAKE_LINK_FLAGS="$LDFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DNVTT_SHARED=1 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DOpenGL_GL_PREFERENCE=GLVND \ + -DCMAKE_BUILD_TYPE=Release \ + -DBINDIR=bin \ + -DLIBDIR=lib \ + -G "Unix Makefiles" +fi +("${MAKE}" clean && "${MAKE}" nvtt "${JOBS}") || die "NVTT build failed" cd ../../ - -DLL_EXTN=so -LIB_EXTN=so +mkdir -p lib/ LIB_PREFIX=lib -cp src/build/src/nv*/${LIB_PREFIX}nv*.${LIB_EXTN} lib/ -cp src/build/src/nv*/${LIB_PREFIX}nv*.${DLL_EXTN} ../../../binaries/system/ +if [ "$(uname -s)" = "Darwin" ]; then + LIB_EXTN=a + cp src/build/src/bc*/"${LIB_PREFIX}"bc*."${LIB_EXTN}" lib/ + cp src/build/src/nvtt/squish/"${LIB_PREFIX}"squish."${LIB_EXTN}" lib/ +else + LIB_EXTN=so + cp src/build/src/nv*/"${LIB_PREFIX}"nv*."${LIB_EXTN}" ../../../binaries/system/ +fi + +cp src/build/src/nv*/"${LIB_PREFIX}"nv*."${LIB_EXTN}" lib/ + +echo "$LIB_VERSION" > .already-built Index: ps/trunk/libraries/source/spidermonkey/build.sh =================================================================== --- ps/trunk/libraries/source/spidermonkey/build.sh +++ ps/trunk/libraries/source/spidermonkey/build.sh @@ -14,7 +14,7 @@ # special file and only rebuild if the build.sh version differs. if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] then - echo "SpiderMonkey is already up to date" + echo "SpiderMonkey is already up to date." exit fi