Skip to content
This repository
Browse code

Merge pull request #3190 from sraue/texturepacker-rework

Texturepacker rework
  • Loading branch information...
commit 439b50dfb4fc693cfdc9910f9e64e81fbf1a9a38 2 parents 16931c0 + ed1cd08
Stephan Raue authored September 03, 2013
2  Makefile.in
@@ -520,7 +520,7 @@ else
520 520
 	$(SILENT_LD) $(CC) $(CFLAGS) $(LDFLAGS) -o xbmc-xrandr xbmc-xrandr.c -lXrandr -lX11 -lm
521 521
 endif
522 522
 
523  
-tools/TexturePacker/TexturePacker: lib/libsquish/libsquish.a xbmc/guilib/XBTF.h
  523
+tools/TexturePacker/TexturePacker: xbmc/guilib/XBTF.h
524 524
 	$(MAKE) -C tools/TexturePacker/
525 525
 
526 526
 
5  Makefile.include.in
@@ -28,10 +28,15 @@ dvidir=@dvidir@
28 28
 pdfdir=@pdfdir@
29 29
 psdir=@psdir@
30 30
 CXX=@CXX@
  31
+CXX_FOR_BUILD=@CXX_FOR_BUILD@
31 32
 CC=@CC@
  33
+CC_FOR_BUILD=@CC_FOR_BUILD@
32 34
 CXXFLAGS+=@CXXFLAGS@
  35
+CXXFLAGS_FOR_BUILD+=@CXXFLAGS_FOR_BUILD@
33 36
 CFLAGS+=@CFLAGS@
  37
+CFLAGS_FOR_BUILD+=@CFLAGS_FOR_BUILD@
34 38
 LDFLAGS+=@LDFLAGS@
  39
+LDFLAGS_FOR_BUILD+=@LDFLAGS_FOR_BUILD@
35 40
 INCLUDES+=-I@abs_top_srcdir@/lib
36 41
 INCLUDES+=-I@abs_top_srcdir@/xbmc
37 42
 INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.gui
41  configure.in
@@ -5,6 +5,8 @@ AC_PREREQ(2.59)
5 5
 AC_INIT([xbmc], [12.9.8], [http://trac.xbmc.org])
6 6
 AC_CONFIG_HEADERS([xbmc/config.h])
7 7
 AH_TOP([#pragma once])
  8
+m4_include([m4/ax_prog_cc_for_build.m4])
  9
+m4_include([m4/ax_prog_cxx_for_build.m4])
8 10
 m4_include([m4/ax_python_devel.m4])
9 11
 m4_include([m4/xbmc_arch.m4])
10 12
 
@@ -579,13 +581,15 @@ if test "x$host_vendor" != "xapple"; then
579 581
 fi
580 582
 
581 583
 # Checks for programs.
  584
+PASSED_CFLAGS=$CFLAGS # Hack to override autoconf default values
  585
+AC_PROG_CC
  586
+AX_PROG_CC_FOR_BUILD
  587
+CFLAGS="$PASSED_CFLAGS $DEFAULT_COMPILE_FLAGS"
582 588
 PASSED_CXXFLAGS=$CXXFLAGS # Hack to override autoconf default values
583 589
 AC_PROG_CXX
  590
+AX_PROG_CXX_FOR_BUILD
584 591
 CXXFLAGS="$PASSED_CXXFLAGS $DEFAULT_COMPILE_FLAGS"
585  
-PASSED_CFLAGS=$CFLAGS # Hack to override autoconf default values
586  
-AC_PROG_CC
587 592
 AC_PROG_LIBTOOL
588  
-CFLAGS="$PASSED_CFLAGS $DEFAULT_COMPILE_FLAGS"
589 593
 AC_PROG_AWK
590 594
 AC_PROG_LN_S
591 595
 AC_PROG_MAKE_SET
@@ -633,7 +637,6 @@ case $host in
633 637
      use_dvdcss=no
634 638
      use_gles=yes
635 639
      use_cpu=cortex-a8
636  
-     use_texturepacker_native=yes
637 640
      ARCH="arm-osx"
638 641
      use_arch="arm"
639 642
      PYTHON_VERSION="2.6"
@@ -645,7 +648,6 @@ case $host in
645 648
   *86*-apple-darwin*)
646 649
      use_joystick=no
647 650
      use_vtbdecoder=no
648  
-     use_texturepacker_native=yes
649 651
      ARCH="x86-osx"
650 652
      ;;
651 653
   powerpc-apple-darwin*)
@@ -662,7 +664,6 @@ case $host in
662 664
      ARCH="powerpc64-linux"
663 665
      ;;
664 666
   arm*-*-linux-gnu*)
665  
-     use_texturepacker=no
666 667
      ARCH="arm"
667 668
      use_arch="arm"
668 669
      ffmpeg_target_os=linux
@@ -691,7 +692,7 @@ case $host in
691 692
 esac
692 693
 AC_SUBST([ARCH])
693 694
 
694  
-check_sdl_arch=[`file $USE_TEXTUREPACKER_NATIVE_ROOT/lib/libSDL_image.dylib | awk '{print $NF}'`]
  695
+check_sdl_arch=[`file $NATIVE_ROOT/lib/libSDL_image.dylib | awk '{print $NF}'`]
695 696
 if test "x$check_sdl_arch" = "xi386" ; then
696 697
   DARWIN_NATIVE_ARCH=-m32
697 698
 elif test "x$check_sdl_arch" = "xx86_64" ; then
@@ -701,7 +702,6 @@ AC_SUBST([DARWIN_NATIVE_ARCH])
701 702
 
702 703
 if test "$target_platform" = "target_android" ; then
703 704
   USE_ANDROID=1
704  
-  use_texturepacker_native=yes
705 705
   webserver_checkdepends=yes
706 706
   CFLAGS="$CFLAGS -Wno-psabi"
707 707
   CXXFLAGS="$CXXFLAGS -Wno-psabi"
@@ -712,8 +712,6 @@ case $use_platform in
712 712
   raspberry-pi)
