]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use a convenience lib for journal user sources
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Dec 2017 18:38:43 +0000 (19:38 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Jan 2018 11:09:46 +0000 (12:09 +0100)
Instead of compiling those files twice, once for libsystemd and once for
libshared, compile once as a static archive and then link into both.
This reduce the meson target for man=no compile to 1291.

meson.build
src/journal/meson.build
src/shared/meson.build

index fa0b0abf748bb68ed1b8c74448172a26c2ce7c28..3e5242e09e6e147929e796112ac93b4df01405b2 100644 (file)
@@ -1254,14 +1254,14 @@ libjournal_core = static_library(
 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
 libsystemd = shared_library(
         'systemd',
-        journal_internal_sources,
         version : libsystemd_version,
         include_directories : includes,
         link_args : ['-shared',
                      '-Wl,--version-script=' + libsystemd_sym_path],
         link_with : [libbasic,
                      libbasic_gcrypt],
-        link_whole : libsystemd_static,
+        link_whole : [libsystemd_static,
+                      libjournal_client],
         dependencies : [threads,
                         librt,
                         libxz,
index e4d78f330d4118c44d764096595b9efe1ac1710a..a23f6a712cde1a9077dcef5903b59e3b020cec0a 100644 (file)
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
-journal_internal_sources = files('''
+journal_client_sources = files('''
         audit-type.c
         audit-type.h
         catalog.c
@@ -38,7 +38,7 @@ journal_internal_sources = files('''
 '''.split())
 
 if conf.get('HAVE_GCRYPT') == 1
-        journal_internal_sources += files('''
+        journal_client_sources += files('''
                 journal-authenticate.c
                 journal-authenticate.h
                 fsprg.c
@@ -69,7 +69,13 @@ audit_type_to_name = custom_target(
         command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
         capture : true)
 
-journal_internal_sources += [audit_type_to_name]
+journal_client_sources += [audit_type_to_name]
+
+libjournal_client = static_library(
+        'journal-client',
+        journal_client_sources,
+        include_directories : includes,
+        c_args : ['-fvisibility=default'])
 
 ############################################################
 
index 5fa863acefadc415a4bdc439db0ce252bf9fa883..290fa0524c1f299932cc8cbc06c064d707098573 100644 (file)
@@ -166,7 +166,6 @@ libshared_static = static_library(
 
 libshared = shared_library(
         libshared_name,
-        journal_internal_sources,
         libudev_sources,
         include_directories : includes,
         link_args : ['-shared',
@@ -174,7 +173,8 @@ libshared = shared_library(
         link_whole : [libshared_static,
                       libbasic,
                       libbasic_gcrypt,
-                      libsystemd_static],
+                      libsystemd_static,
+                      libjournal_client],
         c_args : ['-fvisibility=default'],
         dependencies : libshared_deps,
         install : true,