Decide the path of the provider so files at compile time, w.r.t, the target architecture 58/92258/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 14 Oct 2016 06:56:11 +0000 (15:56 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 14 Oct 2016 06:56:11 +0000 (15:56 +0900)
Change-Id: I3bc1c4fe6ead78213bd20e9794d0b385504ce66b
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
CMakeLists.txt
packaging/context-service.spec
src/ProviderLoader.cpp

index 565a232..30b5e50 100644 (file)
@@ -40,6 +40,7 @@ INCLUDE_DIRECTORIES(
 )
 ADD_DEFINITIONS(-O2 -Wall -fPIC -fPIE -fdata-sections -ffunction-sections -fvisibility=hidden)
 ADD_DEFINITIONS(-DLOG_TAG="CONTEXT")
+ADD_DEFINITIONS(-D_LIBDIR_="${LIBDIR}")
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -pie -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
 
 # Building Daemon
index 61b2691..ac2b761 100644 (file)
@@ -62,7 +62,7 @@ export CXXFLAGS+=" -std=c++0x"
 #export   CFLAGS+=" -Wcast-qual"
 #export CXXFLAGS+=" -Wcast-qual"
 
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DPROFILE=%{?BUILD_PROFILE}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DPROFILE=%{?BUILD_PROFILE}
 make %{?jobs:-j%jobs}
 
 %install
index f4cfa7e..275f67d 100644 (file)
@@ -46,8 +46,8 @@ ContextProvider* ProviderLoader::load(const char *subject)
                return NULL;
        }
 
-       std::string path = LIB_DIRECTORY;
-       path = path + LIB_PREFIX + it->second + LIB_EXTENSION;
+       std::string path(_LIBDIR_ LIB_PREFIX);
+       path = path + it->second + LIB_EXTENSION;
 
        return __load(path.c_str(), subject);
 }