713 713
      target_platform=target_raspberry_pi
714 714
      use_neon=no
715  
-     use_texturepacker=yes
716  
-     use_texturepacker_native=yes
717 715
      use_arch="arm"
718 716
      use_cpu=arm1176jzf-s
719 717
      use_hardcoded_tables="yes"
@@ -1956,6 +1954,15 @@ AC_C_BIGENDIAN
1956 1954
 
1957 1955
 if test "$cross_compiling" = "yes"; then
1958 1956
   final_message="$final_message\n  Crosscomp.:\tYes"
  1957
+  if [[ -d "$NATIVE_ROOT" ]]; then
  1958
+    CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -I$NATIVE_ROOT/include"
  1959
+    CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -I$NATIVE_ROOT/include"
  1960
+    LDFLAGS_FOR_BUILD="$LDFLAGS_FOR_BUILD -L$NATIVE_ROOT/lib"
  1961
+    if test "$host_vendor" != "apple" ; then
  1962
+      LDFLAGS_FOR_BUILD="$LDFLAGS_FOR_BUILD -Wl,-rpath=$NATIVE_ROOT/lib"
  1963
+    fi
  1964
+    final_message="$final_message\n  Native Root:\t$NATIVE_ROOT"
  1965
+  fi
1959 1966
 else
1960 1967
   final_message="$final_message\n  Crosscomp.:\tNo"
1961 1968
 fi
@@ -2093,16 +2100,9 @@ else
2093 2100
   final_message="$final_message\n  Bluray:\tNo"
2094 2101
 fi
2095 2102
 
2096  
-USE_TEXTUREPACKER_NATIVE=0
2097 2103
 if test "x$use_texturepacker" != "xno"; then
2098 2104
   final_message="$final_message\n  TexturePacker:Yes"
2099 2105
   USE_TEXTUREPACKER=1
2100  
-  if test "x$use_texturepacker_native" = "xyes"; then
2101  
-    USE_TEXTUREPACKER_NATIVE=1
2102  
-    if [[ ! -d "$USE_TEXTUREPACKER_NATIVE_ROOT" ]]; then 
2103  
-      USE_TEXTUREPACKER_NATIVE_ROOT= 
2104  
-    fi
2105  
-  fi
2106 2106
 else
