Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2f2d057

Browse files
committed
Change PL/Tcl build to use configured compiler and Makefile.shlib
system, not Tcl-provided one. Make sure export file, if any, is cleaned. Tcl configuration is now read directly in configure and recorded in Makefile.global. This eliminates some duplicate efforts and allows for easier hand-editing of the results, if necessary.
1 parent c0fdec2 commit 2f2d057

10 files changed

+80
-157
lines changed

config/tcl.m4

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/config/tcl.m4,v 1.3 2002/03/29 17:32:54 petere Exp $
1+
# $Header: /cvsroot/pgsql/config/tcl.m4,v 1.4 2002/05/24 18:10:17 petere Exp $
22

33
# Autoconf macros to check for Tcl related things
44

@@ -74,3 +74,16 @@ fi
7474
7575
AC_SUBST([TK_CONFIG_SH])
7676
])# PGAC_PATH_TKCONFIGSH
77+
78+
79+
# PGAC_EVAL_TCLCONFIGSH(FILE, WANTED-VARS)
80+
# ----------------------------------------
81+
# Assigns variables listed in WANTED-VARS by reading FILE and
82+
# evaluating it according to the quoting scheme of tclConfig.sh and
83+
# tkConfig.sh. Calls AC_SUBST for each variable.
84+
85+
AC_DEFUN([PGAC_EVAL_TCLCONFIGSH],
86+
[. "$1"
87+
m4_foreach([pgac_item], [$2],
88+
[eval pgac_item=\"[$]pgac_item\"
89+
AC_SUBST(pgac_item)])])

configure

+20-1
Original file line numberDiff line numberDiff line change
@@ -16405,7 +16405,13 @@ fi
1640516405
1640616406
1640716407
16408-
fi
16408+
. "$TCL_CONFIG_SH"
16409+
eval TCL_LIB_FILE=\"$TCL_LIB_FILE\"
16410+
eval TCL_LIBS=\"$TCL_LIBS\"
16411+
eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
16412+
eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
16413+
16414+
fi
1640916415
1641016416
# Check for Tk configuration script tkConfig.sh
1641116417
if test "$with_tk" = yes; then
@@ -16444,6 +16450,11 @@ fi
1644416450
1644516451
1644616452
16453+
. "$TK_CONFIG_SH"
16454+
eval TK_LIBS=\"$TK_LIBS\"
16455+
eval TK_LIB_SPEC=\"$TK_LIB_SPEC\"
16456+
eval TK_XINCLUDES=\"$TK_XINCLUDES\"
16457+
1644716458
fi
1644816459
1644916460
@@ -17435,7 +17446,15 @@ s,@XGETTEXT@,$XGETTEXT,;t t
1743517446
s,@localedir@,$localedir,;t t
1743617447
s,@TCLSH@,$TCLSH,;t t
1743717448
s,@TCL_CONFIG_SH@,$TCL_CONFIG_SH,;t t
17449+
s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
17450+
s,@TCL_LIBS@,$TCL_LIBS,;t t
17451+
s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
17452+
s,@TCL_SHARED_BUILD@,$TCL_SHARED_BUILD,;t t
17453+
s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t
1743817454
s,@TK_CONFIG_SH@,$TK_CONFIG_SH,;t t
17455+
s,@TK_LIBS@,$TK_LIBS,;t t
17456+
s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t
17457+
s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t
1743917458
s,@NSGMLS@,$NSGMLS,;t t
1744017459
s,@JADE@,$JADE,;t t
1744117460
s,@have_docbook@,$have_docbook,;t t

configure.in

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.184 2002/05/05 00:03:28 tgl Exp $
3-
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.185 2002/05/24 18:10:17 petere Exp $
3+
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
66
dnl 0. Initialization and options processing
@@ -14,7 +14,9 @@ dnl 7. Functions, global variables
1414
dnl 8. System services
1515
dnl
1616
dnl Read the Autoconf manual for details.
17-
17+
dnl
18+
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
19+
dnl
1820
dnl The GNU folks apparently haven't heard that some people don't use
1921
dnl Texinfo. Use this sorcery to use "docdir" instead of "infodir".
2022
m4_define([info], [doc])
@@ -1201,11 +1203,15 @@ fi
12011203
# Check for Tcl configuration script tclConfig.sh
12021204
if test "$with_tcl" = yes; then
12031205
PGAC_PATH_TCLCONFIGSH([$with_tclconfig])
1206+
PGAC_EVAL_TCLCONFIGSH([$TCL_CONFIG_SH],
1207+
[TCL_LIB_FILE,TCL_LIBS,TCL_LIB_SPEC,TCL_SHARED_BUILD])
1208+
AC_SUBST(TCL_SHLIB_LD_LIBS)dnl don't want to double-evaluate that one
12041209
fi
12051210

