patch for configure for enabling of pl/tcl unknown support

Started by Vsevolod Lobkoover 25 years ago10 messagespatches
Jump to latest
#1Vsevolod Lobko
seva@sevasoft.kiev.ua

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

Index: configure.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/configure.in,v
retrieving revision 1.106
diff -u -r1.106 configure.in
--- configure.in	2001/03/05 10:18:47	1.106
+++ configure.in	2001/03/07 21:32:45
@@ -359,6 +359,16 @@
 AC_MSG_RESULT([$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, [  --with-pltcl-unknown    build pl/tcl unknown support if Tcl is enabled])
+else
+  with_pltcl_unknown=no
+fi
+AC_MSG_RESULT([$with_pltcl_unknown])
+AC_SUBST([with_pltcl_unknown])
+
 # 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])
 if test "$with_tcl" = yes; then
@@ -1172,6 +1182,9 @@
   src/GNUmakefile
   src/Makefile.global
   src/backend/port/Makefile
+  src/pl/tcl/modules/pltcl_listmod
+  src/pl/tcl/modules/pltcl_loadmod
+  src/pl/tcl/modules/pltcl_delmod
 ],
 [
 # Update timestamp for config.h (see Makefile.global)
Index: src/Makefile.global.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/Makefile.global.in,v
retrieving revision 1.122
diff -u -r1.122 Makefile.global.in
--- src/Makefile.global.in	2001/03/05 09:39:51	1.122
+++ src/Makefile.global.in	2001/03/07 20:55:39
@@ -111,6 +111,7 @@
 with_perl	= @with_perl@
 with_python	= @with_python@
 with_tcl	= @with_tcl@
+with_pltcl_unknown	= @with_pltcl_unknown@
 with_tk		= @with_tk@
 enable_odbc	= @enable_odbc@
 MULTIBYTE	= @MULTIBYTE@
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- src/pl/tcl/Makefile	2000/12/15 18:50:35	1.26
+++ src/pl/tcl/Makefile	2001/03/07 21:21:26
@@ -70,8 +70,9 @@
 # first of all calls to the call handler. See the doc in the modules
 # directory about details.
-#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-
+ifeq ($(with_pltcl_unknown), yes)
+override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
+endif

#
# DLOBJS is the dynamically-loaded object file.
@@ -98,6 +99,16 @@

 install: all installdirs
 	$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(with_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
+endif

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -117,4 +128,4 @@
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

 clean distclean maintainer-clean:
-	rm -f $(INFILES) pltcl.o Makefile.tcldefs
+	rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
Index: src/pl/tcl/modules/pltcl_delmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_delmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_delmod
--- src/pl/tcl/modules/pltcl_delmod	1998/02/11 14:14:15	1.1
+++ src/pl/tcl/modules/pltcl_delmod	2001/03/07 21:42:04
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
 #
 # Code still has to be documented
Index: src/pl/tcl/modules/pltcl_listmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_listmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_listmod
--- src/pl/tcl/modules/pltcl_listmod	1998/02/11 14:14:16	1.1
+++ src/pl/tcl/modules/pltcl_listmod	2001/03/07 21:42:14
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
 #
 # Code still has to be documented
Index: src/pl/tcl/modules/pltcl_loadmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_loadmod,v
retrieving revision 1.2
diff -u -r1.2 pltcl_loadmod
--- src/pl/tcl/modules/pltcl_loadmod	2001/03/07 16:09:09	1.2
+++ src/pl/tcl/modules/pltcl_loadmod	2001/03/07 21:42:24
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@

#
# Code still has to be documented

#2Bruce Momjian
bruce@momjian.us
In reply to: Vsevolod Lobko (#1)
Re: patch for configure for enabling of pl/tcl unknown support

I think I will have to hold this for 7.2. Sorry.

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

Index: configure.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/configure.in,v
retrieving revision 1.106
diff -u -r1.106 configure.in
--- configure.in	2001/03/05 10:18:47	1.106
+++ configure.in	2001/03/07 21:32:45
@@ -359,6 +359,16 @@
AC_MSG_RESULT([$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, [  --with-pltcl-unknown    build pl/tcl unknown support if Tcl is enabled])
+else
+  with_pltcl_unknown=no
+fi
+AC_MSG_RESULT([$with_pltcl_unknown])
+AC_SUBST([with_pltcl_unknown])
+
# 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])
if test "$with_tcl" = yes; then
@@ -1172,6 +1182,9 @@
src/GNUmakefile
src/Makefile.global
src/backend/port/Makefile
+  src/pl/tcl/modules/pltcl_listmod
+  src/pl/tcl/modules/pltcl_loadmod
+  src/pl/tcl/modules/pltcl_delmod
],
[
# Update timestamp for config.h (see Makefile.global)
Index: src/Makefile.global.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/Makefile.global.in,v
retrieving revision 1.122
diff -u -r1.122 Makefile.global.in
--- src/Makefile.global.in	2001/03/05 09:39:51	1.122
+++ src/Makefile.global.in	2001/03/07 20:55:39
@@ -111,6 +111,7 @@
with_perl	= @with_perl@
with_python	= @with_python@
with_tcl	= @with_tcl@
+with_pltcl_unknown	= @with_pltcl_unknown@
with_tk		= @with_tk@
enable_odbc	= @enable_odbc@
MULTIBYTE	= @MULTIBYTE@
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- src/pl/tcl/Makefile	2000/12/15 18:50:35	1.26
+++ src/pl/tcl/Makefile	2001/03/07 21:21:26
@@ -70,8 +70,9 @@
# first of all calls to the call handler. See the doc in the modules
# directory about details.
-#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-
+ifeq ($(with_pltcl_unknown), yes)
+override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
+endif

#
# DLOBJS is the dynamically-loaded object file.
@@ -98,6 +99,16 @@

install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(with_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
+endif

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -117,4 +128,4 @@
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

clean distclean maintainer-clean:
-	rm -f $(INFILES) pltcl.o Makefile.tcldefs
+	rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
Index: src/pl/tcl/modules/pltcl_delmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_delmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_delmod
--- src/pl/tcl/modules/pltcl_delmod	1998/02/11 14:14:15	1.1
+++ src/pl/tcl/modules/pltcl_delmod	2001/03/07 21:42:04
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_listmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_listmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_listmod
--- src/pl/tcl/modules/pltcl_listmod	1998/02/11 14:14:16	1.1
+++ src/pl/tcl/modules/pltcl_listmod	2001/03/07 21:42:14
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_loadmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_loadmod,v
retrieving revision 1.2
diff -u -r1.2 pltcl_loadmod
--- src/pl/tcl/modules/pltcl_loadmod	2001/03/07 16:09:09	1.2
+++ src/pl/tcl/modules/pltcl_loadmod	2001/03/07 21:42:24
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@

#
# Code still has to be documented

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Bruce Momjian
bruce@momjian.us
In reply to: Vsevolod Lobko (#1)
Re: patch for configure for enabling of pl/tcl unknown support

Patch applied. I added a mention to installation.sgml too. Autoconf
run.

<varlistentry>
<term>--with-pltcl-unknown</term>
<listitem>
<para>
Enables enables PL/Tcl unknown support.
</para>
</listitem>
</varlistentry>

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

Index: configure.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/configure.in,v
retrieving revision 1.106
diff -u -r1.106 configure.in
--- configure.in	2001/03/05 10:18:47	1.106
+++ configure.in	2001/03/07 21:32:45
@@ -359,6 +359,16 @@
AC_MSG_RESULT([$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, [  --with-pltcl-unknown    build pl/tcl unknown support if Tcl is enabled])
+else
+  with_pltcl_unknown=no
+fi
+AC_MSG_RESULT([$with_pltcl_unknown])
+AC_SUBST([with_pltcl_unknown])
+
# 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])
if test "$with_tcl" = yes; then
@@ -1172,6 +1182,9 @@
src/GNUmakefile
src/Makefile.global
src/backend/port/Makefile
+  src/pl/tcl/modules/pltcl_listmod
+  src/pl/tcl/modules/pltcl_loadmod
+  src/pl/tcl/modules/pltcl_delmod
],
[
# Update timestamp for config.h (see Makefile.global)
Index: src/Makefile.global.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/Makefile.global.in,v
retrieving revision 1.122
diff -u -r1.122 Makefile.global.in
--- src/Makefile.global.in	2001/03/05 09:39:51	1.122
+++ src/Makefile.global.in	2001/03/07 20:55:39
@@ -111,6 +111,7 @@
with_perl	= @with_perl@
with_python	= @with_python@
with_tcl	= @with_tcl@
+with_pltcl_unknown	= @with_pltcl_unknown@
with_tk		= @with_tk@
enable_odbc	= @enable_odbc@
MULTIBYTE	= @MULTIBYTE@
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- src/pl/tcl/Makefile	2000/12/15 18:50:35	1.26
+++ src/pl/tcl/Makefile	2001/03/07 21:21:26
@@ -70,8 +70,9 @@
# first of all calls to the call handler. See the doc in the modules
# directory about details.
-#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-
+ifeq ($(with_pltcl_unknown), yes)
+override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
+endif

#
# DLOBJS is the dynamically-loaded object file.
@@ -98,6 +99,16 @@

install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(with_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
+endif

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -117,4 +128,4 @@
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

clean distclean maintainer-clean:
-	rm -f $(INFILES) pltcl.o Makefile.tcldefs
+	rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
Index: src/pl/tcl/modules/pltcl_delmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_delmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_delmod
--- src/pl/tcl/modules/pltcl_delmod	1998/02/11 14:14:15	1.1
+++ src/pl/tcl/modules/pltcl_delmod	2001/03/07 21:42:04
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_listmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_listmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_listmod
--- src/pl/tcl/modules/pltcl_listmod	1998/02/11 14:14:16	1.1
+++ src/pl/tcl/modules/pltcl_listmod	2001/03/07 21:42:14
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_loadmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_loadmod,v
retrieving revision 1.2
diff -u -r1.2 pltcl_loadmod
--- src/pl/tcl/modules/pltcl_loadmod	2001/03/07 16:09:09	1.2
+++ src/pl/tcl/modules/pltcl_loadmod	2001/03/07 21:42:24
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@

#
# Code still has to be documented

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

Patch applied. I added a mention to installation.sgml too. Autoconf
run.

<varlistentry>
<term>--with-pltcl-unknown</term>
<listitem>
<para>
Enables enables PL/Tcl unknown support.
</para>
</listitem>
</varlistentry>

Should be --enable-pltcl-unknown.

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

Index: configure.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/configure.in,v
retrieving revision 1.106
diff -u -r1.106 configure.in
--- configure.in	2001/03/05 10:18:47	1.106
+++ configure.in	2001/03/07 21:32:45
@@ -359,6 +359,16 @@
AC_MSG_RESULT([$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, [  --with-pltcl-unknown    build pl/tcl unknown support if Tcl is enabled])
+else
+  with_pltcl_unknown=no
+fi
+AC_MSG_RESULT([$with_pltcl_unknown])
+AC_SUBST([with_pltcl_unknown])
+
# 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])
if test "$with_tcl" = yes; then
@@ -1172,6 +1182,9 @@
src/GNUmakefile
src/Makefile.global
src/backend/port/Makefile
+  src/pl/tcl/modules/pltcl_listmod
+  src/pl/tcl/modules/pltcl_loadmod
+  src/pl/tcl/modules/pltcl_delmod
],
[
# Update timestamp for config.h (see Makefile.global)
Index: src/Makefile.global.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/Makefile.global.in,v
retrieving revision 1.122
diff -u -r1.122 Makefile.global.in
--- src/Makefile.global.in	2001/03/05 09:39:51	1.122
+++ src/Makefile.global.in	2001/03/07 20:55:39
@@ -111,6 +111,7 @@
with_perl	= @with_perl@
with_python	= @with_python@
with_tcl	= @with_tcl@
+with_pltcl_unknown	= @with_pltcl_unknown@
with_tk		= @with_tk@
enable_odbc	= @enable_odbc@
MULTIBYTE	= @MULTIBYTE@
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- src/pl/tcl/Makefile	2000/12/15 18:50:35	1.26
+++ src/pl/tcl/Makefile	2001/03/07 21:21:26
@@ -70,8 +70,9 @@
# first of all calls to the call handler. See the doc in the modules
# directory about details.
-#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-
+ifeq ($(with_pltcl_unknown), yes)
+override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
+endif

#
# DLOBJS is the dynamically-loaded object file.
@@ -98,6 +99,16 @@

install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(with_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
+endif

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -117,4 +128,4 @@
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

clean distclean maintainer-clean:
-	rm -f $(INFILES) pltcl.o Makefile.tcldefs
+	rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
Index: src/pl/tcl/modules/pltcl_delmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_delmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_delmod
--- src/pl/tcl/modules/pltcl_delmod	1998/02/11 14:14:15	1.1
+++ src/pl/tcl/modules/pltcl_delmod	2001/03/07 21:42:04
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_listmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_listmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_listmod
--- src/pl/tcl/modules/pltcl_listmod	1998/02/11 14:14:16	1.1
+++ src/pl/tcl/modules/pltcl_listmod	2001/03/07 21:42:14
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_loadmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_loadmod,v
retrieving revision 1.2
diff -u -r1.2 pltcl_loadmod
--- src/pl/tcl/modules/pltcl_loadmod	2001/03/07 16:09:09	1.2
+++ src/pl/tcl/modules/pltcl_loadmod	2001/03/07 21:42:24
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@

#
# Code still has to be documented

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

Patch applied. I added a mention to installation.sgml too. Autoconf
run.

<varlistentry>
<term>--with-pltcl-unknown</term>
<listitem>
<para>
Enables enables PL/Tcl unknown support.
</para>
</listitem>
</varlistentry>

Should be --enable-pltcl-unknown.

Done, change made, docs updated, autoconf run.

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

Also it adds substituting of tclsh with tclsh that was by configure in
pltcl_*mod scripts. For example, On freebsd, tclsh can be called tclsh8.2 or
tclsh8.3 depending on installed version of Tcl.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

Index: configure.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/configure.in,v
retrieving revision 1.106
diff -u -r1.106 configure.in
--- configure.in	2001/03/05 10:18:47	1.106
+++ configure.in	2001/03/07 21:32:45
@@ -359,6 +359,16 @@
AC_MSG_RESULT([$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, [  --with-pltcl-unknown    build pl/tcl unknown support if Tcl is enabled])
+else
+  with_pltcl_unknown=no
+fi
+AC_MSG_RESULT([$with_pltcl_unknown])
+AC_SUBST([with_pltcl_unknown])
+
# 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])
if test "$with_tcl" = yes; then
@@ -1172,6 +1182,9 @@
src/GNUmakefile
src/Makefile.global
src/backend/port/Makefile
+  src/pl/tcl/modules/pltcl_listmod
+  src/pl/tcl/modules/pltcl_loadmod
+  src/pl/tcl/modules/pltcl_delmod
],
[
# Update timestamp for config.h (see Makefile.global)
Index: src/Makefile.global.in
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/Makefile.global.in,v
retrieving revision 1.122
diff -u -r1.122 Makefile.global.in
--- src/Makefile.global.in	2001/03/05 09:39:51	1.122
+++ src/Makefile.global.in	2001/03/07 20:55:39
@@ -111,6 +111,7 @@
with_perl	= @with_perl@
with_python	= @with_python@
with_tcl	= @with_tcl@
+with_pltcl_unknown	= @with_pltcl_unknown@
with_tk		= @with_tk@
enable_odbc	= @enable_odbc@
MULTIBYTE	= @MULTIBYTE@
Index: src/pl/tcl/Makefile
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- src/pl/tcl/Makefile	2000/12/15 18:50:35	1.26
+++ src/pl/tcl/Makefile	2001/03/07 21:21:26
@@ -70,8 +70,9 @@
# first of all calls to the call handler. See the doc in the modules
# directory about details.
-#override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
-
+ifeq ($(with_pltcl_unknown), yes)
+override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
+endif

#
# DLOBJS is the dynamically-loaded object file.
@@ -98,6 +99,16 @@

install: all installdirs
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(libdir)/$(DLOBJS)
+ifeq ($(with_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
+endif

installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
@@ -117,4 +128,4 @@
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'

clean distclean maintainer-clean:
-	rm -f $(INFILES) pltcl.o Makefile.tcldefs
+	rm -f $(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
Index: src/pl/tcl/modules/pltcl_delmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_delmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_delmod
--- src/pl/tcl/modules/pltcl_delmod	1998/02/11 14:14:15	1.1
+++ src/pl/tcl/modules/pltcl_delmod	2001/03/07 21:42:04
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_listmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_listmod,v
retrieving revision 1.1
diff -u -r1.1 pltcl_listmod
--- src/pl/tcl/modules/pltcl_listmod	1998/02/11 14:14:16	1.1
+++ src/pl/tcl/modules/pltcl_listmod	2001/03/07 21:42:14
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@
#
# Code still has to be documented
Index: src/pl/tcl/modules/pltcl_loadmod
===================================================================
RCS file: /home/src/pgsql/repo/pgsql/src/pl/tcl/modules/pltcl_loadmod,v
retrieving revision 1.2
diff -u -r1.2 pltcl_loadmod
--- src/pl/tcl/modules/pltcl_loadmod	2001/03/07 16:09:09	1.2
+++ src/pl/tcl/modules/pltcl_loadmod	2001/03/07 21:42:24
@@ -1,6 +1,6 @@
#!/bin/sh
# Start tclsh \
-exec tclsh "$0" $@
+exec @TCLSH@ "$0" $@

#
# Code still has to be documented

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#6Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

These files should be build in a makefile. Creating them with
config.status is not going to fly.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter

#7Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#6)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

These files should be build in a makefile. Creating them with
config.status is not going to fly.

I am on it.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#8Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#6)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

This patch adds a new configure option --with-pltcl-unknown which
enables pltcl unknown support.

After patching files
src/pl/tcl/modules/pltcl_listmod
src/pl/tcl/modules/pltcl_loadmod
src/pl/tcl/modules/pltcl_delmod
must be renamed(copied,repocopied) to
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/pl/tcl/modules/pltcl_delmod.in

These files should be build in a makefile. Creating them with
config.status is not going to fly.

OK, Peter, I have removed the generation of rht pltcl's from configure,
added TCLSH to Makefile.global.in, and added something to the
pl/tcl/Makefile to generate them from *.in files using sed.

I am attaching the new Makefile. I was a little confused on the
Makefile dependencies when the actual files are not generated unless
then ask for --enable-pltcl-unknown:

all: $(INFILES) tcl_unknown

tcl_unknown: $(top_builddir)/src/Makefile.global \
modules/pltcl_loadmod.in \
modules/pltcl_delmod.in \
modules/pltcl_listmod.in
ifeq ($(enable_pltcl_unknown), yes)
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_loadmod.in > modules/pltcl_$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_delmod.in > modules/pltcl_d$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_listmod.in > modules/pltcl_$
chmod a+x modules/pltcl_loadmod modules/pltcl_delmod modules/pltcl_list$
endif

I am not sure about the dependencies. If I knew I was making them all
the time, I could easily create proper dependencies for the files, but I
only generate them if enabled.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pg/pl/tcl/Makefiletext/plainDownload
#9Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#8)
Re: patch for configure for enabling of pl/tcl unknown support

Bruce Momjian writes:

I am attaching the new Makefile. I was a little confused on the
Makefile dependencies when the actual files are not generated unless
then ask for --enable-pltcl-unknown:

all: $(INFILES) tcl_unknown

tcl_unknown: $(top_builddir)/src/Makefile.global \
modules/pltcl_loadmod.in \
modules/pltcl_delmod.in \
modules/pltcl_listmod.in
ifeq ($(enable_pltcl_unknown), yes)
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_loadmod.in > modules/pltcl_$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_delmod.in > modules/pltcl_d$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_listmod.in > modules/pltcl_$
chmod a+x modules/pltcl_loadmod modules/pltcl_delmod modules/pltcl_list$
endif

Probably something like this:

all: pltcl_loadmod pltcl_delmod pltcl_listmod

pltcl_%mod: pltcl_%mod.in
sed 's/@TCLSH@/$(TCLSH)/g' $< >$@

Do they need to be executable? I don't know exactly how this "unknown"
thing works anyway, I'll probably take a look later. As long as it
doesn't break anything now. ;-)

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter

#10Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#9)
Re: patch for configure for enabling of pl/tcl unknown support

tcl_unknown: $(top_builddir)/src/Makefile.global \
modules/pltcl_loadmod.in \
modules/pltcl_delmod.in \
modules/pltcl_listmod.in
ifeq ($(enable_pltcl_unknown), yes)
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_loadmod.in > modules/pltcl_$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_delmod.in > modules/pltcl_d$
sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_listmod.in > modules/pltcl_$
chmod a+x modules/pltcl_loadmod modules/pltcl_delmod modules/pltcl_list$
endif

Probably something like this:

all: pltcl_loadmod pltcl_delmod pltcl_listmod

pltcl_%mod: pltcl_%mod.in
sed 's/@TCLSH@/$(TCLSH)/g' $< >$@

Do they need to be executable? I don't know exactly how this "unknown"
thing works anyway, I'll probably take a look later. As long as it
doesn't break anything now. ;-)

I did much better than that because I didn't want to generate those
files unless they asked for unknown. I did:

ifeq ($(enable_pltcl_unknown), yes)
override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
TCL_UNKNOWN_MODS= modules/pltcl_loadmod \
modules/pltcl_delmod \
modules/pltcl_listmod
endif

and later:

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 $@
...

Yes, they are tcl scripts so they have to be executable. That is what
the author had.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026