2107 2107
   final_message="$final_message\n  TexturePacker:No"
2108 2108
   USE_TEXTUREPACKER=0
@@ -2467,6 +2467,11 @@ AC_SUBST(CFLAGS)
2467 2467
 AC_SUBST(CXXFLAGS)
2468 2468
 AC_SUBST(INCLUDES)
2469 2469
 AC_SUBST(LDFLAGS)
  2470
+AC_SUBST(CXX_FOR_BUILD)
  2471
+AC_SUBST(CC_FOR_BUILD)
  2472
+AC_SUBST(CFLAGS_FOR_BUILD)
  2473
+AC_SUBST(CXXFLAGS_FOR_BUILD)
  2474
+AC_SUBST(LDFLAGS_FOR_BUILD)
2470 2475
 AC_SUBST(SDL_DEFINES)
2471 2476
 AC_SUBST(BUILD_DVDCSS)
2472 2477
 AC_SUBST(DISABLE_WAVEFORM)
@@ -2507,8 +2512,6 @@ AC_SUBST(USE_PULSE)
2507 2512
 AC_SUBST(USE_XRANDR)
2508 2513
 AC_SUBST(USE_ALSA)
2509 2514
 AC_SUBST(USE_TEXTUREPACKER)
2510  
-AC_SUBST(USE_TEXTUREPACKER_NATIVE)
2511  
-AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
2512 2515
 AC_SUBST(USE_AIRTUNES)
2513 2516
 AC_SUBST(USE_LIBUDEV)
2514 2517
 AC_SUBST(USE_LIBUSB)
22  lib/libsquish/Makefile.in
@@ -11,26 +11,24 @@ SRCS= \
11 11
   singlecolourfit.cpp \
12 12
   squish.cpp
13 13
 
14  
-CXXFLAGS+=-I.
15  
-
16  
-LIB=libsquish.a
17  
-
18  
-ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
19  
-NATIVE_LIB=libsquish-native.so
20  
-CLEAN_FILES+=$(NATIVE_LIB)
  14
+CXXFLAGS           += -I.
  15
+CXXFLAGS_FOR_BUILD += -I.
  16
+LIB                 = libsquish.a
  17
+NATIVE_LIB          = libsquish-native.so
  18
+CLEAN_FILES        += $(NATIVE_LIB)
21 19
 
22 20
 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
23  
-NATIVE_ARCH=@DARWIN_NATIVE_ARCH@
  21
+  CXXFLAGS_FOR_BUILD += @DARWIN_NATIVE_ARCH@
24 22
 endif
25 23
 
26  
-all: $(LIB) $(NATIVE_LIB)
  24
+all: $(LIB)
  25
+
27 26
 # TexturePacker links to libsquish and needs to run on build system, so make a native flavor.
28 27
 $(NATIVE_LIB): $(SRCS)
29 28
 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
30  
-	g++ $(NATIVE_ARCH) -I. $(SRCS) -dynamiclib -install_name `pwd`/libsquish-native.so -o $@
  29
