- Get VPATH build to work
authorfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 24 Nov 2009 23:53:37 +0000 (23:53 +0000)
committerfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 24 Nov 2009 23:53:37 +0000 (23:53 +0000)
- Get test programs to run under VPATH build tree
- Get 'make distcheck' to pass

14 files changed:
configure.ac
docs/reference/Makefile.am
interpreters/git/Makefile.am
interpreters/nitfol/Makefile.am
interpreters/nitfol/nitfol.info
libchimara/Makefile.am
libchimara/chimara-glk.c
libchimara/chimara-if.c
libchimara/style.c
po/POTFILES.in
po/POTFILES.skip
tests/Makefile.am
tests/glulxercise.c
tests/main.c

index 53db3191cd8da11bc603e86d10ab565151e4f62c..18f9d5f55185600d774b4ae111e8b43d9bf8bd79 100644 (file)
@@ -44,7 +44,7 @@ AC_PROG_LIBTOOL              # Old way of declaring Libtool
 AM_GNU_GETTEXT([external])   # Gettext, link to system libintl
 IT_PROG_INTLTOOL    # Intltool
 PKG_PROG_PKG_CONFIG          # pkg_config
-GTK_DOC_CHECK(1.9)           # Gtk-Doc
+GTK_DOC_CHECK(1.11)          # Gtk-Doc 1.11 required
 # Other utilities used in this package's various make scripts
 AC_PROG_AWK
 AC_PATH_PROG([PERL], [perl]) # Perl
index f7f5ee528b81881a54d8687b461a2e4a73344722..c039fb8abe30699da72028164e47292e646c9a02 100644 (file)
@@ -33,7 +33,8 @@ MKDB_OPTIONS = --sgml-mode --output-format=xml
 MKTMPL_OPTIONS = 
 
 # Extra options to supply to gtkdoc-mkhtml
-MKHTML_OPTIONS = 
+# The --path is because Gtk-doc is broken on non-distcheck vpath builds! Sigh.
+MKHTML_OPTIONS = --path="$(abs_builddir)"
 
 # Extra options to supply to gtkdoc-fixref. Not normally needed.
 FIXXREF_OPTIONS = 
@@ -51,26 +52,26 @@ IGNORE_HFILES = chimara-glk-private.h \
 
 # Images to copy into HTML directory.
 HTML_IMAGES = \
-       $(srcdir)/images/fig1.png \
-       $(srcdir)/images/fig2.png \
-       $(srcdir)/images/fig3a.png \
-       $(srcdir)/images/fig3b.png \
-       $(srcdir)/images/fig3c.png \
-       $(srcdir)/images/fig4a.png \
-       $(srcdir)/images/fig4b.png \
-       $(srcdir)/images/fig4c.png \
-       $(srcdir)/images/fig5-7a.png \
-       $(srcdir)/images/fig6.png \
-       $(srcdir)/images/fig7b.png \
-       $(srcdir)/images/fig7c.png \
-       $(srcdir)/images/fig7d.png \
-       $(srcdir)/images/fig7e.png \
-       $(srcdir)/images/fig8a.png \
-       $(srcdir)/images/fig8b.png \
-       $(srcdir)/images/fig8c.png \
-       $(srcdir)/images/fig9.png \
-       $(srcdir)/images/fig10.png \
-       $(srcdir)/images/fig11.png
+       images/fig1.png \
+       images/fig2.png \
+       images/fig3a.png \
+       images/fig3b.png \
+       images/fig3c.png \
+       images/fig4a.png \
+       images/fig4b.png \
+       images/fig4c.png \
+       images/fig5-7a.png \
+       images/fig6.png \
+       images/fig7b.png \
+       images/fig7c.png \
+       images/fig7d.png \
+       images/fig7e.png \
+       images/fig8a.png \
+       images/fig8b.png \
+       images/fig8c.png \
+       images/fig9.png \
+       images/fig10.png \
+       images/fig11.png
 
 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
 content_files = version.xml \
index ac41315f2374e90b5ada28b04553f7c298014878..a2825d49b64427b4d03e62a4cb1167edf08574bc 100644 (file)
@@ -21,7 +21,7 @@ git_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
 gitdocdir = $(datadir)/doc/$(PACKAGE)/git
 dist_gitdoc_DATA = README.txt
 
