is there an autoconf guru in the house?
Rusty Conover
rconover at zootweb.com
Sun Mar 4 01:51:54 EST 2001
Brian Bruns <camber at ais.org> writes:
> I got the notion to allow the odbc bits to compile with either iODBC or
> unixODBC, so I added two options to configure.in like such:
>
> --
>
> AC_ARG_WITH(iodbc,
> [ --with-iodbc=/path/to/iodbc build odbc driver against iODBC])
> if test "$with_iodbc"; then
> CFLAGS="$CFLAGS -DIODBC";
> ODBC_INC=$with_iodbc/include;
> odbc=true
> fi
>
> AC_ARG_WITH(iodbc,
> [ --with-unixodbc=/path/to/unixodbc build odbc driver against unixODBC])
> if test "$with_unixodbc"; then
> CFLAGS="$CFLAGS -DUNIXODBC"
> ODBC_INC=$with_unixodbc/include
> odbc=true
> fi
> AM_CONDITIONAL(ODBC, test x$odbc = xtrue)
>
> --
>
> So the problem is with AM_CONDITIONAL...running the configure script with
> sh -x configure or sh -x configure --with-iodbc=/usr/local sets ODBC_TRUE
> and ODBC_FALSE as expected. I then added this to the src/Makefile.am
>
> --
> if ODBC
> SUBDIRS = tds ctlib dblib odbc server
> else
> SUBDIRS = tds ctlib dblib server
> endif
>
> --
>
> so that odbc would only get compiled if a driver manager was
> specified. Problem is that 'ODBC' alway evaluates to true. Anyone have
> any clues?
Brian,
Add a line like
AC_SUBST(ODBC)
to configure.in to bring the variable into the Makefile.am when it is
generated.
Then to look at the value of the variable use $(ODBC) in Makefile.am
HTH,
Rusty
--
Rusty Conover
Systems Programmer
Zoot Enterprises Inc, www.zootweb.com
More information about the FreeTDS
mailing list