+	$(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $(SRCS) -dynamiclib -install_name `pwd`/$(NATIVE_LIB) -o $@
31 30
 else
32  
-	g++ -I. $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@
33  
-endif
  31
+	$(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/$(NATIVE_LIB) -o $@
34 32
 endif
35 33
 
36 34
 include ../../Makefile.include
125  m4/ax_prog_cc_for_build.m4
... ...
@@ -0,0 +1,125 @@
  1
+# ===========================================================================
  2
+#   http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
  3
+# ===========================================================================
  4
+#
  5
+# SYNOPSIS
  6
+#
  7
+#   AX_PROG_CC_FOR_BUILD
  8
+#
  9
+# DESCRIPTION
  10
+#
  11
+#   This macro searches for a C compiler that generates native executables,
  12
+#   that is a C compiler that surely is not a cross-compiler. This can be
  13
+#   useful if you have to generate source code at compile-time like for
  14
+#   example GCC does.
  15
+#
  16
+#   The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
  17
+#   needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
  18
+#   The value of these variables can be overridden by the user by specifying
  19
+#   a compiler with an environment variable (like you do for standard CC).
  20
+#
  21
+#   It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
  22
+#   file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
  23
+#   the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
  24
+#   substituted in the Makefile.
  25
+#
  26
+# LICENSE
  27
+#
  28
+#   Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
  29
+#
  30
+#   Copying and distribution of this file, with or without modification, are
  31
+#   permitted in any medium without royalty provided the copyright notice
  32
+#   and this notice are preserved. This file is offered as-is, without any
  33
+#   warranty.
  34
+
  35
+#serial 8
  36
+
  37
+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
  38
+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
  39
+AC_REQUIRE([AC_PROG_CC])dnl
  40
+AC_REQUIRE([AC_PROG_CPP])dnl
  41
+AC_REQUIRE([AC_EXEEXT])dnl
  42
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
  43
+
  44
+dnl Use the standard macros, but make them use other variable names
  45
+dnl
  46
+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
  47
+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
  48
+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
  49
+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
  50
+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
  51
+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
  52
+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
  53
+pushdef([ac_exeext], ac_build_exeext)dnl
  54
+pushdef([ac_objext], ac_build_objext)dnl
  55
+pushdef([CC], CC_FOR_BUILD)dnl
  56
+pushdef([CPP], CPP_FOR_BUILD)dnl
  57
+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
  58
+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
  59
+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
  60
+pushdef([host], build)dnl
  61
+pushdef([host_alias], build_alias)dnl
  62
+pushdef([host_cpu], build_cpu)dnl
  63
+pushdef([host_vendor], build_vendor)dnl
  64
+pushdef([host_os], build_os)dnl
  65
+pushdef([ac_cv_host], ac_cv_build)dnl
  66
+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
  67
+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
  68
+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
  69
+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
  70
+pushdef([ac_cpp], ac_build_cpp)dnl
  71
+pushdef([ac_compile], ac_build_compile)dnl
  72
+pushdef([ac_link], ac_build_link)dnl
  73
+
  74
+save_cross_compiling=$cross_compiling
  75
+save_ac_tool_prefix=$ac_tool_prefix
  76
+cross_compiling=no
  77
+ac_tool_prefix=
  78
+
  79
+AC_PROG_CC
  80
+AC_PROG_CPP
  81
+AC_EXEEXT
  82
+
  83
+ac_tool_prefix=$save_ac_tool_prefix
  84
+cross_compiling=$save_cross_compiling
  85
+
  86
+dnl Restore the old definitions
  87
+dnl
  88
+popdef([ac_link])dnl
  89
+popdef([ac_compile])dnl
  90
+popdef([ac_cpp])dnl
  91
+popdef([ac_cv_host_os])dnl
  92
+popdef([ac_cv_host_vendor])dnl
  93
+popdef([ac_cv_host_cpu])dnl
  94
+popdef([ac_cv_host_alias])dnl
  95
+popdef([ac_cv_host])dnl
  96
+popdef([host_os])dnl
  97
+popdef([host_vendor])dnl
  98
+popdef([host_cpu])dnl
  99
+popdef([host_alias])dnl
  100
+popdef([host])dnl
  101
+popdef([LDFLAGS])dnl
  102
+popdef([CPPFLAGS])dnl
  103
+popdef([CFLAGS])dnl
  104
+popdef([CPP])dnl
  105
+popdef([CC])dnl
  106
+popdef([ac_objext])dnl
  107
+popdef([ac_exeext])dnl
  108
+popdef([ac_cv_objext])dnl
  109
+popdef([ac_cv_exeext])dnl
  110
+popdef([ac_cv_prog_cc_g])dnl
  111
+popdef([ac_cv_prog_cc_cross])dnl
  112
+popdef([ac_cv_prog_cc_works])dnl
  113
+popdef([ac_cv_prog_gcc])dnl
  114
+popdef([ac_cv_prog_CPP])dnl
  115
+
  116
+dnl Finally, set Makefile variables
  117
+dnl
  118
+BUILD_EXEEXT=$ac_build_exeext
  119
+BUILD_OBJEXT=$ac_build_objext
  120
+AC_SUBST(BUILD_EXEEXT)dnl
  121
+AC_SUBST(BUILD_OBJEXT)dnl
  122
+AC_SUBST([CFLAGS_FOR_BUILD])dnl
  123
+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
  124
+AC_SUBST([LDFLAGS_FOR_BUILD])dnl
  125
+])
110  m4/ax_prog_cxx_for_build.m4
... ...
@@ -0,0 +1,110 @@
  1
