Description: Use CFLAGS from dap-config as well as LIBS.
Author: Adam Conrad <adconrad@ubuntu.com>

Index: gdal-1.9.0/configure
===================================================================
--- gdal-1.9.0.orig/configure	2013-10-23 15:08:03.000000000 -0600
+++ gdal-1.9.0/configure	2013-10-23 15:09:22.645514158 -0600
@@ -24191,8 +24191,14 @@
     as_fn_error $? "--with-dods-root requires path to dods root as argument" "$LINENO" 5
 else
     DODS_LIB=$with_dods_root/lib
-    DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap -I$with_dods_root/include/dap"
     DODS_BIN=$with_dods_root/bin
+    if test -x $DODS_BIN/opendap-config ; then
+        DODS_INC="`$DODS_BIN/opendap-config --cflags`"
+    elif test -x $DODS_BIN/dap-config ; then
+        DODS_INC="`$DODS_BIN/dap-config --cflags`"
+    else
+        DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap -I$with_dods_root/include/dap"
+    fi
 
 rm -f islibdappost310.*
 echo '#include "Connect.h"' > islibdappost310.cpp
Index: gdal-1.9.0/configure.in
===================================================================
--- gdal-1.9.0.orig/configure.in	2013-10-23 15:08:03.000000000 -0600
+++ gdal-1.9.0/configure.in	2013-10-23 15:08:03.000000000 -0600
@@ -2266,8 +2266,14 @@
     AC_MSG_ERROR([--with-dods-root requires path to dods root as argument])
 else
     DODS_LIB=$with_dods_root/lib
-    DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap -I$with_dods_root/include/dap"
     DODS_BIN=$with_dods_root/bin
+    if test -x $DODS_BIN/opendap-config ; then
+        DODS_INC="`$DODS_BIN/opendap-config --cflags`"
+    elif test -x $DODS_BIN/dap-config ; then
+        DODS_INC="`$DODS_BIN/dap-config --cflags`"
+    else
+        DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap -I$with_dods_root/include/dap"
+    fi
 
 dnl Test if we have libdap >= 3.10
 dnl From libdap 3.10, AISConnect.h has been renamed as Connect.h