-CLEANFILES = test/*.tmp
+CLEANFILES = version.h test/*.tmp
 
 #TESTS = test/test.sh \
 #      test/Alabaster.gblorb test/Alabaster.walk test/Alabaster.golden
index c1031b1203183f007c78aded9296dd9e246fcef7..da182116b1790acb6df63129d4b49b6ae26138da 100644 (file)
@@ -10,13 +10,12 @@ dist_noinst_SCRIPTS = copying.awk opt2glkc.pl y2help.pl
 pkglib_LTLIBRARIES = nitfol.la
 nitfol_la_SOURCES = automap.c automap.h binary.h copying.h debug.c debug.h \
        decode.c decode.h errmesg.c errmesg.h globals.c globals.h hash.c hash.h \
-       iff.c iff.h infix.c infix.h inform.y inform.h init.c init.h io.c \
-       linkevil.h main.c main.h nio.h nitfol.h no_blorb.h objects.c objects.h \
-       op_call.c op_call.h op_jmp.c op_jmp.h oplist.c oplist.h op_math.c \
-       op_math.h op_save.c op_save.h op_table.c op_table.h op_v6.c op_v6.h \
-       portfunc.c portfunc.h quetzal.c quetzal.h solve.c solve.h stack.c stack.h \
-       struct.c struct.h tokenise.c tokenise.h undo.c undo.h z_io.c z_io.h \
-       zscii.c zscii.h \
+       iff.c iff.h infix.c infix.h inform.y inform.h init.c init.h io.c io.h \
+       linkevil.h main.c main.h nitfol.h no_blorb.h objects.c objects.h op_call.c \
+       op_call.h op_jmp.c op_jmp.h oplist.c oplist.h op_math.c op_math.h \
+       op_save.c op_save.h op_table.c op_table.h op_v6.c op_v6.h portfunc.c \
+       portfunc.h quetzal.c quetzal.h solve.c solve.h stack.c stack.h struct.c \
+       struct.h tokenise.c tokenise.h undo.c undo.h z_io.c z_io.h zscii.c zscii.h \
        $(GRAPHICS) \
        $(BLORB) \
        $(SOUND)
@@ -29,8 +28,8 @@ info_TEXINFOS = nitfol.texi
 nitfol_TEXINFOS = dbg_help.texi options.texi
 # man_MANS = nitfol.6
 
-BUILT_SOURCES = copying.c dbg_help.h startunix.c
-CLEANFILES = $(BUILT_SOURCES) dbg_help.texi nitfol.6 options.texi 
+BUILT_SOURCES = copying.c dbg_help.h startunix.c dbg_help.texi options.texi
+CLEANFILES = $(BUILT_SOURCES) nitfol.6 
 
 dbg_help.h: inform.y y2help.pl
        $(PERL) $(srcdir)/y2help.pl $(srcdir)/inform.y
index 26970799e6e5888b5512321d53c221a859b65613..fba02ccb6def5957948a54cd73297d307793158d 100644 (file)
@@ -1,4 +1,5 @@
-This is nitfol.info, produced by makeinfo version 4.13 from nitfol.texi.
+This is ../../../interpreters/nitfol/nitfol.info, produced by makeinfo
+version 4.13 from ../../../interpreters/nitfol/nitfol.texi.
 
 INFO-DIR-SECTION Games
 START-INFO-DIR-ENTRY
@@ -1056,20 +1057,20 @@ File: nitfol.info,  Node: Games Cited,  Prev: Thanks,  Up: Top
 
 \1f
 Tag Table:
-Node: Top\7f205
-Node: Invoking nitfol\7f1544
-Node: Features\7f8420
-Node: Preferences\7f9069
-Node: Infinite undo/redo\7f10425
-Node: Aliases\7f11199
-Node: Abbreviation Expansion\7f13723
-Node: Typo correction\7f14840
-Node: Automapping\7f16754
-Node: Quetzal\7f22533
-Node: Blorb\7f24254
-Node: Debugger\7f24680
-Node: Bugs\7f31655
-Node: Thanks\7f34710
-Node: Games Cited\7f35126
+Node: Top\7f263
+Node: Invoking nitfol\7f1602
+Node: Features\7f8478
+Node: Preferences\7f9127
+Node: Infinite undo/redo\7f10483
+Node: Aliases\7f11257
+Node: Abbreviation Expansion\7f13781
+Node: Typo correction\7f14898
+Node: Automapping\7f16812
+Node: Quetzal\7f22591
+Node: Blorb\7f24312
+Node: Debugger\7f24738
+Node: Bugs\7f31713
+Node: Thanks\7f34768
+Node: Games Cited\7f35184
 \1f
 End Tag Table
index ddc0438b40790610df7d1fc18010b0c3163c595e..69c5922f26b7afb96d61fa3c4fe69fea1ecc33d3 100644 (file)
@@ -38,6 +38,7 @@ libchimara_la_CPPFLAGS = \
        -DG_LOG_DOMAIN=\"Chimara\" \
        -DLOCALEDIR=\""$(datadir)/locale"\" \
        -DPLUGINDIR=\""$(pkglibdir)"\" \
+       -DPLUGINSOURCEDIR=\""$(abs_builddir)/../interpreters"\" \
        -I$(top_srcdir)
 libchimara_la_CFLAGS = @CHIMARA_CFLAGS@ $(AM_CFLAGS)
 libchimara_la_LIBADD = @CHIMARA_LIBS@
index 1d981a5ce2445201d8b809a888952483ef6bda5f..f62c1bee2b79b372860fc7a61cca8777b6218d08 100644 (file)
@@ -222,8 +222,9 @@ chimara_glk_finalize(GObject *object)
 
 /**
  * chimara_glk_reset:
+ * @self: The ChimaraGLK widget to reset
+ *
  * Resets the widget back to it's origional state. IE: it resets all the private data.
- * @param self: The ChimaraGLK widget to reset
  */
 void
 chimara_glk_reset(ChimaraGlk *self)