+# ===========================================================================
  2
+#   http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html
  3
+# ===========================================================================
  4
+#
  5
+# SYNOPSIS
  6
+#
  7
+#   AX_PROG_CXX_FOR_BUILD
  8
+#
  9
+# DESCRIPTION
  10
+#
  11
+#   This macro searches for a C++ compiler that generates native
  12
+#   executables, that is a C++ compiler that surely is not a cross-compiler.
  13
+#   This can be useful if you have to generate source code at compile-time
  14
+#   like for example GCC does.
  15
+#
  16
+#   The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything
  17
+#   needed to compile or link (CXX_FOR_BUILD) and preprocess
  18
+#   (CXXCPP_FOR_BUILD). The value of these variables can be overridden by
  19
+#   the user by specifying a compiler with an environment variable (like you
  20
+#   do for standard CXX).
  21
+#
  22
+# LICENSE
  23
+#
  24
+#   Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
  25
+#   Copyright (c) 2012 Avionic Design GmbH
  26
+#
  27
+#   Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini.
  28
+#
  29
+#   Copying and distribution of this file, with or without modification, are
  30
+#   permitted in any medium without royalty provided the copyright notice
  31
+#   and this notice are preserved. This file is offered as-is, without any
  32
+#   warranty.
  33
+
  34
+#serial 2
  35
+
  36
+AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD])
  37
+AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl
  38
+AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl
  39
+AC_REQUIRE([AC_PROG_CXX])dnl
  40
+AC_REQUIRE([AC_PROG_CXXCPP])dnl
  41
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
  42
+
  43
+dnl Use the standard macros, but make them use other variable names
  44
+dnl
  45
+pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl
  46
+pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl
  47
+pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl
  48
+pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl
  49
+pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl
  50
+pushdef([CXX], CXX_FOR_BUILD)dnl
  51
+pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl
  52
+pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl
  53
+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
  54
+pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl
  55
+pushdef([host], build)dnl
  56
+pushdef([host_alias], build_alias)dnl
  57
+pushdef([host_cpu], build_cpu)dnl
  58
+pushdef([host_vendor], build_vendor)dnl
  59
+pushdef([host_os], build_os)dnl
  60
+pushdef([ac_cv_host], ac_cv_build)dnl
  61
+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
  62
+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
  63
+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
  64
+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
  65
+pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl
  66
+pushdef([ac_compile], ac_build_compile)dnl
  67
+pushdef([ac_link], ac_build_link)dnl
  68
+
  69
+save_cross_compiling=$cross_compiling
  70
+save_ac_tool_prefix=$ac_tool_prefix
  71
+cross_compiling=no
  72
+ac_tool_prefix=
  73
+
  74
+AC_PROG_CXX
  75
+AC_PROG_CXXCPP
  76
+
  77
+ac_tool_prefix=$save_ac_tool_prefix
  78
+cross_compiling=$save_cross_compiling
  79
+
  80
+dnl Restore the old definitions
  81
+dnl
  82
+popdef([ac_link])dnl
  83
+popdef([ac_compile])dnl
  84
+popdef([ac_cxxcpp])dnl
  85
+popdef([ac_cv_host_os])dnl
  86
+popdef([ac_cv_host_vendor])dnl
  87
+popdef([ac_cv_host_cpu])dnl
  88
+popdef([ac_cv_host_alias])dnl
  89
+popdef([ac_cv_host])dnl
  90
+popdef([host_os])dnl
  91
+popdef([host_vendor])dnl
  92
+popdef([host_cpu])dnl
  93
+popdef([host_alias])dnl
  94
+popdef([host])dnl
  95
+popdef([CXXCPPFLAGS])dnl
  96
+popdef([CPPFLAGS])dnl
  97
+popdef([CXXFLAGS])dnl
  98
+popdef([CXXCPP])dnl
  99
+popdef([CXX])dnl
  100
+popdef([ac_cv_prog_cxx_g])dnl
  101
+popdef([ac_cv_prog_cxx_cross])dnl
  102
+popdef([ac_cv_prog_cxx_works])dnl
  103
+popdef([ac_cv_prog_gxx])dnl
  104
+popdef([ac_cv_prog_CXXCPP])dnl
  105
+
  106
+dnl Finally, set Makefile variables
  107
+dnl
  108
+AC_SUBST([CXXFLAGS_FOR_BUILD])dnl
  109
+AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl
  110
+])
62  tools/TexturePacker/Makefile.in
... ...
@@ -1,61 +1,37 @@
1  
-DEFINES += -DTARGET_POSIX -DUSE_LZO_PACKING
  1
+DEFINES       += -DTARGET_POSIX -DUSE_LZO_PACKING
2 2
 ifneq ($(or $(findstring powerpc,@ARCH@),$(findstring ppc, @ARCH@)),)
3  
-DEFINES += -DHOST_BIGENDIAN
  3
+DEFINES       += -DHOST_BIGENDIAN
4 4
 endif
5 5
 
6  
-CXXFLAGS+= \
  6
+SRCS           = \
  7
+  md5.cpp \
  8
+  SDL_anigif.cpp \
  9
+  XBTFWriter.cpp \
  10
+  XBMCTex.cpp \
  11
+  @abs_top_srcdir@/xbmc/guilib/XBTF.cpp
  12
+
  13
+TARGET         = TexturePacker
  14
+CLEAN_FILES    = $(TARGET)
  15
+
  16
+CXXFLAGS_FOR_BUILD += \
7 17
   -I. \
8 18
   -I@abs_top_srcdir@/lib \
9 19
   -I@abs_top_srcdir@/xbmc \
10 20
   -I@abs_top_srcdir@/xbmc/linux
11 21
 
12  
-RPATH=-Wl,-rpath=$(NATIVE_ROOT_PATH)/lib
  22
+LDFLAGS_FOR_BUILD += -lSDL_image -lSDL -llzo2
  23
+LDFLAGS_FOR_BUILD += -L@abs_top_srcdir@/lib/libsquish -lsquish-native
13 24
 
14  
-ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
15  
-NATIVE_ROOT_PATH=@USE_TEXTUREPACKER_NATIVE_ROOT@
16  
-ifdef NATIVE_ROOT_PATH
17 25
 ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
18 26
 DEFINES += -DTARGET_DARWIN
19 27
 NATIVE_ARCH=@DARWIN_NATIVE_ARCH@
20  
-RPATH=
21  
-endif
22  
-NATIVE_CXXFLAGS+= -I. \
23  
-                  -I$(NATIVE_ROOT_PATH)/include \
24  
-                  -I@abs_top_srcdir@/lib \
25  
-                  -I@abs_top_srcdir@/xbmc \
26  
-                  -I@abs_top_srcdir@/xbmc/linux
27  
-NATIVE_LIBS    += -L$(NATIVE_ROOT_PATH)/lib
28  
-endif
29  
-NATIVE_LIBS    += -lSDL_image -lSDL -llzo2
30  
-NATIVE_LIBS    += -L@abs_top_srcdir@/lib/libsquish -lsquish-native
31  
-else
32  
-LIBS    += -L@abs_top_srcdir@/lib/libsquish -lsquish
33 28
 endif
34 29
 
