Commit a71a80b0 authored by Marc G. Fournier's avatar Marc G. Fournier

From: Jan Wieck <jwieck@debis.com>

    A few minutes ago I sent down the PL/Tcl  directory  to  this
    list.  Look at it and reuse anything that might help to build
    PL/perl.  I really hope that PL/perl and PL/Tcl appear in the
    6.3 distribution. I'll do whatever I can to make this happen.
parent 243a9137
Installation instructions for PL/Tcl
1. Build the pltcl shared library
The Makefile for the pltcl shared library assumes the sources
for PostgreSQL are in /usr/local/src/postgresql-6.2.1/src. Edit
if not.
The Makefile depends on the tclConfig.sh file that get's installed
with Tcl. This should either be in /usr/lib or in /usr/local/lib.
If it is in a different place, edit mkMakefile.tcldefs or make a
symbolic link to it here.
Type make and the shared library should get built.
2. Now create the PL/Tcl language in PostgreSQL
Since the pg_language system catalog is private to each database,
the new language can be created only for individual databases,
or in the template1 database. In the latter case, it is
automatically available in all newly created databases.
The commands to create the new language are:
create function pltcl_call_handler () returns opaque
as 'path-to-pltcl-shared-lib'
language 'C';
create trusted procedural language 'pltcl'
handler pltcl_call_handler
lancompiler 'PL/Tcl';
The trusted keyword on create procedural language tells PostgreSQL,
that all users (not only those with superuser privilege) are
permitted to create functions with LANGUAGE 'pltcl'. This is
absolutely safe, because there is nothing a normal user can do
with PL/Tcl, to get around access restrictions he/she has.
3. Use PL/Tcl
Read pltcl_guide.txt to learn how to write functions and
trigger procedures in PL/Tcl.
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for the pltcl shared object
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.1 1998/02/11 14:07:55 scrappy Exp $
#
#-------------------------------------------------------------------------
#
# Tell make where the postgresql sources live
#
SRCDIR= ../../../src
include $(SRCDIR)/Makefile.global
#
# Include definitions from the tclConfig.sh file
#
include Makefile.tcldefs
#
# Uncomment the following to force a specific version of the
# Tcl shared library to be used.
#
#TCL_LIB_SPEC=-L/usr/lib -ltcl8.0
#
# Change following to how shared library that contain
# correct references to libtcl must get built on your system.
# Since these definitions come from the tclConfig.sh script,
# they should work if the shared build of tcl was successful
# on this system.
#
%$(TCL_SHLIB_SUFFIX): %.o
$(TCL_SHLIB_LD) -o $@ $< $(TCL_SHLIB_LD_LIBS) $(TCL_LIB_SPEC) $(TCL_LIBS)
#
# 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.
#
#CFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
CC = $(TCL_CC)
CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include $(TCL_SHLIB_CFLAGS)
# For fmgr.h
CFLAGS+= -I$(SRCDIR)/backend
CFLAGS+= $(TCL_DEFS)
LDADD+= -L$(LIBPQDIR) -lpq
#
# DLOBJS is the dynamically-loaded object file.
#
DLOBJS= pltcl$(DLSUFFIX)
INFILES= $(DLOBJS)
#
# plus exports files
#
ifdef EXPSUFF
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
endif
#
# Build the shared lib
#
all: $(INFILES)
Makefile.tcldefs:
./mkMakefile.tcldefs
#
# Clean
#
clean:
rm -f $(INFILES)
rm -f Makefile.tcldefs
install: all
$(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(DESTDIR)$(LIBDIR)/$(DLOBJS)
This software is copyrighted by Jan Wieck - Hamburg.
The following terms apply to all files associated with the
software unless explicitly disclaimed in individual files.
The author hereby grants permission to use, copy, modify,
distribute, and license this software and its documentation
for any purpose, provided that existing copyright notices are
retained in all copies and that this notice is included
verbatim in any distributions. No written agreement, license,
or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their
author and need not follow the licensing terms described
here, provided that the new terms are clearly indicated on
the first page of each file where they apply.
IN NO EVENT SHALL THE AUTHOR OR DISTRIBUTORS BE LIABLE TO ANY
PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS
SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN
IF THE AUTHOR HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
THE AUTHOR AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON
AN "AS IS" BASIS, AND THE AUTHOR AND DISTRIBUTORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.
#!/bin/sh
if [ -f ./tclConfig.sh ]; then
. ./tclConfig.sh
else
if [ -f /usr/lib/tclConfig.sh ]; then
echo "using tclConfig.sh from /usr/lib"
. /usr/lib/tclConfig.sh
else
if [ -f /usr/local/lib/tclConfig.sh ]; then
echo "using tclConfig.sh from /usr/local/lib"
. /usr/local/lib/tclConfig.sh
else
echo "tclConfig.sh not found in /usr/lib or /usr/local/lib"
echo "I need this file! Please make a symbolic link to this file"
echo "and start make again."
exit 1
fi
fi
fi
set | grep '^TCL' >Makefile.tcldefs
exit 0
This diff is collapsed.
This diff is collapsed.
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