aboutsummaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2015-07-15 15:37:57 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2015-07-15 17:09:51 -0700
commita9be2d378b7ad84e679a48efa81f42fb54f85d9a (patch)
tree587d34728dac3517a213d6d2a9a6ebdecd4e7531 /bindings
parentc99720d29f2ee618cc74c9336d2cd2a26544c020 (diff)
downloadexternal_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.zip
external_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.tar.gz
external_parameter-framework-a9be2d378b7ad84e679a48efa81f42fb54f85d9a.tar.bz2
Drop release v2.6.0+no-stlport
Bug 246391 Change-Id: I662b7b0f90c97cb169978e1b64ad1fe32c440cf5 Signed-off-by: Jean-Michel Trivi <jmtrivi@google.com>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/c/CMakeLists.txt3
-rw-r--r--bindings/c/Test.cpp3
-rw-r--r--bindings/python/Android.mk37
-rw-r--r--bindings/python/CMakeLists.txt6
-rw-r--r--bindings/python/pfw.i2
5 files changed, 37 insertions, 14 deletions
diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt
index 36b6aa9..3f00434 100644
--- a/bindings/c/CMakeLists.txt
+++ b/bindings/c/CMakeLists.txt
@@ -48,6 +48,7 @@ if(BUILD_TESTING)
# copy it in a standard location (/usr/include on most linux distribution).
find_path(CATCH_HEADER catch.hpp)
include_directories(${CATCH_HEADER})
+ include_directories("${PROJECT_SOURCE_DIR}/utility")
# Add unit test
add_executable(cparameterUnitTest Test.cpp)
@@ -57,7 +58,7 @@ if(BUILD_TESTING)
# proper failure.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nonnull")
- target_link_libraries(cparameterUnitTest cparameter)
+ target_link_libraries(cparameterUnitTest cparameter pfw_utility)
add_test(NAME cparameterUnitTest
COMMAND cparameterUnitTest)
diff --git a/bindings/c/Test.cpp b/bindings/c/Test.cpp
index c450e60..8cbaa90 100644
--- a/bindings/c/Test.cpp
+++ b/bindings/c/Test.cpp
@@ -29,6 +29,7 @@
*/
#include "ParameterFramework.h"
+#include "FullIo.hpp"
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main()
#include <catch.hpp>
@@ -84,7 +85,7 @@ struct Test
CAPTURE(errno);
REQUIRE(mFd != -1);
mPath = tmpName;
- write(mFd, content.c_str(), content.length());
+ REQUIRE(utility::fullWrite(mFd, content.c_str(), content.length()));
}
~TmpFile() {
CHECK(close(mFd) != -1);
diff --git a/bindings/python/Android.mk b/bindings/python/Android.mk
index fa5b7b8..b4b6277 100644
--- a/bindings/python/Android.mk
+++ b/bindings/python/Android.mk
@@ -38,26 +38,25 @@ include $(CLEAR_VARS)
LOCAL_MODULE := _PyPfw
LOCAL_CPP_EXTENSION := .cxx
-# As long as the parameter-framework is compiled with gcc, we must avoid
-# compiling the bindings with clang and compile with gcc instead.
-LOCAL_CLANG := false
# Android only provides a 32bit version of python.
LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := libparameter_host
-LOCAL_STATIC_LIBRARIES := libxmlserializer_host
+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_INCLUDES_PATH := $(PYTHON_INSTALL_PATH)/include/python2.7
+PYTHON_BIN_PATH := $(PYTHON_INSTALL_PATH)/bin
LOCAL_C_INCLUDES := \
- prebuilts/python/$(HOST_PREBUILT_TAG)/2.7.5/include/python2.7 \
+ $(PYTHON_INCLUDES_PATH) \
$(HOST_OUT_HEADERS)/parameter
-# The 'unused-but-set-variable' warning must be disabled because SWIG generates
-# files that do not respect that constraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
-LOCAL_CFLAGS := -Wno-unused-but-set-variable -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK
+LOCAL_CFLAGS := -fexceptions -DSWIG_PYTHON_SILENT_MEMLEAK
# Undefined symbols will be resolved at runtime
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
@@ -74,6 +73,26 @@ 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
+
$(generated-sources-dir)/pfw_wrap.h: $(generated-sources-dir)/pfw_wrap.cxx
# The PyPfw.py file is generated in the directory given by -outdir switch, thus
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index a885feb..5663301 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -54,13 +54,13 @@ swig_link_libraries(PyPfw parameter ${PYTHON_LIBRARIES})
# ${CMAKE_CURRENT_BINARY_DIR}.
set_property(TARGET _PyPfw PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-# The 'unused-but-set-variable' warning must be disabled because SWIG generates
-# files that do not respect that contraint.
# '-DSWIG_PYTHON_SILENT_MEMLEAK' is needed because the "memleak" warning
# pollutes the standard output. At the time of writing, the only warning is
# spurious anyway, as it relates to "ILogger *" which is an abstract
# class/interface class and as such cannot be destroyed.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable -DSWIG_PYTHON_SILENT_MEMLEAK")
+# -Wno-error is set to prevent compilation failure in case of the code
+# generated by swig generates warnings
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSWIG_PYTHON_SILENT_MEMLEAK -Wno-error")
# Find the python modules install path.
diff --git a/bindings/python/pfw.i b/bindings/python/pfw.i
index 2d39228..bf1330b 100644
--- a/bindings/python/pfw.i
+++ b/bindings/python/pfw.i
@@ -159,6 +159,8 @@ public:
std::string& strError);
bool importSingleDomainXml(const std::string& strXmlSource, bool bOverwrite,
std::string& strError);
+ bool importSingleDomainXml(const std::string& xmlSource, bool overwrite, bool withSettings,
+ bool fromFile, std::string& strError);
// Tells swig that "strXmlDest" in the two following methods are "inout"
// parameters