$OpenBSD: patch-configure_in,v 1.3 2004/06/24 16:23:37 marcm Exp $
--- configure.in.orig	Tue May 11 19:43:13 2004
+++ configure.in	Thu Jun 24 10:10:10 2004
@@ -2046,6 +2046,10 @@ AC_ARG_WITH(gtk,
 [  --with-gtk              Use the Gtk toolkit for the user interface.],
   [with_gtk="$withval"; with_gtk_req="$withval"],[with_gtk=yes])
 
+AC_ARG_WITH(gtk2,
+[  --with-gtk2             Use the Gtk2 toolkit for the user interface.],
+  [with_gtk2="$withval"; with_gtk_req2="$withval"],[with_gtk2=no])
+
 # if --with-gtk=/directory/ was specified, remember that directory so that
 # we can also look for the `gtk-config' program in that directory.
 case "$with_gtk" in
@@ -2127,7 +2131,12 @@ if test "$with_gtk" = yes; then
     gtk_path="$foo:$gtk_path"
   fi
 
-  AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
+  # Nifty hack: if we don't specify gtk2 we don't want it.  If gtk2 isn't asked
+  # for specifically, we don't use pkgconfig; therefore we don't pick up gtk2
+  # as gtk2 only uses pkgconfig.
+  if test "$with_gtk2" = yes; then
+    AC_PATH_PROGS(pkg_config, pkg-config,, $gtk_path)
+  fi
 
   if test -n "$pkg_config" ; then
     #
@@ -2179,7 +2188,10 @@ if test "$with_gtk" = yes; then
       fi
     fi
 
-    if test "$have_gtk" = no; then
+    # Nifty hack #2: If we did specify gtk2, don't give us gtk1.  We shouldn't
+    # even be here anymore unless $with_gtk2 == yes, so the gtk1 stuff below
+    # will never get run.
+    if test "$have_gtk" = no -a "$with_gtk2" = no; then
       #
       # we don't have GTK 2.  Let's look for GTK 1.
       #
@@ -2330,7 +2342,7 @@ if test "$with_gtk" = yes; then
 
   fi   # end of {gnome,gtk}-config based tests
 
-  if test "$have_gtk" = yes -a "$have_gtk2" = no; then
+  if test "$have_gnome" = yes -a "$have_gtk2" = no; then
     # check for this function that was not in libcapplet 1.2.
     # (only needed in Gnome/Gtk 1.x, not Gnome/Gtk 2.x)
     AC_CHECK_X_LIB(capplet, capplet_widget_changes_are_immediate,
@@ -2345,7 +2357,7 @@ if test "$with_gtk" = yes; then
       if test "$have_gtk2" = yes; then
         GNOME_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
       else
-        GNOME_DATADIR=`$pkg_config --variable=prefix gtk+`
+        GNOME_DATADIR=`$gtk_config --prefix`
       fi
     else
       GNOME_DATADIR=`$gtk_config --prefix`
@@ -2743,7 +2755,7 @@ if test "$with_gl" = yes; then
     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
     #
     if test "$ac_have_mesa_gl" = yes; then
-      AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-lpthread"], [],)
+      AC_CHECK_LIB(pthread, pthread_create, [GL_LIBS="-pthread"], [],)
     fi
 
 
@@ -3195,6 +3207,7 @@ if test "$with_gdk_pixbuf" = yes; then
   if test "$have_gdk_pixbuf" = yes; then
     INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
     XPM_LIBS="$ac_gdk_pixbuf_config_libs"
+    GTK_LIBS="$GTK_LIBS  $ac_gdk_pixbuf_config_libs"
     AC_DEFINE(HAVE_GDK_PIXBUF)
   else
     have_gdk_pixbuf2=no
@@ -3610,7 +3623,7 @@ fi
 # config files get installed.
 #
 if test -z "$HACK_CONF_DIR" ; then
-  if test -n "$GNOME_DATADIR" ; then
+  if test "x$with_gnome" == "xyes"; then
     HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
   else
     HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
@@ -3634,7 +3647,7 @@ elif test "$have_gtk" = yes; then
     if test "$have_gtk2" = yes; then
       GLADE_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
     else
-      GLADE_DATADIR=`$pkg_config --variable=prefix gtk+`
+      GLADE_DATADIR=`$gtk_config --prefix`
     fi
   else
     GLADE_DATADIR=`$gtk_config --prefix`
@@ -3655,7 +3668,7 @@ elif test "$have_gtk" = yes; then
     if test "$have_gtk2" = yes; then
       PO_DATADIR=`$pkg_config --variable=prefix gtk+-2.0`
     else
-      PO_DATADIR=`$pkg_config --variable=prefix gtk+`
+      PO_DATADIR=`$gtk_config --prefix`
     fi
   else
     PO_DATADIR=`$gtk_config --prefix`
