From cbffb2b3b862ccfa9c8506ce58ada2895ff3be49 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 15 Apr 2011 19:33:09 +0200 Subject: [PATCH] gcr: Build a testable version with all functions exported. Build a testable version of the gcr library, which has all the functions exported including those with _gcr_ prefixes. --- gcr/Makefile.am | 55 ++++++++++++++++++++++++++++++++++----------------- gcr/tests/Makefile.am | 4 ++-- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/gcr/Makefile.am b/gcr/Makefile.am index f3b3949..817b19b 100644 --- a/gcr/Makefile.am +++ b/gcr/Makefile.am @@ -1,15 +1,4 @@ -if WITH_TESTS -TESTS_DIR = tests -EXPORT_PATT = '^_?gcr_*' -else -TESTS_DIR = -EXPORT_PATT = '^gcr_*' -endif - -SUBDIRS = . \ - $(TESTS_DIR) - # ------------------------------------------------------------------ # UI BUILDER # @@ -68,9 +57,7 @@ INCLUDES = \ BUILT_SOURCES = \ gcr-marshal.c gcr-marshal.h -lib_LTLIBRARIES = libgcr@GCR_VERSION_SUFFIX@.la - -libgcr@GCR_VERSION_SUFFIX@_la_SOURCES = \ +LIB_SOURCES = \ gcr-certificate.c gcr-certificate.h \ gcr-certificate-chain.c gcr-certificate-chain.h \ gcr-certificate-renderer.c gcr-certificate-renderer.h \ @@ -101,16 +88,22 @@ libgcr@GCR_VERSION_SUFFIX@_la_SOURCES = \ gcr-viewer.c gcr-viewer.h \ $(BUILT_SOURCES) -libgcr@GCR_VERSION_SUFFIX@_la_CFLAGS = \ +LIB_CFLAGS = \ -DGCK_API_SUBJECT_TO_CHANGE \ -DGCR_API_SUBJECT_TO_CHANGE \ -DGCR_COMPILATION \ -DUIDIR=\""$(uidir)"\" +lib_LTLIBRARIES = libgcr@GCR_VERSION_SUFFIX@.la + +libgcr@GCR_VERSION_SUFFIX@_la_SOURCES = $(LIB_SOURCES) + +libgcr@GCR_VERSION_SUFFIX@_la_CFLAGS = $(LIB_CFLAGS) + libgcr@GCR_VERSION_SUFFIX@_la_LDFLAGS = \ -version-info $(GCR_LT_RELEASE) \ -no-undefined \ - -export-symbols-regex $(EXPORT_PATT) + -export-symbols-regex '^gcr_*' libgcr@GCR_VERSION_SUFFIX@_la_LIBADD = \ $(top_builddir)/egg/libegg.la \ @@ -134,8 +127,6 @@ pkgconfig_DATA = gcr-$(GCR_MAJOR).pc gcr-$(GCR_MAJOR).pc: gcr.pc cp gcr.pc gcr-$(GCR_MAJOR).pc -# ---------------------------------------------------------------- - EXTRA_DIST = \ gcr.pc.in \ gcr-marshal.list \ @@ -148,3 +139,31 @@ CLEANFILES = \ DISTCLEANFILES = \ $(pkgconfig_DATA) + +# ---------------------------------------------------------------- +# TESTS + +if WITH_TESTS + +TESTS_DIR = tests + +noinst_LTLIBRARIES = \ + libgcr-testable.la + +libgcr_testable_la_SOURCES = $(LIB_SOURCES) + +libgcr_testable_la_CFLAGS = $(LIB_CFLAGS) + +libgcr_testable_la_LDFLAGS = \ + -no-undefined + +else # WITH_TESTS + +TESTS_DIR = + +endif # WITH_TESTS + +# ---------------------------------------------------------------- + +SUBDIRS = . \ + $(TESTS_DIR) diff --git a/gcr/tests/Makefile.am b/gcr/tests/Makefile.am index 59bad0b..b5ff961 100644 --- a/gcr/tests/Makefile.am +++ b/gcr/tests/Makefile.am @@ -10,13 +10,13 @@ INCLUDES = \ $(LIBGCRYPT_CFLAGS) LDADD = \ - $(top_builddir)/gcr/libgcr@GCR_VERSION_SUFFIX@.la \ + $(top_builddir)/gcr/libgcr-testable.la \ $(top_builddir)/egg/libegg.la \ $(top_builddir)/egg/libegg-entry-buffer.la \ $(top_builddir)/gck/libgck.la \ $(GTK_LIBS) \ $(GLIB_LIBS) \ - $(LIBGCRYT_LIBS) + $(LIBGCRYPT_LIBS) TEST_PROGS = \ test-certificate \ -- 2.7.4