1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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

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