0001-solve-ndk-structure-problems.patch 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Index: android-projects/root.mk
  2. ===================================================================
  3. --- android-projects/root.mk (revision 551)
  4. +++ android-projects/root.mk (working copy)
  5. @@ -2,10 +2,10 @@
  6. ## Root configuration file shared by all android projects.
  7. ######
  8. -export ANDROID_NDK_ROOT=/cygdrive/c/android-ndk-r4b
  9. +export ANDROID_NDK_ROOT=/media/dati/projects/android-dk/android-ndk-r5b
  10. export ANDROID_SDK_ROOT=/cygdrive/c/android-sdk
  11. export ANDROID_PLATFORM=android-3
  12. -export ANDROID_HOST=windows
  13. +export ANDROID_HOST=linux-x86
  14. export ANDROID_GCC_VER=4.4.0
  15. @@ -18,13 +18,30 @@
  16. # Path where to copy libraries (*.so) -on the device or emulator-
  17. export LIB_DIR=/system/lib
  18. +# Test the NDK directory structure
  19. +export ANDROID_NDK_BASE=$(shell if [ -r $(ANDROID_NDK_ROOT)/build/platforms ] ; then \
  20. + echo $(ANDROID_NDK_ROOT)/build/platforms ; \
  21. + elif [ -r $(ANDROID_NDK_ROOT)/platforms ] ; then \
  22. + echo $(ANDROID_NDK_ROOT)/platforms ; \
  23. + else \
  24. + echo "Err_Unable_to_recognize_the_NDK_structure_for_ANDROID_NDK_BASE" ; \
  25. + fi)
  26. +
  27. +export ANDROID_NDK_TOOL_BASE=$(shell if [ -r $(ANDROID_NDK_ROOT)/build/prebuilt/$(ANDROID_HOST)/arm-eabi-$(ANDROID_GCC_VER) ] ; then \
  28. + echo $(ANDROID_NDK_ROOT)/build/prebuilt/$(ANDROID_HOST)/arm-eabi-$(ANDROID_GCC_VER) ; \
  29. + elif [ -r $(ANDROID_NDK_ROOT)/toolchains/arm-eabi-$(ANDROID_GCC_VER)/prebuilt/$(ANDROID_HOST) ] ; then \
  30. + echo $(ANDROID_NDK_ROOT)/toolchains/arm-eabi-$(ANDROID_GCC_VER)/prebuilt/$(ANDROID_HOST) ; \
  31. + else \
  32. + echo "Err_Unable_to_recognize_the_NDK_structure_for_ANDROID_NDK_TOOL_BASE" ; \
  33. + fi)
  34. +
  35. ##################################################################################
  36. export AR=arm-eabi-ar
  37. export CC=arm-eabi-gcc-$(ANDROID_GCC_VER)
  38. export CPP=arm-eabi-g++
  39. -export CFLAGS_COMMON=$(CFLAGS) $(DEBUG_FLAGS) -I$(ANDROID_NDK_ROOT)/build/platforms/$(ANDROID_PLATFORM)/arch-arm/usr/include \
  40. +export CFLAGS_COMMON=$(CFLAGS) $(DEBUG_FLAGS) -I$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/include \
  41. -msoft-float \
  42. -fpic \
  43. -mthumb-interwork \
  44. @@ -57,7 +74,7 @@
  45. -DANDROID
  46. #-mthumb
  47. -export LDFLAGS_COMMON=$(LDFLAGS) -Wl,-rpath=/system/lib,-rpath-link=$(ANDROID_NDK_ROOT)/build/platforms/$(ANDROID_PLATFORM)/arch-arm/usr/lib,-rpath-link=$(OUTPUT_DIR),-dynamic-linker=/system/bin/linker,-T,$(ANDROID_NDK_ROOT)/build/prebuilt/$(ANDROID_HOST)/arm-eabi-$(ANDROID_GCC_VER)/arm-eabi/lib/ldscripts/armelf.xsc -L$(ANDROID_NDK_ROOT)/build/platforms/$(ANDROID_PLATFORM)/arch-arm/usr/lib
  48. +export LDFLAGS_COMMON=$(LDFLAGS) -Wl,-rpath=/system/lib,-rpath-link=$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/lib,-rpath-link=$(OUTPUT_DIR),-dynamic-linker=/system/bin/linker,-T,$(ANDROID_NDK_TOOL_BASE)/arm-eabi/lib/ldscripts/armelf.xsc -L$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/lib
  49. export LDFLAGS_COMMON+=-nostdlib -lc -L$(OUTPUT_DIR)
  50. ifeq ($(BT), static)