12061211
# Check for Tk configuration script tkConfig.sh
12071212
if test "$with_tk" = yes; then
12081213
PGAC_PATH_TKCONFIGSH([$with_tkconfig $with_tclconfig])
1214+
PGAC_EVAL_TCLCONFIGSH([$TK_CONFIG_SH], [TK_LIBS,TK_LIB_SPEC,TK_XINCLUDES])
12091215
fi
12101216

12111217

src/Makefile.global.in

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.146 2002/04/14 17:23:20 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.147 2002/05/24 18:10:17 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -147,9 +147,16 @@ python_configdir = @python_configdir@
147147

148148
krb_srvtab = @krb_srvtab@
149149

150-
TCL_CONFIG_SH = @TCL_CONFIG_SH@
151-
TK_CONFIG_SH = @TK_CONFIG_SH@
152-
TCLSH = @TCLSH@
150+
TCLSH = @TCLSH@
151+
TCL_LIB_FILE = @TCL_LIB_FILE@
152+
TCL_LIBS = @TCL_LIBS@
153+
TCL_LIB_SPEC = @TCL_LIB_SPEC@
154+
TCL_SHARED_BUILD = @TCL_SHARED_BUILD@
155+
TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@
156+
157+
TK_LIBS = @TK_LIBS@
158+
TK_LIB_SPEC = @TK_LIB_SPEC@
159+
TK_XINCLUDES = @TK_XINCLUDES@
153160

154161
have_docbook = @have_docbook@
155162
DOCBOOKSTYLE = @DOCBOOKSTYLE@

src/Makefile.shlib

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.57 2002/04/10 16:45:25 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.58 2002/05/24 18:10:17 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -400,7 +400,10 @@ endif # enable_shared
400400
clean-lib:
401401
rm -f lib$(NAME).a
402402
ifeq ($(enable_shared), yes)
403-
rm -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
403+
rm -f lib$(NAME)$(DLSUFFIX) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
404+
ifdef EXPSUFF
405+
rm -f lib$(NAME)$(EXPSUFF)
406+
endif
404407
endif
405408
ifeq ($(PORTNAME), win)
406409
rm -rf $(NAME).def

src/bin/pgtclsh/Makefile

+2-18
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,14 @@
66
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
77
# Portions Copyright (c) 1994, Regents of the University of California
88
#
9-
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.37 2001/02/20 19:20:29 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.38 2002/05/24 18:10:17 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

1313
subdir = src/bin/pgtclsh
1414
top_builddir = ../../..
1515
include $(top_builddir)/src/Makefile.global
1616

17-
#
18-
# Include definitions from the tclConfig.sh file
19-
#
20-
-include Makefile.tcldefs
21-
ifeq ($(with_tk), yes)
22-
-include Makefile.tkdefs
23-
endif
2417

2518
libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl
2619
libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl
@@ -61,14 +54,5 @@ installdirs:
6154
uninstall:
6255
rm -f $(DESTDIR)$(bindir)/pgtclsh $(DESTDIR)$(bindir)/pgtksh
6356

64-
Makefile.tcldefs: mkMakefile.tcldefs.sh
65-
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
66-
67-
Makefile.tkdefs: mkMakefile.tkdefs.sh
68-
$(SHELL) $< '$(TK_CONFIG_SH)' '$@'
69-
7057
clean distclean maintainer-clean:
71-
rm -f pgtclAppInit.o pgtkAppInit.o Makefile.tcldefs Makefile.tkdefs pgtclsh pgtksh
72-
73-
dep depend:
74-
$(CC) -MM $(CFLAGS) *.c > depend
58+
rm -f pgtclAppInit.o pgtkAppInit.o pgtclsh pgtksh

src/bin/pgtclsh/mkMakefile.tcldefs.sh

-23
This file was deleted.

src/bin/pgtclsh/mkMakefile.tkdefs.sh

-23
This file was deleted.

src/pl/tcl/Makefile

