aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-06-20 16:40:19 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-06-20 16:40:19 +0000
commitbfdb695b85c4ed22a63e72524a96c07f8f8696dd (patch)
tree587345f00fe1b13efc6c569a82b71bd35312b410 /src
parent9f1a22304695cf2b6ed4497b4e12af8bb40704de (diff)
downloadpostgresql-bfdb695b85c4ed22a63e72524a96c07f8f8696dd.tar.gz
postgresql-bfdb695b85c4ed22a63e72524a96c07f8f8696dd.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/Makefile.in6
-rw-r--r--src/interfaces/odbc/GNUmakefile.in4
-rw-r--r--src/pl/Makefile.in15
-rw-r--r--src/pl/plpgsql/Makefile20
-rw-r--r--src/pl/plpgsql/Makefile.in34
-rw-r--r--src/pl/plpgsql/src/Makefile.in110
-rw-r--r--src/pl/plpgsql/src/mklang.sql.in5
-rw-r--r--src/pl/plpgsql/src/scan.l3
-rwxr-xr-xsrc/test/regress/run_check.sh4
9 files changed, 127 insertions, 74 deletions
diff --git a/src/interfaces/Makefile.in b/src/interfaces/Makefile.in
index 473f4a4fc7b..3752b4d51a1 100644
--- a/src/interfaces/Makefile.in
+++ b/src/interfaces/Makefile.in
@@ -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
diff --git a/src/interfaces/odbc/GNUmakefile.in b/src/interfaces/odbc/GNUmakefile.in
index 4d8abad9afc..d62249353a2 100644
--- a/src/interfaces/odbc/GNUmakefile.in
+++ b/src/interfaces/odbc/GNUmakefile.in
@@ -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
diff --git a/src/pl/Makefile.in b/src/pl/Makefile.in
index 74b87dcf1bc..1a5a067dc8d 100644
--- a/src/pl/Makefile.in
+++ b/src/pl/Makefile.in
@@ -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
diff --git a/src/pl/plpgsql/Makefile b/src/pl/plpgsql/Makefile
deleted file mode 100644
index f79cacb4aec..00000000000
--- a/src/pl/plpgsql/Makefile
+++ /dev/null
@@ -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 $@
-
diff --git a/src/pl/plpgsql/Makefile.in b/src/pl/plpgsql/Makefile.in
new file mode 100644
index 00000000000..422a02c20e0
--- /dev/null
+++ b/src/pl/plpgsql/Makefile.in
@@ -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
diff --git a/src/pl/plpgsql/src/Makefile.in b/src/pl/plpgsql/src/Makefile.in
index fa34ee02f94..27cc8a8b71e 100644
--- a/src/pl/plpgsql/src/Makefile.in
+++ b/src/pl/plpgsql/src/Makefile.in
@@ -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_comp.o: pl_comp.c plpgsql.h pl.tab.h
+pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h pl.tab.h
-pl_exec.o: pl_exec.c plpgsql.h pl.tab.h
+pl_parse.o: pl_gram.c pl_scan.c plpgsql.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-pl_funcs.o: pl_funcs.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_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
diff --git a/src/pl/plpgsql/src/mklang.sql.in b/src/pl/plpgsql/src/mklang.sql.in
index 18235d0bca9..dde06fc1031 100644
--- a/src/pl/plpgsql/src/mklang.sql.in
+++ b/src/pl/plpgsql/src/mklang.sql.in
@@ -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';
-
diff --git a/src/pl/plpgsql/src/scan.l b/src/pl/plpgsql/src/scan.l
index a0f3766beb1..7256ba78707 100644
--- a/src/pl/plpgsql/src/scan.l
+++ b/src/pl/plpgsql/src/scan.l
@@ -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:]_"]
diff --git a/src/test/regress/run_check.sh b/src/test/regress/run_check.sh
index 05393198867..2f33fdcdf7a 100755
--- a/src/test/regress/run_check.sh
+++ b/src/test/regress/run_check.sh
@@ -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