aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bindings/python/Android.mk34
1 files changed, 12 insertions, 22 deletions
diff --git a/bindings/python/Android.mk b/bindings/python/Android.mk
index b4b6277..ec4f3e1 100644
--- a/bindings/python/Android.mk
+++ b/bindings/python/Android.mk
@@ -44,7 +44,7 @@ LOCAL_32_BIT_ONLY := true
LOCAL_SHARED_LIBRARIES := libxmlserializer_host libparameter_host
# python is only available in 32bits for now, thus arch is forced to 32bits
-PYTHON_INSTALL_PATH := prebuilts/python/$(HOST_OS)-x86/2.7.5/
+PYTHON_INSTALL_PATH := /usr
PYTHON_INCLUDES_PATH := $(PYTHON_INSTALL_PATH)/include/python2.7
PYTHON_BIN_PATH := $(PYTHON_INSTALL_PATH)/bin
@@ -74,24 +74,16 @@ LOCAL_GENERATED_SOURCES := $(generated-sources-dir)/pfw_wrap.cxx $(generated-sou
LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated-sources-dir)
# Get the interpreter ld options.
-ifeq ($(HOST_OS), darwin)
- # Contrary to linux, on darwin, a python 64 bit executable is installed
- # in the x86 prebuild directory,
- # As all host libraries are 32 bit in android. We can not link and host
- # python module against the prebuild python library.
- #
- # As a *dirty* workaround, use the system's python configuration and hope
- # it will be compatible with the prebuild python interpreter used at runtime.
- # To summarize the prebuild python (64 bit?) interpreter will load a
- # python native module (32bit) linked with the host (32 bit ?) python library.
- LOCAL_LDLIBS += $(shell python-config --ldflags)
-else
- # Careful, we need to invoke the android python config not the host's one.
- # Unfortunately, the internal install directory of python is hardcoded to a dummy value,
- # As a workaround, we need to manually add the correct path to libs to the library list.
- LOCAL_LDLIBS += $(shell $(PYTHON_BIN_PATH)/python $(PYTHON_BIN_PATH)/python-config --ldflags) \
- -L $(PYTHON_INSTALL_PATH)/lib/
-endif
+# Contrary to linux, on darwin, a python 64 bit executable is installed
+# in the x86 prebuild directory,
+# As all host libraries are 32 bit in android. We can not link and host
+# python module against the prebuild python library.
+#
+# As a *dirty* workaround, use the system's python configuration and hope
+# it will be compatible with the prebuild python interpreter used at runtime.
+# To summarize the prebuild python (64 bit?) interpreter will load a
+# python native module (32bit) linked with the host (32 bit ?) python library.
+LOCAL_LDLIBS += $(shell python-config --ldflags)
$(generated-sources-dir)/pfw_wrap.h: $(generated-sources-dir)/pfw_wrap.cxx
@@ -101,9 +93,7 @@ $(generated-sources-dir)/pfw_wrap.cxx: $(LOCAL_PATH)/pfw.i
@echo "Generating Python binding files"
mkdir -p $(dir $@) # surprisingly, path is not generated by build system
mkdir -p $(HOST_LIBRARY_PATH)
- prebuilts/misc/$(HOST_OS)-$(HOST_ARCH)/swig/swig \
- -Iprebuilts/misc/common/swig/include/2.0.11/python/ \
- -Iprebuilts/misc/common/swig/include/2.0.11/ \
+ /usr/bin/swig \
-Wall -Werror -v -python -c++ -outdir $(HOST_LIBRARY_PATH)/ -o $@ $^
include $(BUILD_HOST_SHARED_LIBRARY)