Commit bfdb695b authored by Peter Eisentraut's avatar Peter Eisentraut

Cleaned up PL/pgSQL build. Fixed a couple of copyandpaste'os in the

interfaces and interfaces/odbc make files. Adjusted regression test
driver to start building and installing in the top level directory.
parent 9f1a2230
...@@ -8768,14 +8768,6 @@ fi ...@@ -8768,14 +8768,6 @@ fi
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
eval expanded_libdir="$libdir"
eval expanded_libdir="$expanded_libdir"
trap '' 1 2 15 trap '' 1 2 15
cat > confcache <<\EOF cat > confcache <<\EOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
...@@ -8900,8 +8892,8 @@ trap 'rm -fr `echo "GNUmakefile ...@@ -8900,8 +8892,8 @@ trap 'rm -fr `echo "GNUmakefile
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
...@@ -9027,7 +9019,6 @@ s%@X_PRE_LIBS@%$X_PRE_LIBS%g ...@@ -9027,7 +9019,6 @@ s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
s%@X11_LIBS@%$X11_LIBS%g s%@X11_LIBS@%$X11_LIBS%g
s%@expanded_libdir@%$expanded_libdir%g
CEOF CEOF
EOF EOF
...@@ -9092,8 +9083,8 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile ...@@ -9092,8 +9083,8 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
......
...@@ -1184,24 +1184,6 @@ See the file 'config.log' for further diagnostics.]) ...@@ -1184,24 +1184,6 @@ See the file 'config.log' for further diagnostics.])
fi fi
dnl Output files that are neither makefiles nor shell scripts probably
dnl need fully-expanded substitutions, rather than partial expansions
dnl that include references to other variables. Currently the only
dnl such item that's needed is an expanded version of libdir, but
dnl others may be needed someday. NOTE: 'eval' technique only copes
dnl with one level of indirect reference per expansion; two levels is
dnl currently enough for libdir, but it's ugly...
dnl First we have to force 'NONE' prefix to be expanded itself.
dnl For some reason, autoconf 2.13 doesn't do this until AC_OUTPUT,
dnl which is too late...
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
eval expanded_libdir="$libdir"
eval expanded_libdir="$expanded_libdir"
AC_SUBST(expanded_libdir)
dnl Finally ready to produce output files ... dnl Finally ready to produce output files ...
AC_OUTPUT( AC_OUTPUT(
...@@ -1228,8 +1210,8 @@ AC_OUTPUT( ...@@ -1228,8 +1210,8 @@ AC_OUTPUT(
src/interfaces/odbc/GNUmakefile src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile src/interfaces/python/GNUmakefile
src/pl/Makefile src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile src/test/regress/GNUmakefile
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/interfaces/Attic/Makefile.in,v 1.3 2000/06/19 16:58:43 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/Attic/Makefile.in,v 1.4 2000/06/20 16:39:54 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -57,8 +57,8 @@ distclean maintainer-clean: clean ...@@ -57,8 +57,8 @@ distclean maintainer-clean: clean
.PHONY: all install dep depend clean distclean maintainer-clean .PHONY: all install dep depend clean distclean maintainer-clean
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status Makefile: Makefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck cd $(top_builddir) && ./config.status --recheck
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# GNUMakefile.in for psqlodbc (Postgres ODBC driver). # GNUMakefile.in for psqlodbc (Postgres ODBC driver).
# #
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.16 2000/06/19 16:58:44 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.17 2000/06/20 16:39:57 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -71,7 +71,7 @@ endif ...@@ -71,7 +71,7 @@ endif
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck cd $(top_builddir) && ./config.status --recheck
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/pl/Attic/Makefile.in,v 1.1 2000/06/10 18:02:09 petere Exp $ # $Header: /cvsroot/pgsql/src/pl/Attic/Makefile.in,v 1.2 2000/06/20 16:40:04 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,10 +13,13 @@ VPATH = @srcdir@ ...@@ -13,10 +13,13 @@ VPATH = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
top_builddir = ../.. top_builddir = ../..
subdir = src/pl
with_perl = @with_perl@ with_perl = @with_perl@
USE_TCL = @USE_TCL@ USE_TCL = @USE_TCL@
all install clean: all install clean:
$(MAKE) -C plpgsql $@ $(MAKE) -C plpgsql $@
ifeq ($(USE_TCL), true) ifeq ($(USE_TCL), true)
...@@ -29,8 +32,7 @@ endif ...@@ -29,8 +32,7 @@ endif
distclean maintainer-clean: distclean maintainer-clean:
-$(MAKE) -C plpgsql clean -$(MAKE) -C plpgsql $@
rm -f plpgsql/src/Makefile plpgsql/src/mklang.sql
ifeq ($(USE_TCL), true) ifeq ($(USE_TCL), true)
$(MAKE) -C tcl clean $(MAKE) -C tcl clean
endif endif
...@@ -40,3 +42,10 @@ endif ...@@ -40,3 +42,10 @@ endif
.PHONY: all install clean distclean maintainer-clean .PHONY: all install clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for src/pl/plpgsql (PostgreSQL's SQL procedural language)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/pl/plpgsql/Makefile,v 1.1 1998/10/01 03:38:33 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include $(SRCDIR)/Makefile.global
.DEFAULT all install clean dep depend distclean:
-$(MAKE) -C src $@
#-------------------------------------------------------------------------
#
# Makefile for src/pl/plpgsql (PostgreSQL's SQL procedural language)
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/Attic/Makefile.in,v 1.1 2000/06/20 16:40:07 petere Exp $
#
#-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
subdir = src/pl/plpgsql
.DEFAULT all install clean:
$(MAKE) -C src $@
distclean maintainer-clean:
-$(MAKE) -C src $@
rm -f Makefile
.PHONY: all install clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile
# Makefile for the plpgsql shared object # Makefile for the plpgsql shared object
# #
# IDENTIFICATION # $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.26 2000/06/20 16:40:10 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.25 2000/06/07 16:26:54 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../../..
subdir = src/pl/plpgsql/src
INSTALL = @INSTALL@
INSTALL_SHLIB = @INSTALL_SHLIB@
mkinstalldirs = @mkinstalldirs@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
# Shared library parameters
NAME= plpgsql NAME= plpgsql
SO_MAJOR_VERSION= 1 SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0 SO_MINOR_VERSION= 0
DLSUFFIX = @DLSUFFIX@
SRCDIR= ../../.. SRCDIR = $(top_srcdir)/src
include $(SRCDIR)/Makefile.global include $(SRCDIR)/Makefile.global
# If using flex, ask for a case-insensitive, lex-compatible lexer.
ifneq (,$(findstring flex,$(LEX))) CPPFLAGS += -I$(srcdir)
LFLAGS+= -i -l
endif
# bsdi calls flex lex
ifeq ($(PORTNAME), bsdi)
LFLAGS+= -i -l
endif
OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
...@@ -30,47 +40,67 @@ OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o ...@@ -30,47 +40,67 @@ OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
include $(SRCDIR)/Makefile.shlib include $(SRCDIR)/Makefile.shlib
# In order to use Makefile.shlib, we allow it to build a static library # In order to use Makefile.shlib, we allow it to build a static
# libplpgsql.a, which we just ignore, as well as a shared library that # library libplpgsql.a, which we just ignore, as well as a shared
# it will insist on naming $(shlib). We don't want to call it that when # library that it will insist on naming $(shlib). We don't want to
# installed, however, so we ignore the install-shlib rule and do this # call it that when installed, however, so we ignore the install-shlib
# instead: # rule and do this instead:
install: $(shlib) install: installdirs $(shlib)
ifneq ($(shlib),) ifneq ($(shlib),)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/plpgsql$(DLSUFFIX) $(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX)
else else
@echo "plpgsql not installed due to lack of shared library support." @echo "*****"; \
echo "* PL/pgSQL was not installed due to lack of shared library support."; \
echo "*****"
endif endif
installdirs:
$(mkinstalldirs) $(libdir)
pl_handler.o: pl_handler.c plpgsql.h pl.tab.h pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h pl.tab.h
pl_comp.o: pl_comp.c plpgsql.h pl.tab.h
pl_exec.o: pl_exec.c plpgsql.h pl.tab.h
pl_funcs.o: pl_funcs.c plpgsql.h pl.tab.h
pl_parse.o: pl_gram.c pl_scan.c plpgsql.h pl_parse.o: pl_gram.c pl_scan.c plpgsql.h
$(CC) $(CFLAGS) -c -o $@ pl_gram.c $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
# Note: Since the yacc and lex files are shipped in the distribution,
# they must be generated in the srcdir (as opposed to builddir).
pl_gram.c pl.tab.h: gram.y $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
$(YACC) -d $(YFLAGS) $< $(YACC) -d $(YFLAGS) $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <y.tab.c >pl_gram.c sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.c > $(srcdir)/pl_gram.c
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <y.tab.h >pl.tab.h sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.h > $(srcdir)/pl.tab.h
rm -f y.tab.c y.tab.h rm -f y.tab.c y.tab.h
pl_scan.c: scan.l # Assuming flex here for -i and -l options, since scan.l requires flex anyway.
$(LEX) $(LFLAGS) $< $(srcdir)/pl_scan.c: scan.l
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <lex.yy.c >pl_scan.c $(LEX) $(LFLAGS) -i -l $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < lex.yy.c > $@
rm -f lex.yy.c rm -f lex.yy.c
mklang.sql: mklang.sql.in
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
.PHONY: install clean
clean: clean-shlib clean: clean-shlib
rm -f lib$(NAME).a rm -f lib$(NAME).a *.o y.tab.c y.tab.h lex.yy.c mklang.sql
rm -f *.o
# And the garbage that might have been left behind by partial build: distclean: clean
rm -f y.tab.c y.tab.h lex.yy.c rm -f Makefile
maintainer-clean: clean
rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c
rm -f Makefile
.PHONY: all install installdirs clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=src/Makefile.global CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck
-- --
-- PL/pgSQL language declaration -- PL/pgSQL language declaration
-- --
-- $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/mklang.sql.in,v 1.4 1999/05/11 22:57:50 tgl Exp $ -- $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/mklang.sql.in,v 1.5 2000/06/20 16:40:10 petere Exp $
-- --
create function plpgsql_call_handler() returns opaque create function plpgsql_call_handler() returns opaque
as '@expanded_libdir@/plpgsql@DLSUFFIX@' as '__libdir__/plpgsql__DLSUFFIX__'
language 'C'; language 'C';
create trusted procedural language 'plpgsql' create trusted procedural language 'plpgsql'
handler plpgsql_call_handler handler plpgsql_call_handler
lancompiler 'PL/pgSQL'; lancompiler 'PL/pgSQL';
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.3 1999/05/26 20:55:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.4 2000/06/20 16:40:10 petere Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -46,6 +46,7 @@ extern int yylineno; ...@@ -46,6 +46,7 @@ extern int yylineno;
static void plpgsql_input(char *buf, int *result, int max); static void plpgsql_input(char *buf, int *result, int max);
#define YY_INPUT(buf,res,max) plpgsql_input(buf, &res, max) #define YY_INPUT(buf,res,max) plpgsql_input(buf, &res, max)
#define YY_NO_UNPUT
%} %}
WS [[:alpha:]_"] WS [[:alpha:]_"]
......
#!/bin/sh #!/bin/sh
# #
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.19 2000/05/24 22:32:59 tgl Exp $ # $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.20 2000/06/20 16:40:19 petere Exp $
# ---------- # ----------
# Check call syntax # Check call syntax
...@@ -162,7 +162,7 @@ mkdir -p $LOGDIR ...@@ -162,7 +162,7 @@ mkdir -p $LOGDIR
# Install this build into ./tmp/check # Install this build into ./tmp/check
# ---------- # ----------
echo "=============== Installing new build into ./tmp_check ================" echo "=============== Installing new build into ./tmp_check ================"
${MAKE:-gmake} -C ../.. POSTGRESDIR=$CHKDIR install >$LOGDIR/install.log 2>&1 ${MAKE:-gmake} -C ../../.. POSTGRESDIR=$CHKDIR prefix=$CHKDIR install >$LOGDIR/install.log 2>&1
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment