PL patches

From: Brook Milligan <brook(at)trillium(dot)NMSU(dot)Edu>
To: hackers(at)postgresql(dot)org, patches(at)postgresql(dot)org
Subject: PL patches
Date: 1998-10-08 17:27:22
Message-ID: 199810081727.LAA06009@trillium.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have had a few problems with the PL stuff recently committed. The
following patches fix the problems (i.e., all regression tests pass)
in what I hope to be a platform-independent fashion. The accomplish
the following:

1. Allow configure to check for the existence of the tclConfig.sh
script needed to configure the tcl component of PL. Configure
already checks other parts of the tcl installation, so it might
as well check for this script, too, so that paths need not be
hard-coded into mkMakefile.tcldefs.

A few extra files are created by configure from templates.

Configure is also cleaned up a bit at the end so the long list of
output files is easier to deal with.

NOTE: run autoconf.

2. A new script mkMakefile.tcldefs.sh is created from the template
mkMakefile.tcldefs.sh.in so that the substitution for tclConfig.sh
can be inserted. The script is simplified and renamed to reflect
the fact that it is a sh script.

NOTE: pl/tcl/mkMakefile.tcldefs should be removed from the tree.

3. The Makefile executes /bin/sh on the new script rather than
directly executing the script (hence the name change to make it
more explicit).

4. There are shared library problems with the plpgsql/src/Makefile.
The port-specific code was taken from the interfaces/tcl?/Makefile
so that shared libraries should work on all platforms. This means
that that Makefile must be a template for configure.

NOTE: pl/plpgsql/src/Makefile should be removed from the tree.

NOTE: should we be including libtool in our distribution to simplify
shared library (and other stuff) support?

Cheers,
Brook

===========================================================================
--- configure.in.orig Wed Oct 7 01:00:23 1998
+++ configure.in Thu Oct 8 08:22:40 1998
@@ -799,6 +799,30 @@
AC_SUBST(TCL_LIB)
fi

+dnl Check for Tcl configuration script tclConfig.sh
+if test "$USE_TCL"; then
+ AC_MSG_CHECKING(for tclConfig.sh)
+ library_dirs="/usr/lib $LIBRARY_DIRS"
+ TCL_CONFIG_SH=
+ for dir in $library_dirs; do
+ for tcl_dir in $tcl_dirs; do
+ if test -z "$TCL_CONFIG_SH"; then
+ if test -d "$dir/$tcl_dir" -a -r "$dir/$tcl_dir/tclConfig.sh"; then
+ TCL_CONFIG_SH=$dir/$tcl_dir/tclConfig.sh
+ fi
+ fi
+ done
+ done
+ if test -z "$TCL_CONFIG_SH"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN(tcl support disabled; Tcl configuration script missing)
+ USE_TCL=
+ else
+ AC_MSG_RESULT($TCL_CONFIG_SH)
+ AC_SUBST(TCL_CONFIG_SH)
+ fi
+fi
+
dnl Check for location of Tk support (only if Tcl used)
dnl Disable Tcl support if Tk not found

@@ -883,4 +907,21 @@

AC_CONFIG_HEADER(interfaces/odbc/config.h)

-AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpq++/Makefile interfaces/libpgtcl/Makefile interfaces/ecpg/lib/Makefile include/version.h interfaces/odbc/Makefile.global interfaces/odbc/GNUmakefile)
+AC_OUTPUT(
+ GNUmakefile
+ Makefile.global
+ backend/port/Makefile
+ backend/utils/Gen_fmgrtab.sh
+ bin/pg_dump/Makefile
+ bin/pg_version/Makefile
+ bin/psql/Makefile
+ include/version.h
+ interfaces/ecpg/lib/Makefile
+ interfaces/libpgtcl/Makefile
+ interfaces/libpq++/Makefile
+ interfaces/libpq/Makefile
+ interfaces/odbc/GNUmakefile
+ interfaces/odbc/Makefile.global
+ pl/plpgsql/src/Makefile
+ pl/tcl/mkMakefile.tcldefs.sh
+)
===========================================================================
--- pl/tcl/mkMakefile.tcldefs.sh.in.orig Wed Oct 7 14:45:20 1998
+++ pl/tcl/mkMakefile.tcldefs.sh.in Wed Oct 7 14:40:37 1998
@@ -0,0 +1,12 @@
+
+if [ -f @TCL_CONFIG_SH@ ]; then
+ . @TCL_CONFIG_SH@
+else
+ echo "@TCL_CONFIG_SH@ not found"
+ echo "I need this file! Please make a symbolic link to this file"
+ echo "and start make again."
+ exit 1
+fi
+
+set | grep '^TCL' > Makefile.tcldefs
+exit 0
===========================================================================
--- pl/tcl/Makefile.orig Thu Apr 9 17:02:53 1998
+++ pl/tcl/Makefile Wed Oct 7 15:52:48 1998
@@ -77,7 +77,7 @@
all: $(INFILES)

Makefile.tcldefs:
- ./mkMakefile.tcldefs
+ /bin/sh mkMakefile.tcldefs.sh

#
# Clean
===========================================================================
--- pl/plpgsql/src/Makefile.in.orig Thu Oct 8 08:18:46 1998
+++ pl/plpgsql/src/Makefile.in Thu Oct 8 08:21:07 1998
@@ -0,0 +1,131 @@
+#-------------------------------------------------------------------------
+#
+# Makefile
+# Makefile for the plpgsql shared object
+#
+# IDENTIFICATION
+# $Header: /usr/local/cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.1 1998/09/25 15:50:02 momjian Exp $
+#
+#-------------------------------------------------------------------------
+
+#
+# Tell make where the postgresql sources live
+#
+SRCDIR= ../../..
+
+#
+# Include the global and port specific Makefiles
+#
+include $(SRCDIR)/Makefile.global
+
+PORTNAME=(at)PORTNAME@
+
+CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include
+LFLAGS+= -i -l
+
+# For fmgr.h
+CFLAGS+= -I$(SRCDIR)/backend
+
+LDADD+= -L$(LIBPQDIR) -lpq
+
+ifeq ($(PORTNAME), linux)
+ CFLAGS += $(CFLAGS_SL)
+ LDFLAGS_SL = -shared
+endif
+
+ifeq ($(PORTNAME), bsd)
+ ifdef BSD_SHLIB
+ LDFLAGS_SL = -x -Bshareable -Bforcearchive
+ CFLAGS += $(CFLAGS_SL)
+ endif
+endif
+
+ifeq ($(PORTNAME), bsdi)
+ ifdef BSD_SHLIB
+ ifeq ($(LDSUFFIX), .so)
+ LD := shlicc
+ LDFLAGS_SL += -O -shared
+ CFLAGS += $(CFLAGS_SL)
+ endif
+ ifeq ($(LDSUFFIX), .o)
+ LD := shlicc
+ LDFLAGS_SL += -O -r
+ CFLAGS += $(CFLAGS_SL)
+ endif
+ endif
+endif
+
+ifeq ($(PORTNAME), solaris)
+ LDFLAGS_SL := -G -z text
+ CFLAGS += $(CFLAGS_SL)
+endif
+
+ifeq ($(PORTNAME), unixware)
+ LDFLAGS_SL := -G -z text
+ CFLAGS += $(CFLAGS_SL)
+endif
+
+ifeq ($(PORTNAME), univel)
+ LDFLAGS_SL := -G -z text
+ CFLAGS += $(CFLAGS_SL)
+endif
+
+ifeq ($(PORTNAME), hpux)
+ LDFLAGS_SL := -b
+ CFLAGS += $(CFLAGS_SL)
+endif
+
+#
+# DLOBJ is the dynamically-loaded object file.
+#
+DLOBJ= plpgsql$(DLSUFFIX)
+
+OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
+
+ALL= $(DLOBJ)
+
+#
+# Build the shared object
+#
+all: $(ALL)
+
+$(DLOBJ): $(OBJS)
+
+#
+# Clean
+#
+clean:
+ rm -f $(ALL)
+ rm -f *.o y.tab.h pl.tab.h pl_gram.c gram.c pl_scan.c scan.c
+
+install: all
+ $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJ) $(DESTDIR)$(LIBDIR)/$(DLOBJ)
+
+$(DLOBJ): $(OBJS)
+ $(LD) $(LDFLAGS_SL) -o $@ $(OBJS)
+
+
+
+pl_handler.o: pl_handler.c 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
+ $(CC) $(CFLAGS) -c -o $@ pl_gram.c
+
+pl_gram.c: gram.c
+ sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <gram.c >pl_gram.c
+ sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <y.tab.h >pl.tab.h
+
+pl_scan.c: scan.c
+ sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' <scan.c >pl_scan.c
+
+gram.c: gram.y
+
+scan.c: scan.l
+
+pl.tab.h: pl_gram.c

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Terry Mackintosh 1998-10-08 18:06:00 Re: [ADMIN] RE: [HACKERS] Re: [COMMITTERS] 'pgsql/doc/src/sgml protocol.sgml'
Previous Message Brook Milligan 1998-10-08 17:06:21 man page installation patch