Commit 5edecc74 authored by Carlos Perell Marn's avatar Carlos Perell Marn Committed by Carlos Perelló Marín
Browse files

Modified to use the new GNOME 2.0 config stuff. Removed a dup "#include

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
parent 7c29c80d
2001-08-29 Carlos Perell Marn <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> 2001-08-28 Chema Celorio <chema@celorio.com>
* src/glade-placeholder.c (glade_placeholder_add_with_result): rewrite * src/glade-placeholder.c (glade_placeholder_add_with_result): rewrite
......
## Process this file with automake to produce Makefile.in ## 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 Developmentdir = $(datadir)/gnome/apps/Development
Development_in_files = glade2.desktop.in Development_in_files = glade2.desktop.in
...@@ -18,14 +18,17 @@ EXTRA_DIST = \ ...@@ -18,14 +18,17 @@ EXTRA_DIST = \
pixmapsdir = $(datadir)/pixmaps pixmapsdir = $(datadir)/pixmaps
pixmaps_DATA = 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 # Install all the Gnome m4 macros we use to build Glade, so we can copy them
# to each project's directory (for Gnome projects). # to each project's directory (for Gnome projects).
install-data-local: #install-data-local:
@$(NORMAL_INSTALL) # @$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/gnome # $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/gnome
$(INSTALL_DATA) $(srcdir)/macros/Makefile.am $(DESTDIR)$(pkgdatadir)/gnome # $(INSTALL_DATA) $(srcdir)/macros/Makefile.am $(DESTDIR)$(pkgdatadir)/gnome
$(INSTALL_DATA) $(srcdir)/macros/autogen.sh $(DESTDIR)$(pkgdatadir)/gnome # $(INSTALL_DATA) $(srcdir)/macros/autogen.sh $(DESTDIR)$(pkgdatadir)/gnome
for macro_file in $(srcdir)/macros/*.m4; do \ # for macro_file in $(srcdir)/macros/*.m4; do \
$(INSTALL_DATA) $$macro_file $(DESTDIR)$(pkgdatadir)/gnome; \ # $(INSTALL_DATA) $$macro_file $(DESTDIR)$(pkgdatadir)/gnome; \
done # done
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#undef PACKAGE #undef PACKAGE
#undef VERSION #undef VERSION
#undef GLADE_DEBUG #undef GLADE_DEBUG
#undef GLADE_LOCALE_DIR
#undef GLADE_DATA_DIR #undef GLADE_DATA_DIR
#undef USE_GNOME #undef USE_GNOME
#undef USE_GNOME_DB #undef USE_GNOME_DB
......
...@@ -4,12 +4,39 @@ ...@@ -4,12 +4,39 @@
srcdir=`dirname $0` srcdir=`dirname $0`
test -z "$srcdir" && srcdir=. 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 -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level directory" echo " top-level $PKG_NAME directory"
exit 1 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
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
AC_INIT(src/glade-widget.c) AC_INIT(src/glade-widget.c)
AM_INIT_AUTOMAKE(glade2, 0.0.22) AM_INIT_AUTOMAKE(glade2, 0.0.22)
...@@ -8,8 +9,8 @@ AM_CONFIG_HEADER(config.h) ...@@ -8,8 +9,8 @@ AM_CONFIG_HEADER(config.h)
AM_PROG_XML_I18N_TOOLS AM_PROG_XML_I18N_TOOLS
dnl Pick up GNOME macros GNOME_COMMON_INIT
AM_ACLOCAL_INCLUDE(macros) GNOME_PLATFORM_GNOME_2(yes, force)
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
...@@ -20,108 +21,23 @@ AC_PROG_MAKE_SET ...@@ -20,108 +21,23 @@ AC_PROG_MAKE_SET
AC_CHECK_HEADERS(os2.h) 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 ================================================================
dnl Set GLADE_LIBS and GLADE_CFLAGS dnl Gettext stuff.
dnl ================================================================ dnl ================================================================
ALL_LINGUAS="es nn no tr"
AM_GLIB_GNU_GETTEXT
GLADE_LIBS=`pkg-config --libs $modules` dnl
GLADE_CFLAGS=`pkg-config --cflags $modules` 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_LIBS)
AC_SUBST(GLADE_CFLAGS) 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 ================================================================
dnl GLADE_DATA_DIR - Sets the location of the data directory, where we install 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). dnl source files added to projects (such as all the Gnome m4 macros).
...@@ -157,13 +73,11 @@ AC_SUBST(widgetsdir) ...@@ -157,13 +73,11 @@ AC_SUBST(widgetsdir)
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
macros/Makefile
intl/Makefile
pixmaps/Makefile pixmaps/Makefile
widgets/Makefile widgets/Makefile
po/Makefile.in po/Makefile.in
src/Makefile src/Makefile
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) ])
echo " echo "
......
...@@ -4,21 +4,20 @@ SUBDIRS= ...@@ -4,21 +4,20 @@ SUBDIRS=
bin_PROGRAMS = glade2 bin_PROGRAMS = glade2
INCLUDES = \ INCLUDES = \
-DGLADE_LOCALE_DIR=\""$(datadir)/locale"\" \ -I$(top_srcdir) \
-I$(top_builddir) \
$(GLADE_CFLAGS) \ $(GLADE_CFLAGS) \
-I$(top_srcdir)/intl \ -DGLADE_LIBDIR=\""$(libdir)"\" \
-I$(top_builddir)/intl -DGLADE_DATADIR=\""$(datadir)"\" \
-DGLADE_BINDIR=\""$(bindir)"\" \
-DGLADE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-DGLADE_LOCALEDIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"Glade\"
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall
glade2_LDADD = \ glade2_LDADD = \
$(GLADE_LIBS) \ $(GLADE_LIBS)
$(INTLLIBS) \
-lpopt
## FIXME popt should be added in configure.in and checked for
glade2_DEPENDENCIES = \
$(INTLLIBS)
glade2_SOURCES = \ glade2_SOURCES = \
main.c \ main.c \
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#define __GLADE_H__ #define __GLADE_H__
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libintl.h>
/* Borrow from libgnome/libgnome.h */ /* Borrow from libgnome/libgnome.h */
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
......
...@@ -101,22 +101,23 @@ main (int argc, char *argv[]) ...@@ -101,22 +101,23 @@ main (int argc, char *argv[])
poptContext popt_context; poptContext popt_context;
GList *files; 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 #ifdef ENABLE_NLS
bindtextdomain (PACKAGE, GLADE_LOCALE_DIR); setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GLADE_LOCALEDIR);
textdomain (PACKAGE); textdomain (PACKAGE);
#if 0 #if 0
g_print ("textdomain %s\n", PACKAGE); 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")); g_print (_("Translate me\n"));
#endif #endif
#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 ()) if (!glade_init ())
return -1; return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment