$NetBSD: patch-aa,v 1.2 2007/04/02 22:38:44 abs Exp $

--- configure.orig	2007-03-04 15:01:22.000000000 +0000
+++ configure
@@ -108,6 +108,9 @@ case "$opt" in
 --with-cxx=*)
     cxx=`echo $opt | cut -d '=' -f 2`
     ;;
+--x11=*)
+    x_base_dirs=`echo $opt | cut -d '=' -f 2`
+    ;;
 esac
 done
 
@@ -278,11 +281,15 @@ EOF
     rm -f $TMPC $TMPE
 fi
 
+if test -z "$x_base_dirs"; then
+    x_base_dirs="
+    /usr
+    /usr/X11R6
+    /usr/local/X11R6
+    $prefix
+    "
+fi
 # check for X11 base dir
-x_base_dirs='
-/usr
-/usr/X11R6
-/usr/local/X11R6'
 for dir in $x_base_dirs; do
     x_include_dir="$dir/include"
     if test -f $x_include_dir/X11/Intrinsic.h; then
@@ -415,6 +422,7 @@ echo "  --with-lib64=NAME           use 
 echo "  --with-biarch               build both 32-bit and 64-bit components at once"
 echo "  --with-cc=CC                use C compiler CC [$cc]"
 echo "  --with-cxx=CXX              use C++ compiler CXX [$cxx]"
+echo "  --x11=PREFIX                use X11 dir"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -458,6 +466,10 @@ if test "$host_os" = "linux"; then
     echo "OS=linux" >> $config_mak
     echo "#define HOST_LINUX 1" >> $config_h
     echo "#define HOST_OS \"linux\"" >> $config_h
+elif test "$host_os" = "dragonfly"; then
+    echo "OS=dragonfly" >> $config_mak
+    echo "#define HOST_DRAGONFLY 1" >> $config_h
+    echo "#define HOST_OS \"dragonfly\"" >> $config_h
 elif test "$host_os" = "freebsd"; then
     echo "OS=freebsd" >> $config_mak
     echo "#define HOST_FREEBSD 1" >> $config_h
