[buddy] Restrict the number of exported symbols.

* src/bdd.h, src/bvec.h, src/fdd.h: Declare all exported
symbols using BUDDY_API, a new macro that sets visibility=default.
* src/Makefile.am: Compile with -fvisibility=hidden by default,
and compile the C++ part with -fvisibility-inlines-hidden as well.
This commit is contained in:
Alexandre Duret-Lutz 2013-06-23 23:46:57 +02:00
parent 9ed2d7a1dc
commit b5710663f4
5 changed files with 269 additions and 216 deletions

View file

@ -1,17 +1,29 @@
# For
AM_CPPFLAGS = -I$(top_builddir) -DVERSION=23
include_HEADERS = bdd.h fdd.h bvec.h
BUDDY_FLAGS = -I$(top_builddir) -DVERSION=23 \
-fvisibility=hidden -DBUDDY_DLL_EXPORTS -DBUDDY_DLL
# Compile the C++ part of the library with
# -fvisibility-inlines-hidden, this option is not valid for C.
lib_LTLIBRARIES = libbdd.la
libbdd_la_SOURCES = \
libbdd_la_CPPFLAGS = $(BUDDY_FLAGS) -fvisibility-inlines-hidden
libbdd_la_SOURCES = cppext.cxx
libbdd_la_LIBADD = libbdd_c.la
# See the `Updating version info' node of the Libtool manual before
# changing this.
libbdd_la_LDFLAGS = -no-undefined -version-info 0:0:0
# The C part of the library.
noinst_LTLIBRARIES = libbdd_c.la
libbdd_c_la_CPPFLAGS = $(BUDDY_FLAGS)
libbdd_c_la_SOURCES = \
bddio.c \
bddop.c \
bddtree.h \
bvec.c \
cache.c \
cache.h \
cppext.cxx \
fdd.c \
imatrix.c \
imatrix.h \
@ -23,10 +35,7 @@ libbdd_la_SOURCES = \
reorder.c \
tree.c
# See the `Updating version info' node of the Libtool manual before
# changing this.
libbdd_la_LDFLAGS = -no-undefined -version-info 0:0:0
check_PROGRAMS = bddtest
bddtest_SOURCES = bddtest.cxx
bddtest_CPPFLAGS = -I$(top_builddir)
bddtest_LDADD = ./libbdd.la