From 49ff13e5e1d15a8bc9dd5e9f1ab852efb8a3c86e Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 1 Feb 1999 23:17:39 +0000 Subject: [PATCH] Pass gthread on to gtk-config. Mon Feb 1 16:47:55 1999 Owen Taylor * gtk.m4: Pass gthread on to gtk-config. * configure.in gtk-config.in: Support gthread flag to add thread cflags/libraries into the output of gtk-config. --- ChangeLog | 8 +++++ ChangeLog.pre-2-0 | 8 +++++ ChangeLog.pre-2-10 | 8 +++++ ChangeLog.pre-2-2 | 8 +++++ ChangeLog.pre-2-4 | 8 +++++ ChangeLog.pre-2-6 | 8 +++++ ChangeLog.pre-2-8 | 8 +++++ configure.in | 17 ++++++++++ gtk-config.in | 78 ++++++++++++++++++++++++++++++++++++---------- gtk.m4 | 11 ++++++- 10 files changed, 144 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a070c104e..a849596cc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4a070c104e..a849596cc5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Feb 1 16:47:55 1999 Owen Taylor + + * gtk.m4: Pass gthread on to gtk-config. + + * configure.in gtk-config.in: Support gthread flag to + add thread cflags/libraries into the output of + gtk-config. + Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): diff --git a/configure.in b/configure.in index 589a55a945..26b52ff343 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,17 @@ # Process this file with autoconf to produce a configure script. AC_INIT(gdk/gdktypes.h) +# In the following, there are a the following variants +# of GLib cflags and libs variables +# +# GLIB_CFLAGS: cflags for compiling libraries and example progs +# GLIB_LIBS: libraries for linking example programs +# GLIB_DEPLIBS: libraries for linking libraries against +# glib_cflags: cflags to store in gtk-config +# glib_libs: libs to store in gtk-config +# glib_thread_cflags: cflags to store in gtk-config for gtk-config gthread +# glib_thread_libs: libs to store in gtk-config for gtk-config gthread + # Save this value here, since automake will set cflags later cflags_set=${CFLAGS+set} @@ -193,7 +204,9 @@ if test x$with_glib = x ; then # we do not want to make all gtk progs to link to thread libraries. glib_cflags=`$GLIB_CONFIG glib gmodule --cflags` + glib_thread_cflags="$GLIB_CFLAGS" glib_libs=`$GLIB_CONFIG glib gmodule --libs` + glib_thread_libs="$GLIB_LIBS" GLIB_LIBS="$glib_libs" GLIB_DEPLIBS="$glib_libs" else @@ -208,7 +221,9 @@ else # For use in gtk-config glib_cflags=`$GLIB_CONFIG --cflags gmodule` + glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread` glib_libs=`$GLIB_CONFIG --libs gmodule` + glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread` glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'` @@ -232,6 +247,8 @@ fi AC_SUBST(glib_cflags) AC_SUBST(glib_libs) +AC_SUBST(glib_thread_cflags) +AC_SUBST(glib_thread_libs) AC_SUBST(GLIB_DEPLIBS) # Find the X11 include and library directories diff --git a/gtk-config.in b/gtk-config.in index f20dd71542..f056c3a423 100644 --- a/gtk-config.in +++ b/gtk-config.in @@ -2,19 +2,36 @@ glib_libs="@glib_libs@" glib_cflags="@glib_cflags@" +glib_thread_libs="@glib_thread_libs@" +glib_thread_cflags="@glib_thread_cflags@" prefix=@prefix@ exec_prefix=@exec_prefix@ exec_prefix_set=no -usage="\ -Usage: gtk-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" +usage() +{ + cat <&2 - exit 1 + usage 1 1>&2 fi +lib_gtk=yes + while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -29,19 +46,51 @@ while test $# -gt 0; do fi ;; --prefix) - echo $prefix + echo_prefix=yes ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) - echo $exec_prefix + echo_exec_prefix=yes ;; --version) echo @GTK_VERSION@ ;; --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + gtk) + lib_gtk=yes + ;; + gthread) + lib_gthread=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes"; then + echo $exec_prefix +fi + +if test "$lib_gthread" = "yes"; then + glib_cflags="$glib_thread_cflags" + glib_libs="$glib_thread_libs" +fi + +if test "$echo_cflags" = "yes"; then if test @includedir@ != /usr/include ; then includes=-I@includedir@ for i in $glib_cflags ; do @@ -51,8 +100,9 @@ while test $# -gt 0; do done fi echo $includes @x_cflags@ $glib_cflags - ;; - --libs) +fi + +if test "$echo_libs" = "yes"; then my_glib_libs= libdirs=-L@libdir@ for i in $glib_libs ; do @@ -64,13 +114,7 @@ while test $# -gt 0; do fi fi done - echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done + + echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm +fi diff --git a/gtk.m4 b/gtk.m4 index 6cce827ea9..9f6b766e12 100644 --- a/gtk.m4 +++ b/gtk.m4 @@ -1,7 +1,7 @@ # Configure paths for GTK+ # Owen Taylor 97-11-3 -dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, @@ -15,6 +15,15 @@ AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) + for module in . $4 + do + case "$module" in + gthread) + glib_config_args="$glib_config_args gthread" + ;; + esac + done + if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then