Skip to Content.
Sympa Menu

freetds - Re: is there an autoconf guru in the house?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Rusty Conover <rconover AT zootweb.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: is there an autoconf guru in the house?
  • Date: 03 Mar 2001 23:51:54 -0700


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




Archive powered by MHonArc 2.6.24.

Top of Page