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

Commit 4c92391

Browse files
author
Thomas G. Lockhart
committed
Changes to support standalone installation.
1 parent 25f9020 commit 4c92391

File tree

4 files changed

+146
-90
lines changed

4 files changed

+146
-90
lines changed

src/interfaces/odbc/GNUmakefile.in

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#-------------------------------------------------------------------------
22
#
3-
# Makefile.inc--
4-
# Build and install postgres.
3+
# GNUMakefile.in--
4+
# Build and install psqlodbc (Postgres ODBC driver).
55
#
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.2 1998/10/07 06:49:19 thomas Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.3 1998/10/09 07:04:49 thomas Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313
@SET_MAKE@
@@ -40,11 +40,11 @@ ifeq ($(PORTNAME), bsd)
4040
endif
4141
endif
4242

43-
SOURCES = *.c *.h *.in Config.mk Makefile Makefile.unx README.Linux \
43+
SOURCES = *.c *.h *.in Config.mk \
4444
TODO.txt Version.mk config.guess config.sub configure \
45-
install-sh license.txt notice.txt odbcinst.ini patch \
46-
psqlodbc.aps psqlodbc.def psqlodbc.mak psqlodbc.mdp \
47-
psqlodbc.ncb psqlodbc.rc readme.txt
45+
install-sh license.txt notice.txt odbcinst.ini \
46+
psqlodbc.def \
47+
psqlodbc.rc readme.txt
4848

4949
OBJECTS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
5050
environ.o execute.o lobj.o misc.o options.o \
@@ -92,7 +92,7 @@ install-shlib: $(shlib)
9292
cd $(DESTDIR)$(LIBDIR) && $(LN_S) -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
9393

9494
install-ini: odbcinst.ini
95-
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)/odbcinst.ini
95+
$(INSTALL) $(INSTL_LIB_OPTS) odbcinst.ini $(ODBCINST)
9696

9797
depend dep:
9898
$(CC) -MM *.c >depend
@@ -101,24 +101,32 @@ depend dep:
101101

102102
clean:
103103
-rm -f lib$(NAME).a $(shlib) $(OBJECTS) lib$(NAME)$(DLSUFFIX)
104-
-rm -f config.log config.cache config.status
105-
104+
106105
.PHONY: distclean
107106

108107
distclean: clean
109108
-rm -f config.h GNUmakefile Makefile.global
109+
-rm -f config.cache config.log config.status
110+
@if [ $SRCDIR ne $ODBCSRCDIR ]; then rm -f template makefiles port
110111

111112
.PHONY: standalone
112113

113114
standalone:
115+
@if test "$SRCDIR" = "$ODBCSRCDIR"; then \
116+
echo "****************************************************"; \
117+
echo "Note: This was a standalone installation already"; \
118+
echo "This may produce a slightly inconsistant tar file..."; \
119+
echo "You should use the original tar file instead"; \
120+
echo "****************************************************"; \
121+
fi
114122
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar.gz
115-
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar $(SOURCES)
116-
tar -r -C ../.. -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar template
123+
$(TAR) -chf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar \
124+
$(SOURCES) -C @top_srcdir@ makefiles template
117125
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION).tar
118126

119127
.PHONY: integrated
120128

121129
integrated:
122130
-rm -f psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar.gz
123-
tar -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
131+
$(TAR) -cf psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar $(SOURCES)
124132
gzip psqlodbc-$(SO_MAJOR_VERSION)$(SO_MINOR_VERSION)-int.tar

src/interfaces/odbc/Makefile.global.in

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#----------------------------------------------------------------------------
22
#
33
# Makefile.global--
4-
# global configuration for the Makefiles
4+
# global configuration for pgsqlodbc (Postgres ODBC driver)
55
#
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.1 1998/10/06 05:57:56 thomas Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/Makefile.global.in,v 1.2 1998/10/09 07:04:50 thomas Exp $
1111
#
1212
# NOTES
1313
# This is derived from the main Postgres makefile.
@@ -71,18 +71,18 @@ BINDIR= $(POSTGRESDIR)/bin
7171

7272
LIBDIR= $(POSTGRESDIR)/lib
7373

74-
# Where the man pages (suitable for use with "man") get installed.
75-
POSTMANDIR= $(POSTGRESDIR)/man
76-
74+
## Where the man pages (suitable for use with "man") get installed.
75+
#POSTMANDIR= $(POSTGRESDIR)/man
76+
#
7777
# Where the formatted documents (e.g., the reference manual) get installed.
78-
POSTDOCDIR= $(POSTGRESDIR)/doc
78+
#POSTDOCDIR= $(POSTGRESDIR)/doc
7979

8080
# Where the header files necessary to build frontend programs get installed.
8181
HEADERDIR= $(POSTGRESDIR)/include
8282

8383
# Where the odbcinst.ini file will be placed
8484

85-
ODBCINST= $(POSTGRESDIR)@ODBCINSTDIR@
85+
ODBCINST= @ODBCINST@
8686

8787
##############################################################################
8888
#
@@ -119,7 +119,6 @@ DASH_N= @DASH_N@
119119
BACKSLASH_C= @BACKSLASH_C@
120120

121121

122-
123122
#-------------------------------------------------------------
124123
# See the subdirectory template for default settings for these
125124
#-------------------------------------------------------------
@@ -131,30 +130,30 @@ LDFLAGS= @LDFLAGS@ @LIBS@
131130
DLSUFFIX= @DLSUFFIX@
132131
LN_S = @LN_S@
133132

133+
ifneq ($(wildcard $(SRCDIR)/Makefile.port), )
134+
include $(SRCDIR)/Makefile.port
135+
endif
136+
137+
134138
##############################################################################
135139
#
136140
# Customization.
137141
#
138-
# This includes local customizations. If we're being build from
142+
# This includes local customizations. If we're being built from
139143
# 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+
# in the top level Postgres directory it will take precedence
145+
# over any local Makefile.custom in the odbc driver directory.
144146

145147
ifneq ($(wildcard $(SRCDIR)/Makefile.custom), )
146-
include $(SRCDIR)/Makefile.custom
148+
include $(SRCDIR)/Makefile.custom
147149
endif
148150

149-
ifneq ($(wildcard ../../Makefile.custom), )
150-
include ../../Makefile.custom
151-
endif
152151

153152
# This goes here so that customization in Makefile.custom is effective
154153
##############################################################################
155154

156155
ifneq ($(CUSTOM_INSTALL),)
157-
INSTALL= $(CUSTOM_INSTALL)
156+
INSTALL= $(CUSTOM_INSTALL)
158157
endif
159158

160159
#
@@ -193,9 +192,9 @@ ifneq ($(CUSTOM_COPT),)
193192
endif
194193

195194
ifeq ($(CC), gcc)
196-
CFLAGS+= -Wall -Wmissing-prototypes
195+
CFLAGS+= -Wall -Wmissing-prototypes
197196
endif
198197

199198
ifdef COPT
200-
CFLAGS+= $(COPT)
199+
CFLAGS+= $(COPT)
201200
endif

src/interfaces/odbc/configure

+75-30
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ ac_default_prefix=/usr/local
1414
ac_default_prefix=/usr/local
1515
ac_help="$ac_help
1616
--with-template=TEMPLATE
17-
use operating system template file
18-
see template directory"
17+
use operating system template file; see template directory"
1918
ac_help="$ac_help
20-
--with-odbcinst=<datadir> change default directory for odbcinst.ini"
19+
--with-odbcinst=<pathname>
20+
change default directory for odbcinst.ini "
2121

2222
# Initialize some variables set by options.
2323
# The variables have the same names as the options, with
@@ -527,26 +527,32 @@ fi
527527

528528

529529

530+
echo "*** configuring psqlodbc ***"
531+
530532
if test -d ../../interfaces
531533
then
532-
TEMPLATEDIR=../../template
533-
if test "$prefix" = "NONE"
534-
then
535-
ac_default_prefix=/usr/local/pgsql
536-
fi
537-
ODBCINSTDIR=
538-
else
539-
TEMPLATEDIR=./template
540-
if test "$prefix" = "NONE"
534+
echo "psqlodbc can be configured either standalone or integrated"
535+
echo "into the Postgres main distribution."
536+
echo "It appears that you are running the standalone configure"
537+
echo "from within the main distribution. The recommended (and required)"
538+
echo "procedure is to configure ODBC using the integrated configuration"
539+
echo "procedure using the --with-odbc option."
540+
exit
541+
fi
542+
543+
TEMPLATEDIR=./template
544+
if test "$prefix" = "NONE"
545+
then
546+
if test -d "/share"
541547
then
542-
ODBCINSTDIR=/share
548+
ODBCINST=/share/odbcinst.ini
543549
else
544-
ODBCINSTDIR=
550+
ODBCINST=/etc/odbcinst.ini
545551
fi
552+
else
553+
ODBCINST=$prefix/odbcinst.ini
546554
fi
547555

548-
echo "*** configuring psqlodbc ***"
549-
550556
ac_aux_dir=
551557
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
552558
if test -f $ac_dir/install-sh; then
@@ -573,7 +579,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
573579
fi
574580

575581
echo $ac_n "checking host system type""... $ac_c" 1>&6
576-
echo "configure:577: checking host system type" >&5
582+
echo "configure:583: checking host system type" >&5
577583

578584
host_alias=$host
579585
case "$host_alias" in
@@ -637,7 +643,6 @@ esac
637643
PORTNAME=${os}
638644

639645

640-
641646
echo "checking echo setting..."
642647
if echo '\c' | grep -s c >/dev/null 2>&1
643648
then
@@ -652,7 +657,7 @@ fi
652657

653658

654659
echo $ac_n "checking setting template to""... $ac_c" 1>&6
655-
echo "configure:656: checking setting template to" >&5
660+
echo "configure:661: checking setting template to" >&5
656661
# Check whether --with-template or --without-template was given.
657662
if test "${with_template+set}" = set; then
658663
withval="$with_template"
@@ -692,7 +697,7 @@ distribution's 'interfaces/odbc' directory and try
692697
again.
693698
694699
If neither of these is the case than please complain
695-
kindly to the maintainers, their e-mail addresses can
700+
kindly to the maintainers; their e-mail addresses can
696701
be found in the Readme files.
697702
*************************************************************
698703
EOT
@@ -764,7 +769,7 @@ export LDFLAGS
764769
echo "- setting LDFLAGS=$LDFLAGS"
765770

766771
echo $ac_n "checking setting ODBCINST""... $ac_c" 1>&6
767-
echo "configure:768: checking setting ODBCINST" >&5
772+
echo "configure:773: checking setting ODBCINST" >&5
768773
# Check whether --with-odbcinst or --without-odbcinst was given.
769774
if test "${with_odbcinst+set}" = set; then
770775
withval="$with_odbcinst"
@@ -774,18 +779,13 @@ EOF
774779
echo "$ac_t""$with_odbcinst" 1>&6
775780
else
776781
cat >> confdefs.h <<EOF
777-
#define ODBCINST ${ODBCINSTDIR}
782+
#define ODBCINST /etc/odbcinst.ini
778783
EOF
779-
echo "$ac_t""${ODBCINSTDIR}" 1>&6
784+
echo "$ac_t""${ODBCINST}" 1>&6
780785

781786
fi
782787

783788

784-
if test "X$with_odbcinst" != "X"
785-
then
786-
ODBCINSTDIR=$with_odbcinst
787-
fi
788-
789789

790790

791791
if test "X$with_compiler" != "X"
@@ -1755,10 +1755,10 @@ s%@host_alias@%$host_alias%g
17551755
s%@host_cpu@%$host_cpu%g
17561756
s%@host_vendor@%$host_vendor%g
17571757
s%@host_os@%$host_os%g
1758-
s%@PORTNAME@%$PORTNAME%g
1759-
s%@ODBCINSTDIR@%$ODBCINSTDIR%g
1758+
s%@ODBCINST@%$ODBCINST%g
17601759
s%@CC@%$CC%g
17611760
s%@CPP@%$CPP%g
1761+
s%@PORTNAME@%$PORTNAME%g
17621762
s%@AROPT@%$AROPT%g
17631763
s%@SHARED_LIB@%$SHARED_LIB%g
17641764
s%@DLSUFFIX@%$DLSUFFIX%g
@@ -1977,6 +1977,51 @@ cat >> $CONFIG_STATUS <<\EOF
19771977
fi
19781978
fi; done
19791979
1980+
EOF
1981+
1982+
cat >> $CONFIG_STATUS <<EOF
1983+
ac_sources="makefiles/Makefile.${os}"
1984+
ac_dests="Makefile.port"
1985+
EOF
1986+
1987+
cat >> $CONFIG_STATUS <<\EOF
1988+
srcdir=$ac_given_srcdir
1989+
while test -n "$ac_sources"; do
1990+
set $ac_dests; ac_dest=$1; shift; ac_dests=$*
1991+
set $ac_sources; ac_source=$1; shift; ac_sources=$*
1992+
1993+
echo "linking $srcdir/$ac_source to $ac_dest"
1994+
1995+
if test ! -r $srcdir/$ac_source; then
1996+
{ echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
1997+
fi
1998+
rm -f $ac_dest
1999+
2000+
# Make relative symlinks.
2001+
# Remove last slash and all that follows it. Not all systems have dirname.
2002+
ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
2003+
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
2004+
# The dest file is in a subdirectory.
2005+
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
2006+
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
2007+
# A "../" for each directory in $ac_dest_dir_suffix.
2008+
ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
2009+
else
2010+
ac_dest_dir_suffix= ac_dots=
2011+
fi
2012+
2013+
case "$srcdir" in
2014+
[/$]*) ac_rel_source="$srcdir/$ac_source" ;;
2015+
*) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
2016+
esac
2017+
2018+
# Make a symlink if possible; otherwise try a hard link.
2019+
if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
2020+
ln $srcdir/$ac_source $ac_dest; then :
2021+
else
2022+
{ echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
2023+
fi
2024+
done
19802025
EOF
19812026
cat >> $CONFIG_STATUS <<EOF
19822027

0 commit comments

Comments
 (0)