librazor/Makefile.am
author J. Ali Harlow <ali@juiblex.co.uk>
Sat Oct 04 18:12:58 2014 +0100 (2014-10-04)
changeset 454 56ff755c268c
parent 453 1fd1d221092d
child 455 df914f383f5c
permissions -rw-r--r--
Only export symbols starting with razor_ in dynamic library.

Apart from being good practice to avoid clashes with higher-level
libraries and the application, this also fixes an obscure bug: The
gnulib library is used both by librazor (the dynamic library) and
by razor (the executable). In doing so, we want to have two separate
copies of the library despite the code duplication this involves.
Without the explicit limit to export only razor_ symbols, the razor
executable under mingw64 was picking up the getopt_long function
from librazor and the optind variable from libgnu which meant that
it did not see optind changing. Hiding librazor's copy of getopt
causes the linker to find libgnu's copy and everything works.

Note that under mingw librazor-#.dll still contains undocumented
(private) razor_ symbols but these will do no harm as long as nobody
tries to use them.
     1 ## Process this file with automake to produce Makefile.in
     2 
     3 SUBDIRS = types
     4 
     5 INCLUDES = \
     6 	-I$(top_builddir)/gl -I$(top_srcdir)/gl \
     7 	-I$(top_builddir)/src -I$(top_srcdir)/src \
     8 	-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
     9 	-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
    10 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
    11 	-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
    12 	-DPACKAGE_LOCALSTATE_DIR=\""$(localstatedir)"\" \
    13 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
    14 	-DPACKAGE_LIB_DIR=\""$(libdir)"\"
    15 
    16 lib_LTLIBRARIES = librazor.la
    17 if HAVE_LUA
    18   check_PROGRAMS = test-lua
    19 endif
    20 
    21 librazorincludedir = $(includedir)/razor
    22 
    23 librazorinclude_HEADERS =              			\
    24 	razor.h
    25 
    26 librazor_la_SOURCES =                                	\
    27 	razor-internal.h				\
    28 	razor.h						\
    29 	razor.c						\
    30 	root.c						\
    31 	util.c						\
    32 	rpm.c						\
    33 	iterator.c					\
    34 	importer.c					\
    35 	merger.c					\
    36 	error.c						\
    37 	atomic.c					\
    38 	atomic-ktm.c					\
    39 	atomic-none.c					\
    40 	atomic-emulate.c				\
    41 	atomic-actions.c				\
    42 	transaction.c
    43 
    44 if HAVE_LUA
    45   librazor_la_SOURCES += lua.c
    46 endif
    47 
    48 librazor_la_LIBADD = $(ZLIB_LIBS) types/libtypes.la $(LUA_LIBS) \
    49 	../gl/libgnu.la $(INTLLIBS) $(EXTRA_LIBS)
    50 librazor_la_LDFLAGS = -no-undefined -export-symbols-regex '^razor_' \
    51 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    52 
    53 if HAVE_LUA
    54   test_lua_SOURCES = test-lua.c
    55   test_lua_LDADD = lua.lo util.lo error.lo types/libtypes.la $(LUA_LIBS) \
    56 	../gl/libgnu.la $(INTLLIBS) $(EXTRA_LIBS)
    57 
    58   TESTS = test-lua
    59 endif
    60 
    61 EXTRA_DIST = 			\
    62 	test.lua
    63 
    64 clean-local :
    65 	rm -f *~
    66