aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2001-05-11 23:38:06 +0000
committerPeter Eisentraut <peter_e@gmx.net>2001-05-11 23:38:06 +0000
commit5e19e14ecda8c7ff37f4681fc9e04beb7ca935ba (patch)
tree02f969543186f8f65b3a2204575b07426e5289cc /src
parent7a76e29b0e08c9c3dd50681021c9b1a1bd4b8545 (diff)
downloadpostgresql-5e19e14ecda8c7ff37f4681fc9e04beb7ca935ba.tar.gz
postgresql-5e19e14ecda8c7ff37f4681fc9e04beb7ca935ba.zip
Cleanups of pltcl unknown thingy.
Diffstat (limited to 'src')
-rw-r--r--src/include/config.h.in5
-rw-r--r--src/pl/tcl/Makefile61
-rw-r--r--src/pl/tcl/modules/Makefile28
-rw-r--r--src/pl/tcl/modules/pltcl_delmod.in5
-rw-r--r--src/pl/tcl/modules/pltcl_listmod.in5
-rw-r--r--src/pl/tcl/modules/pltcl_loadmod.in6
-rw-r--r--src/pl/tcl/pltcl.c17
7 files changed, 66 insertions, 61 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 01593a4ce96..fc544f4b3e3 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure.
*
- * $Id: config.h.in,v 1.163 2001/05/07 00:43:25 tgl Exp $
+ * $Id: config.h.in,v 1.164 2001/05/11 23:38:06 petere Exp $
*/
#ifndef CONFIG_H
@@ -81,6 +81,9 @@
*/
#undef DEF_MAXBACKENDS
+/* --enable-pltcl-unknown */
+#undef ENABLE_PLTCL_UNKNOWN
+
/*
*------------------------------------------------------------------------
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile
index 7f312fd8062..a78687299ed 100644
--- a/src/pl/tcl/Makefile
+++ b/src/pl/tcl/Makefile
@@ -2,7 +2,7 @@
#
# Makefile for the pltcl shared object
#
-# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.32 2001/05/09 21:42:29 momjian Exp $
+# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.33 2001/05/11 23:38:06 petere Exp $
#
#-------------------------------------------------------------------------
@@ -66,17 +66,6 @@ override CPPFLAGS += $(TCL_DEFS)
override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS)
-# Uncomment the following to enable the unknown command lookup on the
-# first of all calls to the call handler. See the doc in the modules
-# directory about details.
-
-ifeq ($(enable_pltcl_unknown), yes)
-override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-TCL_UNKNOWN_MODS= modules/pltcl_loadmod \
- modules/pltcl_delmod \
- modules/pltcl_listmod
-endif
-
#
# DLOBJS is the dynamically-loaded object file.
#
@@ -96,57 +85,45 @@ endif
ifeq ($(TCL_SHARED_BUILD), 1)
-all: $(INFILES) $(TCL_UNKNOWN_MODS)
-
-modules/pltcl_loadmod: modules/pltcl_loadmod.in \
- $(top_builddir)/src/Makefile.global
- sed -e 's,@TCLSH@,$(TCLSH),g' \
- $< >$@
- chmod a+x $@
-
-modules/pltcl_delmod: modules/pltcl_delmod.in \
- $(top_builddir)/src/Makefile.global
- sed -e 's,@TCLSH@,$(TCLSH),g' \
- $< >$@
- chmod a+x $@
-
-modules/pltcl_listmod: modules/pltcl_listmod.in \
- $(top_builddir)/src/Makefile.global
- sed -e 's,@TCLSH@,$(TCLSH),g' \
- $< >$@
- chmod a+x $@
+all: $(INFILES)
+ifeq ($(enable_pltcl_unknown), yes)
+ $(MAKE) -C modules $@
+endif
pltcl$(DLSUFFIX): pltcl.o
install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
ifeq ($(enable_pltcl_unknown), yes)
- $(INSTALL_SCRIPT) modules/pltcl_loadmod \
- $(DESTDIR)$(bindir)/pltcl_loadmod
- $(INSTALL_SCRIPT) modules/pltcl_delmod \
- $(DESTDIR)$(bindir)/pltcl_delmod
- $(INSTALL_SCRIPT) modules/pltcl_listmod \
- $(DESTDIR)$(bindir)/pltcl_listmod
- $(INSTALL_DATA) modules/unknown.pltcl \
- $(DESTDIR)$(datadir)/unknown.pltcl
+ $(MAKE) -C modules $@
endif
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
+ifeq ($(enable_pltcl_unknown), yes)
+ $(MAKE) -C modules $@
+endif
uninstall:
rm -f $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(enable_pltcl_unknown), yes)
+ $(MAKE) -C modules $@
+endif
-else
+else # TCL_SHARED_BUILD = 0
all install:
@echo "*****"; \
echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
echo "*****"
-endif
+
+endif # TCL_SHARED_BUILD = 0
Makefile.tcldefs: mkMakefile.tcldefs.sh
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
clean distclean maintainer-clean:
- rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
+ rm -f $(INFILES) pltcl.o Makefile.tcldefs
+ifeq ($(enable_pltcl_unknown), yes)
+ $(MAKE) -C modules $@
+endif
diff --git a/src/pl/tcl/modules/Makefile b/src/pl/tcl/modules/Makefile
new file mode 100644
index 00000000000..08253c3e8fd
--- /dev/null
+++ b/src/pl/tcl/modules/Makefile
@@ -0,0 +1,28 @@
+# $Header: /cvsroot/pgsql/src/pl/tcl/modules/Makefile,v 1.1 2001/05/11 23:38:06 petere Exp $
+
+subdir = src/pl/tcl/modules
+top_builddir = ../../../..
+include $(top_builddir)/src/Makefile.global
+
+MODULES = pltcl_loadmod pltcl_delmod pltcl_listmod
+
+all: $(MODULES)
+
+$(MODULES): %: %.in $(top_builddir)/src/Makefile.global
+ sed 's,@TCLSH@,$(TCLSH),g' $< >$@
+ chmod a+x $@
+
+install: all installdirs
+ $(INSTALL_SCRIPT) pltcl_loadmod $(DESTDIR)$(bindir)/pltcl_loadmod
+ $(INSTALL_SCRIPT) pltcl_delmod $(DESTDIR)$(bindir)/pltcl_delmod
+ $(INSTALL_SCRIPT) pltcl_listmod $(DESTDIR)$(bindir)/pltcl_listmod
+ $(INSTALL_DATA) unknown.pltcl $(DESTDIR)$(datadir)/unknown.pltcl
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)
+
+uninstall:
+ rm -f $(DESTDIR)$(bindir)/pltcl_loadmod $(DESTDIR)$(bindir)/pltcl_delmod $(DESTDIR)$(bindir)/pltcl_listmod $(DESTDIR)$(datadir)/unknown.pltcl
+
+clean distclean maintainer-clean:
+ rm -f $(MODULES)
diff --git a/src/pl/tcl/modules/pltcl_delmod.in b/src/pl/tcl/modules/pltcl_delmod.in
index 5bb89be5289..e65a6742e34 100644
--- a/src/pl/tcl/modules/pltcl_delmod.in
+++ b/src/pl/tcl/modules/pltcl_delmod.in
@@ -1,6 +1,6 @@
-#!/bin/sh
+#! /bin/sh
# Start tclsh \
-exec @TCLSH@ "$0" $@
+exec @TCLSH@ "$0" "$@"
#
# Code still has to be documented
@@ -113,4 +113,3 @@ while {$i < $argc} {
}
pg_disconnect $conn
-
diff --git a/src/pl/tcl/modules/pltcl_listmod.in b/src/pl/tcl/modules/pltcl_listmod.in
index 4882044032a..dbb93db73b5 100644
--- a/src/pl/tcl/modules/pltcl_listmod.in
+++ b/src/pl/tcl/modules/pltcl_listmod.in
@@ -1,6 +1,6 @@
-#!/bin/sh
+#! /bin/sh
# Start tclsh \
-exec @TCLSH@ "$0" $@
+exec @TCLSH@ "$0" "$@"
#
# Code still has to be documented
@@ -119,4 +119,3 @@ if {$i == $argc} {
}
pg_disconnect $conn
-
diff --git a/src/pl/tcl/modules/pltcl_loadmod.in b/src/pl/tcl/modules/pltcl_loadmod.in
index 150b8d39d49..084f24967d1 100644
--- a/src/pl/tcl/modules/pltcl_loadmod.in
+++ b/src/pl/tcl/modules/pltcl_loadmod.in
@@ -1,6 +1,6 @@
-#!/bin/sh
+#! /bin/sh
# Start tclsh \
-exec @TCLSH@ "$0" $@
+exec @TCLSH@ "$0" "$@"
#
# Code still has to be documented
@@ -499,5 +499,3 @@ __PLTcl_loadmod_load_modules $__PLTcl_loadmod_conn
pg_disconnect $__PLTcl_loadmod_conn
puts ""
-
-
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 1fd8d67a468..5c44cbe7abc 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -31,10 +31,12 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.34 2001/03/22 04:01:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.35 2001/05/11 23:38:06 petere Exp $
*
**********************************************************************/
+#include "postgres.h"
+
#include <tcl.h>
#include <stdio.h>
@@ -111,10 +113,9 @@ static FunctionCallInfo pltcl_current_fcinfo = NULL;
static void pltcl_init_all(void);
static void pltcl_init_interp(Tcl_Interp *interp);
-#ifdef PLTCL_UNKNOWN_SUPPORT
+#ifdef ENABLE_PLTCL_UNKNOWN
static void pltcl_init_load_unknown(Tcl_Interp *interp);
-
-#endif /* PLTCL_UNKNOWN_SUPPORT */
+#endif
Datum pltcl_call_handler(PG_FUNCTION_ARGS);
Datum pltclu_call_handler(PG_FUNCTION_ARGS);
@@ -230,7 +231,7 @@ pltcl_init_interp(Tcl_Interp *interp)
Tcl_CreateCommand(interp, "spi_execp",
pltcl_SPI_execp, NULL, NULL);
-#ifdef PLTCL_UNKNOWN_SUPPORT
+#ifdef ENABLE_PLTCL_UNKNOWN
/************************************************************
* Try to load the unknown procedure from pltcl_modules
************************************************************/
@@ -239,11 +240,11 @@ pltcl_init_interp(Tcl_Interp *interp)
pltcl_init_load_unknown(interp);
if (SPI_finish() != SPI_OK_FINISH)
elog(ERROR, "pltcl_init_interp(): SPI_finish failed");
-#endif /* PLTCL_UNKNOWN_SUPPORT */
+#endif /* ENABLE_PLTCL_UNKNOWN */
}
-#ifdef PLTCL_UNKNOWN_SUPPORT
+#ifdef ENABLE_PLTCL_UNKNOWN
/**********************************************************************
* pltcl_init_load_unknown() - Load the unknown procedure from
@@ -315,7 +316,7 @@ pltcl_init_load_unknown(Tcl_Interp *interp)
Tcl_DStringFree(&unknown_src);
}
-#endif /* PLTCL_UNKNOWN_SUPPORT */
+#endif /* ENABLE_PLTCL_UNKNOWN */
/**********************************************************************