Integrated ODBC driver into regular build. No more standalone business,

which didn't work anyway. Had to back out unixodbc related patch which
broke the regular ODBC build.
This commit is contained in:
Peter Eisentraut 2000-06-19 16:58:48 +00:00
parent e3b37462c2
commit 81b30f2cb4
19 changed files with 612 additions and 6354 deletions

1193
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -497,99 +497,41 @@ AC_DEFINE_UNQUOTED(PG_KRB_SRVTAB, ["$krb_srvtab"], [The location of the Kerberos
dnl We include odbc support unless we disable it with --with-odbc=false
AC_MSG_CHECKING(setting USE_ODBC)
AC_ARG_WITH(
odbc,
[ --with-odbc build ODBC driver package ],
[
case "$withval" in
y | ye | yes) USE_ODBC=true; AC_MSG_RESULT(enabled) ;;
*) USE_ODBC=false; AC_MSG_RESULT(disabled) ;;
esac
],
[ USE_ODBC=false; AC_MSG_RESULT(disabled) ]
)
export USE_ODBC
dnl
dnl Optionally enable the building of the ODBC driver
dnl
dnl Old option name
if test "x${with_odbc+set}" = xset && test "x${enable_odbc+set}" != xset; then
enable_odbc=$with_odbc
fi
AC_MSG_CHECKING(whether to build the ODBC driver)
AC_ARG_ENABLE(odbc, [ --enable-odbc build the ODBC driver package],
[if test x"$enableval" = x"yes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
AC_SUBST(enable_odbc)
dnl check if we want to use unixODBC to provide access to the odbc.ini
dnl files
use_unixODBC=no
AC_MSG_CHECKING(setting USE_UNIXODBC)
AC_ARG_WITH(
unixODBC,
[ --with-unixODBC[=DIR] Use unixODBC located in DIR],
[
use_unixODBC=yes;
unixODBC="$withval";
USE_ODBC=true;
AC_MSG_RESULT(enabled);
],
[ USE_ODBC=false; use_unixODBC=no; AC_MSG_RESULT(disabled) ]
)
export USE_ODBC
dnl Allow for overriding the default location of the odbcinst.ini
dnl file which is normally ${prefix}/share or ${prefix} if this is
dnl being compiled inside the postgres distribution.
dnl Link in the port and template directories
dnl to help build a "standalone ODBC" tar file
if test "X$USE_ODBC" = "Xtrue"
then
AC_LINK_FILES(src/include/port, src/interfaces/odbc/port)
AC_LINK_FILES(src/makefiles, src/interfaces/odbc/makefiles)
AC_LINK_FILES(src/template, src/interfaces/odbc/template)
AC_LINK_FILES(src/include/config.h, src/interfaces/odbc/config.h)
AC_MSG_CHECKING(setting ODBCINST)
AC_ARG_WITH(
odbcinst,
[ --with-odbcinst=DIR change default directory for odbcinst.ini],
AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst),
AC_DEFINE_UNQUOTED(ODBCINST, ${ODBCINSTDIR}) AC_MSG_RESULT(${ODBCINSTDIR})
)
dnl file which is normally ${datadir} (i.e., ${prefix}/share).
if test x"$enable_odbc" = x"yes" ; then
AC_ARG_WITH(odbcinst, [ --with-odbcinst=DIR default directory for odbcinst.ini [datadir]],
[if test x"$with_odbcinst" = x"yes" || test x"$with_odbcinst" = x"no" ; then
AC_MSG_ERROR([You must supply an argument to the --with-odbcinst option.])
fi
if test "X$with_odbcinst" != "X"
then
ODBCINSTDIR=$with_odbcinst
odbcinst_ini_dir=$withval],
[odbcinst_ini_dir='${datadir}'])
else
odbcinst_ini_dir='${datadir}'
fi
AC_SUBST(ODBCINSTDIR)
AC_SUBST(odbcinst_ini_dir)
#check for unixODBC libs
if test "x$use_unixODBC" = "xyes"
then
# default to /usr/local if not specified
if test "x$unixODBC" = "x"
then
unixODBC="/usr/local";
fi
unixODBC_libs="$unixODBC/lib"
unixODBC_includes="$unixODBC/include"
INCLUDES="$INCLUDES -I$unixODBC_includes"
AC_CHECK_HEADERS(sql.h sqlext.h odbcinst.h,
unixODBC_ok=yes;
odbc_headers="$odbc_headers $ac_hdr",
unixODBC_ok=no )
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_SQL_GET_PRIV_PROFILE)
SHLIB_ODBC="$LDFLAGS_ODBC -L$unixODBC_libs -lodbcinst" ],
[LIBS="$save_LIBS"] )
fi
export SHLIB_ODBC
dnl Unless we specify the command line options
dnl --enable cassert to explicitly enable it
@ -658,8 +600,6 @@ AC_SUBST(DL_LIB)
AC_SUBST(USE_TCL)
AC_SUBST(USE_TK)
AC_SUBST(WISH)
AC_SUBST(USE_ODBC)
AC_SUBST(SHLIB_ODBC)
AC_SUBST(MULTIBYTE)
@ -699,13 +639,16 @@ case "$host_os" in
hpux*)
INSTL_SHLIB_OPTS="-m 555" ;;
esac
AC_SUBST(INSTALL)
AC_SUBST(INSTLOPTS)
AC_SUBST(INSTL_LIB_OPTS)
AC_SUBST(INSTL_SHLIB_OPTS)
AC_SUBST(INSTL_EXE_OPTS)
INSTALL_SHLIB="\${INSTALL} $INST_SHLIB_OPTS"
AC_SUBST(INSTALL_SHLIB)
AC_PROG_AWK
AC_PROG_LEX
@ -788,9 +731,8 @@ AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(values.h)
AC_CHECK_HEADERS(sys/exec.h sys/pstat.h machine/vmparam.h)
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
dnl ODBC headers...
AC_CHECK_HEADERS(sys/param.h pwd.h)
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@ -1241,26 +1183,6 @@ See the file 'config.log' for further diagnostics.])
LDFLAGS="$ice_save_LDFLAGS"
fi
dnl cause configure to recurse into subdirectories with their own configure
dnl Darn, setting AC_CONFIG_SUBDIRS sets a list $subdirs$ in the configure output
dnl file, but then configure doesn't bother using that list. Probably a bug in
dnl this version of autoconf.
dnl So at the moment interfaces/odbc gets configured unconditionally.
dnl - thomas 1998-10-05
#if test "X$USE_ODBC" = "Xtrue"
#then
# AC_CONFIG_SUBDIRS(interfaces/odbc)
#fi
if test "$USE_ODBC" = "true"
then
PWD_INCDIR=no
AC_CHECK_HEADER(pwd.h, PWD_INCDIR=yes)
if test "$PWD_INCDIR" = "no"; then
AC_MSG_WARN(odbc support disabled; pwd.h missing)
USE_ODBC=
fi
AC_SUBST(USE_ODBC)
fi
dnl Output files that are neither makefiles nor shell scripts probably
dnl need fully-expanded substitutions, rather than partial expansions
@ -1304,7 +1226,6 @@ AC_OUTPUT(
src/interfaces/libpgeasy/Makefile
src/interfaces/libpgtcl/Makefile
src/interfaces/odbc/GNUmakefile
src/interfaces/odbc/Makefile.global
src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/src/Makefile

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.79 2000/06/17 00:09:31 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.80 2000/06/19 16:58:35 petere Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
@ -89,10 +89,6 @@ POSTDOCDIR= $(POSTGRESDIR)/doc
# Where the header files necessary to build frontend programs get installed.
HEADERDIR= $(POSTGRESDIR)/include
# Where the ODBC installation-wide configuration file gets installed.
# This needs to be a client-side readable area, so can't go in $PGDATA.
# - thomas 1998-10-05
ODBCINST= $(POSTGRESDIR)
##############################################################################
#

View File

@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure.
*
* $Id: config.h.in,v 1.119 2000/06/17 00:09:56 petere Exp $
* $Id: config.h.in,v 1.120 2000/06/19 16:58:37 petere Exp $
*/
#ifndef CONFIG_H
@ -283,9 +283,6 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* default path for the location of the odbcinst.ini file */
#undef ODBCINST
/* Define if you have the setproctitle function. */
#undef HAVE_SETPROCTITLE
@ -305,9 +302,6 @@
* Block of parameters for the ODBC code.
*/
/* are we building against a libodbcinst */
#undef HAVE_SQLGETPRIVATEPROFILESTRING
/* Set to 1 if you have <pwd.h> */
#undef HAVE_PWD_H

View File

@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/Attic/Makefile.in,v 1.2 2000/06/11 11:39:59 petere Exp $
# $Header: /cvsroot/pgsql/src/interfaces/Attic/Makefile.in,v 1.3 2000/06/19 16:58:43 petere Exp $
#
#-------------------------------------------------------------------------
@ -13,9 +13,10 @@ VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../..
subdir = src/interfaces
USE_TCL = @USE_TCL@
USE_ODBC = @USE_ODBC@
enable_odbc = @enable_odbc@
with_CXX = @with_CXX@
with_perl = @with_perl@
with_python = @with_python@
@ -36,26 +37,28 @@ endif
ifeq ($(with_python), yes)
$(MAKE) -C python $@
endif
ifeq ($(USE_ODBC), true)
ifeq ($(enable_odbc), yes)
$(MAKE) -C odbc $@
endif
distclean maintainer-clean: clean
-$(MAKE) -C perl5 $@
-$(MAKE) -C python $@
-$(MAKE) -C odbc $@
rm -f Makefile \
libpq/Makefile \
ecpg/lib/Makefile \
ecpg/preproc/Makefile \
libpq++/Makefile \
libpgeasy/Makefile \
libpgtcl/Makefile \
odbc/GNUmakefile \
odbc/Makefile.global \
odbc/port \
odbc/makefiles \
odbc/template \
odbc/config.h
libpgtcl/Makefile
.PHONY: all install dep depend clean distclean maintainer-clean
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck

View File

@ -1,43 +0,0 @@
#
#
#
#============ Default for all system ==============
OS = UNX
SHELL = /bin/sh
AR = ar r
DLSUFFIX= so
INCDIR = /include
OBJX =
RANLIB = ranlib
INSTALL = /usr/bin/install
INSTALL_DATA = $(INSTALL) -c -m 644
MKDIR = mkdir
DESTDIR = /usr/local
LIBDIR = /lib
INSTHEADERS = isql.h isqlext.h iodbc.h
DESTLIBDIR = $(DESTDIR)$(LIBDIR)
DESTINCDIR = $(DESTDIR)$(INCDIR)/iodbc
ODBCSYSTEMDIR = /usr/home/gryschuk
# Remove the comment characters from the section you want to
# use below, make sure all other sections are commented out.
#============== Linux ELF =========================
CC = gcc
PIC = -fPIC
CFLAGSX = -g
#CFLAGSX = -g -Wall -DMY_LOG -DQ_LOG
LDFLAGS = -shared
LIBS = -ldl
#============= FreeBSD 2.x ========================
# I don't know if this would work but you can always just try it.
# PIC = -fPIC
# CFLAGSX = -g -Wall
# LDFLAGS = -Bshareable
# LIBS =
#===| end of file 'Config.mk' |===

View File

@ -1,103 +1,64 @@
#-------------------------------------------------------------------------
#
# GNUMakefile.in--
# Build and install psqlodbc (Postgres ODBC driver).
# GNUMakefile.in for psqlodbc (Postgres ODBC driver).
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.15 2000/06/14 02:43:46 momjian Exp $
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.16 2000/06/19 16:58:44 petere Exp $
#
#-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
subdir = src/interfaces/odbc
mkinstalldirs = @mkinstalldirs@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
prefix = @prefix@
datadir = @datadir@
odbcinst_ini_dir = @odbcinst_ini_dir@
includedir = @includedir@
# Shared library parameters
NAME = psqlodbc
SRCDIR= ../..
ODBCSRCDIR= @srcdir@
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 26
SRCDIR= $(top_srcdir)/src
include $(SRCDIR)/Makefile.global
include Version.mk
CFLAGS += -I. @DEFS@ -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
FIND= @find@
# assuming gnu tar and split here
TAR= @tar@
SPLIT= @split@
CFLAGS += -I. @DEFS@
SOURCES = *.c *.h *.in Config.mk \
TODO.txt Version.mk config.guess config.sub configure \
install-sh license.txt notice.txt odbcinst.ini \
psqlodbc.def \
psqlodbc.rc readme.txt
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
environ.o execute.o lobj.o misc.o options.o \
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX)
gpps.o tuple.o tuplelist.o dlg_specific.o
SHLIB_LINK= $(LD_FLAGS)
SHLIB_LINK+= $(SHLIB_ODBC)
# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
.PHONY: install install-ini beforeinstall-headers install-headers
install: all installdirs install-headers install-ini install-lib $(install-shlib-dep)
install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \
install-ini install-lib $(install-shlib-dep)
installdirs:
$(mkinstalldirs) $(includedir)/iodbc $(LIBDIR) $(odbcinst_ini_dir)
$(HEADERDIR) $(LIBDIR) $(ODBCINST):
mkdir -p $@
install-headers: beforeinstall-headers isql.h isqlext.h iodbc.h
$(INSTALL) $(INSTLOPTS) iodbc.h $(HEADERDIR)/iodbc/iodbc.h
$(INSTALL) $(INSTLOPTS) isql.h $(HEADERDIR)/iodbc/isql.h
$(INSTALL) $(INSTLOPTS) isqlext.h $(HEADERDIR)/iodbc/isqlext.h
beforeinstall-headers:
@if [ ! -d $(HEADERDIR)/iodbc ]; then mkdir -p $(HEADERDIR)/iodbc; fi
install-headers: isql.h isqlext.h iodbc.h
$(INSTALL_DATA) $^ $(includedir)/iodbc/
install-ini: odbcinst.ini
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
.PHONY: clean
$(INSTALL_DATA) odbcinst.ini $(odbcinst_ini_dir)
clean: clean-shlib
-rm -f lib$(NAME).a $(OBJS)
rm -f lib$(NAME).a $(OBJS)
.PHONY: distclean
distclean maintainer-clean: clean
rm -f GNUmakefile
distclean: clean
-rm -f config.h GNUmakefile Makefile.global
-rm -f config.cache config.log config.status
ifeq ($(PORTNAME), win)
@if [ $SRCDIR != $ODBCSRCDIR ]; then rm -f template makefiles port; fi
else
@if [ $SRCDIR ne $ODBCSRCDIR ]; then rm -f template makefiles port; fi
endif
.PHONY: standalone
standalone:
@if test "$SRCDIR" = "$ODBCSRCDIR"; then \
echo "****************************************************"; \
echo "Note: This was a standalone installation already"; \
echo "This may produce a slightly inconsistant tar file..."; \
echo "You should use the original tar file instead"; \
echo "****************************************************"; \
fi
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar.gz
$(TAR) -chf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar \
$(SOURCES) -C $(SRCDIR) makefiles template Makefile.shlib
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar
.PHONY: integrated
integrated:
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
$(TAR) -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
@ -105,3 +66,12 @@ depend dep:
ifeq (depend,$(wildcard depend))
include depend
endif
.PHONY: all install installdirs install-headers install-lib install-ini clean distclean maintainer-clean
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck

