diff --git a/.gitignore b/.gitignore index 5c3a5ed..a6f6403 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ ChangeLog *.gcda *.gcno *.sym +*.map .dirstamp .deps/ .libs/ diff --git a/src/Makefile.am b/src/Makefile.am index 6f2325c..1c350b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,7 @@ libbsd_la_included_sources = \ CLEANFILES = EXTRA_DIST = \ - libbsd.map \ + libbsd.map.in \ libbsd.pc.in \ libbsd-ctor.pc.in \ libbsd-overlay.pc.in \ @@ -53,6 +53,7 @@ endif EXTRA_libbsd_la_DEPENDENCIES = \ $(libbsd_la_included_sources) \ libbsd.map \ + libbsd.map.in \ # EOL libbsd_la_LIBADD = \ $(MD5_LIBS) \ @@ -64,7 +65,7 @@ libbsd_la_LDFLAGS = \ # EOL if HAVE_LINKER_VERSION_SCRIPT libbsd_la_LDFLAGS += \ - -Wl,--version-script=$(srcdir)/libbsd.map \ + -Wl,--version-script=libbsd.map \ # EOL else libbsd_la_LDFLAGS += \ @@ -194,12 +195,18 @@ endif DISTCLEANFILES = \ libbsd.sym \ + libbsd.map \ # EOL libbsd_ctor_a_SOURCES = \ setproctitle_ctor.c \ # EOL +# Generate the library map file with the pre-processor to selectively include +# symbols depending on the host system, otherwise some linkers might fail. +libbsd.map: libbsd.map.in + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -P - <$(srcdir)/libbsd.map.in >$@ + # Generate a simple libtool symbol export list to be used as a fallback if # there is no version script support. libbsd.sym: libbsd.map diff --git a/src/libbsd.map b/src/libbsd.map.in similarity index 99% rename from src/libbsd.map rename to src/libbsd.map.in index 6c61235..06550ea 100644 --- a/src/libbsd.map +++ b/src/libbsd.map.in @@ -1,3 +1,5 @@ +#include "config.h" + LIBBSD_0.0 { global: arc4random;