index 3298c795d397ef84754da5ceecfbb79f15b5e5fc..26e5b3a7626cc8f99520f5e0ae63ef28c9025fab 100644 (file)
@@ -533,11 +533,14 @@ chimara_if_run_game(ChimaraIF *self, gchar *gamefile, GError **error)
        ChimaraIFInterpreter interpreter = priv->preferred_interpreter[format];
        gchar *pluginfile = g_strconcat(plugin_names[interpreter], "." G_MODULE_SUFFIX, NULL);
 
+       gchar *pluginpath;
+#ifdef DEBUG
        /* If there is a plugin in the source tree, use that */
-       gchar *pluginpath = g_build_filename("..", "interpreters", plugin_names[interpreter], LT_OBJDIR, pluginfile, NULL);
+       pluginpath = g_build_filename(PLUGINSOURCEDIR, plugin_names[interpreter], LT_OBJDIR, pluginfile, NULL);
        if( !g_file_test(pluginpath, G_FILE_TEST_EXISTS) )
        {
                g_free(pluginpath);
+#endif
                pluginpath = g_build_filename(PLUGINDIR, pluginfile, NULL);
                if( !g_file_test(pluginpath, G_FILE_TEST_EXISTS) )
                {
@@ -546,7 +549,9 @@ chimara_if_run_game(ChimaraIF *self, gchar *gamefile, GError **error)
                        g_set_error(error, CHIMARA_ERROR, CHIMARA_PLUGIN_NOT_FOUND, _("No appropriate %s interpreter plugin was found"), interpreter_names[interpreter]);
                        return FALSE;
                }
+#ifdef DEBUG
        }
+#endif
        g_free(pluginfile);
 
        /* Decide what arguments to pass to the interpreters; currently only the
index 5c639cc0481842fa04f4d2e5c418b4102ce588a8..4a6b5119a52da9e04ca57244730c128a564e53a8 100644 (file)
@@ -177,19 +177,6 @@ style_init()
        GHashTable *current_text_buffer_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref);
        GtkTextTag *tag;
 
-       /* Create the CSS file scanner */
-       GScanner *scanner = g_scanner_new(NULL);
-
-       int f = open(glk_data->css_file, O_RDONLY);
-       g_return_if_fail(f != -1);
-       g_scanner_input_file(scanner, f);
-       scanner->input_name = glk_data->css_file;
-       scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z "#";
-       scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z "-_" G_CSET_DIGITS;
-       scanner->config->symbol_2_token = TRUE;
-       scanner->config->cpair_comment_single = NULL;
-       scanner->config->scan_float = FALSE;
-
        /* Initialise the default styles for a text grid */
        tag = gtk_text_tag_new("normal");
        g_object_set(tag, "font-desc", glk_data->monospace_font_desc, NULL);
@@ -272,15 +259,33 @@ style_init()
        g_object_set(tag, "foreground", "#0000ff", "underline", PANGO_UNDERLINE_SINGLE, "underline-set", TRUE, NULL);
        g_hash_table_insert(default_text_buffer_styles, "hyperlink", tag);
 
-
        glk_data->default_styles->text_grid = default_text_grid_styles;
        glk_data->default_styles->text_buffer = default_text_buffer_styles;
 
