]> Pileus Git - aweather/commitdiff
Fix gen.sh and related things for stand-alone libgis
authorAndy Spencer <andy753421@gmail.com>
Sun, 25 Oct 2009 17:12:14 +0000 (17:12 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 25 Oct 2009 17:12:14 +0000 (17:12 +0000)
This make aweather run without needing to be installed.
gen.sh the libgis source to be installed in ../libgis and configured
with ./gen.sh

autogen.sh
configure.ac
gen.sh
src/Makefile.am
src/aweather-gui.c
src/plugins/Makefile.am

index 28ac04baca06da6f482ccf6129103854e6c302af..086ea135813ad175ded22febcf021eaaffbd2957 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/sh
 
-gtkdocize
 libtoolize
 aclocal
 autoheader
index 3bf3fe420c094b50187ed806cb49f072dae4c421..6a98aa4eb267f6193d8447c189b6784a58c7d958 100644 (file)
@@ -9,10 +9,10 @@ AC_CONFIG_MACRO_DIR([m4])
 AC_PROG_CC
 AC_PROG_LIBTOOL
 PKG_PROG_PKG_CONFIG
-GTK_DOC_CHECK(1.9)
 
 # Check for required packages
 PKG_CHECK_MODULES(GIS, libgis)
+AC_SUBST(PLUGINSDIR, `pkg-config --variable=pluginsdir libgis`)
 
 # Define odd RSL install location
 AC_CHECK_LIB(rsl, RSL_wsr88d_to_radar, RSL_LIBS="-lrsl")
diff --git a/gen.sh b/gen.sh
index e1ad515ef0967f2dbdafb027abfc0c990504e05b..c9b9949f927690b8d47706ce6c8e440d268bb686 100755 (executable)
--- a/gen.sh
+++ b/gen.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 dir=$(dirname $(readlink -f $0))
-# "--libdir=$dir/src/plugins"
-# "--datadir=$dir/data"
+PKG_CONFIG_PATH="../libgis/src/" \
 ./autogen.sh \
-       --enable-gtk-doc \
+       "--datadir=$dir/data" \
+       "--libdir=$dir/src/plugins" \
        CFLAGS="-g -Werror -Wno-unused $CFLAGS" \
        LDFLAGS="-Wl,-z,defs"
index 3552e3053487e8e5d274dbea078defd5db3874b9..84399d487b3b77ed18c58501a6591e5a6bbfcfee 100644 (file)
@@ -8,7 +8,8 @@ bin_PROGRAMS = aweather wsr88ddec
 aweather_SOURCES  = main.c \
        aweather-gui.c      aweather-gui.h \
        aweather-location.c aweather-location.h
-aweather_CPPFLAGS = $(AM_CPPFLAGS) -DDATADIR="\"$(datadir)\""
+aweather_CPPFLAGS = $(AM_CPPFLAGS) \
+                   -DPKGDATADIR="\"$(pkgdatadir)\"" -DPLUGINSDIR="\"$(pkglibdir)\""
 
 wsr88ddec       = wsr88ddec.c
 wsr88ddec_LDADD = -lbz2
@@ -17,10 +18,10 @@ CLEANFILES = gmon.out valgrind.out
 MAINTAINERCLEANFILES = Makefile.in
 
 test: all
-       aweather -o -d 7 -s KVNX
+       .libs/aweather -o -d 7 -s KVNX
 
 gdb: all
-       gdb aweather
+       gdb .libs/aweather
 
 ddd: all
-       ddd aweather
+       ddd .libs/aweather
index 88bd9660601fdafde1ab356913187abec249f259..8edd6938e120d56b6b14972c5051328c3629d8e8 100644 (file)
@@ -452,16 +452,20 @@ static void aweather_gui_init(AWeatherGui *self)
        g_debug("AWeatherGui: init");
 
        /* Simple things */
-       self->prefs   = gis_prefs_new("aweather");
-       self->plugins = gis_plugins_new();
+       gchar *config   = g_build_filename(g_get_user_cache_dir(), "config.ini", NULL);
+       gchar *defaults = g_build_filename(PKGDATADIR, "defaults.ini", NULL);
+       self->prefs   = gis_prefs_new(config, defaults);
+       self->plugins = gis_plugins_new(PLUGINSDIR);
        self->world   = gis_world_new();
        self->view    = gis_view_new();
        self->opengl  = gis_opengl_new(self->world, self->view, self->plugins);
+       g_free(config);
+       g_free(defaults);
 
        /* Setup window */
        self->builder = gtk_builder_new();
        GError *error = NULL;
-       if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.ui", &error))
+       if (!gtk_builder_add_from_file(self->builder, PKGDATADIR "/main.ui", &error))
                g_error("Failed to create gtk builder: %s", error->message);
        gtk_widget_reparent(aweather_gui_get_widget(self, "main_body"), GTK_WIDGET(self));
        GtkWidget *paned = aweather_gui_get_widget(self, "main_paned");
@@ -471,7 +475,7 @@ static void aweather_gui_init(AWeatherGui *self)
        /* Plugins */
        GtkTreeIter iter;
        self->gtk_plugins = GTK_LIST_STORE(aweather_gui_get_object(self, "plugins"));
-       for (GList *cur = gis_plugins_available(); cur; cur = cur->next) {
+       for (GList *cur = gis_plugins_available(self->plugins); cur; cur = cur->next) {
                gchar *name = cur->data;
                gboolean enabled = gis_prefs_get_boolean_v(self->prefs, cur->data, "enabled");
                gtk_list_store_append(self->gtk_plugins, &iter);
index c3718af66288ebe6a88806e14efd3f59569ee857..2dd2031ca40d67e3dd8f6c63dcf15d5bc799dca8 100644 (file)
@@ -3,12 +3,12 @@ AM_CPPFLAGS = $(GIS_CFLAGS)
 AM_LDFLAGS  = -module -avoid-version
 LIBS        = $(GIS_LIBS)
 
-plugindir = $(libdir)/gis
+pluginsdir = $(PLUGINSDIR)
 
-plugin_LTLIBRARIES =
+plugins_LTLIBRARIES =
 
 if HAVE_RSL
-plugin_LTLIBRARIES += radar.la
+plugins_LTLIBRARIES += radar.la
 radar_la_SOURCES = radar.c   radar.h \
        marching.c marching.h \
        radar-colormap.c