diff options
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x[-rw-r--r--] | CMakeLists.txt | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e89d80..4a0c906 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,13 +8,13 @@ SET(INCLUDEDIR "\${prefix}/include") SET(VERSION_MAJOR 1) SET(VERSION ${VERSION_MAJOR}.0.0) -#Verbose -#SET(CMAKE_VERBOSE_MAKEFILE ON) - -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + /usr/include + ) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED openssl security-server dlog) +pkg_check_modules(pkgs REQUIRED openssl dlog vconf dukgenerator capi-base-common) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") @@ -22,19 +22,19 @@ ENDFOREACH(flag) SET(ss_dir "./") SET(ss_include_dir "./include") -SET(ss_client_dir "./client/src") -SET(ss_client_include_dir "./client/include") -SET(ss_server_dir "./server/src") -SET(ss_server_include_dir "./server/include") +SET(ss_client_dir "./client/non-tz/src") +SET(ss_client_include_dir "./client/non-tz/include") +SET(ss_server_dir "./server/non-tz/src") +SET(ss_server_include_dir "./server/non-tz/include") + +SET(ss_prng_dir "./prng/src") +SET(ss_prng_include_dir "./prng/include") SET(ss_test_dir "./testcases") ## About debug -#SET(debug_type "") # for debug - use no debugging -#SET(debug_type "-DSS_CONSOLE_USE") # for debug - use console window SET(debug_type "-DSS_DLOG_USE") # for debug - use dlog -#SET(debug_type "") # for debug - DO NOT use SET(use_key "-DUSE_KEY_FILE") # for private key - use key file -#SET(use_key "-DUSE_NOT") # for private key - use no private key, key will be fixed +SET(smack_groupid "-DSMACK_GROUP_ID") # for group id sharing with smack label SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") @@ -43,7 +43,7 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") ## for libss-client.so (library) SET(libss-client_SOURCES ${ss_client_dir}/ss_client_intf.c ${ss_client_dir}/ss_client_ipc.c ${ss_client_dir}/ss_manager.c) SET(libss-client_LDFLAGS " -module -avoid-version ${OPENSSL_LIBS}") -SET(libss-client_CFLAGS " ${CFLAGS} -fPIC -I${ss_client_include_dir} -I${ss_include_dir} ${OPENSSL_CFLAGS} ${debug_type} ") +SET(libss-client_CFLAGS " ${CFLAGS} -fPIC -I${ss_client_include_dir} -I${ss_include_dir} ${OPENSSL_CFLAGS} ${debug_type}") #SET(libss-client_LIBADD " ${OPENSSL_LIBS} ") ADD_LIBRARY(ss-client SHARED ${libss-client_SOURCES}) @@ -55,12 +55,16 @@ SET_TARGET_PROPERTIES(ss-client PROPERTIES COMPILE_FLAGS "${libss-client_CFLAGS} ################################################################################################### ## for ss-server (binary) -SET(ss-server_SOURCES ${ss_server_dir}/ss_server_ipc.c ${ss_server_dir}/ss_server_main.c) -SET(ss-server_CFLAGS " -I. -I${ss_include_dir} -I${ss_server_include_dir} ${debug_type} ${use_key} ${OPENSSL_CFLAGS} -D_GNU_SOURCE ") +SET(ss-server_SOURCES ${ss_server_dir}/ss_server_ipc.c ${ss_server_dir}/ss_server_main.c ${ss_prng_dir}/ss_prng.c) +SET(ss-server_CFLAGS " -I. -I${ss_include_dir} -I${ss_server_include_dir} -I${ss_prng_include_dir} ${debug_type} ${use_key} ${OPENSSL_CFLAGS} ${smack_groupid} -D_GNU_SOURCE -D_TRUST_ZONE_ -fPIE") SET(ss-server_LDFLAGS ${pkgs_LDFLAGS}) +#ADD PKG_CHECK_MODULES +PKG_CHECK_MODULES(server_pkg REQUIRED libsystemd-daemon cryptsvc) + ADD_EXECUTABLE(ss-server ${ss-server_SOURCES}) -TARGET_LINK_LIBRARIES(ss-server ${pkgs_LDFLAGS}) +TARGET_LINK_LIBRARIES(ss-server ${pkgs_LDFLAGS} ${server_pkg_LIBRARIES} -lsecurity-server-client -ldl -pie) + SET_TARGET_PROPERTIES(ss-server PROPERTIES COMPILE_FLAGS "${ss-server_CFLAGS}") #################################################################################################### @@ -70,6 +74,6 @@ CONFIGURE_FILE(config.in config @ONLY) INSTALL(TARGETS ss-client DESTINATION lib) INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/ss-server DESTINATION bin) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/secure-storage.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/res/salt DESTINATION ../opt/share/secure-storage/salt/) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/config DESTINATION share/secure-storage/) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/ss_manager.h DESTINATION include) -INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/ss-serverd DESTINATION /etc/rc.d/init.d) |