summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2024-04-11 11:08:22 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2024-04-11 11:08:22 +0900
commit2de4cf4a1b3878d96dcebfa04d17b6ce0ac4c774 (patch)
treed3f876d289cc12bf941fa8bc004e86ba62058c1b
parentc4c77d457291869b63954caf89ae9bc43b623c8e (diff)
downloadaul-1-2de4cf4a1b3878d96dcebfa04d17b6ce0ac4c774.tar.gz
aul-1-2de4cf4a1b3878d96dcebfa04d17b6ce0ac4c774.tar.bz2
aul-1-2de4cf4a1b3878d96dcebfa04d17b6ce0ac4c774.zip
Add a dependency of aul-blink library to aul library
This patch adds a missing dependency of the libaul-blink. Currently, if the library is not used, the library is not loaded forcedly by '--wl,--as-needed' option. Change-Id: Ic3939dcc096e8f2c14ab4aa3eca7cd9f3d986f3a Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/aul.spec7
-rw-r--r--src/aul/aul_launch.c12
-rw-r--r--src/blink/CMakeLists.txt14
-rw-r--r--src/blink/aul-blink.pc.in13
-rw-r--r--src/blink/aul_blink.cc10
-rw-r--r--src/blink/include/aul_blink.h30
6 files changed, 79 insertions, 7 deletions
diff --git a/packaging/aul.spec b/packaging/aul.spec
index 4e8cfc93..67044a48 100644
--- a/packaging/aul.spec
+++ b/packaging/aul.spec
@@ -177,7 +177,7 @@ sqlite3 .appsvc.db < ./data/appsvc_db.sql
sqlite3 .component.db < ./src/parser/component/data/component_db.sql
%check
-export LD_LIBRARY_PATH="../../src/aul"
+export LD_LIBRARY_PATH="../../src/aul:../../src/blink"
ctest -V
%if 0%{?gcov:1}
@@ -272,7 +272,7 @@ chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal
%license LICENSE
%manifest %{name}.manifest
%attr(0644,root,root) %{_libdir}/libaul.so.*
-%attr(0644,root,root) %{_libdir}/libaul-blink.so
+%attr(0644,root,root) %{_libdir}/libaul-blink.so.*
%config %{_sysconfdir}/dbus-1/system.d/aul.conf
%{_bindir}/aulctl
%{_bindir}/aul_test
@@ -315,8 +315,11 @@ chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal
%files devel
%{_includedir}/aul/*.h
%{_includedir}/aul/api/*.h
+%{_includedir}/aul/blink/*.h
%{_libdir}/libaul.so
+%{_libdir}/libaul-blink.so
%{_libdir}/pkgconfig/aul.pc
+%{_libdir}/pkgconfig/aul-blink.pc
#################################################
# aul-gcov
diff --git a/src/aul/aul_launch.c b/src/aul/aul_launch.c
index fea5991e..010609f7 100644
--- a/src/aul/aul_launch.c
+++ b/src/aul/aul_launch.c
@@ -18,15 +18,16 @@
#define _GNU_SOURCE
#endif
-#include <stdio.h>
+#include <aul_blink.h>
+#include <bundle_internal.h>
+#include <ctype.h>
+#include <glib.h>
#include <stdbool.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/time.h>
-#include <ctype.h>
-#include <glib.h>
-#include <bundle_internal.h>
+#include <sys/types.h>
#include "aul_api.h"
#include "aul_cmd.h"
@@ -743,6 +744,7 @@ API int aul_launch_worker_init(void)
if (__context.worker == NULL)
return AUL_R_ERROR;
+ aul_blink_initialize();
return AUL_R_OK;
}
diff --git a/src/blink/CMakeLists.txt b/src/blink/CMakeLists.txt
index 4fe5d303..59c55789 100644
--- a/src/blink/CMakeLists.txt
+++ b/src/blink/CMakeLists.txt
@@ -4,9 +4,13 @@ ADD_LIBRARY(${TARGET_AUL_BLINK} SHARED ${SRCS})
TARGET_INCLUDE_DIRECTORIES(${TARGET_AUL_BLINK} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../
)
+SET_TARGET_PROPERTIES(${TARGET_AUL_BLINK} PROPERTIES SOVERSION ${MAJORVER})
+SET_TARGET_PROPERTIES(${TARGET_AUL_BLINK} PROPERTIES VERSION ${FULLVER})
+
APPLY_PKG_CONFIG(${TARGET_AUL_BLINK} PUBLIC
CAPI_SYSTEM_RESOURCE_DEPS
DLOG_DEPS
@@ -16,3 +20,13 @@ APPLY_PKG_CONFIG(${TARGET_AUL_BLINK} PUBLIC
INSTALL(TARGETS ${TARGET_AUL_BLINK}
DESTINATION ${LIB_INSTALL_DIR}
COMPONENT RuntimeLibraries)
+
+CONFIGURE_FILE(aul-blink.pc.in aul-blink.pc @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aul-blink.pc
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
+ DESTINATION include/aul/blink
+ FILES_MATCHING
+ PATTERN "*.h"
+)
diff --git a/src/blink/aul-blink.pc.in b/src/blink/aul-blink.pc.in
new file mode 100644
index 00000000..5e9c95a5
--- /dev/null
+++ b/src/blink/aul-blink.pc.in
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libaul-blink
+Description: AUL blink library
+Version: @VERSION@
+Requires: dlog capi-system-resource glib-2.0
+Libs: -L${libdir} -laul-blink
+Cflags: -I${includedir} -I${includedir}/aul-blink
diff --git a/src/blink/aul_blink.cc b/src/blink/aul_blink.cc
index 13d8e76f..8b606767 100644
--- a/src/blink/aul_blink.cc
+++ b/src/blink/aul_blink.cc
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include "aul_blink.h"
+
#include <cpu-boosting.h>
#include <glib.h>
#include <sys/types.h>
@@ -23,6 +25,12 @@
#include "blink/log_private.hh"
+#undef EXPORT
+#define EXPORT __attribute__ ((visibility("default")))
+
+#undef API
+#define API extern "C" EXPORT
+
namespace aul {
constexpr const char kAulBlink[] = "AUL_BLINK";
@@ -100,3 +108,5 @@ class Blink {
Blink blink;
} // namespace aul
+
+API int aul_blink_initialize(void) { return 0; }
diff --git a/src/blink/include/aul_blink.h b/src/blink/include/aul_blink.h
new file mode 100644
index 00000000..8cd36101
--- /dev/null
+++ b/src/blink/include/aul_blink.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __AUL_BLINK_H__
+#define __AUL_BLINK_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int aul_blink_initialize(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __AUL_BLINK_H__ */