]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: fix gcrypt config option
authorMichael Biebl <biebl@debian.org>
Fri, 21 Apr 2017 21:45:54 +0000 (23:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Apr 2017 23:25:33 +0000 (19:25 -0400)
Also detect libgpg-error. Require both to be present for HAVE_CRYPT,
even though libgpg-error is only used in src/resolve. If one is available,
the other should be too, so it doesn't seem worth the trouble to make two
separate conditions.

meson.build
meson_options.txt
src/journal/meson.build
src/resolve/meson.build
src/shared/meson.build

index 4515c0098d1a2a8a8fe28504582b05361f4abf93..c808a8fc430fa155c5e0e911df380f2ce132dfaf 100644 (file)
@@ -899,14 +899,21 @@ else
         libdbus = []
 endif
 
-want_libgcrypt = get_option('libgcrypt')
-if want_libgcrypt != 'false'
-        libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true')
-        if libgcrypt.found()
-                conf.set('HAVE_LIBGCRYPT', 1)
+want_gcrypt = get_option('gcrypt')
+if want_gcrypt != 'false'
+        libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
+        libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
+
+        if libgcrypt.found() and libgpg_error.found()
+                conf.set('HAVE_GCRYPT', 1)
+        else
+                # link to neither of the libs if one is not found
+                libgcrypt = []
+                libgpg_error = []
         endif
 else
         libgcrypt = []
+        libgpg_error = []
 endif
 
 want_importd = get_option('importd')
@@ -915,7 +922,7 @@ if want_importd != 'false'
                      conf.get('HAVE_ZLIB', 0) == 1 and
                      conf.get('HAVE_BZIP2', 0) == 1 and
                      conf.get('HAVE_XZ', 0) == 1 and
-                     conf.get('HAVE_LIBGCRYPT', 0) == 1)
+                     conf.get('HAVE_GCRYPT', 0) == 1)
         if have_deps
                 conf.set('ENABLE_IMPORTD', 1)
         elif want_importd == 'true'
@@ -1060,6 +1067,7 @@ libsystemd = shared_library(
                      '-Wl,--version-script=' + libsystemd_sym_path],
         link_with : [libbasic],
         dependencies : [threads,
+                        libgcrypt,
                         librt,
                         libxz,
                         liblz4],
@@ -1305,9 +1313,12 @@ endif
 if conf.get('ENABLE_RESOLVED', 0) == 1
         executable('systemd-resolved',
                    systemd_resolved_sources,
+                   gcrypt_util_sources,
                    include_directories : includes,
                    link_with : [libshared],
                    dependencies : [threads,
+                                   libgcrypt,
+                                   libgpg_error,
                                    libm,
                                    libidn],
                    install_rpath : rootlibexecdir,
@@ -1316,9 +1327,12 @@ if conf.get('ENABLE_RESOLVED', 0) == 1
 
         exe = executable('systemd-resolve',
                          systemd_resolve_sources,
+                         gcrypt_util_sources,
                          include_directories : includes,
                          link_with : [libshared],
                          dependencies : [threads,
+                                         libgcrypt,
+                                         libgpg_error,
                                          libm,
                                          libidn],
                          install_rpath : rootlibexecdir,
index 790119cd1f5d6e4a98826a72aa0abdcf3a77d9ef..d9f2f4be33391c9bf7c620622a4373ffe2839504 100644 (file)
@@ -197,8 +197,8 @@ option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'libiptc support')
 option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'libqrencode support')
-option('libgcrypt', type : 'combo', choices : ['auto', 'true', 'false'],
-       description : 'libgcrypt support')
+option('gcrypt', type : 'combo', choices : ['auto', 'true', 'false'],
+       description : 'gcrypt support')
 option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'gnutls support')
 option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'],
index 71396af5298d78f972e57bec846513a1fb6b10a0..37ec559e41488027c2eeb64605a2ce440f2dbbdd 100644 (file)
@@ -20,6 +20,17 @@ journal_internal_sources = files('''
         sd-journal.c
 '''.split())
 
+if conf.get('HAVE_GCRYPT', 0) == 1
+        journal_internal_sources += files('''
+                journal-authenticate.c
+                journal-authenticate.h
+                fsprg.c
+                fsprg.h
+        '''.split())
+
+        journal_internal_sources += gcrypt_util_sources
+endif
+
 ############################################################
 
 audit_type_includes = [config_h,
index b8feb7bb1b949bcace591f504ea58446a3440f6c..46a417e7664c49c76caf765a4a1e85453093a9b2 100644 (file)
@@ -147,6 +147,7 @@ tests += [
           'src/shared/test-tables.h'],
          [],
          [libgcrypt,
+          libgpg_error,
           libm],
          'ENABLE_RESOLVED'],
 
@@ -155,6 +156,7 @@ tests += [
           dns_type_headers],
          [],
          [libgcrypt,
+          libgpg_error,
           libm],
          'ENABLE_RESOLVED'],
 
@@ -163,6 +165,7 @@ tests += [
           dns_type_headers],
          [],
          [libgcrypt,
+          libgpg_error,
           libm],
          'ENABLE_RESOLVED'],
 
index 5f485678173dcae752a94a6f489566d7a1e64cd6..8968127d3f6efe2df4840ae71f9e8fb96099c52b 100644 (file)
@@ -131,6 +131,7 @@ libshared = shared_library(
                         libcap,
                         libacl,
                         libcryptsetup,
+                        libgcrypt,
                         libiptc,
                         libseccomp,
                         libselinux,