From de05d29077a868080c31ce30f64cb9e8a207c5dd Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Wed, 24 Jul 2013 09:20:42 +0900 Subject: [PATCH] separate osp-newlib Change-Id: I5353a02ad111744761b5fb1c9f2b7375ab9817b3 Signed-off-by: Young Ik Cho --- CMakeLists.txt | 5 ++++ packaging/osp-appfw.spec | 10 ++++--- src/CMakeLists.txt | 1 + src/appfw/CMakeLists.txt | 7 +++-- src/base/CMakeLists.txt | 35 ------------------------ src/base/runtime/CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++ src/newlib-compat/CMakeLists.txt | 24 ++++++++++++++-- 7 files changed, 97 insertions(+), 44 deletions(-) mode change 100755 => 100644 src/CMakeLists.txt create mode 100644 src/base/runtime/CMakeLists.txt mode change 100755 => 100644 src/newlib-compat/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 09db716..90b814e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,11 @@ INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp + FILES_MATCHING PATTERN "libosp-newlib.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp-server FILES_MATCHING PATTERN "libosp-appfw-server.so*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ diff --git a/packaging/osp-appfw.spec b/packaging/osp-appfw.spec index 15dd5d9..237b684 100755 --- a/packaging/osp-appfw.spec +++ b/packaging/osp-appfw.spec @@ -2,8 +2,8 @@ %define __strip /bin/true Name: osp-appfw -Summary: The App Framework library of OSP -Version: 1.2.2.0 +Summary: The App Framework library of OSP +Version: 1.2.2.1 Release: 1 Group: TO_BE/FILLED_IN License: Apache License, Version 2.0 or Flora @@ -85,9 +85,9 @@ Requires: message-port Requires: osp-env-config Requires: sqlite -Provides: libosp-appfw.so.1 +Provides: libosp-appfw.so.1, libosp-newlib.so.1 -Requires(post): /sbin/ldconfig +Requires(post): /sbin/ldconfig Requires(post): coreutils Requires(postun): /sbin/ldconfig @@ -177,6 +177,7 @@ chmod 444 /opt/usr/etc/clocale.list /usr/share/locale/* /usr/etc/* %{_libdir}/osp/libosp-appfw.so* +%{_libdir}/osp/libosp-newlib.so* %{_libdir}/osp-server/libosp-appfw-server.so* %{_libdir}/osp-server/libosp-system-server.so* @@ -200,5 +201,6 @@ chmod 444 /opt/usr/etc/clocale.list %files debug %{_libdir}/osp/debug/libosp-appfw.so* +%{_libdir}/osp/debug/libosp-newlib.so* %{_libdir}/osp-server/debug/libosp-appfw-server.so* %{_libdir}/osp-server/debug/libosp-system-server.so* diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt old mode 100755 new mode 100644 index eb88010..c026f68 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,6 +51,7 @@ ADD_SUBDIRECTORY(newlib-compat) ADD_SUBDIRECTORY(app) ADD_SUBDIRECTORY(io) ADD_SUBDIRECTORY(base) +ADD_SUBDIRECTORY(base/runtime base-runtime) ADD_SUBDIRECTORY(locales) ADD_SUBDIRECTORY(security) ADD_SUBDIRECTORY(system) diff --git a/src/appfw/CMakeLists.txt b/src/appfw/CMakeLists.txt index 427312f..9a85f5b 100644 --- a/src/appfw/CMakeLists.txt +++ b/src/appfw/CMakeLists.txt @@ -25,7 +25,7 @@ SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EX ## Create Library ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) -SET(STATIC_LIBS app base io locales security system text newlib-compat) +SET(STATIC_LIBS app base base-runtime io locales security system text) SET_TARGET_PROPERTIES(${this_target} PROPERTIES LINK_INTERFACE_LIBRARIES "") @@ -40,7 +40,10 @@ MACRO(OSP_ADD_OBJS_IN_ARCHIVE archives) ENDMACRO(OSP_ADD_OBJS_IN_ARCHIVE) OSP_ADD_OBJS_IN_ARCHIVE(${STATIC_LIBS}) - + +# add explicit dependency +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed -losp-newlib") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed") TARGET_LINK_LIBRARIES( ${this_target} ${STATIC_LIBS}) diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index bc9159b..e90d34a 100755 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -7,9 +7,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/io/inc inc collection - runtime utility - ext/minizip ) SET (${this_target}_SOURCE_FILES @@ -46,7 +44,6 @@ SET (${this_target}_SOURCE_FILES FBaseTypes.cpp FBaseUuId.cpp FBase_NativeError.cpp - FBaseInit.cpp FBase_Exception.cpp FBaseFloatMatrix.cpp FBaseFloatMatrix3.cpp @@ -63,38 +60,6 @@ SET (${this_target}_SOURCE_FILES collection/FBaseColMultiHashMap.cpp collection/FBaseColHashMap.cpp collection/FBaseColTypes.cpp - runtime/FBaseRt_Event.cpp - runtime/FBaseRt_EventImpl.cpp - runtime/FBaseRtEvent.cpp - runtime/FBaseRt_Process.cpp - runtime/FBaseRt_EventManager.cpp - runtime/FBaseRt_ITask.cpp - runtime/FBaseRt_EventDispatcher.cpp - runtime/FBaseRt_EventPendingOperationManager.cpp - runtime/FBaseRtIEventListener.cpp - runtime/FBaseRtLibrary.cpp - runtime/FBaseRt_LibraryImpl.cpp - runtime/FBaseRtTimer.cpp - runtime/FBaseRtMemoryManager.cpp - runtime/FBaseRt_TimerImpl.cpp - runtime/FBaseRt_ThreadImpl.cpp - runtime/FBaseRt_EventDrivenThreadImpl.cpp - runtime/FBaseRt_EventDrivenThreadEventArg.cpp - runtime/FBaseRt_EventDrivenThreadEvent.cpp - runtime/FBaseRt_MainThreadImpl.cpp - runtime/FBaseRtMonitor.cpp - runtime/FBaseRt_MonitorImpl.cpp - runtime/FBaseRtMutex.cpp - runtime/FBaseRt_MutexImpl.cpp - runtime/FBaseRtIRunnable.cpp - runtime/FBaseRtSemaphore.cpp - runtime/FBaseRt_SemaphoreImpl.cpp - runtime/FBaseRtEventDrivenThread.cpp - runtime/FBaseRtThread.cpp - runtime/FBaseRt_ThreadManager.cpp - runtime/FBaseRt_WorkerThreadImpl.cpp - runtime/FBaseRt_WaitingLoopImpl.cpp - runtime/FBaseRtWaitingLoop.cpp utility/FBaseUtilDeflator.cpp utility/FBaseUtilStringTokenizer.cpp utility/FBaseUtilInflator.cpp diff --git a/src/base/runtime/CMakeLists.txt b/src/base/runtime/CMakeLists.txt new file mode 100644 index 0000000..b04d588 --- /dev/null +++ b/src/base/runtime/CMakeLists.txt @@ -0,0 +1,59 @@ +SET (this_target base-runtime) + +INCLUDE_DIRECTORIES( + ${SLP_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/inc + ${CMAKE_SOURCE_DIR}/src/app/inc + ${CMAKE_SOURCE_DIR}/src/base/inc + ${CMAKE_SOURCE_DIR}/src/base/runtime +) + +SET (${this_target}_SOURCE_FILES + ../FBaseInit.cpp + FBaseRt_Event.cpp + FBaseRt_EventImpl.cpp + FBaseRtEvent.cpp + FBaseRt_Process.cpp + FBaseRt_EventManager.cpp + FBaseRt_ITask.cpp + FBaseRt_EventDispatcher.cpp + FBaseRt_EventPendingOperationManager.cpp + FBaseRtIEventListener.cpp + FBaseRtLibrary.cpp + FBaseRt_LibraryImpl.cpp + FBaseRtTimer.cpp + FBaseRtMemoryManager.cpp + FBaseRt_TimerImpl.cpp + FBaseRt_ThreadImpl.cpp + FBaseRt_EventDrivenThreadImpl.cpp + FBaseRt_EventDrivenThreadEventArg.cpp + FBaseRt_EventDrivenThreadEvent.cpp + FBaseRt_MainThreadImpl.cpp + FBaseRtMonitor.cpp + FBaseRt_MonitorImpl.cpp + FBaseRtMutex.cpp + FBaseRt_MutexImpl.cpp + FBaseRtIRunnable.cpp + FBaseRtSemaphore.cpp + FBaseRt_SemaphoreImpl.cpp + FBaseRtEventDrivenThread.cpp + FBaseRtThread.cpp + FBaseRt_ThreadManager.cpp + FBaseRt_WorkerThreadImpl.cpp + FBaseRt_WaitingLoopImpl.cpp + FBaseRtWaitingLoop.cpp +) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + +## SET EXTRA COMPILER FLAGS +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC" ) + +## SET C COMPILER FLAGS +SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## SET CPP COMPILER FLAGS +SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") + +## Create Library +ADD_LIBRARY (${this_target} STATIC ${${this_target}_SOURCE_FILES}) diff --git a/src/newlib-compat/CMakeLists.txt b/src/newlib-compat/CMakeLists.txt old mode 100755 new mode 100644 index 2117185..d59fe2a --- a/src/newlib-compat/CMakeLists.txt +++ b/src/newlib-compat/CMakeLists.txt @@ -1,7 +1,7 @@ -SET (this_target newlib-compat) +SET (this_target osp-newlib) INCLUDE_DIRECTORIES( - ${SLP_INCLUDE_DIRS} + ${SLP_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/inc ) @@ -22,5 +22,23 @@ SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed") + ## Create Library -ADD_LIBRARY (${this_target} STATIC ${${this_target}_SOURCE_FILES}) +ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) + +SET_TARGET_PROPERTIES(${this_target} + PROPERTIES + VERSION ${FULLVER} + SOVERSION ${MAJORVER} + CLEAN_DIRECT_OUTPUT 1 +) + +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} + COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMENT "strip ${this_target}" +) + -- 2.7.4