Package: unixodbc
Version: 2.2.4-11
Severity: important
Tags: patch
When the unixodbc package is built, the SHLIBEXT C pre-processor macro
is not defined. (I believe this is because the libltdl library is
intentionally not built by the Debian package, although I haven't tested
this hypothesis.) The lack of definition may be seen in the buildd logs
by searching for "SHLIBEXT":
http://buildd.debian.org/fetch.php?&pkg=unixodbc&ver=2.2.4-11&arch=i386&stamp=1097873269&file=log&as=raw
Because SHLIBEXT is not set, code in DriverManager/SQLConnect.c attempts
to load a file named "/usr/lib/libodbccr.1" at runtime (which obviously
doesn't exist) instead of "/usr/lib/libodbccr.so.1". I ran into this
while trying to configure phpbb2 to connect to a SQL Server 2000
database via ODBC. The initial error looked like this:
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open
cursor lib 'libodbccr' : /usr/lib/libodbccr.1: cannot open shared object
file: No such file or directory, SQL state 01000 in SQLConnect in
/usr/share/phpbb2/site/db/mssql-odbc.php on line 54
The attached patch fixes the build-time issue by modifying configure.in
and configure to simply use the $shrext variable which is set for all
configurations anyway. This forces SHLIBEXT to be defined during build
time. (NOTE: I tried re-running autoconf[2.*], but unixodbc has trouble
finding X libraries while running "configure" after doing this.)
Alas, this change did not fix the problem I was seeing with phpbb2. :(
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27-2-386
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages unixodbc depends on:
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii libltdl3 1.5.6-6 A system independent dlopen wrappe
ii libncurses5 5.4-4 Shared libraries for terminal hand
ii libreadline4 4.3-11 GNU readline and history libraries
ii odbcinst1 2.2.4-11 Support library and helper program
-- no debconf information
diff -urN unixodbc-2.2.4-11.orig/configure unixodbc-2.2.4/configure
--- unixodbc-2.2.4-11.orig/configure 2005-08-23 18:22:19.000000000 -0500
+++ unixodbc-2.2.4/configure 2005-08-23 18:29:13.000000000 -0500
@@ -19261,31 +19261,31 @@
subdirs="$subdirs libltdl"
-echo "$as_me:$LINENO: checking which extension is used for shared libraries"
>&5
-echo $ECHO_N "checking which extension is used for shared libraries...
$ECHO_C" >&6
-if test "${libltdl_cv_shlibext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_last=
- for ac_spec in $library_names_spec; do
- ac_last="$ac_spec"
- done
- echo "$ac_last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
-fi
-echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5
-echo "${ECHO_T}$libltdl_cv_shlibext" >&6
-if test -n "$libltdl_cv_shlibext"; then
-cat >>confdefs.h <<_ACEOF
-#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext"
-_ACEOF
-fi
-SHLIBEXT="$libltdl_cv_shlibext"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+SHLIBEXT="$shrext"
if test "x$iconv" = "xtrue";
diff -urN unixodbc-2.2.4-11.orig/configure.in unixodbc-2.2.4/configure.in
--- unixodbc-2.2.4-11.orig/configure.in 2005-08-23 18:22:19.000000000 -0500
+++ unixodbc-2.2.4/configure.in 2005-08-23 18:30:04.000000000 -0500
@@ -111,8 +111,7 @@
AC_CONFIG_SUBDIRS(libltdl)
dnl Find shared lib extension
-AC_LTDL_SHLIBEXT
-SHLIBEXT="$libltdl_cv_shlibext"
+SHLIBEXT="$shrext"
AC_SUBST(SHLIBEXT)
if test "x$iconv" = "xtrue";