summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--Makefile.am21
-rw-r--r--acconfig.h1
-rwxr-xr-xautogen.sh35
-rw-r--r--configure.in112
-rw-r--r--src/Makefile.am19
-rw-r--r--src/glade.h1
-rw-r--r--src/main.c19
8 files changed, 86 insertions, 133 deletions
diff --git a/ChangeLog b/ChangeLog
index d6cdf55c..6ef330ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-08-29 Carlos Perelló Marín <carlos@gnome-db.org>
+
+ * autogen.sh:
+ * configure.in:
+ * Makefile.am: Modified to use the new GNOME 2.0 config stuff.
+ * src/glade.h: Removed a dup "#include <libintl.h>"
+ * src/main.c: Moved the NLS stuff to be the first at main()
+ and added setlocale (LC_ALL, ""); before the bindtextdomain call
+ Now the l10n works!!!! Thanks Martin for your comments ;-)
+ * src/Makefile.am: popt is checked at configure.in
+
2001-08-28 Chema Celorio <chema@celorio.com>
* src/glade-placeholder.c (glade_placeholder_add_with_result): rewrite
diff --git a/Makefile.am b/Makefile.am
index b1c40c7f..d08886a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = macros intl src po pixmaps widgets
+SUBDIRS = src po pixmaps widgets
Developmentdir = $(datadir)/gnome/apps/Development
Development_in_files = glade2.desktop.in
@@ -18,14 +18,17 @@ EXTRA_DIST = \
pixmapsdir = $(datadir)/pixmaps
pixmaps_DATA =
+# Now, we are using pkg-config so, we don't need the m4 macros anymore ;-)
+# I suppose that we could disable this.
+
# Install all the Gnome m4 macros we use to build Glade, so we can copy them
# to each project's directory (for Gnome projects).
-install-data-local:
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/gnome
- $(INSTALL_DATA) $(srcdir)/macros/Makefile.am $(DESTDIR)$(pkgdatadir)/gnome
- $(INSTALL_DATA) $(srcdir)/macros/autogen.sh $(DESTDIR)$(pkgdatadir)/gnome
- for macro_file in $(srcdir)/macros/*.m4; do \
- $(INSTALL_DATA) $$macro_file $(DESTDIR)$(pkgdatadir)/gnome; \
- done
+#install-data-local:
+# @$(NORMAL_INSTALL)
+# $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/gnome
+# $(INSTALL_DATA) $(srcdir)/macros/Makefile.am $(DESTDIR)$(pkgdatadir)/gnome
+# $(INSTALL_DATA) $(srcdir)/macros/autogen.sh $(DESTDIR)$(pkgdatadir)/gnome
+# for macro_file in $(srcdir)/macros/*.m4; do \
+# $(INSTALL_DATA) $$macro_file $(DESTDIR)$(pkgdatadir)/gnome; \
+# done
diff --git a/acconfig.h b/acconfig.h
index 3efe857d..17e48d62 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -6,7 +6,6 @@
#undef PACKAGE
#undef VERSION
#undef GLADE_DEBUG
-#undef GLADE_LOCALE_DIR
#undef GLADE_DATA_DIR
#undef USE_GNOME
#undef USE_GNOME_DB
diff --git a/autogen.sh b/autogen.sh
index 8cda4986..b4fdbb0a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -4,12 +4,39 @@
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
-PKG_NAME="the package."
+PKG_NAME="glade2"
-(test -f $srcdir/configure.in) || {
+(test -f $srcdir/configure.in \
+ && test -f $srcdir/autogen.sh) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level directory"
+ echo " top-level $PKG_NAME directory"
exit 1
}
-. $srcdir/macros/autogen.sh
+DIE=0
+
+# This is a bit complicated here since we can't use gnome-config yet.
+# It'll be easier after switching to pkg-config since we can then
+# use pkg-config to find the gnome-autogen.sh script.
+
+gnome_autogen=
+gnome_datadir=
+
+ifs_save="$IFS"; IFS=":"
+for dir in $PATH ; do
+ test -z "$dir" && dir=.
+ if test -f $dir/gnome-autogen.sh ; then
+ gnome_autogen="$dir/gnome-autogen.sh"
+ gnome_datadir=`echo $dir | sed -e 's,/bin$,/share,'`
+ break
+ fi
+done
+IFS="$ifs_save"
+
+if test -z "$gnome_autogen" ; then
+ echo "You need to install the gnome-common module and make"
+ echo "sure the gnome-autogen.sh script is in your \$PATH."
+ exit 1
+fi
+
+GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen
diff --git a/configure.in b/configure.in
index 5dc3ae0f..3ae8df59 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.52)
AC_INIT(src/glade-widget.c)
AM_INIT_AUTOMAKE(glade2, 0.0.22)
@@ -8,8 +9,8 @@ AM_CONFIG_HEADER(config.h)
AM_PROG_XML_I18N_TOOLS
-dnl Pick up GNOME macros
-AM_ACLOCAL_INCLUDE(macros)
+GNOME_COMMON_INIT
+GNOME_PLATFORM_GNOME_2(yes, force)
AM_PROG_LIBTOOL
@@ -20,108 +21,23 @@ AC_PROG_MAKE_SET
AC_CHECK_HEADERS(os2.h)
-check_program_name="glade2"
-
-dnl ========================================================
-dnl Check for gtk-2.0
-dnl ========================================================
-check_module="gtk+-2.0"
-check_version="1.3.7"
-dnl ====================
-check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-AC_MSG_CHECKING(for $check_module library => $check_version)
-if pkg-config --modversion $check_module > /dev/null 2>&1; then
- vers=`pkg-config --modversion $check_module`
- vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
- if test "$vers_num" -ge "$check_version_num"; then
- AC_MSG_RESULT(found [$vers])
- else
- AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
- fi
- else
- AC_MSG_ERROR(Did not find $check_module installed)
-fi
-modules="$modules $check_module"
-
-dnl ========================================================
-dnl Check for libxml
-dnl ========================================================
-check_module="libxml-2.0"
-check_version="2.3.10"
-dnl ====================
-check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-AC_MSG_CHECKING(for $check_module library => $check_version)
-if pkg-config --modversion $check_module > /dev/null 2>&1; then
- vers=`pkg-config --modversion $check_module`
- vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
- if test "$vers_num" -ge "$check_version_num"; then
- AC_MSG_RESULT(found [$vers])
- else
- AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
- fi
- else
- AC_MSG_ERROR(Did not find $check_module installed)
-fi
-modules="$modules $check_module"
-
-dnl ========================================================
-dnl Check for libgnomeui
-dnl ========================================================
-check_module="libgnomeui-2.0"
-check_version="1.96.88"
-dnl ====================
-if false; then
-check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-AC_MSG_CHECKING(for $check_module library => $check_version)
-if pkg-config --modversion $check_module > /dev/null 2>&1; then
- vers=`pkg-config --modversion $check_module`
- vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
- if test "$vers_num" -ge "$check_version_num"; then
- AC_MSG_RESULT(found [$vers])
- else
- AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
- fi
- else
- AC_MSG_ERROR(Did not find $check_module installed)
-fi
-modules="$modules $check_module"
-fi
-
dnl ================================================================
-dnl Set GLADE_LIBS and GLADE_CFLAGS
+dnl Gettext stuff.
dnl ================================================================
+ALL_LINGUAS="es nn no tr"
+AM_GLIB_GNU_GETTEXT
-GLADE_LIBS=`pkg-config --libs $modules`
-GLADE_CFLAGS=`pkg-config --cflags $modules`
-
+dnl
+dnl Start of pkg-config checks
+dnl
+PKG_CHECK_MODULES(GLADE, gtk+-2.0 >= 1.3.7 libxml-2.0 >= 2.3.10 libgnomeui-2.0 >= 1.96.88)
AC_SUBST(GLADE_LIBS)
AC_SUBST(GLADE_CFLAGS)
+AC_CHECK_LIB(popt, poptStrippedArgv,, AC_MSG_ERROR([popt 1.5 or newer is required to build
+gnome-libs. You can download the latest version from ftp://people.redhat.com/sopwith/popt/]))
-
-
-
-
-
-
-
-
-dnl ================================================================
-dnl Gettext stuff.
-dnl ================================================================
-ALL_LINGUAS="es nn no tr"
-AM_GNU_GETTEXT
-
-dnl Set the location of the locale messages to be used in main.c
-dnl This will substitute GLADE_LOCALE_DIR in config.h (from acconfig.h).
-if test "x$prefix" = "xNONE"; then
- GLADE_LOCALE_DIR=$ac_default_prefix/share/locale
-else
- GLADE_LOCALE_DIR=$prefix/share/locale
-fi
-AC_DEFINE_UNQUOTED(GLADE_LOCALE_DIR, "$GLADE_LOCALE_DIR")
-
dnl ================================================================
dnl GLADE_DATA_DIR - Sets the location of the data directory, where we install
dnl source files added to projects (such as all the Gnome m4 macros).
@@ -157,13 +73,11 @@ AC_SUBST(widgetsdir)
AC_OUTPUT([
Makefile
-macros/Makefile
-intl/Makefile
pixmaps/Makefile
widgets/Makefile
po/Makefile.in
src/Makefile
-],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
+])
echo "
diff --git a/src/Makefile.am b/src/Makefile.am
index f0ce1175..81ef6d30 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,21 +4,20 @@ SUBDIRS=
bin_PROGRAMS = glade2
INCLUDES = \
- -DGLADE_LOCALE_DIR=\""$(datadir)/locale"\" \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
$(GLADE_CFLAGS) \
- -I$(top_srcdir)/intl \
- -I$(top_builddir)/intl
+ -DGLADE_LIBDIR=\""$(libdir)"\" \
+ -DGLADE_DATADIR=\""$(datadir)"\" \
+ -DGLADE_BINDIR=\""$(bindir)"\" \
+ -DGLADE_LOCALSTATEDIR=\""$(localstatedir)"\" \
+ -DGLADE_LOCALEDIR=\""$(datadir)/locale"\" \
+ -DG_LOG_DOMAIN=\"Glade\"
CFLAGS = -g -O2 -Wall
glade2_LDADD = \
- $(GLADE_LIBS) \
- $(INTLLIBS) \
- -lpopt
-## FIXME popt should be added in configure.in and checked for
-
-glade2_DEPENDENCIES = \
- $(INTLLIBS)
+ $(GLADE_LIBS)
glade2_SOURCES = \
main.c \
diff --git a/src/glade.h b/src/glade.h
index 072f4ba7..272e1f3e 100644
--- a/src/glade.h
+++ b/src/glade.h
@@ -3,7 +3,6 @@
#define __GLADE_H__
#include <gtk/gtk.h>
-#include <libintl.h>
/* Borrow from libgnome/libgnome.h */
#ifdef ENABLE_NLS
diff --git a/src/main.c b/src/main.c
index 15e7e904..2c07d8a7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -101,22 +101,23 @@ main (int argc, char *argv[])
poptContext popt_context;
GList *files;
- popt_context = poptGetContext ("Glade2", argc, (const char **) argv, options, 0);
- files = parse_command_line (popt_context);
- poptFreeContext (popt_context);
-
- gtk_init (&argc, &argv);
-
#ifdef ENABLE_NLS
- bindtextdomain (PACKAGE, GLADE_LOCALE_DIR);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, GLADE_LOCALEDIR);
textdomain (PACKAGE);
-#if 0
+#if 0
g_print ("textdomain %s\n", PACKAGE);
- g_print ("localedir %s\n", GLADE_LOCALE_DIR);
+ g_print ("localedir %s\n", GLADE_LOCALEDIR);
g_print (_("Translate me\n"));
#endif
#endif
+
+ popt_context = poptGetContext ("Glade2", argc, (const char **) argv, options, 0);
+ files = parse_command_line (popt_context);
+ poptFreeContext (popt_context);
+ gtk_init (&argc, &argv);
+
if (!glade_init ())
return -1;