Compiling Pango/GTK+/ATK with -D_REENTRANT but without -lgthread
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: Gtk Development List <gtk-devel-list gnome org>, Owen Taylor <otaylor redhat com>
- Subject: Compiling Pango/GTK+/ATK with -D_REENTRANT but without -lgthread
- Date: Wed, 30 May 2001 15:48:41 +0200
Hi,
currently pango builds without -D_REENTRANT, whereas atk and gtk+ build with
-D_REENTRANT, but also with -lgthread. Both are wrong. In general a library
should be compiled with -D_REENTRANT but without -lgthread. Because that's
what we did for gtk+-1.2, I suppose, that this is just a lapse.
Now there are 3 possibilities to solve that:
1.) Replace the search for GLib in pango/atk/gtk+ by
AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
AC_MSG_ERROR([get a grip]),
gobject gmodule)
GLIB_CFLAGS = `$PKG_CONFIG --cflags gobject-2.0 gmodule-2.0 \
gthread-2.0`
This is ugly, because here we write gobject and later gobject-2.0. So
I wouldn't call this a nice solution.
2.) Make @G_THREAD_CFLAGS@ (normally -D_REENTRANT) mandatory for
GLIB_FLAGS. That would make sense for libraries, might however not fit
applications too well. Then we could simply write
AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
AC_MSG_ERROR([get a grip]),
gobject gmodule)
3.) Add an extra argument to AM_PATH_GTK_2_0 and AM_PATH_GLIB_2_0 to pass
over additional modules for GTK_CFLAGS resp. GLIB_CFLAGS. That would
allow us to write
AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
AC_MSG_ERROR([get a grip]),
gobject gmodule, gthread)
All in all this seems to be the best solution to me. A patch to
glib/m4macros/glib-2.0.m4 is appended to demostrate, what I mean.
If you approve any of the latter 2 variants, I would take care of changing
things accordingly in glib/gtk+/atk and pango.
Bye,
Sebastian
--
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
Index: m4macros/glib-2.0.m4
===================================================================
RCS file: /cvs/gnome/glib/m4macros/glib-2.0.m4,v
retrieving revision 1.5
diff -u -b -B -r1.5 glib-2.0.m4
--- m4macros/glib-2.0.m4 2001/04/17 00:55:34 1.5
+++ m4macros/glib-2.0.m4 2001/05/30 13:47:05
@@ -1,7 +1,7 @@
# Configure paths for GLIB
# Owen Taylor 1997-2001
-dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES [, ADDITIONAL MODULES FOR GLIB_CFLAGS]]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
dnl gthread is specified in MODULES, pass to pkg-config
dnl
@@ -12,22 +12,40 @@
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
, enable_glibtest=yes)
- pkg_config_args=glib-2.0
+ pkg_config_args_libs=glib-2.0
for module in . $4
do
case "$module" in
gmodule)
- pkg_config_args="$pkg_config_args gmodule-2.0"
+ pkg_config_args_libs="$pkg_config_args_libs gmodule-2.0"
;;
gobject)
- pkg_config_args="$pkg_config_args gobject-2.0"
+ pkg_config_args_libs="$pkg_config_args_libs gobject-2.0"
;;
gthread)
- pkg_config_args="$pkg_config_args gthread-2.0"
+ pkg_config_args_libs="$pkg_config_args_libs gthread-2.0"
;;
esac
done
+ pkg_config_args_cflags=$pkg_config_args_libs
+
+ for module in . $5
+ do
+ case "$module" in
+ gmodule)
+ pkg_config_args_cflags="$pkg_config_args_cflags gmodule-2.0"
+ ;;
+ gobject)
+ pkg_config_args_cflags="$pkg_config_args_cflags gobject-2.0"
+ ;;
+ gthread)
+ pkg_config_args_cflags="$pkg_config_args_cflags gthread-2.0"
+ ;;
+ esac
+ done
+
+
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
min_glib_version=ifelse([$1], ,1.3.3,$1)
@@ -46,8 +64,8 @@
fi
if test x"$no_glib" = x ; then
- GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
- GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+ GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args_cflags`
+ GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args_libs`
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]