Switch to pkg-config to check for GTK+ 2.0; Removed all
authorMartin Baulig <baulig@suse.de>
Sat, 30 Sep 2000 14:47:31 +0000 (14:47 +0000)
committerMartin Baulig <martin@src.gnome.org>
Sat, 30 Sep 2000 14:47:31 +0000 (14:47 +0000)
2000-09-30  Martin Baulig  <baulig@suse.de>

* gnome-x-checks.m4: Switch to pkg-config to check for GTK+ 2.0;
Removed all `gnome_cv_passdown_x_*' variables and `USE_DEVGTK'.

* gnome-common.m4 (GNOME_COMMON_INIT): Added the always-false
INSIDE_GNOME_COMMON automake conditional.
(GNOME_GTKDOC_CHECK): New macro.
(GNOME_DEBUG_CHECK): New macro.

svn path=/trunk/; revision=1419

macros2/ChangeLog
macros2/gnome-common.m4
macros2/gnome-x-checks.m4

index b246563..d4eb867 100644 (file)
@@ -1,3 +1,13 @@
+2000-09-30  Martin Baulig  <baulig@suse.de>
+
+       * gnome-x-checks.m4: Switch to pkg-config to check for GTK+ 2.0;
+       Removed all `gnome_cv_passdown_x_*' variables and `USE_DEVGTK'.
+
+       * gnome-common.m4 (GNOME_COMMON_INIT): Added the always-false
+       INSIDE_GNOME_COMMON automake conditional.
+       (GNOME_GTKDOC_CHECK): New macro.
+       (GNOME_DEBUG_CHECK): New macro.
+
 Thu Aug 24 02:28:57 2000  George Lebl <jirka@5z.com>
 
        * gnome-x-checks.m4: use the correct name in AC_PROVIDE
index c0dda4d..d229843 100644 (file)
@@ -1,6 +1,5 @@
 # gnome-common.m4
 # 
-# This only for packages that are not in the GNOME CVS tree.
 
 dnl GNOME_COMMON_INIT
 
@@ -16,5 +15,37 @@ AC_DEFUN([GNOME_COMMON_INIT],
        AC_SUBST(GNOME_ACLOCAL_FLAGS)
 
        ACLOCAL="$ACLOCAL $GNOME_ACLOCAL_FLAGS"
+
+       AM_CONDITIONAL(INSIDE_GNOME_DOCU, false)
+])
+
+AC_DEFUN([GNOME_GTKDOC_CHECK],
+[
+       AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
+       AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
+       AC_SUBST(HAVE_GTK_DOC)
+
+       dnl Let people disable the gtk-doc stuff.
+       AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
+
+       if test x$enable_gtk_doc = xauto ; then
+         if test x$GTKDOC = xtrue ; then
+           enable_gtk_doc=yes
+         else
+           enable_gtk_doc=no
+         fi
+       fi
+
+       dnl NOTE: We need to use a separate automake conditional for this
+       dnl       to make this work with the tarballs.
+       AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
 ])
 
+AC_DEFUN([GNOME_DEBUG_CHECK],
+[
+       AC_ARG_ENABLE(debug, [  --enable-debug turn on debugging [default=no]], enable_debug="$enableval", enable_debug=no)
+
+       if test x$enable_debug = xyes ; then
+         AC_DEFINE(GNOME_ENABLE_DEBUG)
+       fi
+])
index 55434be..b5338eb 100644 (file)
@@ -15,38 +15,9 @@ dnl   gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
 dnl
 AC_DEFUN([GNOME2_X_CHECKS],
 [
-       AM_PATH_GTK_2_0(1.3.1,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
-       dnl Hope that GTK_CFLAGS have only -I and -D.  Otherwise, we could
-       dnl   test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
-       dnl
-       dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
-       dnl CPPFLAGS, not CFLAGS
-        CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
-
-        saved_ldflags="$LDFLAGS"
-        LDFLAGS="$LDFLAGS $GTK_LIBS"
-
-       gnome_cv_passdown_x_libs="$GTK_LIBS"
-       gnome_cv_passdown_X_LIBS="$GTK_LIBS"
-       gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
-       gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
-
-        LDFLAGS="$saved_ldflags $GTK_LIBS"
-
-dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
-       USE_DEVGTK=true
-
-dnl    AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
-dnl    AC_EGREP_CPP(answer_affirmatively,
-dnl    [#include <gtk/gtkfeatures.h>
-dnl    #ifdef GTK_HAVE_FEATURES_1_1_0
-dnl       answer_affirmatively
-dnl    #endif
-dnl    ], dev_gtk=yes, dev_gtk=no)
-dnl    if test "$dev_gtk" = "yes"; then
-dnl       USE_DEVGTK=true
-dnl    fi
-dnl    AC_MSG_RESULT("$dev_gtk")
+       PKG_CHECK_MODULES(GTK, gtk+-2.0:1.3.1)
+       AC_SUBST(GTK_CFLAGS)
+       AC_SUBST(GTK_LIBS)
 
        GNOME_HAVE_SM=true
        case "$GTK_LIBS" in