]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
resolved: support libidn2 in addition to libidn
[thirdparty/systemd.git] / meson.build
index 14a20530d432a608632f0178c3b83ac548a28f24..2067dfe60467b564daceb56e2eb3f86b44468b2d 100644 (file)
@@ -791,15 +791,29 @@ else
 endif
 
 want_libidn = get_option('libidn')
-if want_libidn != 'false'
+want_libidn2 = get_option('libidn2')
+if want_libidn == 'true' and want_libidn2 == 'true'
+        error('libidn and libidn2 cannot be requested simultaneously')
+endif
+
+if want_libidn2 != 'false' and want_libidn != 'true'
+        libidn = dependency('libidn2',
+                            required : want_libidn2 == 'true')
+        # libidn is used for both libidn and libidn2 objects
+        if libidn.found()
+                conf.set('HAVE_LIBIDN2', true)
+                m4_defines += ['-DHAVE_LIBIDN2']
+        endif
+else
+        libidn = []
+endif
+if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
         libidn = dependency('libidn',
                             required : want_libidn == 'true')
         if libidn.found()
                 conf.set('HAVE_LIBIDN', true)
                 m4_defines += ['-DHAVE_LIBIDN']
         endif
-else
-        libidn = []
 endif
 
 want_libiptc = get_option('libiptc')
@@ -2428,6 +2442,7 @@ foreach tuple : [
         ['microhttpd'],
         ['gnutls'],
         ['libcurl'],
+        ['libidn2'],
         ['libidn'],
         ['libiptc'],
         ['elfutils'],