View File

@ -1,208 +0,0 @@
#----------------------------------------------------------------------------
#
# Makefile.global--
# global configuration for pgsqlodbc (Postgres ODBC driver)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.4 1998/10/19 00:00:49 tgl Exp $
#
# NOTES
# This is derived from the main Postgres makefile.
#
# When running standalone:
# To override the default setting, create a Makefile.custom in this
# directory and put your defines there. (Makefile.custom is included
# near the end of this file). Sometimes, a variable gets set in
# Makefile.global after Makefile.custom has been included, so you can't
# simply set that variable in Makefile.custom. In those cases, there is
# often another variable (like CUSTOM_COPT) that you can set in
# Makefile.custom that influences the later setting of the true variable
# of interest (like CFLAGS) by Makefile.global.
#
#
# If you change any of these defines you probably have to
# make clean; make
# since no dependencies are created for these. (of course you can
# be crafty and check what files really depend on them and just remake
# those).
#
# Before including this file, you must set the SRCDIR variable to the
# path of the top of the Postgres source tree (the directory that
# contains this file).
#
#-------------------------------------------------------------------------
##############################################################################
#
# CONFIGURATION SECTION
#
# Following are settings pertaining to the postgres build and
# installation.
# of the port.
#
# Ignore LINUX_ELF if you're not using Linux. But if you are, and you're
# compiling to a.out (which means you're using the dld dynamic loading
# library), set LINUX_ELF to null in Makefile.custom.
LINUX_ELF= true
#
# Ignore BSD_SHLIB if you're not using one of the BSD ports. But if you
# are, and it's one that doesn't have shared libraries (NetBSD/vax is an
# example of this), set BSD_SHLIB to null in Makefile.custom.
BSD_SHLIB= true
# For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
# and other target destinations are rooted. Of course, each of these is
# changable separately.
POSTGRESDIR=@prefix@
# Where the postgres executables live (changeable by just putting them
# somewhere else and putting that directory in your shell PATH)
BINDIR= $(POSTGRESDIR)/bin
# Where libpsqlodbc.a gets installed. You must put it where your loader will
# look for it if you wish to use the -lpq convention. Otherwise you
# can just put the absolute pathname to the library at the end of your
# command line.
LIBDIR= $(POSTGRESDIR)/lib
## Where the man pages (suitable for use with "man") get installed.
#POSTMANDIR= $(POSTGRESDIR)/man
#
# Where the formatted documents (e.g., the reference manual) get installed.
#POSTDOCDIR= $(POSTGRESDIR)/doc
# Where the header files necessary to build frontend programs get installed.
HEADERDIR= $(POSTGRESDIR)/include
# Where the odbcinst.ini file will be placed
ODBCINST= @ODBCINST@
##############################################################################
#
# FEATURES
#
# To disable a feature, comment out the entire definition
# (that is, prepend '#', don't set it to "0" or "no").
##############################################################################
#
# Installation.
#
# For many ports, INSTALL is overridden below.
INSTALL= @INSTALL@
RANLIB= @RANLIB@
INSTLOPTS= @INSTLOPTS@
INSTL_EXE_OPTS= @INSTL_EXE_OPTS@
INSTL_LIB_OPTS= @INSTL_LIB_OPTS@
INSTL_SHLIB_OPTS= @INSTL_SHLIB_OPTS@
##############################################################################
#
# For building shell scripts:
#
# For many ports, these are overridden below.
# DASH_N is what we put before the text on an echo command when we don't
# want a trailing newline. BACKSLASH_C is what we put at the end of the
# string on a echo command when we don't want a trailing newline. On
# some systems, you do echo -n "no newline after this", while on others
# you do echo "no newline after this\c".
DASH_N= @DASH_N@
BACKSLASH_C= @BACKSLASH_C@
#-------------------------------------------------------------
# See the subdirectory template for default settings for these
#-------------------------------------------------------------
CC= @CC@
AROPT= @AROPT@
CFLAGS= -I$(ODBCSRCDIR) @CPPFLAGS@ @CFLAGS@
CFLAGS_SL= @SHARED_LIB@
LDFLAGS= @LDFLAGS@ @LIBS@
DLSUFFIX= @DLSUFFIX@
LN_S = @LN_S@
##############################################################################
#
# Additional platform-specific settings
#
PORTNAME= @PORTNAME@
ifneq ($(wildcard $(SRCDIR)/Makefile.port), )
include $(SRCDIR)/Makefile.port
endif
##############################################################################
#
# Customization.
#
# This includes local customizations. If we're being built from
# within the Postgres distribution and a Makefile.custom exists
# in the top level Postgres directory it will take precedence
# over any local Makefile.custom in the odbc driver directory.
ifneq ($(wildcard $(SRCDIR)/Makefile.custom), )
include $(SRCDIR)/Makefile.custom
endif
# This goes here so that customization in Makefile.custom is effective
##############################################################################
ifneq ($(CUSTOM_INSTALL),)
INSTALL= $(CUSTOM_INSTALL)
endif
#
# Flags for CC and LD.
##############################################################################
# COPT
#
# COPT is for options that the sophisticated builder might want to vary
# from one build to the next, like options to build Postgres with debugging
# information included. COPT is meant to be set on the make command line,
# for example with the command "make COPT=-g". The value you see set here
# is the default that gets used if the builder does not give a value for
# COPT on his make command.
#
# There is a nonobvious relationship between -O (optimization) and
# -Werror (consider all warnings fatal). On some systems, if you don't
# optimize, you will always get some warnings because the system header
# files will include some unreferenced functions in the code. These are
# functions that are supposed to be inline, so there wouldn't ordinarily
# be an "unreferenced" problem, but if you don't enable optimization, no
# inlining can happen, and hence the problem. Therefore, we include
# if you override -O, you override -Werror as well.
#
# CUSTOM_COPT is something the user may set in Makefile.custom
# Common values for COPT are: -g for debuggable binaries, -m486 if you are
# using a i486 or better.
ifneq ($(CUSTOM_CC),)
CC= $(CUSTOM_CC)
endif
ifneq ($(CUSTOM_COPT),)
COPT= $(CUSTOM_COPT)
endif
ifeq ($(CC), gcc)
CFLAGS+= -Wall -Wmissing-prototypes
endif
ifdef COPT
CFLAGS+= $(COPT)
endif

View File

@ -1,5 +0,0 @@
VERSION = 0.26
EXTVER = .0
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 26

View File

@ -1,2 +0,0 @@
/* default path for the location of the odbcinst.ini file */
#undef ODBCINST

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* default path for the location of the odbcinst.ini file */
#undef ODBCINST
/* Define if you have the stricmp function. */
#undef HAVE_STRICMP
/* Define if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the c library (-lc). */
#undef HAVE_LIBC
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,332 +0,0 @@
dnl psqlodbc standalone configuration.
dnl Process this file with autoconf to produce a configure script.
dnl Confirm that this is being run from the ODBC source directory,
dnl and halt if not...
AC_INIT(bind.c)
AC_PREFIX_DEFAULT(/usr/local)
echo "*** configuring psqlodbc ***"
if test -d ../../interfaces
then
echo "psqlodbc can be configured either standalone or integrated"
echo "into the Postgres main distribution."
echo "It appears that you are running the standalone configure"
echo "from within the main distribution. The recommended (and required)"
echo "procedure is to configure ODBC using the integrated configuration"
echo "procedure using the --with-odbc option."
exit
fi
TEMPLATEDIR=./template
if test "$prefix" = "NONE"
then
if test -d "/share"
then
ODBCINST=/share/odbcinst.ini
else
ODBCINST=/etc/odbcinst.ini
fi
else
ODBCINST=$prefix/odbcinst.ini
fi
AC_CANONICAL_HOST
case "$host_os" in
solaris*)
case "$host_cpu" in
sparc) os=solaris_sparc ;;
i386) os=solaris_i386 ;;
esac ;;
sunos*) os=sunos4 ;;
aux*) os=aux ;;
linux*) os=linux ;;
bsdi*) os=bsdi ;;
freebsd*|netbsd*|openbsd*) os=bsd ;;
dgux*) os=dgux ;;
aix*) os=aix ;;
nextstep*) os=nextstep ;;
ultrix*) os=ultrix4 ;;
irix*) os=irix5 ;;
hpux*) os=hpux ;;
osf*) os=alpha ;;
sco*) os=sco ;;
machten*) os=machten ;;
cygwin*) os=win ;;
sysv4.2*)
case "$host_vendor" in
univel) os=univel ;;
*) os=unknown ;;
esac ;;
sysv4*) os=svr4 ;;
*) echo ""
echo "*************************************************************"
echo "configure does not currently recognize your operating system,"
echo "therefore you must do a manual configuration of:"
echo "$host_os"
echo "Please contact scrappy@hub.org to see about rectifying this, "
echo "including the above 'checking host system type...' line "
echo "*************************************************************"
echo ""
exit;;
esac
PORTNAME=${os}
AC_LINK_FILES(makefiles/Makefile.${os}, Makefile.port)
echo "checking echo setting..."
if echo '\c' | grep -s c >/dev/null 2>&1
then
ECHO_N="echo -n"
ECHO_C=""
else
ECHO_N="echo"
ECHO_C='\c'
fi
dnl cat <<EOT
dnl **************************************************************
dnl Postodbc v0.0250 Installation Program
dnl
dnl Welcome to the new improved Postodbc installation program.
dnl This configuration program is for version 0.0250 of the
dnl Postodbc software.
dnl
dnl EOT
dnl this part selects the template from the one in the
dnl template directory.
dnl if test "X$with_template" != "X"
dnl then
dnl TEMPLATE=template/$with_template
dnl else
dnl TEMPLATE=DO_NOT_CHANGE_THIS_INVALID_FILENAME
dnl fi
AC_MSG_CHECKING(setting template to)
AC_ARG_WITH(template,
[ --with-template=TEMPLATE
use operating system template file; see template directory],
[ TEMPLATE=$withval ],
[ host_no_ver=`echo "$host" | sed 's/[[0-9.]]*$//'`
GUESS=`grep "$host_no_ver" $TEMPLATEDIR/.similar | sed 's/.*=//' | tail -1`
if test "$GUESS"
then TEMPLATE="$GUESS"
else TEMPLATE=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
fi
])
AC_MSG_RESULT($TEMPLATE)
if test ! -d "$TEMPLATEDIR"
then
cat << EOT
**************************************************************
You seem to be missing the template directory needed by
configure. If you just copied the source from the Postgres
distribution you should instead have issued the command
'make standalone' which would have built a distribution
containing the necessary template directory. The other
option is that your trying to build from the source
which is meant to be placed in the Postgres distribution
directory 'interfaces/odbc'. Depending on your case either get the
standalone source from the following Web site:
www.insightdist.com/psqlodbc/
or issue the 'make standalone' command from the
'interfaces/odbc' directory of your Postgres Distribution,
or copy the distribution file you have to your Postgres
distribution's 'interfaces/odbc' directory and try
again.
If neither of these is the case than please complain
kindly to the maintainers; their e-mail addresses can
be found in the Readme files.
*************************************************************
EOT
exit
else
if test ! -f "$TEMPLATEDIR/$TEMPLATE"
then
cat <<EOT
Please select a template from the ones listed below. If no
template is available, then select the 'generic' one and
consider emailling scrappy@hub.org with the above line which
starts 'checking host system type...'
**************************************************************
EOT
TEMPLATE=generic
GUESS=`grep "^$host_no_ver=" $TEMPLATEDIR/.similar 2>/dev/null`
if test ! "$GUESS"
then host_no_ver=`echo "$host" | sed 's/[[0-9.]]*$//'`
GUESS=`grep "$host_no_ver" $TEMPLATEDIR/.similar 2>/dev/null`
fi
if test "$GUESS"
then
TEMPLATE=`echo $GUESS | sed 's/.*=//'`
fi
export TEMPLATE
ls $TEMPLATEDIR
echo "**************************************************************"
$ECHO_N "Appropriate template file { $TEMPLATE }: $ECHO_C"
read a
if test "$a." != "."
then
TEMPLATE=$a
fi
if test ! -f $TEMPLATEDIR/$TEMPLATE
then
echo "You must choose an appropriate template file."
exit
fi
fi
fi
TEMPLATE=$TEMPLATEDIR/$TEMPLATE
export TEMPLATE
echo ""
AROPT=`grep '^AROPT:' $TEMPLATE | awk -F: '{print $2}'`
SHARED_LIB=`grep '^SHARED_LIB:' $TEMPLATE | awk -F: '{print $2}'`
CFLAGS=`grep '^CFLAGS:' $TEMPLATE | awk -F: '{print $2}'`
SRCH_INC=`grep '^SRCH_INC:' $TEMPLATE | awk -F: '{print $2}'`
SRCH_LIB=`grep '^SRCH_LIB:' $TEMPLATE | awk -F: '{print $2}'`
DLSUFFIX=`grep '^DLSUFFIX:' $TEMPLATE | awk -F: '{print $2}'`
DL_LIB=`grep '^DL_LIB:' $TEMPLATE | awk -F: '{print $2}'`
CC=`grep '^CC:' $TEMPLATE | awk -F: '{print $2}'`
LIBS=`grep '^LIBS:' $TEMPLATE | awk -F: '{print $2}'`
a=$SRCH_INC
CPPFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-I\1@; s@ \([[^ ]]\)@ -I\1@g'`
export CPPFLAGS
echo "- setting CPPFLAGS=$CPPFLAGS"
a=$SRCH_LIB
LDFLAGS=`echo "$a" | sed 's@ *@ @g; s@^\([[^ ]]\)@-L\1@; s@ \([[^ ]]\)@ -L\1@g'`
export LDFLAGS
echo "- setting LDFLAGS=$LDFLAGS"
dnl Allow for overriding the default location of the odbcinst.ini
dnl file which is normally ${prefix}/share or ${prefix} if this is
dnl being compiled inside the postgres distribution.
AC_MSG_CHECKING(setting ODBCINST)
AC_ARG_WITH(
odbcinst,
[ --with-odbcinst=<pathname>
change default directory for odbcinst.ini ],
AC_DEFINE_UNQUOTED(ODBCINST, ${with_odbcinst}) AC_MSG_RESULT($with_odbcinst),
AC_DEFINE_UNQUOTED(ODBCINST, /etc/odbcinst.ini) AC_MSG_RESULT(${ODBCINST})
)
AC_SUBST(ODBCINST)
if test "X$with_compiler" != "X"
then
CC=$with_compiler
else
AC_PROG_CC
fi
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CPP
AC_SUBST(PORTNAME)
AC_SUBST(LDFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(AROPT)
AC_SUBST(SHARED_LIB)
AC_SUBST(CFLAGS)
AC_SUBST(DLSUFFIX)
AC_SUBST(DL_LIB)
INSTALLPATH="`echo /usr/ucb:$PATH | sed 's/:/ /g'`"
AC_PATH_PROGS(INSTALL, ginstall installbsd bsdinst scoinst install, NONE, $INSTALLPATH )
if test $INSTALL = "NONE"
then
echo "- No Install Script found - aborting."
exit 0;
fi
INSTLOPTS="-m 444"
INSTL_EXE_OPTS="-m 555"
INSTL_LIB_OPTS="-m 644"
INSTL_SHLIB_OPTS="-m 644"
dnl HPUX wants shared libs to be mode 555.
case "$host_os" in
hpux*)
INSTL_SHLIB_OPTS="-m 555" ;;
esac
dnl These flavors of install need -c to install by copy rather than move.
dnl install by move is fatal because it removes stuff from the source tree!
case "`basename $INSTALL`" in
install|installbsd|scoinst|install-sh)
INSTLOPTS="-c $INSTLOPTS"
INSTL_EXE_OPTS="-c $INSTL_EXE_OPTS"
INSTL_LIB_OPTS="-c $INSTL_LIB_OPTS"
INSTL_SHLIB_OPTS="-c $INSTL_SHLIB_OPTS";;
esac
echo "- Using $INSTALL"
AC_SUBST(INSTALL)
AC_SUBST(INSTLOPTS)
AC_SUBST(INSTL_LIB_OPTS)
AC_SUBST(INSTL_SHLIB_OPTS)
AC_SUBST(INSTL_EXE_OPTS)
dnl Check the option to echo to inhibit newlines.
ECHO_N_OUT=`echo -n "" | wc -c`
ECHO_C_OUT=`echo "\c" | wc -c`
if test "$ECHO_N_OUT" -eq 0; then
DASH_N='-n'
BACKSLASH_C=
else
if test "ECHO_C_OUT" -eq 0; then
DASH_N=
BACKSLASH_C='\\\\c'
else
AC_MSG_ERROR("echo behaviour undetermined")
fi
fi
AC_SUBST(DASH_N)
AC_SUBST(BACKSLASH_C)
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PATH_PROG(find, find)
AC_PATH_PROG(tar, tar)
AC_PATH_PROG(split,split)
AC_CHECK_LIB(c, main)
AC_CHECK_LIB(m, main)
AC_CHECK_LIB(dl, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/param.h pwd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Check for any "odd" conditions
dnl Checks for library functions.
AC_CHECK_FUNCS(stricmp)
dnl Check for X libraries
dnl Check for X library
AC_OUTPUT(GNUmakefile Makefile.global)

View File

@ -21,16 +21,14 @@
#endif
#ifndef WIN32
#include <string.h>
#include "gpps.h"
#ifndef HAVE_SQL_GET_PRIV_PROFILE
#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
#define stricmp(s1,s2) strcasecmp(s1,s2)
#define strnicmp(s1,s2,n) strncasecmp(s1,s2,n)
#endif
# include <string.h>
# include "gpps.h"
# 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)
# ifndef HAVE_STRICMP
# define stricmp(s1,s2) strcasecmp(s1,s2)
# define strnicmp(s1,s2,n) strncasecmp(s1,s2,n)
# endif
#endif
#include "dlg_specific.h"

View File

@ -31,18 +31,17 @@
/* INI File Stuff */
#ifndef WIN32
#define ODBC_INI ".odbc.ini"
#ifdef ODBCINST
#define xstr(s) str(s)
#define str(s) #s
#define ODBCINST_INI xstr(ODBCINST) "/odbcinst.ini"
#else
#define ODBCINST_INI "/etc/odbcinst.ini"
#endif
#else
#define ODBC_INI "ODBC.INI" /* ODBC initialization file */
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */
#endif
# define ODBC_INI ".odbc.ini"
# ifdef ODBCINSTDIR
# define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini"
# else
# define ODBCINST_INI "/etc/odbcinst.ini"
# warning "location of odbcinst.ini file defaulted to /etc"
# endif
#else /* WIN32 */
# define ODBC_INI "ODBC.INI" /* ODBC initialization file */
# define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */
#endif /* WIN32 */
#define INI_DSN DBMS_NAME /* Name of default Datasource in ini file (not used?) */

View File

@ -1,250 +0,0 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View File

@ -16,10 +16,8 @@
#ifndef WIN32
#include "gpps.h"
#ifndef HAVE_SQL_GET_PRIV_PROFILE
#define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
#endif
#endif
#include <stdio.h>