[PATCH] mc CVS port to glib 2.0
- From: Ali Akcaagac <ali akcaagac stud fh-wilhelmshaven de>
- To: mc-devel gnome org
- Subject: [PATCH] mc CVS port to glib 2.0
- Date: 12 Sep 2002 14:52:15 +0200
hello,
not long ago i was requesting here on this mailinglist, that mc should
support glib 2.0. i still recall the replies i got e.g. that for a
future comming mc it may be planned to add glib as library within mc so
it compiles against it and make the dependency of an external glib not
necessary. or that a lot of people still use glib 1.x and want to stay
on it. etc.
so far so good:
please allow me to point out some advantages of using glib 2.0 in hope i
can get some positive feedback for this idea. you know that many
people are using gnome 2.0 nowadays and they would like to see a glib
2.0 supporting mc that can be easily compiled on their system e.g. some
of them like me prefer compiling stuff from CVS. right now as is, mc
requires that these people still install glib 1.x besides their glib 2.x
system. this is for sure no big deal but the problems are starting with
gettext. as you know many gnome 2.0 and gtk 2.0 related material can't
be compiled using gettext below 0.11.x anymore. this causes a lot of
problems for them. now the problem for us is that we need to tweak
gettext 0.10.x on our system so we can get the gettext stuff compiled.
that is removing gettext 0.11.x and installing gettext 0.10.x and then
after it is configured we removed the old gettext again and install the
new one.
the advantage of using glib 2.x is it makes the requirement of using
AM_GNU_GETTEXT obsolete you can replace it by using AM_GLIB_GNU_GETTEXT
and use the functions provided by glib 2.0 for the future it is easier
having a unified system that works with all kind of gettext versions.
right now you need to deal with older and newer gettext, need to have a
lot of checks in the autogen.sh file and probably some workarounds etc.
i personally don't know how the maintainer likes to see the future of
mc. i probably think he/she likes to have it independant of other stuff
as much as possible so the idea comes close to embedd the glib library
into mc's sourcecode. but please if you do so, then it may be more
interesting to get glib 2.0 into it since it supports all these nice
gettext stuff. this makes maintaining of mc much easier because you
don't need to deal with gettext anymore.
please allow me to show you this patch that i wrote today. it still
causes some minor issues during the compile time with some 'getopt'
thingies that i haven't figured out yet. but i hope that someone could
help me or explain me what this was meant to be so i can solve the last
minor issue.
the patch ports mc to glib 2.0 in a sane correct way and it ports
gettext support to glib gettext. it is possible for someone who runs
glib 2.0, gtk 2.0 or gnome 2.0 to configure mc without the need of an
older glib 1.x or older gettext versions.
by the way, it's not needed to port mc to glib 2.0 if you don't like but
please at least help me getting this easy patch that far that it
compiles mc successfully. i am willing to keep that patch in sync to mc
for the future (to some sort of point) so those who don't like to have
the old glib 1.x installed to be able to use it with glib 2.0. i think
the minor issue is easy to fix, somehow i must have missed some minor
issue.
--
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali akcaagac stud fh-wilhelmshaven de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
diff -ruN mc-cvs/Makefile.am mc/Makefile.am
--- mc-cvs/Makefile.am 2002-02-22 07:45:10.000000000 +0100
+++ mc/Makefile.am 2002-09-12 14:25:19.000000000 +0200
@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = 1.5
-SUBDIRS = intl po vfs slang edit src lib doc syntax pc
+SUBDIRS = po vfs slang edit src lib doc syntax pc
EXTRA_DIST = FAQ INSTALL.FAST MAINTAINERS \
README.PC README.QNX extraconf.h
diff -ruN mc-cvs/autogen.sh mc/autogen.sh
--- mc-cvs/autogen.sh 2002-07-28 08:39:48.000000000 +0200
+++ mc/autogen.sh 2002-09-12 14:25:19.000000000 +0200
@@ -4,9 +4,11 @@
# Make it possible to specify path in the environment
: ${AUTOCONF=autoconf}
: ${AUTOHEADER=autoheader}
-: ${AUTOMAKE=automake}
-: ${ACLOCAL=aclocal}
-: ${GETTEXTIZE=gettextize}
+: ${AUTOMAKE=automake-1.6}
+: ${ACLOCAL=aclocal-1.6}
+: ${GLIBGETTEXTIZE=glib-gettextize}
+: ${INTLTOOLIZE=intltoolize}
+: ${LIBTOOLIZE=libtoolize}
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
@@ -14,82 +16,9 @@
(
cd $srcdir
-# The autoconf cache (version after 2.52) is not reliable yet.
-rm -rf autom4te.cache vfs/samba/autom4te.cache
-
-if test ! -d config; then
- mkdir config || exit 1
-fi
-
-# Ensure that gettext is reasonably new.
-gettext_ver=`$GETTEXTIZE --version | sed -n '1s/\.//g;1s/.* //;1s/^\(...\)$/\100/;1s/^\(...\)\(.\)$/\10\2/;1p'`
-if test $gettext_ver -lt 01038; then
- echo "Don't use gettext older than 0.10.38" 2>&1
- exit 1
-fi
-
-rm -rf intl
-if test $gettext_ver -ge 01100; then
- $GETTEXTIZE --copy --force --intl --no-changelog >tmpout || exit 1
- if test -e Makefile.am~; then
- rm -rf Makefile.am
- mv Makefile.am~ Makefile.am
- fi
- if test -e configure.in~ ; then
- rm -rf configure.in
- mv configure.in~ configure.in
- fi
- for i in po/Rules-quot po/boldquot.sed po/en boldquot header \
- po/en quot header po/insert-header.sin po/quot.sed \
- po/remove-potcdate.sin po/Makefile.in.in
- do
- if diff -s $i $i~ >/dev/null 2>&1 ; then
- mv $i~ $i
- fi
- done
- # Does we need po/Makevars.in and family for gettext 0.11 ?
- if test ! -e po/Makevars; then
- cat > po/Makevars <<\EOF
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ../config
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-EOF
- fi
-else
- $GETTEXTIZE --copy --force >tmpout || exit 1
- if test -e po/ChangeLog~; then
- rm -f po/ChangeLog
- mv po/ChangeLog~ po/ChangeLog
- fi
-fi
-
-rm -f aclocal.m4
-if test -f `aclocal --print-ac-dir`/gettext.m4; then
- : # gettext macro files are available to aclocal.
-else
- # gettext macro files are not available.
- # Find them and copy to a local directory.
- # Ugly way to parse the instructions gettexize gives us.
- m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`"
- fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'`
- rm -rf gettext.m4
- mkdir gettext.m4
- for i in $m4files; do
- cp -f $fromdir/$i gettext.m4
- done
- ACLOCAL_INCLUDES="-I gettext.m4"
-fi
-
-rm -f tmpout
-
-# Some old version of GNU build tools fail to set error codes.
-# Check that they generate some of the files they should.
+$GLIBGETTEXTIZE --copy --force || exit 1
+$INTLTOOLIZE --copy --force --automake || exit 1
+$LIBTOOLIZE --copy --force || exit 1
$ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1
test -f aclocal.m4 || \
diff -ruN mc-cvs/configure.in mc/configure.in
--- mc-cvs/configure.in 2002-09-07 09:52:24.000000000 +0200
+++ mc/configure.in 2002-09-12 14:25:40.000000000 +0200
@@ -5,7 +5,7 @@
AC_INIT([GNU Midnight Commander], [], [mc-devel gnome org])
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(src/main.c)
-AC_CONFIG_AUX_DIR(config)
+dnl AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(mc, 4.6.0-pre1a)
AM_CONFIG_HEADER(config.h)
@@ -19,21 +19,16 @@
AC_PROG_CC_STDC
+AC_PROG_LIBTOOL
+AC_PROG_INTLTOOL
dnl
-dnl Find glib 1.2.x. This check should be kept close to the beginning,
-dnl as it tends to fail often.
+dnl Find glib 2.x.
dnl
-
-dnl This temporary variable is a workaround for a bug in Autoconf-2.53
-glib_path=$PATH:/usr/local/bin
-
-dnl Klugde for FreeBSD, where glib-config is renamed to glib12-config.
-AC_PATH_PROGS([GLIB_CONFIG], [glib-config glib12-config],,[$glib_path])
-
-AC_ARG_VAR([GLIB_CONFIG], [Path to glib-config])
-AM_PATH_GLIB(1.2.0,,[AC_MSG_ERROR([Test for GLIB failed. MC requires GLIB.])])
-AC_SUBST(GLIB_LIBS)
+pkg_modules="glib-2.0"
+PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
+AC_SUBST(PACKAGE_CFLAGS)
+AC_SUBST(PACKAGE_LIBS)
AC_HEADER_MAJOR
@@ -65,17 +60,14 @@
esac])
AC_FUNC_MMAP
-if test "x$ALL_LINGUAS" = x; then
-ALL_LINGUAS="az be bg ca cs da de el es es_ES eu fi fr hu it ja ko lv nl no pl pt pt_BR ro ru sk sl sv uk ta tr wa zh_CN zh_TW"
-fi
-
dnl
dnl Internationalization
dnl
-AM_GNU_GETTEXT
-if test "x$USE_INCLUDED_LIBINTL" = xyes; then
- CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
-fi
+GETTEXT_PACKAGE=mc
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Needed for glib gettext])
+ALL_LINGUAS="az be bg ca cs da de el es es_ES eu fi fr hu it ja ko lv nl no pl pt pt_BR ro ru sk sl sv uk ta tr wa zh_CN zh_TW"
+AM_GLIB_GNU_GETTEXT
dnl
dnl Hack to make extraconf.h visible even if compiling outside srcdir.
@@ -731,7 +723,7 @@
doc/pl/mc.1 doc/pl/Makefile
doc/ru/mc.1 doc/ru/Makefile
-intl/Makefile po/Makefile.in
+po/Makefile.in
])
AC_CONFIG_COMMANDS(potfiles,
diff -ruN mc-cvs/edit/Makefile.am mc/edit/Makefile.am
--- mc-cvs/edit/Makefile.am 2001-09-07 23:24:11.000000000 +0200
+++ mc/edit/Makefile.am 2002-09-12 14:25:19.000000000 +0200
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(GLIB_CFLAGS)
+AM_CFLAGS = $(PACKAGE_CFLAGS)
if USE_EDIT
noinst_LIBRARIES = libedit.a
diff -ruN mc-cvs/slang/Makefile.am mc/slang/Makefile.am
--- mc-cvs/slang/Makefile.am 2002-01-21 08:52:46.000000000 +0100
+++ mc/slang/Makefile.am 2002-09-12 14:25:19.000000000 +0200
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(GLIB_CFLAGS)
+AM_CFLAGS = $(PACKAGE_CFLAGS)
if INCLUDED_SLANG
noinst_LIBRARIES = libmcslang.a
diff -ruN mc-cvs/src/Makefile.am mc/src/Makefile.am
--- mc-cvs/src/Makefile.am 2002-09-03 19:58:26.000000000 +0200
+++ mc/src/Makefile.am 2002-09-12 14:25:19.000000000 +0200
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(GLIB_CFLAGS)
+AM_CFLAGS = $(PACKAGE_CFLAGS)
AM_CPPFLAGS = -DLIBDIR=\""$(mclibdir)/"\" -DLOCALEDIR=\""$(localedir)"\"
mclibdir = $(libdir)/mc
@@ -36,7 +36,7 @@
endif
mc_LDADD = $(EDITLIB) $(SLANGLIB) $(VFSLIB) \
- $(INTLLIBS) $(GLIB_LIBS) $(MCLIBS) $(LIBICONV)
+ $(INTLLIBS) $(PACKAGE_LIBS) $(MCLIBS) $(LIBICONV)
CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h
diff -ruN mc-cvs/vfs/Makefile.am mc/vfs/Makefile.am
--- mc-cvs/vfs/Makefile.am 2002-09-03 19:58:27.000000000 +0200
+++ mc/vfs/Makefile.am 2002-09-12 14:25:19.000000000 +0200
@@ -7,9 +7,9 @@
DIST_SUBDIRS = extfs
if USE_SAMBA_FS
-AM_CFLAGS = $(GLIB_CFLAGS) -DCONFIGDIR=\""@configdir@"\"
+AM_CFLAGS = $(PACKAGE_CFLAGS) -DCONFIGDIR=\""@configdir@"\"
else
-AM_CFLAGS = $(GLIB_CFLAGS)
+AM_CFLAGS = $(PACKAGE_CFLAGS)
endif
BASICFILES = \
@@ -102,7 +102,7 @@
mcserv_SOURCES = mcserv.c tcputil.c
-mcserv_LDADD = $(PAMLIBS) $(LCRYPT) $(GLIB_LIBS)
+mcserv_LDADD = $(PAMLIBS) $(LCRYPT) $(PACKAGE_LIBS)
SAMBA_DIST = \
Makefile.in \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]