From 4c81fbbc874567c2417c4686f061ededb5fac45b Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 27 Aug 2024 09:11:23 +0800 Subject: [PATCH] Move atomic_ops libs into Requires.private --- CMakeLists.txt | 2 ++ bdw-gc.pc.in | 2 +- configure.ac | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 602731197..926f262fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ set(SRC allchblk.c alloc.c blacklst.c dbg_mlc.c dyn_load.c finalize.c set(NODIST_SRC) set(ATOMIC_OPS_LIBS) +set(ATOMIC_OPS_PC) set(ATOMIC_OPS_LIBS_CMAKE) set(THREADDLLIBS_LIST) set(NEED_LIB_RT) @@ -197,6 +198,7 @@ if (enable_threads) "with_libatomic_ops and without_libatomic_ops are mutually exclusive") endif() set(ATOMIC_OPS_LIBS "-latomic_ops") + set(ATOMIC_OPS_PC "atomic_ops") find_package(Atomic_ops CONFIG) if (Atomic_ops_FOUND) get_target_property(AO_INCLUDE_DIRS Atomic_ops::atomic_ops diff --git a/bdw-gc.pc.in b/bdw-gc.pc.in index 759bd9c0b..995d16ed6 100644 --- a/bdw-gc.pc.in +++ b/bdw-gc.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: Boehm-Demers-Weiser Conservative Garbage Collector Description: A garbage collector for C and C++ Version: @PACKAGE_VERSION@ +Requires.private: @ATOMIC_OPS_PC@ Libs: -L${libdir} -lgc @THREADDLLIBS@ -Libs.private: @ATOMIC_OPS_LIBS@ Cflags: -I${includedir} diff --git a/configure.ac b/configure.ac index 6496ffce8..72e5d0ea6 100644 --- a/configure.ac +++ b/configure.ac @@ -1207,7 +1207,9 @@ AS_IF([test x"$with_libatomic_ops" != xno], [AS_IF([test x"$with_libatomic_ops" != xnone -a x"$THREADS" != xnone], [AC_MSG_RESULT([external]) ATOMIC_OPS_LIBS="-latomic_ops" - AC_SUBST([ATOMIC_OPS_LIBS])], + ATOMIC_OPS_PC="atomic_ops" + AC_SUBST([ATOMIC_OPS_LIBS]) + AC_SUBST([ATOMIC_OPS_PC])], [AC_MSG_RESULT([none]) AS_IF([test x"$THREADS" != xnone], [AC_DEFINE([GC_BUILTIN_ATOMIC], [1],