-       /* Run the scanner over the CSS file, overriding defaults */
-       while( g_scanner_peek_next_token(scanner) != G_TOKEN_EOF) {
-               if( !style_accept_style_selector(scanner) )
-                       break;
+       /* Create the CSS file scanner */
+       GScanner *scanner = g_scanner_new(NULL);
+
+       int f = open(glk_data->css_file, O_RDONLY);
+       if(f != -1)
+       {
+               g_scanner_input_file(scanner, f);
+               scanner->input_name = glk_data->css_file;
+               scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z "#";
+               scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z "-_" G_CSET_DIGITS;
+               scanner->config->symbol_2_token = TRUE;
+               scanner->config->cpair_comment_single = NULL;
+               scanner->config->scan_float = FALSE;
+
+               /* Run the scanner over the CSS file, overriding defaults */
+               while( g_scanner_peek_next_token(scanner) != G_TOKEN_EOF) {
+                       if( !style_accept_style_selector(scanner) )
+                               break;
+               }
+
+               g_scanner_destroy(scanner);
        }
+       else
+               g_warning("Could not find CSS file");
 
        /* Set the current style to a copy of the default style */
        g_hash_table_foreach(default_text_grid_styles, style_table_copy, current_text_grid_styles);
@@ -288,8 +293,6 @@ style_init()
        glk_data->current_styles->text_grid = current_text_grid_styles;
        glk_data->current_styles->text_buffer = current_text_buffer_styles;
 
-       g_scanner_destroy(scanner);
-
        glk_data->style_initialized = TRUE;
 }
 
index e12a0d13de0579bfecf1fe90ad4add0a68ca24f5..a3b956b993d9ebaeab33f7b90bab694b51689620 100644 (file)
@@ -1,5 +1,7 @@
 # List of source files containing translatable strings.
 
 libchimara/chimara-glk.c
-tests/chimara.glade
+libchimara/chimara-if.c
+libchimara/init.c
+tests/chimara.ui
 
index ce59acd2c155f61330beff438dcf2a8ac1182cfc..419e8ad4bdb5aad5b4d06062987c7b9bbeb86115 100644 (file)
@@ -2,5 +2,5 @@
 # but don't.
 
 interpreters/nitfol/inform.c
-tests/chimara.ui
+tests/glulxercise.ui
 
index 45e0acfa46b0bfe537bb9a9749baece2a1590c34..18494375d480c7905aa70d98aa1926ff0ebc3663 100644 (file)
@@ -29,7 +29,8 @@ test_multisession_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS)
 test_multisession_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la
 
 glulxercise_SOURCES = glulxercise.c error.c error.h
-glulxercise_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS)
+glulxercise_CPPFLAGS = $(AM_CPPFLAGS) -DPACKAGE_SRC_DIR=\""$(srcdir)"\"
+glulxercise_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS) 
 glulxercise_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la
 
 plugin_loader_SOURCES = plugin-loader.c
index 3c786a922655139250adfd95a00294328283b410..3db6bba753e3a8b02439aa921218c38f483994dc 100644 (file)
@@ -28,11 +28,14 @@ on_go_clicked(GtkButton *go, Widgets *w)
        gtk_tree_model_get(model, &iter, 1, &filename, -1);
        g_object_unref(model);
 
-       if( !chimara_if_run_game(CHIMARA_IF(w->interp), filename, &error) )
+       gchar *fullpath = g_build_filename(PACKAGE_SRC_DIR, filename, NULL);
+
+       if( !chimara_if_run_game(CHIMARA_IF(w->interp), fullpath, &error) )
        {
                error_dialog(GTK_WINDOW(w->window), error, "Error starting Glk library: ");
                gtk_main_quit();
        }
+       g_free(fullpath);
 
        gtk_widget_set_sensitive(w->go, FALSE);
        gtk_widget_set_sensitive(w->stop, TRUE);
@@ -75,7 +78,7 @@ main(int argc, char *argv[])
        gtk_init(&argc, &argv);
 
        GtkBuilder *builder = gtk_builder_new();
-       if(!gtk_builder_add_from_file(builder, "glulxercise.ui", &error))
+       if(!gtk_builder_add_from_file(builder, PACKAGE_SRC_DIR "/glulxercise.ui", &error))
        {
                error_dialog(NULL, error, "Failed to build interface: ");
                return 1;
index 5cadc226533c872299e57c58e1a2a39cd0d09d36..82c92bf1a073a3fc474efa32e7edcea1b808203c 100644 (file)
@@ -88,7 +88,7 @@ create_window(void)
        GError *error = NULL;
 
        builder = gtk_builder_new();
-       if( !gtk_builder_add_from_file(builder, "chimara.ui", &error) ) {
+       if( !gtk_builder_add_from_file(builder, PACKAGE_SRC_DIR "/chimara.ui", &error) ) {
                error_dialog(NULL, error, "Error while building interface: ");  
                return;
        }
@@ -114,7 +114,7 @@ create_window(void)
                gtk_action_group_add_action_with_accel(actiongroup, GTK_ACTION(load_object(ptr[0])), ptr[1]);
 
        uimanager = gtk_ui_manager_new();
-       if( !gtk_ui_manager_add_ui_from_file(uimanager, "chimara.menus", &error) ) {
+       if( !gtk_ui_manager_add_ui_from_file(uimanager, PACKAGE_SRC_DIR "/chimara.menus", &error) ) {
                error_dialog(NULL, error, "Error while building interface: ");
                return;
        }