diff options
author | Pali Rohár <pali@kernel.org> | 2022-04-18 22:35:12 +0200 |
---|---|---|
committer | Pali Rohár <pali@kernel.org> | 2022-06-10 01:18:35 +0200 |
commit | a65bb452c1625b971611677d9f1a837915ac65f8 (patch) | |
tree | cb284e5c193695364112b9f11d095f38f927b001 | |
parent | 638892c82689009282d110c2f5749c5b49339711 (diff) | |
download | pciutils-a65bb452c1625b971611677d9f1a837915ac65f8.tar.gz |
Makefile: Unify building of shared libpci library
Move Darwin and Linux/ELF platform link switches to new PCILIB_LDFLAGS
variable.
-rw-r--r-- | lib/Makefile | 6 | ||||
-rwxr-xr-x | 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' |