Commit 5e19e14e authored by Peter Eisentraut's avatar Peter Eisentraut

Cleanups of pltcl unknown thingy.

parent 7a76e29b
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -359,16 +359,6 @@ PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfa ...@@ -359,16 +359,6 @@ PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfa
AC_MSG_RESULT([$with_tcl]) AC_MSG_RESULT([$with_tcl])
AC_SUBST([with_tcl]) AC_SUBST([with_tcl])
# If Tcl is enabled (above) then check for pltcl_unknown_support
AC_MSG_CHECKING([whether to build with pl/tcl unknown support])
if test "$with_tcl" = yes; then
PGAC_ARG_BOOL(with, pltcl_unknown, no, [ --enable-pltcl-unknown build pl/tcl unknown support if Tcl is enabled])
else
enable_pltcl_unknown=no
fi
AC_MSG_RESULT([$enable_pltcl_unknown])
AC_SUBST([enable_pltcl_unknown])
# If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk
AC_MSG_CHECKING([whether to build with Tk]) AC_MSG_CHECKING([whether to build with Tk])
if test "$with_tcl" = yes; then if test "$with_tcl" = yes; then
...@@ -391,6 +381,21 @@ PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConf ...@@ -391,6 +381,21 @@ PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConf
PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR]) PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
#
# If Tcl is enabled (above) then check for pltcl_unknown_support
#
AC_MSG_CHECKING([whether to build with PL/Tcl unknown support])
if test "$with_tcl" = yes; then
PGAC_ARG_BOOL(enable, pltcl-unknown, no,
[ --enable-pltcl-unknown build PL/Tcl unknown support (if Tcl is enabled)],
[AC_DEFINE([ENABLE_PLTCL_UNKNOWN])])
else
enable_pltcl_unknown=no
fi
AC_MSG_RESULT([$enable_pltcl_unknown])
AC_SUBST([enable_pltcl_unknown])
# #
# Optionally build Perl modules (Pg.pm and PL/Perl) # Optionally build Perl modules (Pg.pm and PL/Perl)
# #
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your * or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure. * 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 #ifndef CONFIG_H
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
*/ */
#undef DEF_MAXBACKENDS #undef DEF_MAXBACKENDS
/* --enable-pltcl-unknown */
#undef ENABLE_PLTCL_UNKNOWN
/* /*
*------------------------------------------------------------------------ *------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for the pltcl shared object # 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) ...@@ -66,17 +66,6 @@ override CPPFLAGS += $(TCL_DEFS)
override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS) 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. # DLOBJS is the dynamically-loaded object file.
# #
...@@ -96,57 +85,45 @@ endif ...@@ -96,57 +85,45 @@ endif
ifeq ($(TCL_SHARED_BUILD), 1) ifeq ($(TCL_SHARED_BUILD), 1)
all: $(INFILES) $(TCL_UNKNOWN_MODS) all: $(INFILES)
ifeq ($(enable_pltcl_unknown), yes)
modules/pltcl_loadmod: modules/pltcl_loadmod.in \ $(MAKE) -C modules $@
$(top_builddir)/src/Makefile.global endif
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 $@
pltcl$(DLSUFFIX): pltcl.o pltcl$(DLSUFFIX): pltcl.o
install: all installdirs install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS) $(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
ifeq ($(enable_pltcl_unknown), yes) ifeq ($(enable_pltcl_unknown), yes)
$(INSTALL_SCRIPT) modules/pltcl_loadmod \ $(MAKE) -C modules $@
$(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
endif endif
installdirs: installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(mkinstalldirs) $(DESTDIR)$(libdir)
ifeq ($(enable_pltcl_unknown), yes)
$(MAKE) -C modules $@
endif
uninstall: uninstall:
rm -f $(DESTDIR)$(libdir)/$(DLOBJS) rm -f $(DESTDIR)$(libdir)/$(DLOBJS)
ifeq ($(enable_pltcl_unknown), yes)
$(MAKE) -C modules $@
endif
else else # TCL_SHARED_BUILD = 0
all install: all install:
@echo "*****"; \ @echo "*****"; \
echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \ echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
echo "*****" echo "*****"
endif
endif # TCL_SHARED_BUILD = 0
Makefile.tcldefs: mkMakefile.tcldefs.sh Makefile.tcldefs: mkMakefile.tcldefs.sh
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@' $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
clean distclean maintainer-clean: 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
# $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)
#!/bin/sh #! /bin/sh
# Start tclsh \ # Start tclsh \
exec @TCLSH@ "$0" $@ exec @TCLSH@ "$0" "$@"
# #
# Code still has to be documented # Code still has to be documented
...@@ -113,4 +113,3 @@ while {$i < $argc} { ...@@ -113,4 +113,3 @@ while {$i < $argc} {
} }
pg_disconnect $conn pg_disconnect $conn
#!/bin/sh #! /bin/sh
# Start tclsh \ # Start tclsh \
exec @TCLSH@ "$0" $@ exec @TCLSH@ "$0" "$@"
# #
# Code still has to be documented # Code still has to be documented
...@@ -119,4 +119,3 @@ if {$i == $argc} { ...@@ -119,4 +119,3 @@ if {$i == $argc} {
} }
pg_disconnect $conn pg_disconnect $conn
#!/bin/sh #! /bin/sh
# Start tclsh \ # Start tclsh \
exec @TCLSH@ "$0" $@ exec @TCLSH@ "$0" "$@"
# #
# Code still has to be documented # Code still has to be documented
...@@ -499,5 +499,3 @@ __PLTcl_loadmod_load_modules $__PLTcl_loadmod_conn ...@@ -499,5 +499,3 @@ __PLTcl_loadmod_load_modules $__PLTcl_loadmod_conn
pg_disconnect $__PLTcl_loadmod_conn pg_disconnect $__PLTcl_loadmod_conn
puts "" puts ""
...@@ -31,10 +31,12 @@ ...@@ -31,10 +31,12 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * 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 <tcl.h>
#include <stdio.h> #include <stdio.h>
...@@ -111,10 +113,9 @@ static FunctionCallInfo pltcl_current_fcinfo = NULL; ...@@ -111,10 +113,9 @@ static FunctionCallInfo pltcl_current_fcinfo = NULL;
static void pltcl_init_all(void); static void pltcl_init_all(void);
static void pltcl_init_interp(Tcl_Interp *interp); 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); static void pltcl_init_load_unknown(Tcl_Interp *interp);
#endif
#endif /* PLTCL_UNKNOWN_SUPPORT */
Datum pltcl_call_handler(PG_FUNCTION_ARGS); Datum pltcl_call_handler(PG_FUNCTION_ARGS);
Datum pltclu_call_handler(PG_FUNCTION_ARGS); Datum pltclu_call_handler(PG_FUNCTION_ARGS);
...@@ -230,7 +231,7 @@ pltcl_init_interp(Tcl_Interp *interp) ...@@ -230,7 +231,7 @@ pltcl_init_interp(Tcl_Interp *interp)
Tcl_CreateCommand(interp, "spi_execp", Tcl_CreateCommand(interp, "spi_execp",
pltcl_SPI_execp, NULL, NULL); pltcl_SPI_execp, NULL, NULL);
#ifdef PLTCL_UNKNOWN_SUPPORT #ifdef ENABLE_PLTCL_UNKNOWN
/************************************************************ /************************************************************
* Try to load the unknown procedure from pltcl_modules * Try to load the unknown procedure from pltcl_modules
************************************************************/ ************************************************************/
...@@ -239,11 +240,11 @@ pltcl_init_interp(Tcl_Interp *interp) ...@@ -239,11 +240,11 @@ pltcl_init_interp(Tcl_Interp *interp)
pltcl_init_load_unknown(interp); pltcl_init_load_unknown(interp);
if (SPI_finish() != SPI_OK_FINISH) if (SPI_finish() != SPI_OK_FINISH)
elog(ERROR, "pltcl_init_interp(): SPI_finish failed"); 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 * pltcl_init_load_unknown() - Load the unknown procedure from
...@@ -315,7 +316,7 @@ pltcl_init_load_unknown(Tcl_Interp *interp) ...@@ -315,7 +316,7 @@ pltcl_init_load_unknown(Tcl_Interp *interp)
Tcl_DStringFree(&unknown_src); Tcl_DStringFree(&unknown_src);
} }
#endif /* PLTCL_UNKNOWN_SUPPORT */ #endif /* ENABLE_PLTCL_UNKNOWN */
/********************************************************************** /**********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment