]> git.sur5r.net Git - openldap/commitdiff
Update SQL detection
authorKurt Zeilenga <kurt@openldap.org>
Sat, 26 Aug 2000 18:59:51 +0000 (18:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 26 Aug 2000 18:59:51 +0000 (18:59 +0000)
configure.in

index fe6f2434d1265cbfe29768221258e38ccb56cddb..ac975ca7a6427de9d39a4195680c0ce5c6640674 100644 (file)
@@ -1706,6 +1706,28 @@ if test $ol_enable_syslog != no ; then
        ol_enable_syslog=$ac_cv_func_openlog
 fi
 
+dnl ----------------------------------------------------------------
+dnl SQL
+ol_link_sql=no
+if test $ol_enable_sql != no ; then
+       AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
+       if test $have_iodbc = yes ; then
+               ol_link_sql="-liodbc"
+       else
+               AC_CHECK_LIB(odbc,SQLDriverConnect,[have_odbc=yes],[have_odbc=no])
+               if test $have_odbc = yes ; then
+                       ol_link_sql="-lodbc"
+               fi
+       fi
+
+       if test $ol_link_sql != no ; then
+               SLAPD_SQL_LIBS="$ol_link_sql"
+
+       elif test $ol_enable_sql != auto ; then
+               AC_MSG_ERROR([could not locate suitable ODBC library])
+       fi
+fi
+
 dnl ----------------------------------------------------------------
 dnl ud needs termcap (should insert check here)
 ol_link_termcap=no
@@ -2156,7 +2178,6 @@ if test "$ol_enable_sql" != no ; then
        AC_DEFINE(SLAPD_SQL,1,[define to support SQL backend])
        BUILD_SLAPD=yes
        BUILD_SQL=yes
-       SLAPD_SQL_LIBS=-liodbc
        if test "$ol_with_sql_module" != static; then
                AC_DEFINE(SLAPD_SQL_DYNAMIC,1,
                        [define to support dynamic SQL backend])