From a65bb452c1625b971611677d9f1a837915ac65f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Mon, 18 Apr 2022 22:35:12 +0200 Subject: [PATCH] Makefile: Unify building of shared libpci library Move Darwin and Linux/ELF platform link switches to new PCILIB_LDFLAGS variable. --- lib/Makefile | 6 +----- lib/configure | 7 +++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index b29a48f..8a69481 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -69,11 +69,7 @@ $(PCILIB): $(addsuffix .o,$(OBJS)) else CFLAGS += -fPIC -fvisibility=hidden $(PCILIB): $(addsuffix .o,$(OBJS)) - ifdef PCI_HAVE_PM_DARWIN_DEVICE - $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,-install_name,$(LIBDIR)/$(PCILIB) -o $@ $^ $(LIB_LDLIBS) - else - $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS) - endif + $(CC) -shared $(CFLAGS) $(LDFLAGS) $(PCILIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS) endif $(PCILIBPC): libpci.pc.in diff --git a/lib/configure b/lib/configure index 45a416a..f89b069 100755 --- a/lib/configure +++ b/lib/configure @@ -297,8 +297,11 @@ else echo >>$m 'LDLIBS=' echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)' echo >>$c '#define PCI_SHARED_LIB' - if [ "$SHARED" = yes -a "$LIBEXT" = so ]; then - echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).$(LIBEXT)$(ABI_VERSION)' + if [ "$LIBEXT" = so ]; then + echo >>$m 'PCILIB_LDFLAGS+=-Wl,-soname,$(LIBNAME).$(LIBEXT).$(ABI_VERSION)' + echo >>$m 'PCILIB_LDFLAGS+=-Wl,--version-script=libpci.ver' + elif [ "$LIBEXT" = dylib ]; then + echo >>$m 'PCILIB_LDFLAGS+=-Wl,-install_name,$(LIBDIR)/$(PCILIB)' fi fi echo >>$m 'PCILIBPC=$(LIBNAME).pc' -- 2.39.2