]> git.sur5r.net Git - kconfig-frontends/commitdiff
frontends: add gconf
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed, 18 Jan 2012 21:18:31 +0000 (22:18 +0100)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed, 18 Jan 2012 21:18:31 +0000 (22:18 +0100)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
.hgignore
configure.ac
frontends/Makefile.am
frontends/gconf/Makefile.am [new file with mode: 0644]
frontends/gconf/gconf.c

index d6774d6a17df1ab83e6e73550ec6eb623181f509..696c0e3f6d414401f6de7fb11e99912c886ba877 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -5,6 +5,7 @@ syntax: glob
 *.a
 
 frontends/conf/conf
+frontends/gconf/gconf
 frontends/mconf/mconf
 frontends/nconf/nconf
 
index 6c8eb312d335f01b94ef9ca9fd05d85362b987b2..fd4563e515aa84f7cbeb0fdc2020c83f811922bb 100644 (file)
@@ -9,8 +9,8 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([scripts])
 
 # Checks for programs.
-AC_PROG_CXX
 AC_PROG_CC
+AC_PROG_CXX
 AC_PROG_MAKE_SET
 
 # Checks for libraries.
@@ -60,6 +60,12 @@ AC_ARG_ENABLE(
         [--enable-nconf],
         [nconf, the modern ncurses-based frontend (default=yes)])])
 AC_SUBST([enable_nconf], [${enable_nconf:-yes}])
+AC_ARG_ENABLE(
+    [gconf],
+    [AS_HELP_STRING(
+        [--enable-gconf],
+        [gconf, the GTK-based frontend (default=yes)])])
+AC_SUBST([enable_gconf], [${enable_gconf:-yes}])
 
 #----------------------------------------
 # Some program checks
@@ -108,6 +114,15 @@ AS_IF(
     [AC_MSG_ERROR([could not find curses library])])
 
 #----------------------------------------
+# Check headers and libs for gconf
+AS_IF(
+    [test "$enable_gconf" = yes ],
+    [PKG_PROG_PKG_CONFIG()
+     PKG_CHECK_MODULES(
+        [gtk],
+        [gtk+-2.0 gmodule-2.0 libglade-2.0])])
+
+#---------------------------------------------------------------------------
 # Prepare automake
 AM_INIT_AUTOMAKE
 AM_PROG_CC_C_O
@@ -120,6 +135,9 @@ AM_CONDITIONAL(
 AM_CONDITIONAL(
     [COND_nconf],
     [test "$enable_nconf" = "yes"])
+AM_CONDITIONAL(
+    [COND_gconf],
+    [test "$enable_gconf" = "yes"])
 
 #----------------------------------------
 # Finalise
@@ -131,5 +149,6 @@ AC_CONFIG_FILES([
     frontends/conf/Makefile
     frontends/mconf/Makefile
     frontends/nconf/Makefile
+    frontends/gconf/Makefile
 ])
 AC_OUTPUT
index a1121fe786946be86e25bce1dcd13df7fe5205ed..f8f24ab15c2516a91b82a54edebe5231a840314e 100644 (file)
@@ -7,4 +7,7 @@ endif
 if COND_nconf
     MAYBE_nconf = nconf
 endif
-SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf)
+if COND_gconf
+    MAYBE_gconf = gconf
+endif
+SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf) $(MAYBE_gconf)
diff --git a/frontends/gconf/Makefile.am b/frontends/gconf/Makefile.am
new file mode 100644 (file)
index 0000000..76fbf26
--- /dev/null
@@ -0,0 +1,14 @@
+bin_PROGRAMS = gconf
+
+gconf_SOURCES = gconf.c gconf.glade
+dist_EXTRA_gconf_SOURCES = images.c
+gconf_CPPFLAGS = $(AM_CPPFLAGS) \
+                 $(GETTEXT)     \
+                 -I../../parser \
+                 -DGUI_PATH='"$(pkgdatadir)/gconf.glade"'
+gconf_CFLAGS = $(AM_CFLAGS) \
+               $(gtk_CFLAGS)
+gconf_LDADD = $(gtk_LIBS)                   \
+              ../../parser/libkconfigparser.a
+gconfdir = $(pkgdatadir)
+gconf_DATA = gconf.glade
index adc230638c5b141ceaa2cf9b25d35f99324c19b6..d8eb3dda65456a52631fc2863971981c28678373 100644 (file)
@@ -1469,7 +1469,7 @@ int main(int ac, char *av[])
 {
        const char *name;
        char *env;
-       gchar *glade_file;
+       gchar *glade_file = GUI_PATH;
 
        bindtextdomain(PACKAGE, LOCALEDIR);
        bind_textdomain_codeset(PACKAGE, "UTF-8");
@@ -1483,6 +1483,7 @@ int main(int ac, char *av[])
        //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
        //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
 
+#if 0
        /* Determine GUI path */
        env = getenv(SRCTREE);
        if (env)
@@ -1491,6 +1492,7 @@ int main(int ac, char *av[])
                glade_file = g_strconcat(av[0], ".glade", NULL);
        else
                glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
+#endif
 
        /* Conf stuffs */
        if (ac > 1 && av[1][0] == '-') {