From 554fb9e69ad703d9746912b1e98c093d5eacdf12 Mon Sep 17 00:00:00 2001 From: "taesub.kim" Date: Fri, 12 Feb 2016 15:41:53 +0900 Subject: [PATCH] Fixed build error for 64bit Change-Id: I1925a8001c114740826472abb4bb56341d6ab76b Signed-off-by: Taesub Kim --- CMakeLists.txt | 2 +- daemon/CMakeLists.txt | 4 ++-- framework/CMakeLists.txt | 8 ++++---- framework/capi-vpnsvc.pc.in | 2 +- packaging/capi-vpn-service.spec | 3 ++- test/CMakeLists.txt | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8e110a..42a6afb 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE(FindPkgConfig) SET(CMAKE_INSTALL_PREFIX /usr) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX ${PREFIX}/bin) -SET(LIBDIR ${PREFIX}/lib) +SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR ${PREFIX}/include) # If supported for the target machine, emit position-independent code,suitable diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 09ffa1d..e94f838 100755 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -4,7 +4,7 @@ SET(LIB_NAME ${PACKAGE_NAME}) PROJECT(${LIB_NAME}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") +SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include") SET(DAEMON_DIR "${CMAKE_SOURCE_DIR}/daemon") SET(VERSION 0.1) @@ -39,7 +39,7 @@ ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"") ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATADIR}\"") ADD_DEFINITIONS("-DSLP_DEBUG") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath="${LIBDIR}" -pie") ADD_CUSTOM_COMMAND( WORKING_DIRECTORY diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index b78e4d4..a01be18 100755 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -4,7 +4,7 @@ SET(LIB_NAME ${PACKAGE_NAME}) PROJECT(${LIB_NAME}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") +SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include") SET(VERSION 0.1) @@ -34,12 +34,12 @@ ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"") ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATADIR}\"") ADD_DEFINITIONS("-DSLP_DEBUG") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath="${LIBDIR}) ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${${PACKAGE_NAME}_LDFLAGS} -lrt -ldl) -INSTALL(TARGETS ${PACKAGE_NAME} DESTINATION lib) +INSTALL(TARGETS ${PACKAGE_NAME} DESTINATION ${LIBDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/vpn_service.h DESTINATION include) SET_TARGET_PROPERTIES(${PACKAGE_NAME} @@ -61,4 +61,4 @@ CONFIGURE_FILE( @ONLY ) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_NAME}.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) diff --git a/framework/capi-vpnsvc.pc.in b/framework/capi-vpnsvc.pc.in index fbe305b..b30cfc2 100755 --- a/framework/capi-vpnsvc.pc.in +++ b/framework/capi-vpnsvc.pc.in @@ -3,7 +3,7 @@ prefix=@PREFIX@ exec_prefix=/usr -libdir=/usr/lib +libdir=@LIBDIR@ includedir=/usr/include Name: @PC_NAME@ diff --git a/packaging/capi-vpn-service.spec b/packaging/capi-vpn-service.spec index 1075804..95195dd 100755 --- a/packaging/capi-vpn-service.spec +++ b/packaging/capi-vpn-service.spec @@ -81,7 +81,8 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DMAJORVER=${MAJORVER} \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \ -DTIZEN_ENGINEER_MODE=%{?tizen_build_binary_release_type_eng:1}%{!?tizen_build_binary_release_type_eng:0} \ - -DCMAKE_VERBOSE_MAKEFILE=ON + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DLIB_INSTALL_DIR=%{_libdir} make %{?jobs:-j%jobs} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 87a4496..e23d651 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ SET(LIB_NAME ${PACKAGE_NAME}) PROJECT(${LIB_NAME}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") +SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include") SET(VERSION 0.1) @@ -33,7 +33,7 @@ SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") ADD_DEFINITIONS("-DSLP_DEBUG") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath="${LIBDIR}) ADD_EXECUTABLE(${PACKAGE_NAME} ${TEST_SRCS}) TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${${PACKAGE_NAME}_LDFLAGS} "-ldl" capi-vpnsvc) -- 2.7.4