src/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 429 51905cfc2bde
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 INCLUDES = \
     4 	$(LUA_CFLAGS) \
     5 	$(CURL_CFLAGS) \
     6 	$(EXPAT_CFLAGS) \
     7 	$(RPM_CFLAGS) \
     8 	-I$(top_builddir)/gl -I$(top_srcdir)/gl \
     9 	-I$(top_builddir)/src -I$(top_srcdir)/src \
    10 	-I$(top_builddir)/librazor -I$(top_srcdir)/librazor \
    11 	-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
    12 	-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
    13 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
    14 	-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
    15 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
    16 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\"
    17 
    18 bin_PROGRAMS = razor
    19 noinst_PROGRAMS = rpm
    20 check_PROGRAMS = test-driver
    21 
    22 razor_SOURCES = main.c import-yum.c
    23 if HAVE_RPMLIB
    24 razor_SOURCES += import-rpmdb.c
    25 endif
    26 razor_LDADD = $(top_builddir)/librazor/librazor.la $(RPM_LIBS) $(EXPAT_LIBS) $(CURL_LIBS) $(LUA_LIBS) $(top_builddir)/gl/libgnu.la $(INTLLIBS) $(EXTRA_LIBS)
    27 
    28 rpm_SOURCES = rpm.c
    29 rpm_LDADD = $(top_builddir)/librazor/librazor.la $(LUA_LIBS) $(EXTRA_LIBS)
    30 
    31 test_driver_SOURCES = test-driver.c
    32 test_driver_LDADD = $(top_builddir)/librazor/librazor.la $(EXPAT_LIBS) $(EXTRA_LIBS)
    33 
    34 TESTS = test-driver
    35 XFAIL_TESTS = test-driver
    36 
    37 EXTRA_DIST = 			\
    38 	test.xml
    39 
    40 clean-local :
    41 	rm -f *~
    42