From 5ae8c90ba8cbfeaddef0c2ae69cc0745b64cd379 Mon Sep 17 00:00:00 2001 From: fliep Date: Thu, 23 Apr 2009 20:52:47 +0000 Subject: [PATCH] - Added pkg-config files (.pc.in), so after the library is installed you can link to it with `pkg-config --cflags --libs chimara`. - Plugins need to compile, for the definition of glui32 and glsi32 in glk.h; don't know why this worked before. - Fixed libtool craziness. Apparently when you declare your plugins "noinst" then libtool "figures out" that it doesn't need to build shared libraries. --- .svnignore | 2 +- Makefile.am | 15 +++++---------- chimara-plugin.pc.in | 13 +++++++++++++ chimara.pc.in | 13 +++++++++++++ configure.ac | 24 ++++++++++++++++-------- src/Makefile.am | 22 +++++++++++++++------- src/input.c | 4 ++-- src/strio.c | 2 +- 8 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 chimara-plugin.pc.in create mode 100644 chimara.pc.in diff --git a/.svnignore b/.svnignore index 374828c..f2c5a21 100644 --- a/.svnignore +++ b/.svnignore @@ -1,7 +1,7 @@ +*.pc aclocal.m4 autom4te.cache bugreports -chimara.anjuta compile config.* configure diff --git a/Makefile.am b/Makefile.am index 4a87cfd..c03385d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = src po docs chimaradocdir = ${prefix}/doc/chimara -chimaradoc_DATA = \ +dist_chimaradoc_DATA = \ README\ COPYING\ AUTHORS\ @@ -12,16 +12,11 @@ chimaradoc_DATA = \ INSTALL\ NEWS -EXTRA_DIST = $(chimaradoc_DATA) \ - intltool-extract.in intltool-merge.in intltool-update.in +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = chimara.pc chimara-plugin.pc -# Copy all the spec files. Of cource, only one is actually used. -dist-hook: - for specfile in *.spec; do \ - if test -f $$specfile; then \ - cp -p $$specfile $(distdir); \ - fi \ - done +EXTRA_DIST = intltool-extract.in intltool-merge.in intltool-update.in \ + chimara.pc.in chimara-plugin.pc.in DISTCLEANFILES = intltool-extract intltool-merge intltool-update diff --git a/chimara-plugin.pc.in b/chimara-plugin.pc.in new file mode 100644 index 0000000..85146b5 --- /dev/null +++ b/chimara-plugin.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Chimara +Description: Multi-session Glk library, with interactive fiction plugins +Version: @PACKAGE_VERSION@ +URL: http://no.public.website.yet +Requires: glib-2.0 +Libs: -module -shared -avoid-version -export-symbols-regex "^glk_main$$" +Cflags: -I${includedir}/chimara + diff --git a/chimara.pc.in b/chimara.pc.in new file mode 100644 index 0000000..f4d0346 --- /dev/null +++ b/chimara.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Chimara +Description: Multi-session Glk library, with interactive fiction plugins +Version: @PACKAGE_VERSION@ +URL: http://no.public.website.yet +Requires: glib-2.0 >= @GLIB_REQUIRED_VERSION@, gtk+-2.0 >= @GTK_REQUIRED_VERSION@ +Requires.private: gthread-2.0, gmodule-2.0 +Libs: -L${libdir} -lchimara +Cflags: -I${includedir}/chimara diff --git a/configure.ac b/configure.ac index 1e49440..ed39840 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,9 @@ AM_INIT_AUTOMAKE([-Wall]) AC_PROG_CC # C compiler AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS AC_PROG_INSTALL # Install -LT_INIT # Libtool +LT_INIT # Libtool 2.2.6 and up +#LT_INIT([dlopen]) # Should call it this way, but +#LT_PREREQ([2.2.6]) # ...goddamn Fedora 10 still has 1.5 AC_PROG_LIBTOOL # Old way of declaring Libtool AM_GLIB_GNU_GETTEXT # Use GLib gettext instead of standard IT_PROG_INTLTOOL([0.35.0]) # Intltool @@ -31,22 +33,26 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) ### CHECK FOR LIBRARIES ####################################################### +GTK_REQUIRED_VERSION=2.8 +GLIB_REQUIRED_VERSION=2.6 + +AC_SUBST(GTK_REQUIRED_VERSION) +AC_SUBST(GLIB_REQUIRED_VERSION) + # Libraries needed to build Chimara library PKG_CHECK_MODULES([CHIMARA], [ - glib-2.0 >= 2.6 - gtk+-2.0 >= 2.8 + glib-2.0 >= $GLIB_REQUIRED_VERSION + gtk+-2.0 >= $GTK_REQUIRED_VERSION gthread-2.0 gmodule-2.0 ]) -AC_SUBST(CHIMARA_CFLAGS) -AC_SUBST(CHIMARA_LIBS) # Libraries needed to build test programs PKG_CHECK_MODULES([TEST], [ - gtk+-2.0 >= 2.8 + gtk+-2.0 >= $GTK_REQUIRED_VERSION gmodule-2.0 ]) -AC_SUBST(TEST_CFLAGS) -AC_SUBST(TEST_LIBS) +# GLib CFLAGS for plugins +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_REQUIRED_VERSION]) ### GTK-DOC ################################################################### @@ -61,6 +67,8 @@ AC_CONFIG_HEADERS([config.h]) # List of other files for Autoconf to output AC_CONFIG_FILES([ Makefile +chimara.pc +chimara-plugin.pc src/Makefile docs/Makefile docs/reference/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 52b8652..4f05a5b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,20 +35,28 @@ libchimara_la_CPPFLAGS = \ -DG_LOG_DOMAIN=\"Chimara\" libchimara_la_CFLAGS = @CHIMARA_CFLAGS@ $(AM_CFLAGS) libchimara_la_LIBADD = @CHIMARA_LIBS@ -libchimara_la_LDFLAGS = -no-undefined -export-symbols-regex "^chimara_glk_|^glk_" +libchimara_la_LDFLAGS = -no-undefined -export-symbols-regex "^(chimara_)?glk_" libchimara_includedir = $(includedir)/chimara/chimara libchimara_include_HEADERS = chimara-glk.h -PLUGIN_LDFLAGS = -module -shared -avoid-version -export-symbols-regex "^glk_main$$" -noinst_LTLIBRARIES = first.la model.la gridtest.la splittest.la +pkglib_LTLIBRARIES = first.la model.la gridtest.la splittest.la +PLUGIN_LIBTOOL_FLAGS=-module -avoid-version -export-symbols-regex "^glk_main$$" + first_la_SOURCES = first.c -first_la_LDFLAGS = $(PLUGIN_LDFLAGS) +first_la_CFLAGS = @GLIB_CFLAGS@ +first_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) + model_la_SOURCES = model.c -model_la_LDFLAGS = $(PLUGIN_LDFLAGS) +model_la_CFLAGS = @GLIB_CFLAGS@ +model_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) + gridtest_la_SOURCES = gridtest.c -gridtest_la_LDFLAGS = $(PLUGIN_LDFLAGS) +gridtest_la_CFLAGS = @GLIB_CFLAGS@ +gridtest_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) + splittest_la_SOURCES = splittest.c -splittest_la_LDFLAGS = $(PLUGIN_LDFLAGS) +splittest_la_CFLAGS = @GLIB_CFLAGS@ +splittest_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) CLEANFILES = chimara.ui diff --git a/src/input.c b/src/input.c index c5d7b90..c513419 100644 --- a/src/input.c +++ b/src/input.c @@ -42,7 +42,7 @@ glk_request_char_event_uni(winid_t win) } /* Internal function: Request either latin-1 or unicode line input, in a text grid window. */ -void +static void text_grid_request_line_event_common(winid_t win, glui32 maxlen, gboolean insert, gchar *inserttext) { GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); @@ -103,7 +103,7 @@ text_grid_request_line_event_common(winid_t win, glui32 maxlen, gboolean insert, } /* Internal function: Request either latin-1 or unicode line input, in a text buffer window. */ -void +static void text_buffer_request_line_event_common(winid_t win, glui32 maxlen, gboolean insert, gchar *inserttext) { GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); diff --git a/src/strio.c b/src/strio.c index 9baaf0f..4517b38 100644 --- a/src/strio.c +++ b/src/strio.c @@ -459,7 +459,7 @@ is_unicode_newline(glsi32 ch, FILE *fp, gboolean utf8) /* Internal function: Read one character from a stream. Returns a value which can be returned unchanged by glk_get_char_stream_uni(), but glk_get_char_stream() must replace high values by the placeholder character. */ -glsi32 +static glsi32 get_char_stream_common(strid_t str) { switch(str->type) -- 2.30.2