-dnl ODBC objects are Unix only
-if test "$TOOLKIT" != "MSW" -a "$wxUSE_ODBC" = "yes" ; then
- ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)"
+
+dnl ----------------------------------------------------------------
+dnl iODBC support
+dnl ----------------------------------------------------------------
+
+IODBC_C_SRC=""
+
+
+dnl ODBC is handled seperately for MSW
+if test "$TOOLKIT" != "MSW" ; then
+
+ if test "$wxUSE_ODBC" != "no" ; then
+ AC_DEFINE(wxUSE_ODBC)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
+
+ dnl is this still necessary in 2.5?
+ WXODBCFLAG="-D_IODBC_"
+
+
+ if test "$wxUSE_ODBC" = "sys" ; then
+ dnl This is not ideal we really ough to use the unixodbc-config
+ dnl or iodbc-config if they exist.
+
+ AC_CHECK_HEADER(sql.h)
+ AC_SEARCH_LIBS(SQLAllocEnv,iodbc unixodbc odbc , , [
+ wxUSE_ODBC=builtin;
+ AC_MSG_WARN( [ can't find system Odbc library falling back to builtin ])
+ ] )
+ fi
+ dnl Not "no" either...
+ if test "$wxUSE_ODBC" != "sys" ; then
+ ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)"
+ fi
+
+ fi
+