$OpenBSD: patch-Amaya_configure_in,v 1.2 2003/12/20 01:17:43 espie Exp $
--- Amaya/configure.in.orig	2001-07-03 13:23:50.000000000 +0200
+++ Amaya/configure.in	2003-12-20 02:05:54.000000000 +0100
@@ -69,8 +69,8 @@ dnl
         )
 dnl    
 dnl
-    AC_MSG_CHECKING([for libpng version = 1.0.x])
-    AC_EGREP_CPP([x \"1.0\..*\" *x],
+    AC_MSG_CHECKING([for libpng version = 1.2.x])
+    AC_EGREP_CPP([x \"1.2\..*\" *x],
         [#include <png.h>
 	x PNG_LIBPNG_VER_STRING x],
 dnl
@@ -232,43 +232,32 @@ AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mkdir mktime putenv select socket strdup strerror strftime strstr strtod strtol uname lstat strcasecmp strncasecmp strchr memcpy)
 
 GTK_OPTIONS=
-AC_ARG_WITH(gtk, [  --with-gtk              use GTK instead of Motif])
-if test "$withval" = "yes" ; then
-  for ac_dir in               \
-    /usr/lib/glib/include     \
-    /usr/X11R6/include        \
-                              \
-    /usr/include/X11R6        \
-    /usr/local/X11R6/include  \
-    /usr/local/include/X11R6  \
-                              \
-    /usr/X11/include          \
-    /usr/include/X11          \
-    /usr/local/X11/include    \
-    /usr/local/include/X11    \
-                              \
-    /usr/X386/include         \
-    /usr/x386/include         \
-    /usr/XFree86/include/X11  \
-    /usr/dt/include           \
-    /usr/include              \
-    /usr/local/include        \
-    /usr/local/lib/glib/include  \
-    ; \
-  do
-    if test -r "$ac_dir/gdk/gdk.h"; then
-      no_gtk= ac_gtk_includes=$ac_dir
-      break
-    fi
-  done
+
+motif_includes_with=
+AC_ARG_WITH(motif-includes,
+[  --with-motif-includes=DIR
+                          Motif include files are in DIR],
+motif_includes_with="$withval")
+motif_libraries_with=
+AC_ARG_WITH(motif-libraries,
+[  --with-motif-libraries=DIR
+                          Motif libraries are in DIR],
+motif_libraries_with="$withval")
+
+AC_ARG_WITH(gtk, [  --with-gtk              use GTK instead of Motif],
+	use_gtk="$withval")
+no_gtk=yes
+if test "$use_gtk" != "no" ; then
 
 GTK_INCLUDES="`gtk-config --cflags`"
 AC_SUBST(GTK_INCLUDES)
 GTK_LIBRARIES="`gtk-config --libs` -lgdk_imlib -ltiff -lgif"
 AC_SUBST(GTK_LIBRARIES)
 GTK_OPTIONS=-D_GTK
+  no_gtk=no
   no_motif=yes
 else
+
 dnl
 dnl Checking for Motif libraries and includes
 dnl
@@ -281,6 +270,7 @@ AC_DEFUN(AC_PATH_MOTIF_DIRECT,
 test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
 test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
   for ac_dir in               \
+    $motif_includes_with      \
     /usr/include/Motif1.2     \
     /usr/Motif1.2/include     \
                               \
@@ -335,6 +325,7 @@ ac_save_LIBS="$LIBS"
 LIBS="-l$motif_direct_test_library $LIBS"
 # First see if replacing the include by lib works.
 for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
+    $motif_libraries_with \
     /usr/lib/Motif1.2     \
     /usr/Motif1.2/lib     \
                           \
@@ -744,21 +735,23 @@ if test "$build_amaya" = "yes" ; then
     fi
 fi
 
-if test "$no_motif" = yes ; then
-    echo "Motif seems not installed on this machine"
-    echo "Amaya need Motif 1.2 or 2.0"
-else
-if test "$motif_includes" = "" ; then
-    echo "Motif includes were not found"
-    echo "Amaya might not compile"
-    echo "Edit your Option file"
-else
-if test "$motif_libraries" = "" ; then
-    echo "Motif libraries were not found"
-    echo "Amaya might not compile"
-    echo "Edit your Option file"
-fi
-fi
+if test "$no_gtk" = yes ; then
+	if test "$no_motif" = yes ; then
+	    echo "Motif seems not installed on this machine"
+	    echo "Amaya need Motif 1.2 or 2.0"
+	else
+	if test "$motif_includes" = "" ; then
+	    echo "Motif includes were not found"
+	    echo "Amaya might not compile"
+	    echo "Edit your Option file"
+	else
+	if test "$motif_libraries" = "" ; then
+	    echo "Motif libraries were not found"
+	    echo "Amaya might not compile"
+	    echo "Edit your Option file"
+	fi
+	fi
+	fi
 fi
 
 echo "Now start \"make all\" (GNU make preferably) to build the bianries"
