]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
configure: introduce FLAT_NAMESPACE_FLAGS
authorPavel Hrdina <phrdina@redhat.com>
Thu, 30 Apr 2020 12:34:33 +0000 (14:34 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Jul 2020 07:40:02 +0000 (09:40 +0200)
Set FLAT_NAMESPACE_FLAGS to -Wl,-flat_namespace in configure only for
macOS and use it unconditionally in Makefiles.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
configure.ac
src/Makefile.am
tests/Makefile.am

index 61d43c1a6349d340774da7fb1311fbf414dea184..fb18c5b52e1bae423925f512d27bbb12d25715f0 100644 (file)
@@ -189,6 +189,19 @@ esac
 AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
 AC_SUBST([VERSION_SCRIPT_FLAGS])
 
+dnl macOS has two-level namespaces by default.
+dnl Override it to allow symbol replacement with DYLD_INSERT_LIBRARIES
+case "$host" in
+  *-*-darwin*)
+    FLAT_NAMESPACE_FLAGS=-Wl,-flat_namespace
+    ;;
+  * )
+    FLAT_NAMESPACE_FLAGS=""
+    ;;
+esac
+AC_MSG_RESULT([$FLAT_NAMESPACE_FLAGS])
+AC_SUBST([FLAT_NAMESPACE_FLAGS])
+
 dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case
 dnl we're working on BSD)
 want_ifconfig=no
index 447cff8165921825a4a894b0342dc12593f1dbb7..b893f4179e82a18bcbc974495df62f09ae6731e7 100644 (file)
@@ -431,13 +431,9 @@ libvirt_la_LDFLAGS = \
                -version-info $(LIBVIRT_VERSION_INFO) \
                $(LIBVIRT_NODELETE) \
                $(NO_UNDEFINED_LDFLAGS) \
-               $(AM_LDFLAGS)
-if WITH_MACOS
-# macOS has two-level namespaces by default.
-# Override it to allow symbol replacement with DYLD_INSERT_LIBRARIES
-libvirt_la_LDFLAGS += -Wl,-flat_namespace
-endif WITH_MACOS
-libvirt_la_LDFLAGS += $(NULL)
+               $(FLAT_NAMESPACE_FLAGS) \
+               $(AM_LDFLAGS) \
+               $(NULL)
 libvirt_la_LIBADD += \
                    $(DLOPEN_LIBS)
 libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
index 65d1ceeefdfceaf120516f85a380a934c3010975..06d70ab559c51589cfee12d0670fa42d24b2b00c 100644 (file)
@@ -55,10 +55,9 @@ MOCKLIBS_LDFLAGS = -avoid-version \
 DRIVERLIB_LDFLAGS = \
        -avoid-version \
        -rpath /evil/libtool/hack/to/force/shared/lib/creation \
-       $(MINGW_EXTRA_LDFLAGS)
-if WITH_MACOS
-DRIVERLIB_LDFLAGS += -Wl,-flat_namespace
-endif WITH_MACOS
+       $(MINGW_EXTRA_LDFLAGS) \
+       $(FLAT_NAMESPACE_FLAGS) \
+       $(NULL)
 
 PROBES_O =
 if WITH_DTRACE_PROBES