1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-28 17:32:29 +01:00

wrlib: generate automatically the list of symbols to keep from the API header

Instead of having to maintain manually the map file for LD with the list of
symbols that we want to keep in the WRaster library (the purpose is to hide
internal symbols), this patch implements a script that parses the public
API header and extracts automatically the list of names that are supposed
to be visible to the user.

The goal is to reduce possible human errors, like for example the function
RCombineAlpha that was forgotten from the list, yet still keep the map file
feature which is considered a good practice (it reduces the risk for name
clash and the risk of mis-use of internal stuff from the library).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-01-05 11:06:31 +01:00
committed by Carlos R. Mafra
parent d12b647069
commit d458304610
4 changed files with 252 additions and 103 deletions

View File

@@ -5,14 +5,16 @@ DIST_SUBDIRS = $(SUBDIRS) tests
AUTOMAKE_OPTIONS =
EXTRA_DIST = tests libwraster.map get-wraster-flags.in
EXTRA_DIST = tests get-wraster-flags.in
lib_LTLIBRARIES = libwraster.la
libwraster_la_LDFLAGS = -version-info @WRASTER_VERSION@
if HAVE_LD_VERSION_SCRIPT
libwraster_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libwraster.map
libwraster_la_LDFLAGS += -Wl,--version-script=libwraster.map
EXTRA_libwraster_la_DEPENDENCIES = libwraster.map
CLEANFILES = libwraster.map
endif
bin_SCRIPTS = get-wraster-flags
@@ -101,3 +103,8 @@ get-wraster-flags: get-wraster-flags.in Makefile
-e 's#$${XLIBS}#$(XLIBS)#;' < $(abs_srcdir)/get-wraster-flags.in > $@
@chmod 755 $@
if HAVE_LD_VERSION_SCRIPT
libwraster.map: $(include_HEADERS) $(top_srcdir)/script/generate-mapfile-from-header.sh
$(AM_V_GEN)$(top_srcdir)/script/generate-mapfile-from-header.sh \
-n LIBWRASTER -v $(WRASTER_VERSION) $(srcdir)/$(include_HEADERS) > libwraster.map
endif