Permalink
Browse files

added native build option of TexturePacker

  • Loading branch information...
1 parent d1db2b1 commit 8305a846cbf5a8d1640ff6c5b2f39b60ab24bc47 @davilla davilla committed Apr 24, 2011
Showing with 26 additions and 2 deletions.
  1. +8 −2 configure.in
  2. +18 −0 tools/TexturePacker/Makefile.in
View
@@ -340,8 +340,8 @@ case $host in
use_joystick=no
use_vdadecoder=no
use_vtbdecoder=yes
- use_texturepacker=no
use_texturepacker_native=yes
+ USE_TEXTUREPACKER_NATIVE_ROOT="/opt/local"
ARCH="arm-osx"
SYSROOT="-miphoneos-version-min=4.1 -isysroot $SDKROOT"
ARCHTYPE=$HOSTTYPE
@@ -356,6 +356,8 @@ case $host in
i386-apple-darwin*)
use_joystick=no
use_vtbdecoder=no
+ use_texturepacker_native=yes
+ USE_TEXTUREPACKER_NATIVE_ROOT="$prefix"
ARCH="x86-osx"
export MACOSX_DEPLOYMENT_TARGET=10.4
SYSROOT="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
@@ -1232,8 +1234,11 @@ USE_TEXTUREPACKER_NATIVE=0
if test "x$use_texturepacker" != "xno"; then
final_message="$final_message\n TexturePacker:Yes"
USE_TEXTUREPACKER=1
- if test "x$use_texturepacker_native" = "yes"; then
+ if test "x$use_texturepacker_native" = "xyes"; then
USE_TEXTUREPACKER_NATIVE=1
+ if [[ ! -d "$USE_TEXTUREPACKER_NATIVE_ROOT" ]]; then
+ USE_TEXTUREPACKER_NATIVE_ROOT=
+ fi
fi
else
final_message="$final_message\n TexturePacker:No"
@@ -1469,6 +1474,7 @@ AC_SUBST(USE_PULSE)
AC_SUBST(USE_XRANDR)
AC_SUBST(USE_TEXTUREPACKER)
AC_SUBST(USE_TEXTUREPACKER_NATIVE)
+AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
@@ -9,7 +9,17 @@ CXXFLAGS+= \
-I@abs_top_srcdir@/xbmc \
-I@abs_top_srcdir@/xbmc/linux
+ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
+NATIVE_ROOT_PATH=@USE_TEXTUREPACKER_NATIVE_ROOT@
+ifdef NATIVE_ROOT_PATH
+CXXFLAGS+= -I$(NATIVE_ROOT_PATH)/include
+LIBS += -L$(NATIVE_ROOT_PATH)/lib
+endif
+LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish-native
+else
LIBS += -L@abs_top_srcdir@/lib/libsquish -lsquish
+endif
+
LIBS += -lSDL_image -lSDL -llzo2
SRCS = \
@@ -25,7 +35,15 @@ CLEAN_FILES=$(TARGET)
all: $(TARGET)
+ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
+# TexturePacker run native on build system, build it with native tools
+$(TARGET): $(SRCS)
+ g++ $(DEFINES) $(CXXFLAGS) $(SRCS) $(LIBS) -o $(TARGET)
+clean:
+ rm -f $(TARGET)
+else
include @abs_top_srcdir@/Makefile.include
$(TARGET): $(SRCS)
$(CXX) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(SRCS) $(LDFLAGS) $(LIBS) -o $(TARGET)
+endif

0 comments on commit 8305a84

Please sign in to comment.