35  
-LIBS    += -lSDL_image -lSDL -llzo2
36  
-
37  
-SRCS = \
38  
-  md5.cpp \
39  
-  SDL_anigif.cpp \
40  
-  XBTFWriter.cpp \
41  
-  XBMCTex.cpp \
42  
-  @abs_top_srcdir@/xbmc/guilib/XBTF.cpp
43  
-
44  
-
45  
-TARGET = TexturePacker
46  
-CLEAN_FILES=$(TARGET)
47  
-
48 30
 all: $(TARGET)
49 31
 
50  
-ifeq (@USE_TEXTUREPACKER_NATIVE@,1)
51  
-# TexturePacker run native on build system, build it with native tools
52 32
 $(TARGET): $(SRCS) @abs_top_srcdir@/xbmc/guilib/XBTF.h
53  
-	g++ $(DEFINES) $(NATIVE_ARCH) $(NATIVE_CXXFLAGS) $(SRCS) $(NATIVE_LIBS) $(RPATH) -o $(TARGET)
54  
-clean:
55  
-	rm -f $(TARGET)
56  
-else
57  
-include @abs_top_srcdir@/Makefile.include
  33
+# TexturePacker run native on build system, build it with native tools
  34
+	make -C @abs_top_srcdir@/lib/libsquish/ libsquish-native.so
  35
+	$(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $(DEFINES) $(NATIVE_ARCH) $(SRCS) $(LDFLAGS_FOR_BUILD) -o $(TARGET)
58 36
 
59  
-$(TARGET): $(SRCS) @abs_top_srcdir@/xbmc/guilib/XBTF.h
60  
-	$(CXX) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(SRCS) $(LDFLAGS) $(LIBS) -o $(TARGET)
61  
-endif
  37
+include @abs_top_srcdir@/Makefile.include
2  tools/depends/target/config.site.in
@@ -39,7 +39,7 @@ PYTHON_LDFLAGS="-L@prefix@/@deps_dir@/lib -lpython${PYTHON_VERSION} -lc -ldl -lm
39 39
 PYTHON_CPPFLAGS=-I@prefix@/@deps_dir@/include/python${PYTHON_VERSION}
40 40
 PYTHON_SITE_PKG=@prefix@/@deps_dir@/lib/python${PYTHON_VERSION}/site-packages
41 41
 PYTHON_NOVERSIONCHECK=no-check
42  
-USE_TEXTUREPACKER_NATIVE_ROOT=@prefix@/@tool_dir@
  42
+NATIVE_ROOT=@prefix@/@tool_dir@
43 43
 
44 44
 #afps-ng and libomxil-bellagio
45 45
 ac_cv_func_malloc_0_nonnull=yes
4  tools/rbp/depends/depends.mk
@@ -19,7 +19,7 @@ ifeq ($(USE_BUILDROOT),1)
19 19
 	export PKG_CONFIG_PATH=$(PREFIX)/lib/pkgconfig
20 20
 	export PYTHON_VERSION=2.7
21 21
 	export PATH:=$(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)
22  
-	export USE_TEXTUREPACKER_NATIVE_ROOT=/usr
  22
+	export NATIVE_ROOT=/usr
23 23
 	export PYTHON_LDFLAGS=-L$(SDKSTAGE)/usr/lib -lpython$(PYTHON_VERSION) -lpthread -ldl -lutil -lm
24 24
 else
25 25
 	export CFLAGS=-pipe -O3 -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=softfp -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
@@ -47,7 +47,7 @@ else
47 47
 	export PKG_CONFIG_PATH=$(PREFIX)/bin/pkg-config
48 48
 	export PYTHON_VERSION=2.6
49 49
 	export PATH:=${PREFIX}/bin:$(PATH):${TOOLCHAIN}/bin
50  
-	export USE_TEXTUREPACKER_NATIVE_ROOT=/usr
  50
+	export NATIVE_ROOT=/usr
51 51
 	export PYTHON_LDFLAGS=-L$(SDKSTAGE)/usr/lib -lpython$(PYTHON_VERSION)
52 52
 endif
53 53
 export PYTHON_CPPFLAGS=-I$(SDKSTAGE)/usr/include/python$(PYTHON_VERSION)

0 notes on commit 439b50d

Please sign in to comment.
Something went wrong with that request. Please try again.