$OpenBSD: patch-Amaya_configure_in,v 1.3 2010/06/06 12:27:26 kili Exp $
--- Amaya/configure.in.orig	Tue Jul  3 13:23:50 2001
+++ Amaya/configure.in	Sat Jun  5 14:30:06 2010
@@ -55,8 +55,8 @@ AC_PATH_PROG(DIFF, diff, /usr/bin/diff, $PATH:/bin:/us
 AC_ARG_WITH(graphic-libs, [  --without-graphic-libs    doesn't use provided libjpeg, libpng.])
 if test "$withval" = "no" ; then
 dnl
-    AC_MSG_CHECKING([for libjpeg version = 6b])
-    AC_EGREP_CPP([x 62 *x],
+    AC_MSG_CHECKING([for libjpeg version = 7])
+    AC_EGREP_CPP([x 70 *x],
         [#include <jpeglib.h>
          x JPEG_LIB_VERSION x],
 dnl
@@ -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"
