[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    Re: [freetds] Bug or not bug?
From:       "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio () vodafone ! com>
Date:       2007-03-29 10:19:20
Message-ID: F7F148C986A2A84F930FEB8C3B169EA002FBCC9A () OPDMEXO01 ! omnitel ! it
[Download RAW message or body]

> > 
> > 
> > I was looking at
> >
> http://sourceforge.net/tracker/index.php?func=detail&aid=16745
> 75&group_i
> > d=33106&atid=407806. I still don't understand if this is wanted or
> > not... from configure --help
> > 
> >   --with-unixodbc=DIR     build odbc driver against unixODBC in
> >   DIR
> > 
> > this tell, "I want to build with unixODBC support with unixODBC
> > installed in DIR" but what does it mean if there is no DIR? "I want
> > unixODBC support"? In this case I think default detection should
> > be used and should produce an error if sql.h/sqlext.h are not found.
> 
> Different bug, IMO.  The option is
> 
> 	--with-unixodbc=DIR
> not
> 	--with-unixodbc[=DIR]
> 
> If possible, configure should break with an error message 
> saying DIR is
> required.  
> 
> I do not think it's helpful to say "--with-unixodbc" by itself.
> Autodetection already builds ODBC if  the headers are found, so
> "--with-unixodbc" would mean "build unixODBC and ignore other DMs you
> happen to find".  If a machine has two DMs installed, the user is
> competent to tell configure which directory has the one he wants.  
> 

I applied this patch

Index: configure.ac
===================================================================
RCS file: /cvsroot/freetds/freetds/configure.ac,v
retrieving revision 1.16
diff -u -1 -0 -r1.16 configure.ac
--- configure.ac        6 Feb 2007 09:18:53 -0000       1.16
+++ configure.ac        29 Mar 2007 10:16:53 -0000
@@ -377,57 +377,66 @@
        AC_DEFINE(TDS50, 1, [Define to use TDS 5.0 by default])
 fi

 AC_ARG_WITH(iodbc,
 AS_HELP_STRING([--with-iodbc=DIR], [build odbc driver against iODBC in
DIR]))
 if test "$with_iodbc"; then
        if echo "$with_iodbc" | grep -v '^/'; then
                with_iodbc="$PWD/$with_iodbc"
        fi
        CPPFLAGS="$CPPFLAGS -DIODBC"
-       ODBC_INC="-I$with_iodbc/include"
+       ODBC_INC="$with_iodbc/include"
+       test -r "$ODBC_INC/isql.h" || AC_ERROR([isql.h not found])
+       test -r "$ODBC_INC/isqlext.h" || AC_ERROR([isqlext.h not found])
+       ODBC_INC="-I$ODBC_INC"
        LDFLAGS="$LDFLAGS -L$with_iodbc/lib"
        ODBCLIB="-liodbc"
        odbc=true
        iodbc=true
 fi

 AC_ARG_WITH(unixodbc,
 AS_HELP_STRING([--with-unixodbc=DIR], [build odbc driver against
unixODBC in DIR]))
 if test "$with_unixodbc"; then
        if echo "$with_unixodbc" | grep -v '^/'; then
                with_unixodbc="$PWD/$with_unixodbc"
        fi
        CPPFLAGS="$CPPFLAGS -DUNIXODBC"
        if test -f "$with_unixodbc/bin/odbc_config"; then
                ODBC_CONFIG="$with_unixodbc/bin/odbc_config"
-               ODBC_INC="-I`$ODBC_CONFIG --include-prefix`"
+               ODBC_INC=`$ODBC_CONFIG --include-prefix`
                LDFLAGS="$LDFLAGS -L`$ODBC_CONFIG --lib-prefix`"
        else
                # if not available do not use system default
                ODBC_CONFIG=""
-               ODBC_INC="-I$with_unixodbc/include"
+               ODBC_INC="$with_unixodbc/include"
                LDFLAGS="$LDFLAGS -L$with_unixodbc/lib"
        fi
+       test -r "$ODBC_INC/sql.h" || AC_ERROR([sql.h not found])
+       test -r "$ODBC_INC/sqlext.h" || AC_ERROR([sqlext.h not found])
+       ODBC_INC="-I$ODBC_INC"
        ODBCLIB="-lodbc"
        odbc=true
        unixodbc=true
 fi

 AC_ARG_WITH(odbc_nodm,
 AS_HELP_STRING([--with-odbc-nodm=DIR], [build odbc without driver
manager (headers in DIR)]))
 if test "$with_odbc_nodm"; then
        if echo "$with_odbc_nodm" | grep -v '^/'; then
                with_odbc_nodm="$PWD/$with_odbc_nodm"
        fi
        CPPFLAGS="$CPPFLAGS -DTDS_NO_DM"
-       ODBC_INC="-I$with_odbc_nodm/include"
+       ODBC_INC="$with_odbc_nodm/include"
+       test -r "$ODBC_INC/sql.h" || AC_ERROR([sql.h not found])
+       test -r "$ODBC_INC/sqlext.h" || AC_ERROR([sqlext.h not found])
+       ODBC_INC="-I$ODBC_INC"
        # The next line is for linking the unittests. Here the ODBC
driver
        #  itself is treated as the driver manager to be linked.
        # Can't use ODBCLIB/LDFLAGS variables since they are used in
building
        #  other directories.
        ODBCNODMLIB="-L.. -ltdsodbc"
        odbc=true
 fi

 build_odbc=yes
 if test "$odbc" != "true"; then

freddy77

_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic