From b59e8675947bcbc5a12937195246f75baceba2e4 Mon Sep 17 00:00:00 2001 From: Junfeng Date: Thu, 21 Mar 2013 21:11:44 +0800 Subject: [PATCH] Fix for x86_64 compatibility. - Adapt CFLAGS & LDFLAGS for x86-64. - Fix hardcoding library path. Change-Id: I36df4134d391b958f904ddbbd183e5f97e6820b9 --- bt-api/CMakeLists.txt | 5 ++--- bt-api/bluetooth-api.pc.in | 2 +- bt-api/bt-service-api.pc.in | 2 +- packaging/bluetooth-frwk.spec | 11 ++++++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bt-api/CMakeLists.txt b/bt-api/CMakeLists.txt index 1db2e69d..0d4a554c 100644 --- a/bt-api/CMakeLists.txt +++ b/bt-api/CMakeLists.txt @@ -30,7 +30,6 @@ bluetooth-media-control.h) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") SET(INCLUDEDIR "\${prefix}/include") SET(VERSION_MAJOR 1) SET(VERSION ${VERSION_MAJOR}.0.0) @@ -73,8 +72,8 @@ SET_TARGET_PROPERTIES(bluetooth-api PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(bluetooth-api PROPERTIES VERSION ${VERSION}) TARGET_LINK_LIBRARIES(bluetooth-api ${packages_LDFLAGS}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-api.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bluetooth-api.pc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bluetooth-api.pc DESTINATION lib/pkgconfig) -INSTALL(TARGETS bluetooth-api DESTINATION lib COMPONENT RuntimeLibraries) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bluetooth-api.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +INSTALL(TARGETS bluetooth-api DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) FOREACH(hfile ${HEADERS}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/${hfile} DESTINATION include/bt-service) diff --git a/bt-api/bluetooth-api.pc.in b/bt-api/bluetooth-api.pc.in index c7210a4c..e577fa3b 100644 --- a/bt-api/bluetooth-api.pc.in +++ b/bt-api/bluetooth-api.pc.in @@ -1,6 +1,6 @@ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ +libdir=@LIB_INSTALL_DIR@ includedir=@INCLUDEDIR@ Name: bluetooth-api diff --git a/bt-api/bt-service-api.pc.in b/bt-api/bt-service-api.pc.in index d0d81d40..00120310 100644 --- a/bt-api/bt-service-api.pc.in +++ b/bt-api/bt-service-api.pc.in @@ -1,6 +1,6 @@ prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ +libdir=@LIB_INSTALL_DIR@ includedir=@INCLUDEDIR@ Name: bt-service diff --git a/packaging/bluetooth-frwk.spec b/packaging/bluetooth-frwk.spec index 5bf1f050..0be06292 100644 --- a/packaging/bluetooth-frwk.spec +++ b/packaging/bluetooth-frwk.spec @@ -61,10 +61,15 @@ This package is Bluetooth core daemon to manage activation / deactivation. %build -export CFLAGS+=" -fpie" -export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie" -cmake . -DCMAKE_INSTALL_PREFIX=/usr +%ifarch x86_64 +export CFLAGS+=" -Wall -g -fvisibility=hidden -fPIC" +export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs" +%else +export CFLAGS+=" -fpie" +export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie" +%endif +%cmake . make -- 2.34.1