From 8fd4f66b5d416dd55c4b9fc8fafe5fedae861cb4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 14 Feb 2012 00:04:03 +0100 Subject: [PATCH] parser: build a shared library A shared library allows for all frontends to share code. It also allows third-party programs to use the parser. Signed-off-by: "Yann E. MORIN" --- .hgignore | 6 ++++++ bootstrap | 3 +++ configure.ac | 5 ++++- frontends/conf/Makefile.am | 2 +- frontends/gconf/Makefile.am | 2 +- frontends/mconf/Makefile.am | 2 +- frontends/nconf/Makefile.am | 2 +- frontends/qconf/Makefile.am | 2 +- libs/parser/Makefile.am | 9 +++++---- 9 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.hgignore b/.hgignore index b5aff72..2d0f36c 100644 --- a/.hgignore +++ b/.hgignore @@ -2,7 +2,10 @@ syntax: glob .*.swp *.o +*.lo *.a +*.la +*.lai frontends/conf/conf frontends/gconf/gconf @@ -12,6 +15,8 @@ frontends/qconf/qconf frontends/qconf/qconf.moc libs/parser/?conf.c +libs/*/.libs +frontends/*/.libs aclocal.m4 configure @@ -19,6 +24,7 @@ config.h config.h.in config.log config.status +libtool Makefile Makefile.in diff --git a/bootstrap b/bootstrap index b07f76d..0042020 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,9 @@ #!/bin/sh set -e +printf "Running libtoolize...\n" +libtoolize --copy --force + printf "Running aclocal...\n" aclocal -Wall --force diff --git a/configure.ac b/configure.ac index 7f7569e..8ee8fd5 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,6 @@ AC_SUBST([enable_qconf], [${enable_qconf:-auto}]) #---------------------------------------- # Some program checks -AC_PROG_RANLIB AC_PROG_LEX AC_PROG_YACC AC_CHECK_PROGS( @@ -263,6 +262,10 @@ AM_CONDITIONAL( [COND_lxdialog], [test "$need_lxdialog" = "yes"]) +#--------------------------------------------------------------------------- +# Prepare libtool +LT_INIT([disable-static]) + #---------------------------------------- # Finalise AC_CONFIG_FILES([ diff --git a/frontends/conf/Makefile.am b/frontends/conf/Makefile.am index c8068df..7fef926 100644 --- a/frontends/conf/Makefile.am +++ b/frontends/conf/Makefile.am @@ -4,4 +4,4 @@ conf_SOURCES = conf.c conf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs/parser -conf_LDADD = ../../libs/parser/libkconfigparser.a +conf_LDADD = ../../libs/parser/libkconfigparser.la diff --git a/frontends/gconf/Makefile.am b/frontends/gconf/Makefile.am index 3f34d6e..310198e 100644 --- a/frontends/gconf/Makefile.am +++ b/frontends/gconf/Makefile.am @@ -9,6 +9,6 @@ gconf_CPPFLAGS = $(AM_CPPFLAGS) \ gconf_CFLAGS = $(AM_CFLAGS) \ $(gtk_CFLAGS) gconf_LDADD = $(gtk_LIBS) \ - ../../libs/parser/libkconfigparser.a + ../../libs/parser/libkconfigparser.la gconfdir = $(pkgdatadir) gconf_DATA = gconf.glade diff --git a/frontends/mconf/Makefile.am b/frontends/mconf/Makefile.am index 4e06958..0440c2d 100644 --- a/frontends/mconf/Makefile.am +++ b/frontends/mconf/Makefile.am @@ -6,5 +6,5 @@ mconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs \ -I../../libs/parser -mconf_LDADD = ../../libs/parser/libkconfigparser.a \ +mconf_LDADD = ../../libs/parser/libkconfigparser.la \ ../../libs/lxdialog/liblxdialog.a diff --git a/frontends/nconf/Makefile.am b/frontends/nconf/Makefile.am index c68566c..532c8f9 100644 --- a/frontends/nconf/Makefile.am +++ b/frontends/nconf/Makefile.am @@ -4,4 +4,4 @@ nconf_SOURCES = nconf.c nconf.gui.c nconf.h nconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs/parser -nconf_LDADD = ../../libs/parser/libkconfigparser.a +nconf_LDADD = ../../libs/parser/libkconfigparser.la diff --git a/frontends/qconf/Makefile.am b/frontends/qconf/Makefile.am index 0f4b199..f93fe70 100644 --- a/frontends/qconf/Makefile.am +++ b/frontends/qconf/Makefile.am @@ -9,7 +9,7 @@ qconf_CPPFLAGS = $(AM_CPPFLAGS) \ qconf_CXXFLAGS = $(AM_CXXFLAGS) \ $(qt4_CFLAGS) qconf_LDADD = $(qt4_LIBS) \ - ../../libs/parser/libkconfigparser.a + ../../libs/parser/libkconfigparser.la .h.moc: moc -i $< -o $@ diff --git a/libs/parser/Makefile.am b/libs/parser/Makefile.am index 5f0d352..40fe4b8 100644 --- a/libs/parser/Makefile.am +++ b/libs/parser/Makefile.am @@ -1,13 +1,14 @@ SUFFIXES = .gperf -noinst_LIBRARIES = libkconfigparser.a - -libkconfigparser_a_SOURCES = yconf.y -dist_EXTRA_libkconfigparser_a_SOURCES = \ +lib_LTLIBRARIES = libkconfigparser.la +libkconfigparser_la_SOURCES = yconf.y +dist_EXTRA_libkconfigparser_la_SOURCES = \ hconf.gperf lconf.l \ confdata.c menu.c symbol.c util.c \ expr.c expr.h lkc.h lkc_proto.h +include_HEADERS = expr.h lkc.h lkc_proto.h + BUILT_SOURCES = hconf.c lconf.c # Can't use libkconfigparser_a_CPPFLAGS, as it breaks dependencies -- 2.39.5