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.
This commit is contained in:
Peter Eisentraut 2000-06-20 16:40:19 +00:00
parent 9f1a223046
commit bfdb695b85
11 changed files with 130 additions and 104 deletions

13
configure vendored
View File

@ -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
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@ -8900,8 +8892,8 @@ trap 'rm -fr `echo "GNUmakefile
src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile
@ -9027,7 +9019,6 @@ s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
s%@X11_LIBS@%$X11_LIBS%g
s%@expanded_libdir@%$expanded_libdir%g
CEOF
EOF
@ -9092,8 +9083,8 @@ CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile

View File

@ -1184,24 +1184,6 @@ See the file 'config.log' for further diagnostics.])
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 ...
AC_OUTPUT(
@ -1228,8 +1210,8 @@ AC_OUTPUT(
src/interfaces/odbc/GNUmakefile
src/interfaces/python/GNUmakefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/mklang.sql
src/pl/tcl/mkMakefile.tcldefs.sh
src/pl/plperl/GNUmakefile
src/test/regress/GNUmakefile

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.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
.PHONY: all install dep depend clean distclean maintainer-clean
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
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

View File

@ -2,7 +2,7 @@
#
# 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
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
cd $(top_builddir) && ./config.status --recheck

View File

@ -4,7 +4,7 @@
#
# 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@
top_srcdir = @top_srcdir@
top_builddir = ../..
subdir = src/pl
with_perl = @with_perl@
USE_TCL = @USE_TCL@
all install clean:
$(MAKE) -C plpgsql $@
ifeq ($(USE_TCL), true)
@ -29,8 +32,7 @@ endif
distclean maintainer-clean:
-$(MAKE) -C plpgsql clean
rm -f plpgsql/src/Makefile plpgsql/src/mklang.sql
-$(MAKE) -C plpgsql $@
ifeq ($(USE_TCL), true)
$(MAKE) -C tcl clean
endif
@ -40,3 +42,10 @@ endif
.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

View File

@ -1,20 +0,0 @@
#-------------------------------------------------------------------------
#
# 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 $@

View File

@ -0,0 +1,34 @@
#-------------------------------------------------------------------------
#
# 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

View File

@ -1,28 +1,38 @@
#-------------------------------------------------------------------------
#
# 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.25 2000/06/07 16:26:54 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.26 2000/06/20 16:40:10 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
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
DLSUFFIX = @DLSUFFIX@
SRCDIR= ../../..
SRCDIR = $(top_srcdir)/src
include $(SRCDIR)/Makefile.global
# If using flex, ask for a case-insensitive, lex-compatible lexer.
ifneq (,$(findstring flex,$(LEX)))
LFLAGS+= -i -l
endif
# bsdi calls flex lex
ifeq ($(PORTNAME), bsdi)
LFLAGS+= -i -l
endif
CPPFLAGS += -I$(srcdir)
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
# In order to use Makefile.shlib, we allow it to build a static library
# libplpgsql.a, which we just ignore, as well as a shared library that
# it will insist on naming $(shlib). We don't want to call it that when
# installed, however, so we ignore the install-shlib rule and do this
# instead:
# In order to use Makefile.shlib, we allow it to build a static
# library libplpgsql.a, which we just ignore, as well as a shared
# library that it will insist on naming $(shlib). We don't want to
# call it that when installed, however, so we ignore the install-shlib
# rule and do this instead:
install: $(shlib)
install: installdirs $(shlib)
ifneq ($(shlib),)
$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/plpgsql$(DLSUFFIX)
$(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX)
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
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_parse.o: pl_gram.c pl_scan.c plpgsql.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
pl_exec.o: pl_exec.c plpgsql.h pl.tab.h
# Note: Since the yacc and lex files are shipped in the distribution,
# they must be generated in the srcdir (as opposed to builddir).
pl_funcs.o: pl_funcs.c plpgsql.h pl.tab.h
pl_parse.o: pl_gram.c pl_scan.c plpgsql.h
$(CC) $(CFLAGS) -c -o $@ pl_gram.c
pl_gram.c pl.tab.h: gram.y
$(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
$(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.h >pl.tab.h
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 > $(srcdir)/pl.tab.h
rm -f y.tab.c y.tab.h
pl_scan.c: scan.l
$(LEX) $(LFLAGS) $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <lex.yy.c >pl_scan.c
# Assuming flex here for -i and -l options, since scan.l requires flex anyway.
$(srcdir)/pl_scan.c: scan.l
$(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
mklang.sql: mklang.sql.in
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
.PHONY: install clean
clean: clean-shlib
rm -f lib$(NAME).a
rm -f *.o
# And the garbage that might have been left behind by partial build:
rm -f y.tab.c y.tab.h lex.yy.c
rm -f lib$(NAME).a *.o y.tab.c y.tab.h lex.yy.c mklang.sql
distclean: clean
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

View File

@ -1,14 +1,13 @@
--
-- 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
as '@expanded_libdir@/plpgsql@DLSUFFIX@'
as '__libdir__/plpgsql__DLSUFFIX__'
language 'C';
create trusted procedural language 'plpgsql'
handler plpgsql_call_handler
lancompiler 'PL/pgSQL';

View File

@ -4,7 +4,7 @@
* procedural language
*
* 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.
*
@ -46,6 +46,7 @@ extern int yylineno;
static void plpgsql_input(char *buf, int *result, int max);
#define YY_INPUT(buf,res,max) plpgsql_input(buf, &res, max)
#define YY_NO_UNPUT
%}
WS [[:alpha:]_"]

View File

@ -1,6 +1,6 @@
#!/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
@ -162,7 +162,7 @@ mkdir -p $LOGDIR
# Install this 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 ]
then