]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Fix the check for --version-script support
authorSimon McVittie <smcv@collabora.com>
Tue, 28 Jun 2022 12:06:35 +0000 (13:06 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
At the time we do this check, version_script has not yet been generated,
so we have to use something else.

Signed-off-by: Simon McVittie <smcv@collabora.com>
dbus/Makefile.am
dbus/meson.build
dbus/test-version-script [new file with mode: 0644]

index 7e3e82e0634eafcb66eb2f5493808803652cb490..3c2ea87c111fa4241717e61bcefad50ad9c9fd67 100644 (file)
@@ -330,6 +330,7 @@ endif
 noinst_PROGRAMS =
 
 EXTRA_DIST += meson.build
+EXTRA_DIST += test-version-script
 
 # Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
 include $(top_srcdir)/aminclude_static.am
index a4342d2dd98339a1e4440d1295cd3163e29aa464..2fd7cc72b35850e2024b96b3dd90871449108a93 100644 (file)
@@ -172,9 +172,16 @@ version_script = configure_file(
     configuration: data_config,
 )
 
-version_flags = '-Wl,--version-script,@0@'.format(version_script)
-if not cc.has_link_argument(version_flags)
-  version_flags = []
+# We can't use version_script to check for support, because it hasn't been
+# generated yet, so use a static source file instead.
+if cc.has_link_argument(
+    '-Wl,--version-script,@0@'.format(
+        meson.current_source_dir() / 'test-version-script'
+    )
+)
+    version_flags = ['-Wl,--version-script,@0@'.format(version_script)]
+else
+    version_flags = []
 endif
 
 libdbus = library('dbus-1',
diff --git a/dbus/test-version-script b/dbus/test-version-script
new file mode 100644 (file)
index 0000000..c0f8462
--- /dev/null
@@ -0,0 +1,10 @@
+NOT_REALLY_LIBDBUS_1_3 {
+  global:
+    dbus_*;
+  local:
+    *;
+};
+NOT_REALLY_LIBDBUS_PRIVATE_1.2.3 {
+  global:
+    _dbus_*;
+};