Changeset: 6ce208a41e29 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ce208a41e29
Modified Files:
NT/rules.msc
clients/odbc/driver/Makefile.ag
clients/odbc/samples/Makefile.ag
configure.ag
Branch: Aug2011
Log Message:
The ODBC test programs use the ODBC driver manager, i.e. -lodbc/odbc32.lib.
These programs do not use anything from MonetDB and the MonetDB ODBC
driver. They do use ODBC calls and get them from the ODBC driver.
diffs (106 lines):
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -71,7 +71,8 @@ PTHREAD_INCS =
PTHREAD_LIBS =
!ENDIF
-ODBC_LIBS = odbccp32.lib user32.lib
+ODBCINST_LIBS = odbccp32.lib user32.lib
+ODBC_LIBS = odbc.lib
!IFNDEF PYTHONBASE
PYTHONBASE=C:\Python27
diff --git a/clients/odbc/driver/Makefile.ag b/clients/odbc/driver/Makefile.ag
--- a/clients/odbc/driver/Makefile.ag
+++ b/clients/odbc/driver/Makefile.ag
@@ -117,6 +117,6 @@ lib_MonetODBC = {
SQLTransact.c \
driver.rc \
ODBC.syms
- LIBS = ../../mapilib/libmapi $(LTLIBICONV) $(ODBC_LIBS) $(SOCKET_LIBS)
+ LIBS = ../../mapilib/libmapi $(LTLIBICONV) $(ODBCINST_LIBS)
$(SOCKET_LIBS)
}
diff --git a/clients/odbc/samples/Makefile.ag b/clients/odbc/samples/Makefile.ag
--- a/clients/odbc/samples/Makefile.ag
+++ b/clients/odbc/samples/Makefile.ag
@@ -17,19 +17,11 @@
MTSAFE
-# FIXME: libMonetODBC is actually a module, one cannot link against
-# that on Darwin. We need to properly link against (unix)ODBC and use
-# it's drivermanager which correctly dlopens the MonetODBC module. This
-# requires an odbc.ini file, and testing to be aware of it as well.
-#BINS = {
-# CONDINST = HAVE_TESTING
-# DIR = libdir/monetdb/tests
-# SOURCES = odbcsample1.c testgetinfo.c
-# LIBS = ../driver/libMonetODBC ../../mapilib/libmapi $(curl_LIBS)
-#}
+INCLUDES = $(ODBC_INCS)
-bin_odbctest = {
- COND = NATIVE_WIN32
- SOURCES = odbcsample1.c
- LIBS = -lodbc32
+BINS = {
+ CONDINST = HAVE_TESTING
+ DIR = libdir/monetdb/tests
+ SOURCES = odbcsample1.c testgetinfo.c
+ LIBS = $(ODBC_LIBS)
}
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2095,6 +2095,7 @@ AM_CONDITIONAL(HAVE_SPHINXCLIENT, test x
if test "x$enable_odbc" != xno; then
have_unixodbc=auto
ODBC_INCS=''
+ ODBCINST_LIBS=''
ODBC_LIBS=''
AC_ARG_WITH(unixodbc,
AS_HELP_STRING([--with-unixodbc=DIR],
@@ -2106,6 +2107,7 @@ if test "x$enable_odbc" != xno; then
;;
*)
ODBC_INCS="-I$have_unixodbc/include"
+ ODBCINST_LIBS="-L$have_unixodbc/lib"
ODBC_LIBS="-L$have_unixodbc/lib"
;;
esac
@@ -2118,14 +2120,23 @@ if test "x$enable_odbc" != xno; then
fi
if test "x$have_unixodbc" != xno; then
save_LIBS="$LIBS"
- LIBS="$LIBS $ODBC_LIBS"
+ LIBS="$LIBS $ODBCINST_LIBS"
AC_CHECK_LIB(odbcinst,
SQLGetPrivateProfileString, :,
[if test "x$have_unixodbc" != xauto; then
AC_MSG_ERROR([-lodbcinst not found]); fi; have_unixodbc=no])
LIBS="$save_LIBS"
fi
if test "x$have_unixodbc" != xno; then
- ODBC_LIBS="$ODBC_LIBS -lodbcinst"
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $ODBC_LIBS"
+ AC_CHECK_LIB(odbc,
+ SQLGetDiagRec, :,
+ [if test "x$have_unixodbc" != xauto; then
AC_MSG_ERROR([-lodbc not found]); fi; have_unixodbc=no])
+ LIBS="$save_LIBS"
+ fi
+ if test "x$have_unixodbc" != xno; then
+ ODBCINST_LIBS="$ODBCINST_LIBS -lodbcinst"
+ ODBC_LIBS="$ODBC_LIBS -lodbc"
AC_DEFINE(HAVE_SQLGETPRIVATEPROFILESTRING, 1,
[Define if you have the SQLGetPrivateProfileString
function])
fi
@@ -2152,6 +2163,7 @@ if test "x$enable_odbc" != xno; then
[Define as SQLLEN * or SQLPOINTER depending on the
include file])
fi
AC_SUBST(ODBC_INCS)
+ AC_SUBST(ODBCINST_LIBS)
AC_SUBST(ODBC_LIBS)
case "x${enable_odbc}x${have_unixodbc}" in
xautoxno)
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list