+19-54
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
#
33
# Makefile for the pltcl shared object
44
#
5-
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.37 2002/01/23 18:45:41 tgl Exp $
5+
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.38 2002/05/24 18:10:17 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

99
subdir = src/pl/tcl
1010
top_builddir = ../../..
1111
include $(top_builddir)/src/Makefile.global
1212

13-
-include Makefile.tcldefs
1413

1514
# Find out whether Tcl was built as a shared library --- if not, we
1615
# can't link a shared library that depends on it, and have to forget
@@ -27,93 +26,59 @@ endif
2726
endif
2827

2928

30-
# Change following to how shared library that contains references to
31-
# libtcl must get built on your system. Since these definitions come
32-
# from the tclConfig.sh script, they should work if the shared build
33-
# of tcl was successful on this system. However, tclConfig.sh lies to
34-
# us a little bit (at least in versions 7.6 through 8.0.4) --- it
35-
# doesn't mention -lc in TCL_LIBS, but you still need it on systems
36-
# that want to hear about dependent libraries...
29+
# The following attempts to figure out what libraries need to be
30+
# linked with pltcl. The information comes from the tclConfig.sh
31+
# file, but it's mostly bogus. This just might work.
3732

3833
ifneq ($(TCL_SHLIB_LD_LIBS),)
3934
# link command for a shared lib must mention shared libs it uses
40-
SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
35+
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
4136
else
4237
ifeq ($(PORTNAME), hpux)
4338
# link command for a shared lib must mention shared libs it uses,
4439
# even though Tcl doesn't think so...
45-
SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
40+
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
4641
else
4742
# link command for a shared lib must NOT mention shared libs it uses
48-
SHLIB_EXTRA_LIBS=
43+
SHLIB_LINK = $(TCL_LIB_SPEC)
4944
endif
5045
endif
5146

52-
%$(TCL_SHLIB_SUFFIX): %.o
53-
$(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)
5447

48+
NAME = pltcl
49+
SO_MAJOR_VERSION = 2
50+
SO_MINOR_VERSION = 0
51+
OBJS = pltcl.o
5552

56-
CC = $(TCL_CC)
57-
58-
# Since we are using Tcl's choice of C compiler, which might not be
59-
# the same one selected for Postgres, do NOT use CFLAGS from
60-
# Makefile.global. Instead use TCL's CFLAGS plus necessary -I
61-
# directives.
62-
63-
# Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as
64-
# needed
65-
override CPPFLAGS += $(TCL_DEFS)
66-
override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS)
67-
68-
69-
#
70-
# DLOBJS is the dynamically-loaded object file.
71-
#
72-
DLOBJS= pltcl$(DLSUFFIX)
73-
74-
INFILES= $(DLOBJS)
75-
76-
#
77-
# plus exports files
78-
#
79-
ifdef EXPSUFF
80-
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
81-
endif
82-
83-
84-
# Provide dummy targets for the case where we can't build the shared library.
53+
include $(top_srcdir)/src/Makefile.shlib
8554

8655
ifeq ($(TCL_SHARED_BUILD), 1)
8756

88-
all: $(INFILES)
57+
all: all-lib
8958
$(MAKE) -C modules $@
9059

91-
pltcl$(DLSUFFIX): pltcl.o
92-
9360
install: all installdirs
94-
$(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(pkglibdir)/$(DLOBJS)
61+
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
9562
$(MAKE) -C modules $@
9663

9764
installdirs:
9865
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
9966
$(MAKE) -C modules $@
10067

10168
uninstall:
102-
rm -f $(DESTDIR)$(pkglibdir)/$(DLOBJS)
69+
rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
10370
$(MAKE) -C modules $@
10471

10572
else # TCL_SHARED_BUILD = 0
10673

107-
all install:
74+
# Provide dummy targets for the case where we can't build the shared library.
75+
all:
10876
@echo "*****"; \
10977
echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
11078
echo "*****"
11179

11280
endif # TCL_SHARED_BUILD = 0
11381

114-
Makefile.tcldefs: mkMakefile.tcldefs.sh
115-
$(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
116-
117-
clean distclean maintainer-clean:
118-
rm -f $(INFILES) pltcl.o Makefile.tcldefs
82+
clean distclean maintainer-clean: clean-lib
83+
rm -f $(OBJS)
11984
$(MAKE) -C modules $@

src/pl/tcl/mkMakefile.tcldefs.sh

-28
This file was deleted.

0 commit comments

Comments
 (0)