Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5e19e14

Browse files
committed
Cleanups of pltcl unknown thingy.
1 parent7a76e29 commit5e19e14

File tree

9 files changed

+471
-455
lines changed

9 files changed

+471
-455
lines changed

‎configure

Lines changed: 390 additions & 384 deletions
Large diffs are not rendered by default.

‎configure.in

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,6 @@ PGAC_ARG_BOOL(with, tcl, no, [ --with-tcl build Tcl and Tk interfa
359359
AC_MSG_RESULT([$with_tcl])
360360
AC_SUBST([with_tcl])
361361

362-
# If Tcl is enabled (above) then check for pltcl_unknown_support
363-
AC_MSG_CHECKING([whether to build with pl/tcl unknown support])
364-
if test "$with_tcl" = yes; then
365-
PGAC_ARG_BOOL(with, pltcl_unknown, no, [ --enable-pltcl-unknown build pl/tcl unknown support if Tcl is enabled])
366-
else
367-
enable_pltcl_unknown=no
368-
fi
369-
AC_MSG_RESULT([$enable_pltcl_unknown])
370-
AC_SUBST([enable_pltcl_unknown])
371-
372362
# If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk
373363
AC_MSG_CHECKING([whether to build with Tk])
374364
if test "$with_tcl" = yes; then
@@ -391,6 +381,21 @@ PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConf
391381
PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
392382

393383

384+
#
385+
# If Tcl is enabled (above) then check for pltcl_unknown_support
386+
#
387+
AC_MSG_CHECKING([whether to build with PL/Tcl unknown support])
388+
if test "$with_tcl" = yes; then
389+
PGAC_ARG_BOOL(enable, pltcl-unknown, no,
390+
[ --enable-pltcl-unknown build PL/Tcl unknown support (if Tcl is enabled)],
391+
[AC_DEFINE([ENABLE_PLTCL_UNKNOWN])])
392+
else
393+
enable_pltcl_unknown=no
394+
fi
395+
AC_MSG_RESULT([$enable_pltcl_unknown])
396+
AC_SUBST([enable_pltcl_unknown])
397+
398+
394399
#
395400
# Optionally build Perl modules (Pg.pm and PL/Perl)
396401
#

‎src/include/config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in config.h afterwards. Of course, if you edit config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: config.h.in,v 1.163 2001/05/07 00:43:25 tgl Exp $
11+
* $Id: config.h.in,v 1.164 2001/05/11 23:38:06 petere Exp $
1212
*/
1313

1414
#ifndefCONFIG_H
@@ -81,6 +81,9 @@
8181
*/
8282
#undef DEF_MAXBACKENDS
8383

84+
/* --enable-pltcl-unknown */
85+
#undef ENABLE_PLTCL_UNKNOWN
86+
8487

8588
/*
8689
*------------------------------------------------------------------------

‎src/pl/tcl/Makefile

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the pltcl shared object
44
#
5-
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.32 2001/05/09 21:42:29 momjian Exp $
5+
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.33 2001/05/11 23:38:06 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -66,17 +66,6 @@ override CPPFLAGS += $(TCL_DEFS)
6666
overrideCFLAGS =$(TCL_CFLAGS_OPTIMIZE)$(TCL_SHLIB_CFLAGS)
6767

6868

69-
# Uncomment the following to enable the unknown command lookup on the
70-
# first of all calls to the call handler. See the doc in the modules
71-
# directory about details.
72-
73-
ifeq ($(enable_pltcl_unknown), yes)
74-
overrideCPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
75-
TCL_UNKNOWN_MODS=modules/pltcl_loadmod\
76-
modules/pltcl_delmod\
77-
modules/pltcl_listmod
78-
endif
79-
8069
#
8170
# DLOBJS is the dynamically-loaded object file.
8271
#
@@ -96,57 +85,45 @@ endif
9685

9786
ifeq ($(TCL_SHARED_BUILD), 1)
9887

99-
all:$(INFILES)$(TCL_UNKNOWN_MODS)
100-
101-
modules/pltcl_loadmod: modules/pltcl_loadmod.in\
102-
$(top_builddir)/src/Makefile.global
103-
sed -e's,@TCLSH@,$(TCLSH),g'\
104-
$<>$@
105-
chmod a+x$@
106-
107-
modules/pltcl_delmod: modules/pltcl_delmod.in\
108-
$(top_builddir)/src/Makefile.global
109-
sed -e's,@TCLSH@,$(TCLSH),g'\
110-
$<>$@
111-
chmod a+x$@
112-
113-
modules/pltcl_listmod: modules/pltcl_listmod.in\
114-
$(top_builddir)/src/Makefile.global
115-
sed -e's,@TCLSH@,$(TCLSH),g'\
116-
$<>$@
117-
chmod a+x$@
88+
all:$(INFILES)
89+
ifeq ($(enable_pltcl_unknown), yes)
90+
$(MAKE) -C modules $@
91+
endif
11892

11993
pltcl$(DLSUFFIX): pltcl.o
12094

12195
install: all installdirs
12296
$(INSTALL_SHLIB)$(DLOBJS)$(DESTDIR)$(libdir)/$(DLOBJS)
12397
ifeq ($(enable_pltcl_unknown), yes)
124-
$(INSTALL_SCRIPT) modules/pltcl_loadmod \
125-
$(DESTDIR)$(bindir)/pltcl_loadmod
126-
$(INSTALL_SCRIPT) modules/pltcl_delmod \
127-
$(DESTDIR)$(bindir)/pltcl_delmod
128-
$(INSTALL_SCRIPT) modules/pltcl_listmod \
129-
$(DESTDIR)$(bindir)/pltcl_listmod
130-
$(INSTALL_DATA) modules/unknown.pltcl \
131-
$(DESTDIR)$(datadir)/unknown.pltcl
98+
$(MAKE) -C modules $@
13299
endif
133100

134101
installdirs:
135102
$(mkinstalldirs)$(DESTDIR)$(libdir)
103+
ifeq ($(enable_pltcl_unknown), yes)
104+
$(MAKE) -C modules $@
105+
endif
136106

137107
uninstall:
138108
rm -f$(DESTDIR)$(libdir)/$(DLOBJS)
109+
ifeq ($(enable_pltcl_unknown), yes)
110+
$(MAKE) -C modules $@
111+
endif
139112

140-
else
113+
else # TCL_SHARED_BUILD = 0
141114

142115
allinstall:
143116
@echo"*****";\
144117
echo"* Cannot build pltcl because Tcl is not a shared library; skipping it.";\
145118
echo"*****"
146-
endif
119+
120+
endif# TCL_SHARED_BUILD = 0
147121

148122
Makefile.tcldefs: mkMakefile.tcldefs.sh
149123
$(SHELL)$<'$(TCL_CONFIG_SH)''$@'
150124

151125
cleandistcleanmaintainer-clean:
152-
rm -f$(INFILES) pltcl.o Makefile.tcldefs modules/pltcl_listmod modules/pltcl_loadmod modules/pltcl_delmod
126+
rm -f$(INFILES) pltcl.o Makefile.tcldefs
127+
ifeq ($(enable_pltcl_unknown), yes)
128+
$(MAKE) -C modules $@
129+
endif

‎src/pl/tcl/modules/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# $Header: /cvsroot/pgsql/src/pl/tcl/modules/Makefile,v 1.1 2001/05/11 23:38:06 petere Exp $
2+
3+
subdir = src/pl/tcl/modules
4+
top_builddir = ../../../..
5+
include$(top_builddir)/src/Makefile.global
6+
7+
MODULES = pltcl_loadmod pltcl_delmod pltcl_listmod
8+
9+
all:$(MODULES)
10+
11+
$(MODULES):%:%.in$(top_builddir)/src/Makefile.global
12+
sed's,@TCLSH@,$(TCLSH),g'$<>$@
13+
chmod a+x$@
14+
15+
install: all installdirs
16+
$(INSTALL_SCRIPT) pltcl_loadmod$(DESTDIR)$(bindir)/pltcl_loadmod
17+
$(INSTALL_SCRIPT) pltcl_delmod$(DESTDIR)$(bindir)/pltcl_delmod
18+
$(INSTALL_SCRIPT) pltcl_listmod$(DESTDIR)$(bindir)/pltcl_listmod
19+
$(INSTALL_DATA) unknown.pltcl$(DESTDIR)$(datadir)/unknown.pltcl
20+
21+
installdirs:
22+
$(mkinstalldirs)$(DESTDIR)$(bindir)$(DESTDIR)$(datadir)
23+
24+
uninstall:
25+
rm -f$(DESTDIR)$(bindir)/pltcl_loadmod$(DESTDIR)$(bindir)/pltcl_delmod$(DESTDIR)$(bindir)/pltcl_listmod$(DESTDIR)$(datadir)/unknown.pltcl
26+
27+
cleandistcleanmaintainer-clean:
28+
rm -f$(MODULES)

‎src/pl/tcl/modules/pltcl_delmod.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/sh
22
# Start tclsh \
3-
exec @TCLSH@"$0"$@
3+
exec @TCLSH@"$0""$@"
44

55
#
66
# Code still has to be documented
@@ -113,4 +113,3 @@ while {$i < $argc} {
113113
}
114114
115115
pg_disconnect $conn
116-

‎src/pl/tcl/modules/pltcl_listmod.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/sh
22
# Start tclsh \
3-
exec @TCLSH@"$0"$@
3+
exec @TCLSH@"$0""$@"
44

55
#
66
# Code still has to be documented
@@ -119,4 +119,3 @@ if {$i == $argc} {
119119
}
120120
121121
pg_disconnect $conn
122-

‎src/pl/tcl/modules/pltcl_loadmod.in

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/sh
22
# Start tclsh \
3-
exec @TCLSH@"$0"$@
3+
exec @TCLSH@"$0""$@"
44

55
#
66
# Code still has to be documented
@@ -499,5 +499,3 @@ __PLTcl_loadmod_load_modules $__PLTcl_loadmod_conn
499499
pg_disconnect $__PLTcl_loadmod_conn
500500
501501
puts ""
502-
503-

‎src/pl/tcl/pltcl.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
* ENHANCEMENTS, OR MODIFICATIONS.
3232
*
3333
* IDENTIFICATION
34-
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.34 2001/03/22 04:01:42 momjian Exp $
34+
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.35 2001/05/11 23:38:06 petere Exp $
3535
*
3636
**********************************************************************/
3737

38+
#include"postgres.h"
39+
3840
#include<tcl.h>
3941

4042
#include<stdio.h>
@@ -111,10 +113,9 @@ static FunctionCallInfo pltcl_current_fcinfo = NULL;
111113
staticvoidpltcl_init_all(void);
112114
staticvoidpltcl_init_interp(Tcl_Interp*interp);
113115

114-
#ifdefPLTCL_UNKNOWN_SUPPORT
116+
#ifdefENABLE_PLTCL_UNKNOWN
115117
staticvoidpltcl_init_load_unknown(Tcl_Interp*interp);
116-
117-
#endif/* PLTCL_UNKNOWN_SUPPORT */
118+
#endif
118119

119120
Datumpltcl_call_handler(PG_FUNCTION_ARGS);
120121
Datumpltclu_call_handler(PG_FUNCTION_ARGS);
@@ -230,7 +231,7 @@ pltcl_init_interp(Tcl_Interp *interp)
230231
Tcl_CreateCommand(interp,"spi_execp",
231232
pltcl_SPI_execp,NULL,NULL);
232233

233-
#ifdefPLTCL_UNKNOWN_SUPPORT
234+
#ifdefENABLE_PLTCL_UNKNOWN
234235
/************************************************************
235236
* Try to load the unknown procedure from pltcl_modules
236237
************************************************************/
@@ -239,11 +240,11 @@ pltcl_init_interp(Tcl_Interp *interp)
239240
pltcl_init_load_unknown(interp);
240241
if (SPI_finish()!=SPI_OK_FINISH)
241242
elog(ERROR,"pltcl_init_interp(): SPI_finish failed");
242-
#endif/*PLTCL_UNKNOWN_SUPPORT */
243+
#endif/*ENABLE_PLTCL_UNKNOWN */
243244
}
244245

245246

246-
#ifdefPLTCL_UNKNOWN_SUPPORT
247+
#ifdefENABLE_PLTCL_UNKNOWN
247248

248249
/**********************************************************************
249250
* pltcl_init_load_unknown()- Load the unknown procedure from
@@ -315,7 +316,7 @@ pltcl_init_load_unknown(Tcl_Interp *interp)
315316
Tcl_DStringFree(&unknown_src);
316317
}
317318

318-
#endif/*PLTCL_UNKNOWN_SUPPORT */
319+
#endif/*ENABLE_PLTCL_UNKNOWN */
319320

320321

321322
/**********************************************************************

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp