Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1eab86e

Browse files
author
Thomas G. Lockhart
committed
Update source code to Byron's v6.30.0250 sources plus minor cleanup
to get rid of unused variables. Get clean compile on Linux (Thomas and Gerald). Implement autoconf/configure for standalone builds and use the existing autoconf/configure system when in the Postgres source tree. Code tests and functions with ApplixWare-4.4.1beta on a Linux box. Changes should be backward compatible with WIN32 but still needs testing.
1 parent dfde7f1 commit 1eab86e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6089
-1000
lines changed

src/interfaces/odbc/Config.mk

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#
32
#
43
#

src/interfaces/odbc/GNUmakefile.in

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# Makefile.inc--
4+
# Build and install postgres.
5+
#
6+
# Copyright (c) 1994, Regents of the University of California
7+
#
8+
#
9+
# IDENTIFICATION
10+
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.1 1998/10/06 05:57:56 thomas Exp $
11+
#
12+
#-------------------------------------------------------------------------
13+
@SET_MAKE@
14+
15+
NAME = psqlodbc
16+
SRCDIR=@srcdir@
17+
ODBCSRCDIR=@srcdir@
18+
include $(ODBCSRCDIR)/Makefile.global
19+
20+
include Version.mk
21+
PORTNAME= @PORTNAME@
22+
23+
FIND = @find@
24+
25+
# assuming gnu tar and split here
26+
TAR = @tar@
27+
SPLIT = @split@
28+
29+
ifeq ($(PORTNAME), linux)
30+
install-shlib-dep := install-shlib
31+
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
32+
LDFLAGS_SL = -shared -soname lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
33+
LDFLAGS_SL += -Bsymbolic $(LDFLAGS) -lc -lm
34+
CFLAGS += -I. $(CFLAGS_SL)
35+
endif
36+
37+
ifeq ($(PORTNAME), bsd)
38+
ifdef BSD_SHLIB
39+
install-shlib-dep := install-shlib
40+
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
41+
LDFLAGS_SL = -x -Bshareable -Bforcearchive $(LDFLAGS)
42+
CFLAGS += -I. $(CFLAGS_SL)
43+
endif
44+
endif
45+
46+
SOURCES = *.c *.h *.in Config.mk Makefile Makefile.unx README.Linux \
47+
TODO.txt Version.mk config.guess config.sub configure \
48+
install-sh license.txt notice.txt odbcinst.ini patch \
49+
psqlodbc.aps psqlodbc.def psqlodbc.mak psqlodbc.mdp \
50+
psqlodbc.ncb psqlodbc.rc readme.txt
51+
52+
OBJECTS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
53+
environ.o execute.o lobj.o misc.o options.o \
54+
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
55+
gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX)
56+
57+
CFLAGS += @DEFS@
58+
59+
all: libpsqlodbc.a $(shlib)
60+
61+
libpsqlodbc.a: $(OBJECTS)
62+
$(AR) $(AROPT) libpsqlodbc.a $(OBJS)
63+
$(RANLIB) libpsqlodbc.a
64+
65+
$(shlib): $(OBJECTS)
66+
$(LD) $(LDFLAGS_SL) $(OBJECTS) \
67+
-o $(shlib) $(LIBS)
68+
69+
.PHONY: beforeinstall-headers
70+
71+
.PHONY: install
72+
73+
install: $(HEADERDIR) $(LIBDIR) $(ODBCINST) install-headers \
74+
install-libpsqlodbc install-ini $(install-shlib-dep)
75+
76+
$(HEADERDIR) $(LIBDIR) $(ODBCINST):
77+
mkdir -p $@
78+
79+
install-headers: beforeinstall-headers isql.h isqlext.h iodbc.h
80+
$(INSTALL) $(INSTLOPTS) iodbc.h $(HEADERDIR)/iodbc/iodbc.h
81+
$(INSTALL) $(INSTLOPTS) isql.h $(HEADERDIR)/iodbc/isql.h
82+
$(INSTALL) $(INSTLOPTS) isqlext.h $(HEADERDIR)/iodbc/isqlext.h
83+
84+
beforeinstall-headers:
85+
@if [ ! -d $(HEADERDIR)/iodbc ]; then mkdir -p $(HEADERDIR)/iodbc; fi
86+
87+
install-libpsqlodbc: libpsqlodbc.a
88+
$(INSTALL) $(INSTL_LIB_OPTS) libpsqlodbc.a $(DESTDIR)$(LIBDIR)/lib$(NAME).a
89+
90+
install-shlib: $(shlib)
91+
$(INSTALL) $(INSTL_LIB_OPTS) $(shlib) $(DESTDIR)$(LIBDIR)/$(shlib)
92+
rm -f $(DESTDIR)$(LIBDIR)/lib$(NAME)$(DLSUFFIX)
93+
rm -f $(DESTDIR)$(LIBDIR)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
94+
cd $(DESTDIR)$(LIBDIR) && $(LN_S) -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
95+
cd $(DESTDIR)$(LIBDIR) && $(LN_S) -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
96+
97+
install-ini: odbcinst.ini
98+
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
99+
100+
depend dep:
101+
$(CC) -MM *.c >depend
102+
103+
.PHONY: clean
104+
105+
clean:
106+
-rm -f lib$(NAME).a $(shlib) $(OBJECTS) lib$(NAME)$(DLSUFFIX)
107+
-rm -f config.log config.cache config.status
108+
109+
.PHONY: distclean
110+
111+
distclean: clean
112+
-rm -f config.h GNUmakefile Makefile.global
113+
114+
.PHONY: standalone
115+
116+
standalone:
117+
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar.gz
118+
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar $(SOURCES)
119+
tar -r -C ../.. -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar template
120+
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar
121+
122+
.PHONY: integrated
123+
124+
integrated:
125+
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
126+
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
127+
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar
+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
#----------------------------------------------------------------------------
2+
#
3+
# Makefile.global--
4+
# global configuration for the Makefiles
5+
#
6+
# Copyright (c) 1994, Regents of the University of California
7+
#
8+
#
9+
# IDENTIFICATION
10+
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.1 1998/10/06 05:57:56 thomas Exp $
11+
#
12+
# NOTES
13+
# This is derived from the main Postgres makefile.
14+
#
15+
# When running standalone:
16+
# To override the default setting, create a Makefile.custom in this
17+
# directory and put your defines there. (Makefile.custom is included
18+
# near the end of this file). Sometimes, a variable gets set in
19+
# Makefile.global after Makefile.custom has been included, so you can't
20+
# simply set that variable in Makefile.custom. In those cases, there is
21+
# often another variable (like CUSTOM_COPT) that you can set in
22+
# Makefile.custom that influences the later setting of the true variable
23+
# of interest (like CFLAGS) by Makefile.global.
24+
#
25+
#
26+
# If you change any of these defines you probably have to
27+
# make clean; make
28+
# since no dependencies are created for these. (of course you can
29+
# be crafty and check what files really depend on them and just remake
30+
# those).
31+
#
32+
# Before including this file, you must set the SRCDIR variable to the
33+
# path of the top of the Postgres source tree (the directory that
34+
# contains this file).
35+
#
36+
#-------------------------------------------------------------------------
37+
38+
39+
##############################################################################
40+
#
41+
# CONFIGURATION SECTION
42+
#
43+
# Following are settings pertaining to the postgres build and
44+
# installation.
45+
# of the port.
46+
#
47+
# Ignore LINUX_ELF if you're not using Linux. But if you are, and you're
48+
# compiling to a.out (which means you're using the dld dynamic loading
49+
# library), set LINUX_ELF to null in Makefile.custom.
50+
LINUX_ELF= true
51+
#
52+
# Ignore BSD_SHLIB if you're not using one of the BSD ports. But if you
53+
# are, and it's one that doesn't have shared libraries (NetBSD/vax is an
54+
# example of this), set BSD_SHLIB to null in Makefile.custom.
55+
BSD_SHLIB= true
56+
57+
# For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
58+
# and other target destinations are rooted. Of course, each of these is
59+
# changable separately.
60+
61+
POSTGRESDIR=@prefix@
62+
63+
# Where the postgres executables live (changeable by just putting them
64+
# somewhere else and putting that directory in your shell PATH)
65+
BINDIR= $(POSTGRESDIR)/bin
66+
67+
# Where libpsqlodbc.a gets installed. You must put it where your loader will
68+
# look for it if you wish to use the -lpq convention. Otherwise you
69+
# can just put the absolute pathname to the library at the end of your
70+
# command line.
71+
72+
LIBDIR= $(POSTGRESDIR)/lib
73+
74+
# Where the man pages (suitable for use with "man") get installed.
75+
POSTMANDIR= $(POSTGRESDIR)/man
76+
77+
# Where the formatted documents (e.g., the reference manual) get installed.
78+
POSTDOCDIR= $(POSTGRESDIR)/doc
79+
80+
# Where the header files necessary to build frontend programs get installed.
81+
HEADERDIR= $(POSTGRESDIR)/include
82+
83+
# Where the odbcinst.ini file will be placed
84+
85+
ODBCINST= $(POSTGRESDIR)@ODBCINSTDIR@
86+
87+
##############################################################################
88+
#
89+
# FEATURES
90+
#
91+
# To disable a feature, comment out the entire definition
92+
# (that is, prepend '#', don't set it to "0" or "no").
93+
94+
##############################################################################
95+
#
96+
# Installation.
97+
#
98+
# For many ports, INSTALL is overridden below.
99+
INSTALL= @INSTALL@
100+
RANLIB= @RANLIB@
101+
102+
INSTLOPTS= @INSTLOPTS@
103+
INSTL_EXE_OPTS= @INSTL_EXE_OPTS@
104+
INSTL_LIB_OPTS= @INSTL_LIB_OPTS@
105+
106+
##############################################################################
107+
#
108+
# For building shell scripts:
109+
#
110+
# For many ports, these are overridden below.
111+
112+
# DASH_N is what we put before the text on an echo command when we don't
113+
# want a trailing newline. BACKSLASH_C is what we put at the end of the
114+
# string on a echo command when we don't want a trailing newline. On
115+
# some systems, you do echo -n "no newline after this", while on others
116+
# you do echo "no newline after this\c".
117+
118+
DASH_N= @DASH_N@
119+
BACKSLASH_C= @BACKSLASH_C@
120+
121+
122+
123+
#-------------------------------------------------------------
124+
# See the subdirectory template for default settings for these
125+
#-------------------------------------------------------------
126+
CC= @CC@
127+
AROPT= @AROPT@
128+
CFLAGS= -I$(ODBCSRCDIR) @CPPFLAGS@ @CFLAGS@
129+
CFLAGS_SL= @SHARED_LIB@
130+
LDFLAGS= @LDFLAGS@ @LIBS@
131+
DLSUFFIX= @DLSUFFIX@
132+
LN_S = @LN_S@
133+
134+
##############################################################################
135+
#
136+
# Customization.
137+
#
138+
# This includes local customizations. If we're being build from
139+
# within the Postgres distribution and a Makefile.custom exists
140+
# in the top level Postgres directory it overrides any local customization
141+
# that might be in Makefile.custom of the odbc driver directory. These
142+
# files don't exist in the original
143+
# distribution so that they don't get overwritten when you upgrade.
144+
145+
ifneq ($(wildcard $(SRCDIR)/Makefile.custom), )
146+
include $(SRCDIR)/Makefile.custom
147+
endif
148+
149+
ifneq ($(wildcard ../../Makefile.custom), )
150+
include ../../Makefile.custom
151+
endif
152+
153+
# This goes here so that customization in Makefile.custom is effective
154+
##############################################################################
155+
156+
ifneq ($(CUSTOM_INSTALL),)
157+
INSTALL= $(CUSTOM_INSTALL)
158+
endif
159+
160+
#
161+
# Flags for CC and LD.
162+
163+
##############################################################################
164+
# COPT
165+
#
166+
# COPT is for options that the sophisticated builder might want to vary
167+
# from one build to the next, like options to build Postgres with debugging
168+
# information included. COPT is meant to be set on the make command line,
169+
# for example with the command "make COPT=-g". The value you see set here
170+
# is the default that gets used if the builder does not give a value for
171+
# COPT on his make command.
172+
#
173+
# There is a nonobvious relationship between -O (optimization) and
174+
# -Werror (consider all warnings fatal). On some systems, if you don't
175+
# optimize, you will always get some warnings because the system header
176+
# files will include some unreferenced functions in the code. These are
177+
# functions that are supposed to be inline, so there wouldn't ordinarily
178+
# be an "unreferenced" problem, but if you don't enable optimization, no
179+
# inlining can happen, and hence the problem. Therefore, we include
180+
# if you override -O, you override -Werror as well.
181+
#
182+
# CUSTOM_COPT is something the user may set in Makefile.custom
183+
184+
# Common values for COPT are: -g for debuggable binaries, -m486 if you are
185+
# using a i486 or better.
186+
187+
ifneq ($(CUSTOM_CC),)
188+
CC= $(CUSTOM_CC)
189+
endif
190+
191+
ifneq ($(CUSTOM_COPT),)
192+
COPT= $(CUSTOM_COPT)
193+
endif
194+
195+
ifeq ($(CC), gcc)
196+
CFLAGS+= -Wall -Wmissing-prototypes
197+
endif
198+
199+
ifdef COPT
200+
CFLAGS+= $(COPT)
201+
endif

0 commit comments

Comments
 (0)