diff --git a/.travis.yml b/.travis.yml index 96a10bcb7..48c84b785 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ env: compiler: - gcc - # clang not supported yet - # - clang + - clang # Install a recent gcc and gcov, # it will not be necessary once travis worker is based on ubuntu > 12.04. diff --git a/bindings/python/Android.mk b/bindings/python/Android.mk index 977ffb79c..d1ba0f159 100644 --- a/bindings/python/Android.mk +++ b/bindings/python/Android.mk @@ -47,17 +47,20 @@ LOCAL_32_BIT_ONLY := true LOCAL_SHARED_LIBRARIES := libparameter_host LOCAL_STATIC_LIBRARIES := libxmlserializer_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/linux-x86/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 +77,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 @@ -82,7 +105,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/linux-x86_64/swig/swig \ + 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/ \ -Wall -Werror -v -python -c++ -outdir $(HOST_LIBRARY_PATH)/ -o $@ $^ diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index a885febd2..5663301a2 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/parameter/Android.mk b/parameter/Android.mk index 90e33f09b..aa1e802b4 100644 --- a/parameter/Android.mk +++ b/parameter/Android.mk @@ -143,6 +143,8 @@ include $(CLEAR_VARS) LOCAL_COPY_HEADERS_TO := $(common_copy_headers_to) LOCAL_COPY_HEADERS := $(common_copy_headers) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_CFLAGS := $(common_cflags) LOCAL_SRC_FILES := $(common_src_files) @@ -158,7 +160,6 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer libpfw_utility libxml2 LOCAL_REQUIRED_MODULES := libremote-processor -LOCAL_CLANG := false include external/stlport/libstlport.mk include $(BUILD_SHARED_LIBRARY) @@ -170,6 +171,8 @@ include $(CLEAR_VARS) LOCAL_COPY_HEADERS_TO := $(common_copy_headers_to) LOCAL_COPY_HEADERS := $(common_copy_headers) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_CFLAGS := $(common_cflags) -O0 -ggdb LOCAL_SRC_FILES := $(common_src_files) @@ -186,39 +189,4 @@ LOCAL_STATIC_LIBRARIES := libxmlserializer_host libpfw_utility_host libxml2 LOCAL_LDLIBS += -ldl -LOCAL_CLANG := false include $(BUILD_HOST_SHARED_LIBRARY) - -################################ -# Export includes for plugins (Target build) - -include $(CLEAR_VARS) - -LOCAL_MODULE := $(common_module)_includes -LOCAL_MODULE_OWNER := intel - -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) - -LOCAL_STATIC_LIBRARIES := \ - libxmlserializer \ - libpfw_utility \ - libxml2 - -include $(BUILD_STATIC_LIBRARY) - -################################ -# Export includes for plugins (Host build) - -include $(CLEAR_VARS) - -LOCAL_MODULE := $(common_module)_includes_host -LOCAL_MODULE_OWNER := intel - -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) - -LOCAL_STATIC_LIBRARIES := \ - libxmlserializer_host \ - libpfw_utility_host \ - libxml2 - -include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/parameter/ArrayParameter.cpp b/parameter/ArrayParameter.cpp index 8561410c3..291b6a13a 100644 --- a/parameter/ArrayParameter.cpp +++ b/parameter/ArrayParameter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -34,6 +34,7 @@ #include "ParameterAccessContext.h" #include "ConfigurationAccessContext.h" #include "ParameterBlackboard.h" +#include "Utility.h" #include #define base CParameter @@ -62,7 +63,7 @@ void CArrayParameter::showProperties(string& strResult) const // Array length strResult += "Array length: "; - strResult += toString(getArrayLength()); + strResult += CUtility::toString(getArrayLength()); strResult += "\n"; } @@ -281,7 +282,8 @@ bool CArrayParameter::setValues(uint32_t uiStartIndex, uint32_t uiBaseOffset, co if (!doSetValue(astrValues[uiValueIndex], uiOffset, parameterAccessContext)) { // Append parameter path to error - parameterAccessContext.appendToError(" " + getPath() + "/" + toString(uiValueIndex + uiStartIndex)); + parameterAccessContext.appendToError(" " + getPath() + "/" + + CUtility::toString(uiValueIndex + uiStartIndex)); return false; } diff --git a/parameter/BitParameter.cpp b/parameter/BitParameter.cpp index fb853e479..2a53afd90 100644 --- a/parameter/BitParameter.cpp +++ b/parameter/BitParameter.cpp @@ -87,7 +87,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon } // Rely on integer access - uint64_t uiValue; + uint32_t uiValue; if (bSet) { @@ -108,7 +108,7 @@ bool CBitParameter::accessAsBoolean(bool& bValue, bool bSet, CParameterAccessCon } // Integer Access -bool CBitParameter::accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const +bool CBitParameter::accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const { uint32_t uiOffset = getOffset(); diff --git a/parameter/BitParameter.h b/parameter/BitParameter.h index 436f32118..f9e2b9d2d 100644 --- a/parameter/BitParameter.h +++ b/parameter/BitParameter.h @@ -49,7 +49,7 @@ class CBitParameter : public CBaseParameter virtual bool accessAsBoolean(bool& bValue, bool bSet, CParameterAccessContext& parameterAccessContext) const; // Integer Access - virtual bool accessAsInteger(uint64_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const; + virtual bool accessAsInteger(uint32_t& uiValue, bool bSet, CParameterAccessContext& parameterAccessContext) const; // AreaConfiguration creation virtual CAreaConfiguration* createAreaConfiguration(const CSyncerSet* pSyncerSet) const; diff --git a/parameter/BitParameterBlockType.cpp b/parameter/BitParameterBlockType.cpp index 2016b3b70..0d344f23b 100644 --- a/parameter/BitParameterBlockType.cpp +++ b/parameter/BitParameterBlockType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -29,6 +29,7 @@ */ #include "BitParameterBlockType.h" #include "BitParameterBlock.h" +#include "Utility.h" #define base CTypeElement @@ -74,7 +75,7 @@ CInstanceConfigurableElement* CBitParameterBlockType::doInstantiate() const void CBitParameterBlockType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const { // Size - xmlElement.setAttributeString("Size", toString(_uiSize * 8)); + xmlElement.setAttributeString("Size", CUtility::toString(_uiSize * 8)); base::toXml(xmlElement, serializingContext); } diff --git a/parameter/BitParameterType.cpp b/parameter/BitParameterType.cpp index 2a400d40f..14fe901b1 100644 --- a/parameter/BitParameterType.cpp +++ b/parameter/BitParameterType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -33,6 +33,7 @@ #include #include "ParameterAccessContext.h" #include "BitParameterBlockType.h" +#include "Utility.h" #define base CTypeElement @@ -55,17 +56,17 @@ void CBitParameterType::showProperties(string& strResult) const // Bit Pos strResult += "Bit pos: "; - strResult += toString(_uiBitPos); + strResult += CUtility::toString(_uiBitPos); strResult += "\n"; // Bit size strResult += "Bit size: "; - strResult += toString(_uiBitSize); + strResult += CUtility::toString(_uiBitSize); strResult += "\n"; // Max strResult += "Max: "; - strResult += toString(_uiMax); + strResult += CUtility::toString(_uiMax); strResult += "\n"; } @@ -191,7 +192,7 @@ bool CBitParameterType::toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CP return true; } -void CBitParameterType::fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const +void CBitParameterType::fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const { (void)parameterAccessContext; @@ -245,13 +246,13 @@ bool CBitParameterType::isEncodable(uint64_t uiData) const void CBitParameterType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const { // Position - xmlElement.setAttributeString("Pos", toString(_uiBitPos)); + xmlElement.setAttributeString("Pos", CUtility::toString(_uiBitPos)); // Size - xmlElement.setAttributeString("Size", toString(_uiBitSize)); + xmlElement.setAttributeString("Size", CUtility::toString(_uiBitSize)); // Maximum - xmlElement.setAttributeString("Max", toString(_uiMax)); + xmlElement.setAttributeString("Max", CUtility::toString(_uiMax)); base::toXml(xmlElement, serializingContext); diff --git a/parameter/BitParameterType.h b/parameter/BitParameterType.h index 8f147e655..4c91a1a15 100644 --- a/parameter/BitParameterType.h +++ b/parameter/BitParameterType.h @@ -53,7 +53,7 @@ class CBitParameterType : public CTypeElement void fromBlackboard(std::string& strValue, const uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const; // Integer bool toBlackboard(uint64_t uiUserValue, uint64_t& uiValue, CParameterAccessContext& parameterAccessContext) const; - void fromBlackboard(uint64_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const; + void fromBlackboard(uint32_t& uiUserValue, uint64_t uiValue, CParameterAccessContext& parameterAccessContext) const; // Access from area configuration uint64_t merge(uint64_t uiOriginData, uint64_t uiNewData) const; diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index aa9da51a6..346b1f9ba 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -847,7 +847,7 @@ void CConfigurableDomain::validate(const CParameterBlackboard* pMainBlackboard) // Ensure validity on areas related to configurable element void CConfigurableDomain::validateAreas(const CConfigurableElement* pConfigurableElement, const CParameterBlackboard* pMainBlackboard) { - log_info("Validating domain \"" + getName() + "\" against main blackboard for configurable element \"" + pConfigurableElement->getPath() + "\""); + log_info("Validating domain \"%s\" against main blackboard for configurable element \"%s\"", getName().c_str(), pConfigurableElement->getPath().c_str()); // Propagate size_t uiNbConfigurations = getNbChildren(); diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp index 844ade754..bfa9271cf 100644 --- a/parameter/ConfigurableDomains.cpp +++ b/parameter/ConfigurableDomains.cpp @@ -145,7 +145,7 @@ bool CConfigurableDomains::addDomain(CConfigurableDomain& domain, bool bOverwrit deleteDomain(*pExistingDomain); } - log_info("Adding configurable domain \"" + strDomainName + "\""); + log_info("Adding configurable domain \"%s\"", strDomainName.c_str()); addChild(&domain); @@ -154,7 +154,7 @@ bool CConfigurableDomains::addDomain(CConfigurableDomain& domain, bool bOverwrit void CConfigurableDomains::deleteDomain(CConfigurableDomain& configurableDomain) { - log_info("Deleting configurable domain \"" + configurableDomain.getName() + "\""); + log_info("Deleting configurable domain \"%s\"", configurableDomain.getName().c_str() ); removeChild(&configurableDomain); diff --git a/parameter/ConfigurableElement.cpp b/parameter/ConfigurableElement.cpp index 754f2077e..08a01223a 100644 --- a/parameter/ConfigurableElement.cpp +++ b/parameter/ConfigurableElement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -34,6 +34,7 @@ #include "ConfigurationAccessContext.h" #include "ConfigurableElementAggregator.h" #include "AreaConfiguration.h" +#include "Utility.h" #include #define base CElement @@ -360,7 +361,7 @@ bool CConfigurableElement::isRogue() const std::string CConfigurableElement::getFootprintAsString() const { // Get size as string - return toString(getFootPrint()) + " byte(s)"; + return CUtility::toString(getFootPrint()) + " byte(s)"; } // Matching check for no domain association diff --git a/parameter/Element.cpp b/parameter/Element.cpp index 76661cd7d..afd1f3387 100644 --- a/parameter/Element.cpp +++ b/parameter/Element.cpp @@ -35,7 +35,6 @@ #include #include #include -#include using std::string; @@ -51,14 +50,14 @@ CElement::~CElement() } // Logging -void CElement::log_info(const string& strMessage, ...) const +void CElement::log_info(const char* strMessage, ...) const { char *pacBuffer; va_list listPointer; va_start(listPointer, strMessage); - vasprintf(&pacBuffer, strMessage.c_str(), listPointer); + vasprintf(&pacBuffer, strMessage, listPointer); va_end(listPointer); @@ -69,14 +68,14 @@ void CElement::log_info(const string& strMessage, ...) const free(pacBuffer); } -void CElement::log_warning(const string& strMessage, ...) const +void CElement::log_warning(const char* strMessage, ...) const { char *pacBuffer; va_list listPointer; va_start(listPointer, strMessage); - vasprintf(&pacBuffer, strMessage.c_str(), listPointer); + vasprintf(&pacBuffer, strMessage, listPointer); va_end(listPointer); @@ -212,43 +211,6 @@ void CElement::showDescriptionProperty(std::string &strResult) const } } -// Conversion utilities -string CElement::toString(uint32_t uiValue) -{ - std::ostringstream ostr; - - ostr << uiValue; - - return ostr.str(); -} - -string CElement::toString(uint64_t uiValue) -{ - std::ostringstream ostr; - - ostr << uiValue; - - return ostr.str(); -} - -string CElement::toString(int32_t iValue) -{ - std::ostringstream ostr; - - ostr << iValue; - - return ostr.str(); -} - -string CElement::toString(double dValue) -{ - std::ostringstream ostr; - - ostr << dValue; - - return ostr.str(); -} - // Content dumping void CElement::logValue(string& strValue, CErrorContext& errorContext) const { @@ -738,17 +700,3 @@ uint8_t CElement::computeStructureChecksum() const return uiChecksum; } - -// Utility to underline -void CElement::appendTitle(string& strTo, const string& strTitle) -{ - strTo += "\n" + strTitle + "\n"; - - string::size_type uiLength = strTitle.size(); - - while (uiLength--) { - - strTo += "="; - } - strTo += "\n"; -} diff --git a/parameter/Element.h b/parameter/Element.h index 74aecd5ac..d3844e654 100644 --- a/parameter/Element.h +++ b/parameter/Element.h @@ -49,8 +49,8 @@ class CElement : public IXmlSink, public IXmlSource virtual ~CElement(); // Logging - void log_info(const std::string& strMessage, ...) const; - void log_warning(const std::string& strMessage, ...) const; + void log_info(const char* strMessage, ...) const; + void log_warning(const char* strMessage, ...) const; void log_table(bool bIsWarning, const std::list lstrMessage) const; // Description @@ -133,12 +133,6 @@ class CElement : public IXmlSink, public IXmlSource // Element properties virtual void showProperties(std::string& strResult) const; - // Conversion utilities - static std::string toString(uint32_t uiValue); - static std::string toString(uint64_t uiValue); - static std::string toString(int32_t iValue); - static std::string toString(double dValue); - // Checksum for integrity checks uint8_t computeStructureChecksum() const; @@ -171,8 +165,6 @@ class CElement : public IXmlSink, public IXmlSource protected: // Content dumping virtual void logValue(std::string& strValue, CErrorContext& errorContext) const; - // Utility to underline - static void appendTitle(std::string& strTo, const std::string& strTitle); // Hierarchy CElement* getParent(); diff --git a/parameter/EnumParameterType.cpp b/parameter/EnumParameterType.cpp index 8cca7d746..147ee95bf 100644 --- a/parameter/EnumParameterType.cpp +++ b/parameter/EnumParameterType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -35,6 +35,7 @@ #include #include "ParameterAccessContext.h" #include "EnumValuePair.h" +#include "Utility.h" #include #define base CParameterType @@ -344,7 +345,7 @@ bool CEnumParameterType::isValid(int iNumerical, CParameterAccessContext& parame void CEnumParameterType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const { // Size - xmlElement.setAttributeString("Size", toString(getSize() * 8)); + xmlElement.setAttributeString("Size", CUtility::toString(getSize() * 8)); base::toXml(xmlElement, serializingContext); } diff --git a/parameter/EnumValuePair.cpp b/parameter/EnumValuePair.cpp index 81febdd5c..35f4cd236 100644 --- a/parameter/EnumValuePair.cpp +++ b/parameter/EnumValuePair.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "EnumValuePair.h" +#include "Utility.h" #define base CElement @@ -51,7 +52,7 @@ int32_t CEnumValuePair::getNumerical() const string CEnumValuePair::getNumericalAsString() const { - return toString(_iNumerical); + return CUtility::toString(_iNumerical); } // From IXmlSink diff --git a/parameter/FixedPointParameterType.cpp b/parameter/FixedPointParameterType.cpp index e7779a9cb..5189a0719 100644 --- a/parameter/FixedPointParameterType.cpp +++ b/parameter/FixedPointParameterType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -36,6 +36,7 @@ #include "Parameter.h" #include "ParameterAccessContext.h" #include "ConfigurationAccessContext.h" +#include "Utility.h" #include #include @@ -59,9 +60,9 @@ void CFixedPointParameterType::showProperties(string& strResult) const // Notation strResult += "Notation: Q"; - strResult += toString(_uiIntegral); + strResult += CUtility::toString(_uiIntegral); strResult += "."; - strResult += toString(_uiFractional); + strResult += CUtility::toString(_uiFractional); strResult += "\n"; } @@ -363,13 +364,13 @@ double CFixedPointParameterType::binaryQnmToDouble(int32_t iValue) const void CFixedPointParameterType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const { // Size - xmlElement.setAttributeString("Size", toString(getSize() * 8)); + xmlElement.setAttributeString("Size", CUtility::toString(getSize() * 8)); // Integral - xmlElement.setAttributeString("Integral", toString(_uiIntegral)); + xmlElement.setAttributeString("Integral", CUtility::toString(_uiIntegral)); // Fractional - xmlElement.setAttributeString("Fractional", toString(_uiFractional)); + xmlElement.setAttributeString("Fractional", CUtility::toString(_uiFractional)); base::toXml(xmlElement, serializingContext); } diff --git a/parameter/IntegerParameterType.cpp b/parameter/IntegerParameterType.cpp index edc3d46ac..2d48d53c2 100644 --- a/parameter/IntegerParameterType.cpp +++ b/parameter/IntegerParameterType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -34,6 +34,7 @@ #include "ParameterAccessContext.h" #include #include "ParameterAdaptation.h" +#include "Utility.h" #include #define base CParameterType @@ -69,12 +70,12 @@ void CIntegerParameterType::showProperties(string& strResult) const // Min strResult += "Min: "; - strResult += _bSigned ? toString((int32_t)_uiMin) : toString(_uiMin); + strResult += _bSigned ? CUtility::toString((int32_t)_uiMin) : CUtility::toString(_uiMin); strResult += "\n"; // Max strResult += "Max: "; - strResult += _bSigned ? toString((int32_t)_uiMax) : toString(_uiMax); + strResult += _bSigned ? CUtility::toString((int32_t)_uiMax) : CUtility::toString(_uiMax); strResult += "\n"; // Check if there's an adaptation object available @@ -439,22 +440,22 @@ void CIntegerParameterType::toXml(CXmlElement& xmlElement, CXmlSerializingContex if (_bSigned) { // Mininmum - xmlElement.setAttributeString("Min", toString((int32_t)_uiMin)); + xmlElement.setAttributeString("Min", CUtility::toString((int32_t)_uiMin)); // Maximum - xmlElement.setAttributeString("Max", toString((int32_t)_uiMax)); + xmlElement.setAttributeString("Max", CUtility::toString((int32_t)_uiMax)); } else { // Minimum - xmlElement.setAttributeString("Min", toString(_uiMin)); + xmlElement.setAttributeString("Min", CUtility::toString(_uiMin)); // Maximum - xmlElement.setAttributeString("Max", toString(_uiMax)); + xmlElement.setAttributeString("Max", CUtility::toString(_uiMax)); } // Size - xmlElement.setAttributeString("Size", toString(getSize() * 8)); + xmlElement.setAttributeString("Size", CUtility::toString(getSize() * 8)); base::toXml(xmlElement, serializingContext); diff --git a/parameter/LinearParameterAdaptation.cpp b/parameter/LinearParameterAdaptation.cpp index ea833b3b0..ae925a74a 100644 --- a/parameter/LinearParameterAdaptation.cpp +++ b/parameter/LinearParameterAdaptation.cpp @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "LinearParameterAdaptation.h" +#include "Utility.h" #define base CParameterAdaptation @@ -49,12 +50,12 @@ void CLinearParameterAdaptation::showProperties(string& strResult) const // SlopeNumerator strResult += " - SlopeNumerator: "; - strResult += toString(_dSlopeNumerator); + strResult += CUtility::toString(_dSlopeNumerator); strResult += "\n"; // SlopeDenominator strResult += " - SlopeDenominator: "; - strResult += toString(_dSlopeDenominator); + strResult += CUtility::toString(_dSlopeDenominator); strResult += "\n"; } diff --git a/parameter/LogarithmicParameterAdaptation.cpp b/parameter/LogarithmicParameterAdaptation.cpp index 688527daa..bca494834 100644 --- a/parameter/LogarithmicParameterAdaptation.cpp +++ b/parameter/LogarithmicParameterAdaptation.cpp @@ -29,6 +29,7 @@ */ #include "LogarithmicParameterAdaptation.h" +#include "Utility.h" #include #define base CLinearParameterAdaptation @@ -45,10 +46,10 @@ void CLogarithmicParameterAdaptation::showProperties(std::string& strResult) con base::showProperties(strResult); strResult += " - LogarithmBase: "; - strResult += toString(_dLogarithmBase); + strResult += CUtility::toString(_dLogarithmBase); strResult += "\n"; strResult += " - FloorValue: "; - strResult += toString(_dFloorValue); + strResult += CUtility::toString(_dFloorValue); strResult += "\n"; } diff --git a/parameter/ParameterAdaptation.cpp b/parameter/ParameterAdaptation.cpp index f1e73c19f..99955f144 100644 --- a/parameter/ParameterAdaptation.cpp +++ b/parameter/ParameterAdaptation.cpp @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "ParameterAdaptation.h" +#include "Utility.h" #define base CElement @@ -58,7 +59,7 @@ void CParameterAdaptation::showProperties(string& strResult) const // Offset strResult += " - Offset: "; - strResult += toString(_iOffset); + strResult += CUtility::toString(_iOffset); strResult += "\n"; } diff --git a/parameter/ParameterBlockType.cpp b/parameter/ParameterBlockType.cpp index aafa7ca85..ad9488827 100644 --- a/parameter/ParameterBlockType.cpp +++ b/parameter/ParameterBlockType.cpp @@ -29,6 +29,7 @@ */ #include "ParameterBlockType.h" #include "ParameterBlock.h" +#include "Utility.h" #define base CTypeElement @@ -62,7 +63,8 @@ void CParameterBlockType::populate(CElement* pElement) const for (uiChild = 0; uiChild < uiArrayLength; uiChild++) { - CParameterBlock* pChildParameterBlock = new CParameterBlock(toString(uiChild), this); + CParameterBlock* pChildParameterBlock = new CParameterBlock(CUtility::toString(uiChild), + this); pElement->addChild(pChildParameterBlock); diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 98c2c5320..b42c7decd 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -447,11 +447,11 @@ string CParameterMgr::getVersion() const string strVersion; // Major - strVersion = toString(guiEditionMajor) + "."; + strVersion = CUtility::toString(guiEditionMajor) + "."; // Minor - strVersion += toString(guiEditionMinor) + "."; + strVersion += CUtility::toString(guiEditionMinor) + "."; // Revision - strVersion += toString(guiRevision); + strVersion += CUtility::toString(guiRevision); return strVersion; } @@ -571,7 +571,7 @@ bool CParameterMgr::loadStructure(string& strError) // Retrieve system to load structure to CSystemClass* pSystemClass = getSystemClass(); - log_info("Loading " + pSystemClass->getName() + " system class structure"); + log_info("Loading %s system class structure", pSystemClass->getName().c_str()); // Get structure description element const CFrameworkConfigurationLocation* pStructureDescriptionFileLocation = static_cast(getConstFrameworkConfiguration()->findChildOfKind("StructureDescriptionFileLocation")); @@ -620,7 +620,7 @@ bool CParameterMgr::loadSettings(string& strError) if (!success && !_bFailOnFailedSettingsLoad) { // Load can not fail, ie continue but log the load errors - log_info(strLoadError); + log_info("%s", strLoadError.c_str()); log_info("Failed to load settings, continue without domains."); success = true; } @@ -902,7 +902,7 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::statusCommandProces // Show status /// General section - appendTitle(strResult, "General:"); + CUtility::appendTitle(strResult, "General:"); // System class strResult += "System Class: "; strResult += pSystemClass->getName(); @@ -929,19 +929,19 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::statusCommandProces strResult += "\n"; /// Subsystem list - appendTitle(strResult, "Subsystems:"); + CUtility::appendTitle(strResult, "Subsystems:"); string strSubsystemList; pSystemClass->listChildrenPaths(strSubsystemList); strResult += strSubsystemList; /// Last applied configurations - appendTitle(strResult, "Last Applied [Pending] Configurations:"); + CUtility::appendTitle(strResult, "Last Applied [Pending] Configurations:"); string strLastAppliedConfigurations; getConfigurableDomains()->listLastAppliedConfigurations(strLastAppliedConfigurations); strResult += strLastAppliedConfigurations; /// Criteria states - appendTitle(strResult, "Selection Criteria:"); + CUtility::appendTitle(strResult, "Selection Criteria:"); list lstrSelectionCriteria; getSelectionCriteria()->listSelectionCriteria(lstrSelectionCriteria, false, true); // Concatenate the criterion list as the command result diff --git a/parameter/ParameterType.cpp b/parameter/ParameterType.cpp index a06667180..eb9fd3dfe 100644 --- a/parameter/ParameterType.cpp +++ b/parameter/ParameterType.cpp @@ -31,6 +31,7 @@ #include "Parameter.h" #include "ArrayParameter.h" #include "ParameterAccessContext.h" +#include "Utility.h" #define base CTypeElement @@ -117,7 +118,7 @@ void CParameterType::showProperties(string& strResult) const } // Scalar size - strResult += "Scalar size: " + toString(getSize()) + " byte(s) \n"; + strResult += "Scalar size: " + CUtility::toString(getSize()) + " byte(s) \n"; } // Default value handling (simulation only) diff --git a/parameter/SelectionCriterion.cpp b/parameter/SelectionCriterion.cpp index 781892401..e45c99329 100644 --- a/parameter/SelectionCriterion.cpp +++ b/parameter/SelectionCriterion.cpp @@ -30,6 +30,7 @@ #include "SelectionCriterion.h" #include "AutoLog.h" +#include "Utility.h" #define base CElement @@ -125,7 +126,7 @@ std::string CSelectionCriterion::getFormattedDescription(bool bWithTypeInfo, boo if (bWithTypeInfo) { // Display type info - appendTitle(strFormattedDescription, getName() + ":"); + CUtility::appendTitle(strFormattedDescription, getName() + ":"); // States strFormattedDescription += "Possible states "; diff --git a/parameter/StringParameterType.cpp b/parameter/StringParameterType.cpp index d47895d0c..321dc9751 100644 --- a/parameter/StringParameterType.cpp +++ b/parameter/StringParameterType.cpp @@ -29,6 +29,7 @@ */ #include "StringParameterType.h" #include "StringParameter.h" +#include "Utility.h" #define base CTypeElement @@ -51,7 +52,7 @@ void CStringParameterType::showProperties(string& strResult) const // Max length strResult += "Max length: "; - strResult += toString(_uiMaxLength); + strResult += CUtility::toString(_uiMaxLength); strResult += "\n"; } diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp index a493f6136..6b0264bfc 100644 --- a/parameter/Subsystem.cpp +++ b/parameter/Subsystem.cpp @@ -35,6 +35,7 @@ #include "ConfigurationAccessContext.h" #include "SubsystemObjectCreator.h" #include "MappingData.h" +#include "Utility.h" #include #include @@ -444,7 +445,8 @@ bool CSubsystem::handleSubsystemObjectCreation( pSubsystemObjectCreator->getMaxConfigurableElementSize()) { string strSizeError = "Size should not exceed " + - toString(pSubsystemObjectCreator->getMaxConfigurableElementSize()); + CUtility::toString( + pSubsystemObjectCreator->getMaxConfigurableElementSize()); strError = getMappingError(strKey, strSizeError, pInstanceConfigurableElement); diff --git a/parameter/SubsystemObject.cpp b/parameter/SubsystemObject.cpp index 76b954907..e6b7b442d 100644 --- a/parameter/SubsystemObject.cpp +++ b/parameter/SubsystemObject.cpp @@ -149,7 +149,7 @@ bool CSubsystemObject::sync(CParameterBlackboard& parameterBlackboard, bool bBac strError = string("Unable to ") + (bBack ? "back" : "forward") + " synchronize configurable element " + _pInstanceConfigurableElement->getPath() + ": " + strError; - log_warning(strError); + log_warning("%s", strError.c_str()); // Fall back to parameter default initialization if (bBack) { @@ -213,37 +213,37 @@ void CSubsystemObject::blackboardWrite(const void* pvData, uint32_t uiSize) } // Logging -void CSubsystemObject::log_info(const string& strMessage, ...) const +void CSubsystemObject::log_info(std::string strMessage, ...) const { char *pacBuffer; va_list listPointer; va_start(listPointer, strMessage); - vasprintf(&pacBuffer, strMessage.c_str(), listPointer); + vasprintf(&pacBuffer, strMessage.c_str(), listPointer); va_end(listPointer); if (pacBuffer != NULL) { - _pInstanceConfigurableElement->log_info(pacBuffer); + _pInstanceConfigurableElement->log_info("%s", pacBuffer); } free(pacBuffer); } -void CSubsystemObject::log_warning(const string& strMessage, ...) const +void CSubsystemObject::log_warning(std::string strMessage, ...) const { char *pacBuffer; va_list listPointer; va_start(listPointer, strMessage); - vasprintf(&pacBuffer, strMessage.c_str(), listPointer); + vasprintf(&pacBuffer, strMessage.c_str(), listPointer); va_end(listPointer); if (pacBuffer != NULL) { - _pInstanceConfigurableElement->log_warning(pacBuffer); + _pInstanceConfigurableElement->log_warning("%s", pacBuffer); } free(pacBuffer); diff --git a/parameter/SubsystemObject.h b/parameter/SubsystemObject.h index ab085bc02..2ba212344 100644 --- a/parameter/SubsystemObject.h +++ b/parameter/SubsystemObject.h @@ -83,8 +83,12 @@ class CSubsystemObject : private ISyncer void blackboardRead(void* pvData, uint32_t uiSize); void blackboardWrite(const void* pvData, uint32_t uiSize); // Logging - void log_info(const std::string& strMessage, ...) const; - void log_warning(const std::string& strMessage, ...) const; + // Copy the string format because: + // - passing char * would break compatibility + // - passing a const std::string & in forbiden by the c++ standard + // as va_start second argument must not be a reference. + void log_info(std::string strMessage, ...) const; + void log_warning(std::string strMessage, ...) const; // Belonging Subsystem retrieval const CSubsystem* getSubsystem() const; diff --git a/remote-processor/Android.mk b/remote-processor/Android.mk index 87cdcda29..890a40752 100644 --- a/remote-processor/Android.mk +++ b/remote-processor/Android.mk @@ -49,9 +49,6 @@ common_cflags := \ -Werror \ -Wextra \ -Wno-unused-parameter \ - -pthread - -common_ldlibs := -pthread ############################# # Target build @@ -63,7 +60,6 @@ LOCAL_SRC_FILES := $(common_src_files) LOCAL_STATIC_LIBRARIES := libpfw_utility LOCAL_CFLAGS := $(common_cflags) -LOCAL_LDLIBS := $(common_ldlibs) LOCAL_MODULE := $(common_module) LOCAL_MODULE_OWNER := intel @@ -81,8 +77,8 @@ LOCAL_SRC_FILES := $(common_src_files) LOCAL_STATIC_LIBRARIES := libpfw_utility_host -LOCAL_CFLAGS := $(common_cflags) -LOCAL_LDLIBS := $(common_ldlibs) +LOCAL_CFLAGS := $(common_cflags) -pthread +LOCAL_LDLIBS := -lpthread LOCAL_MODULE := $(common_module)_host LOCAL_MODULE_OWNER := intel diff --git a/remote-processor/Socket.cpp b/remote-processor/Socket.cpp index b36d32fc8..0aec7a21a 100644 --- a/remote-processor/Socket.cpp +++ b/remote-processor/Socket.cpp @@ -39,8 +39,9 @@ #include #include #include +#include -CSocket::CSocket() : _iSockFd(socket(AF_INET, SOCK_STREAM, 0)) +CSocket::CSocket() : _iSockFd(socket(AF_INET, SOCK_STREAM, 0)), mSendFlag(0) { assert(_iSockFd != -1); @@ -50,6 +51,19 @@ CSocket::CSocket() : _iSockFd(socket(AF_INET, SOCK_STREAM, 0)) // they are ready to be sent, instead of waiting for more data on the // socket. setsockopt(_iSockFd, IPPROTO_TCP, TCP_NODELAY, (char *)&iNoDelay, sizeof(iNoDelay)); + + // Disable sigpipe reception on send +# if not defined(SIGPIPE) + // Pipe signal does not exist, there no sigpipe to ignore on send +# elif defined(SO_NOSIGPIPE) + const int set = 1; + setsockopt(_iSockFd, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof(set)); +# elif defined(MSG_NOSIGNAL) + // Use flag NOSIGNAL on send call + mSendFlag = MSG_NOSIGNAL; +# else +# error Can not disable SIGPIPE +# endif } CSocket::CSocket(int iSockId) : _iSockFd(iSockId) @@ -59,7 +73,11 @@ CSocket::CSocket(int iSockId) : _iSockFd(iSockId) CSocket::~CSocket() { - close(_iSockFd); + // fd might be invalide if send had an error. + // valgrind displays a warning if closing an invalid fd. + if (_iSockFd != -1) { + close(_iSockFd); + } } // Socket address init @@ -108,7 +126,7 @@ bool CSocket::read(void* pvData, uint32_t uiSize) while (uiSize) { - int32_t iAccessedSize = ::recv(_iSockFd, &pucData[uiOffset], uiSize, MSG_NOSIGNAL); + int32_t iAccessedSize = ::recv(_iSockFd, &pucData[uiOffset], uiSize, 0); switch (iAccessedSize) { case 0: @@ -140,17 +158,19 @@ bool CSocket::write(const void* pvData, uint32_t uiSize) while (uiSize) { - int32_t iAccessedSize = ::send(_iSockFd, &pucData[uiOffset], uiSize, MSG_NOSIGNAL); + int32_t iAccessedSize = ::send(_iSockFd, &pucData[uiOffset], uiSize, mSendFlag); if (iAccessedSize == -1) { - if (errno == ECONNRESET) { - // Peer has disconnected - _disconnected = true; - } - // errno == EINTR => The send system call was interrupted, try again - if (errno != EINTR) { - return false; + if (errno == EINTR) { + // The send system call was interrupted, try again + continue; } + + // An error occured, forget this socket + _disconnected = true; + close(_iSockFd); + _iSockFd = -1; // Avoid writing again on the same socket + return false; } else { uiSize -= iAccessedSize; uiOffset += iAccessedSize; diff --git a/remote-processor/Socket.h b/remote-processor/Socket.h index 00bd8bc39..8c3fb9f31 100644 --- a/remote-processor/Socket.h +++ b/remote-processor/Socket.h @@ -108,4 +108,5 @@ class CSocket * See hasPeerDisconnected for more details. */ bool _disconnected; + int mSendFlag; }; diff --git a/support/android/build_pfw_settings.mk b/support/android/build_pfw_settings.mk index 482c56d58..e51adfd1d 100644 --- a/support/android/build_pfw_settings.mk +++ b/support/android/build_pfw_settings.mk @@ -35,7 +35,8 @@ $(LOCAL_BUILT_MODULE): MY_TOOL := $(HOST_OUT)/bin/domainGenerator.py # As of Android K, python is available as prebuilt. We can't reliably use the # host's default python because the low-level python binding has been compiled # against Android's Python headers. -$(LOCAL_BUILT_MODULE): MY_PYTHON := prebuilts/python/linux-x86/2.7.5/bin/python +# BTW, python is only available in 32bits for now, thus arch is forced to 32bits +$(LOCAL_BUILT_MODULE): MY_PYTHON := prebuilts/python/$(HOST_OS)-x86/2.7.5/bin/python # The parameter-framework binding module is installed on these locations on # Android (On 64bit machines, PyPfw.py is installed in the 'lib64' directory # and _PyPfw.so is installed in the 'lib' directory, hence the need for these diff --git a/test/test-platform/Android.mk b/test/test-platform/Android.mk index a8dc619e4..91e474c2e 100644 --- a/test/test-platform/Android.mk +++ b/test/test-platform/Android.mk @@ -43,8 +43,6 @@ common_c_includes := \ $(LOCAL_PATH)/../../parameter/include \ $(LOCAL_PATH)/../../remote-processor/ -common_ldlibs := -pthread - common_shared_libraries := libparameter libremote-processor ############################# # Target build @@ -58,7 +56,6 @@ LOCAL_MODULE_OWNER := intel LOCAL_MODULE_TAGS := $(common_module_tags) LOCAL_C_INCLUDES := $(common_c_includes) -LOCAL_LDLIBS := $(common_ldlibs) LOCAL_STATIC_LIBRARIES := libpfw_utility LOCAL_SHARED_LIBRARIES := $(common_shared_libraries) @@ -78,7 +75,8 @@ LOCAL_MODULE_OWNER := intel LOCAL_MODULE_TAGS := $(common_module_tags) LOCAL_C_INCLUDES += $(common_c_includes) -LOCAL_LDLIBS := $(common_ldlibs) +LOCAL_CFLAGS := -pthread +LOCAL_LDLIBS := -lpthread LOCAL_STATIC_LIBRARIES := libpfw_utility_host LOCAL_SHARED_LIBRARIES := $(foreach shared_library, $(common_shared_libraries), \ diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index 24323e60a..6e67b3a55 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -63,7 +63,6 @@ class CParameterMgrPlatformConnectorLogger : public CParameterMgrPlatformConnect CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber, sem_t& exitSemaphore) : _pParameterMgrPlatformConnector(new CParameterMgrPlatformConnector(strClass)), _pParameterMgrPlatformConnectorLogger(new CParameterMgrPlatformConnectorLogger), - _portNumber(iPortNumber), _exitSemaphore(exitSemaphore) { _pCommandHandler = new CCommandHandler(this); diff --git a/test/test-platform/TestPlatform.h b/test/test-platform/TestPlatform.h index e9d1dd41a..fae838643 100644 --- a/test/test-platform/TestPlatform.h +++ b/test/test-platform/TestPlatform.h @@ -153,9 +153,6 @@ class CTestPlatform // Remote Processor Server CRemoteProcessorServer* _pRemoteProcessorServer; - // Port number for the server socket - int _portNumber; - // Semaphore used by calling thread to avoid exiting sem_t& _exitSemaphore; }; diff --git a/utility/Utility.cpp b/utility/Utility.cpp index dc0bce1f4..e5f689a1b 100644 --- a/utility/Utility.cpp +++ b/utility/Utility.cpp @@ -32,6 +32,7 @@ #include #include +#include using std::string; @@ -72,3 +73,15 @@ void CUtility::asString(const std::map& mapStr, CUtility::asString(listKeysValues, strOutput, strItemSeparator); } +void CUtility::appendTitle(string& strTo, const string& strTitle) +{ + strTo += "\n" + strTitle + "\n"; + + uint32_t uiLength = strTitle.size(); + + while (uiLength--) { + + strTo += "="; + } + strTo += "\n"; +} diff --git a/utility/Utility.h b/utility/Utility.h index 51f796f02..93acd8205 100644 --- a/utility/Utility.h +++ b/utility/Utility.h @@ -33,6 +33,7 @@ #include #include #include +#include class CUtility { @@ -62,5 +63,21 @@ class CUtility std::string& strOutput, const std::string& strItemSeparator = ", ", const std::string& strKeyValueSeparator = ":"); -}; + /** Utility to easily convert a builtin type into string + * + * FIXME: Should be replaced by std::to_string after C++11 introduction + */ + template + static std::string toString(T uiValue) + { + std::ostringstream ostr; + + ostr << uiValue; + + return ostr.str(); + } + + /** Utility to underline */ + static void appendTitle(std::string& strTo, const std::string& strTitle); +}; diff --git a/xmlserializer/Android.mk b/xmlserializer/Android.mk index 37a8241df..de32991f0 100644 --- a/xmlserializer/Android.mk +++ b/xmlserializer/Android.mk @@ -63,6 +63,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(common_src_files) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_MODULE := $(common_module) LOCAL_MODULE_OWNER := intel LOCAL_MODULE_TAGS := $(common_module_tags) @@ -86,6 +88,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(common_src_files) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_MODULE := $(common_module)_host LOCAL_MODULE_OWNER := intel LOCAL_MODULE_TAGS := $(common_module_tags) @@ -101,20 +105,3 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) include $(BUILD_HOST_STATIC_LIBRARY) -################################ -# Export includes for plugins (Target build) -include $(CLEAR_VARS) -LOCAL_MODULE := $(common_module)_includes -LOCAL_MODULE_OWNER := intel -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) -LOCAL_STATIC_LIBRARIES := libxml2 -include $(BUILD_STATIC_LIBRARY) - -################################ -# Export includes for plugins (Host build) -include $(CLEAR_VARS) -LOCAL_MODULE := $(common_module)_includes -LOCAL_MODULE_OWNER := intel -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) -LOCAL_STATIC_LIBRARIES := libxml2 -include $(BUILD_HOST_STATIC_LIBRARY)