ports/85586: ports/databases/mdbtools ODBC support
Brian A. Seklecki
lavalamp at spiritual-machines.org
Thu Sep 1 20:20:24 UTC 2005
>Number: 85586
>Category: ports
>Synopsis: ports/databases/mdbtools ODBC support
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Sep 01 20:20:22 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Brian A. Seklecki
>Release: 5.3 RELENG i386
>Organization:
Spiritual, Machines
>Environment:
FreeBSD krok 5.3-RELEASE-p17 FreeBSD 5.3-RELEASE-p17 #0: Tue Jul 5 06:16:28 EDT 2005 root at krok.collaborativefusion.com:/usr/obj/usr/src/sys/KROK i386
>Description:
From: mdbtools-dev at lists.sourceforge.net
> For whatever reason, FreeBSD's ports/mdbtools isn't linking (or even offering
> to link) against unixODBC or iODBC.
>
> I was browsing the list archives and someone hinted that v0.5 is "several
> years" old, but thanks to sf.net's anti-spam measures on list archives, I
> don't have that contact's e-mail.
>
> Anyway, the port lacks a maintainer and if there hasn't been an official
> release in that period, that may explain a great many things.
>
> Anyway, It's hard to believe I'm the first person to try
>
>How-To-Repeat:
If you simply add
CONFIGURE_ARGS+= --with-unixodbc=/usr/local
..to the Makefile, it bombs out when it descends into src/odbc/ with:
Making all in odbc
Error expanding embedded variable.
*** Error code 1
Stop in /usr/ports/databases/mdbtools/work/mdbtools-0.5/src.
*** Error code 1
Stop in /usr/ports/databases/mdbtools/work/mdbtools-0.5.
*** Error code 1
Stop in /usr/ports/databases/mdbtools.
..which is actually it failing on a GNU gmake(1) specific trap. If I
manually gmake(1) in that dir:
$ sudo cd /usr/ports/databases/mdbtools/work/mdbtools-0.5/src/odbc/ &&
sudo gmake
source='odbc.c' object='odbc.lo' libtool=yes \
depfile='.deps/odbc.Plo' tmpdepfile='.deps/odbc.TPlo' \
depmode=gcc3 /bin/sh ../../depcomp \
/bin/sh /usr/local/bin/libtool15 --mode=compile cc -DPACKAGE_NAME=\"\"
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mdbtools\" -DVERSION=\"0.5\"
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
-DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_LIMITS_H=1
-DHAVE_UNISTD_H=1 -DHAVE_WORDEXP_H=1 -DHAVE_READLINE=1 -I. -I. -I
./../include `glib-config --cflags` -O -pipe -march=pentium3 -DSQL
-DUNIXODBC -c -o odbc.lo `test -f 'odbc.c' || echo './'`odbc.c
mkdir .libs
cc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mdbtools\"
-DVERSION=\"0.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DHAVE_DLFCN_H=1 -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1
-DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WORDEXP_H=1 -DHAVE_READLINE=1
-DHAVE_DLFCN_H=1 -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1
-DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WORDEXP_H=1 -DHAVE_READLINE=1
-I. -I. -I ../../include -I/usr/local/include/glib12 -O -pipe
-march=pentium3 -DSQL -DUNIXODBC -c odbc.c -MT odbc.lo -MD -MP -MF
.deps/odbc.TPlo -fPIC -DPIC -o .libs/odbc.o
odbc.c:21:17: sql.h: No such file or directory
odbc.c:22:20: sqlext.h: No such file or directory
odbc.c:39: error: syntax error before "_odbc_get_client_type"
odbc.c:39: warning: data definition has no type or storage class
odbc.c:43: error: syntax error before "SQL_API"
odbc.c:43: error: syntax error before "henv"
odbc.c:43: warning: data definition has no type or storage class
odbc.c:44: error: syntax error before "SQL_API"
..which is obviously a result of it not properly #include'ing
/usr/local/include/sql.h
Anyway, when I fetch mdbtools-0.6pre1.tar.gz, from last year, and manually
roll it with ./configure --prefix=/opt --with-unixodbc=/usr/local, it
compiles /opt/lib/libmdbodbc.0, which I would normally expect to be a *.so
lrwxr-xr-x 1 root wheel 12 Sep 1 14:44 libmdbodbc@ -> libmdbodbc.0
-rwxr-xr-x 1 root wheel 276986 Sep 1 14:44 libmdbodbc.0*
-rw-r--r-- 1 root wheel 407048 Sep 1 14:44 libmdbodbc.a
-rwxr-xr-x 1 root wheel 836 Sep 1 14:44 libmdbodbc.la*
$ ldd /opt/lib/libmdbodbc.0
/opt/lib/libmdbodbc.0:
libglib-2.0.so.600 => /usr/local/lib/libglib-2.0.so.600 (0x2818d000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28214000)
libodbcinst.so.1 => /usr/local/lib/libodbcinst.so.1 (0x28304000)
libintl.so.6 => /usr/local/lib/libintl.so.6 (0x28316000)
>Fix:
The solution is to upgrade the port to 0.6pre1 (0.6 will hopefully be
out soon).
Then add a conditional check for OBDC linkage such as that in the
ports/databases/postgresql-odbc/Makefile :
.if ${DRIVER_MANAGER} == "unixodbc"
PKGNAMESUFFIX= -unixodbc
CONFIGURE_ARGS+= --with-unixodbc
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
.else # assume we're using iodbc
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
CONFIGURE_ARGS+= --with-iodbc
--with-odbcinst=${LOCALBASE}/etc/libiodbc
.endif
...or:
.if defined(WITH_IODBC)
CONFIGURE_ARGS+= --with-iodbc=${PREFIX}
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
.endif
.if defined(WITH_UNIXODBC)
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
CONFIGURE_ARGS+=--with-unixodbc=${PREFIX}
.endif
.if defined(WITH_UNIXODBC) && defined(WITH_IODBC)
.error "iOnly one ODBC driver supported."
.endif
..
~BAS
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list