Re: odbc patches

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nick Gorham <nick(at)easysoft(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org
Subject: Re: odbc patches
Date: 2000-06-09 16:02:39
Message-ID: 200006091602.MAA00304@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Sorry. Found your nice diff. Applied. Thanks.

> Hello.
>
> I have made the couple of mods required to make the odbc driver with
> postgres build and use unixODBC (http://www.unixodbc.org)
>
> This patch was applied against the postgresql-7.0beta1 build
>
> Any problems let me know.
>
> Nick Gorham

> Only in .: pg-beta-unixODBC.patch
> diff -c -r -p1 ../pgsql/src/configure.in ./src/configure.in
> *** ../pgsql/src/configure.in Mon Feb 21 08:00:25 2000
> --- ./src/configure.in Thu Mar 2 16:42:40 2000
> *************** AC_SUBST(ODBCINSTDIR)
> *** 391,392 ****
> --- 391,434 ----
>
> + #check for unixODBC
> +
> + use_unixODBC=no
> + AC_ARG_WITH(unixODBC,
> + [ --with-unixODBC[=DIR] Use unixODBC located in DIR],
> + [use_unixODBC=yes;unixODBC="$withval"],use_unixODBC=no)
> +
> + if test "x$use_unixODBC" = "xyes"
> + then
> +
> + # default to /usr if not specified
> + if test "x$unixODBC" = "x"
> + then
> + unixODBC="/usr";
> + fi
> +
> + AC_ARG_WITH(unixODBC-includes,
> + [ --with-unixODBC-includes=DIR Find unixODBC headers in DIR],
> + unixODBC_includes="$withval",unixODBC_includes="$unixODBC/include")
> +
> + AC_ARG_WITH(unixODBC-libs,
> + [ --with-unixODBC-libs=DIR Find unixODBC libraries in DIR],
> + unixODBC_libs="$withval",unixODBC_libs="$unixODBC/lib")
> +
> + CPPFLAGS="$CPPFLAGS -I$unixODBC_includes"
> + AC_CHECK_HEADERS(sql.h sqlext.h odbcinst.h,
> + unixODBC_ok=yes;odbc_headers="$odbc_headers $ac_hdr",unixODBC_ok=no; break)
> +
> + if test "x$unixODBC_ok" != "xyes"
> + then
> + AC_MSG_ERROR([Unable to find the unixODBC headers in $1])
> + fi
> +
> + save_LIBS="$LIBS"
> + LIBS="-L$unixODBC_libs $LIBS"
> +
> + AC_CHECK_LIB(odbcinst,SQLGetPrivateProfileString,
> + [AC_DEFINE(HAVE_SQLGETPRIVATEPROFILESTRING)
> + LIBS="$LIBS -lodbcinst"],
> + [LIBS="$save_LIBS"])
> + fi
> +
> dnl Unless we specify the command line options
> diff -c -r -p1 ../pgsql/src/include/config.h.in ./src/include/config.h.in
> *** ../pgsql/src/include/config.h.in Mon Feb 21 08:00:25 2000
> --- ./src/include/config.h.in Thu Mar 2 16:42:58 2000
> ***************
> *** 310,311 ****
> --- 310,314 ----
>
> + /* are we building against a libodbcinst */
> + #undef HAVE_SQLGETPRIVATEPROFILESTRING
> +
> /* Set to 1 if you have <pwd.h> */
> diff -c -r -p1 ../pgsql/src/interfaces/odbc/dlg_specific.c ./src/interfaces/odbc/dlg_specific.c
> *** ../pgsql/src/interfaces/odbc/dlg_specific.c Tue Nov 30 08:00:26 1999
> --- ./src/interfaces/odbc/dlg_specific.c Thu Mar 2 16:43:40 2000
> ***************
> *** 25,28 ****
> --- 25,30 ----
> #include "gpps.h"
> + #ifndef HAVE_SQLGETPRIVATEPROFILESTRING
> #define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
> #define SQLWritePrivateProfileString(a,b,c,d) WritePrivateProfileString(a,b,c,d)
> + #endif
> #ifndef HAVE_STRICMP
> diff -c -r -p1 ../pgsql/src/interfaces/odbc/misc.h ./src/interfaces/odbc/misc.h
> *** ../pgsql/src/interfaces/odbc/misc.h Thu Dec 31 00:26:44 1998
> --- ./src/interfaces/odbc/misc.h Thu Mar 2 16:43:23 2000
> ***************
> *** 17,20 ****
> #ifndef WIN32
> ! #include "gpps.h"
> #define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
> #endif
> --- 17,21 ----
> #ifndef WIN32
> ! #ifndef HAVE_SQLGETPRIVATEPROFILESTRING
> #define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
> + #endif
> #endif

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Karel Zak 2000-06-09 16:04:51 Re: NO-CREATE-TABLE and NO-LOCK-TABLE
Previous Message Bruce Momjian 2000-06-09 15:50:30 Re: NO-CREATE-TABLE and NO-LOCK-TABLE