]> granicus.if.org Git - postgresql/commitdiff
Cleaned up PL/pgSQL build. Fixed a couple of copyandpaste'os in the
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 20 Jun 2000 16:40:19 +0000 (16:40 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 20 Jun 2000 16:40:19 +0000 (16:40 +0000)
interfaces and interfaces/odbc make files. Adjusted regression test
driver to start building and installing in the top level directory.

configure
configure.in
src/interfaces/Makefile.in
src/interfaces/odbc/GNUmakefile.in
src/pl/Makefile.in
src/pl/plpgsql/Makefile [deleted file]
src/pl/plpgsql/Makefile.in [new file with mode: 0644]
src/pl/plpgsql/src/Makefile.in
src/pl/plpgsql/src/mklang.sql.in
src/pl/plpgsql/src/scan.l
src/test/regress/run_check.sh

index 10ddff0e90747d2405ec9dfcffa05006e232e8f9..abe199f6601360a8a929094fe3f7239bcec0024f 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index c00c65ef92da9e8147c006d78eaf38fbc2ae8ced..1460ddada55fa36120e20a700f6afff6c0565750 100644 (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
index 473f4a4fc7bc49d399a10ebc757e0d58567e2066..3752b4d51a14289302a722f9fcfb56ebb24cae04 100644 (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
index 4d8abad9afc9d695acaa53dbe282d5beacc756ad..d62249353a2b9070107efd00777718278ac533ac 100644 (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
index 74b87dcf1bc1c9614a6fbefdfaee1753fc351404..1a5a067dc8d890f94bd97f44184a4d3c995d66f6 100644 (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
diff --git a/src/pl/plpgsql/Makefile b/src/pl/plpgsql/Makefile
deleted file mode 100644 (file)
index f79cacb..0000000
+++ /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 (file)
index 0000000..422a02c
--- /dev/null
@@ -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
index fa34ee02f94aa835aaa79619aa2f5f94cccc589c..27cc8a8b71e494b3c7669c1425d46bd3a9390561 100644 (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_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
index 18235d0bca96e60815d946dbf61750a69e653c4b..dde06fc1031b3d026ced3c61e64de8ff60529a4d 100644 (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';
-
index a0f3766beb1c0c2a89369fb7a7b06919e77dcf47..7256ba78707cfaae70068c257a980bc456a8bffb 100644 (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:]_"]
index 05393198867dc2562e1ca142c09abd0cdb5ceade..2f33fdcdf7a4648147b5c66480e009e608702aa9 100755 (executable)
@@ -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