summaryrefslogtreecommitdiff
path: root/src/pl/tcl
diff options
context:
space:
mode:
authorPeter Eisentraut2002-05-24 18:10:17 +0000
committerPeter Eisentraut2002-05-24 18:10:17 +0000
commit2f2d05763d1c55c7998c0d7030659e3db6f60183 (patch)
tree712315fa10be6aae8bc89a26db9d1be221248183 /src/pl/tcl
parentc0fdec2b6a5ff5981c097101a938dea890be2392 (diff)
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.
Diffstat (limited to 'src/pl/tcl')
-rw-r--r--src/pl/tcl/Makefile73
-rw-r--r--src/pl/tcl/mkMakefile.tcldefs.sh28
2 files changed, 19 insertions, 82 deletions
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile
index 5a9ae266d02..43f420c7e1f 100644
--- a/src/pl/tcl/Makefile
+++ b/src/pl/tcl/Makefile
@@ -2,7 +2,7 @@
#
# Makefile for the pltcl shared object
#
-# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.37 2002/01/23 18:45:41 tgl Exp $
+# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.38 2002/05/24 18:10:17 petere Exp $
#
#-------------------------------------------------------------------------
@@ -10,7 +10,6 @@ subdir = src/pl/tcl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
--include Makefile.tcldefs
# Find out whether Tcl was built as a shared library --- if not, we
# can't link a shared library that depends on it, and have to forget
@@ -27,71 +26,39 @@ endif
endif
-# Change following to how shared library that contains 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. However, tclConfig.sh lies to
-# us a little bit (at least in versions 7.6 through 8.0.4) --- it
-# doesn't mention -lc in TCL_LIBS, but you still need it on systems
-# that want to hear about dependent libraries...
+# The following attempts to figure out what libraries need to be
+# linked with pltcl. The information comes from the tclConfig.sh
+# file, but it's mostly bogus. This just might work.
ifneq ($(TCL_SHLIB_LD_LIBS),)
# link command for a shared lib must mention shared libs it uses
-SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
+SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
else
ifeq ($(PORTNAME), hpux)
# link command for a shared lib must mention shared libs it uses,
# even though Tcl doesn't think so...
-SHLIB_EXTRA_LIBS=$(TCL_LIBS) -lc
+SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
else
# link command for a shared lib must NOT mention shared libs it uses
-SHLIB_EXTRA_LIBS=
+SHLIB_LINK = $(TCL_LIB_SPEC)
endif
endif
-%$(TCL_SHLIB_SUFFIX): %.o
- $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)
+NAME = pltcl
+SO_MAJOR_VERSION = 2
+SO_MINOR_VERSION = 0
+OBJS = pltcl.o
-CC = $(TCL_CC)
-
-# Since we are using Tcl's choice of C compiler, which might not be
-# the same one selected for Postgres, do NOT use CFLAGS from
-# Makefile.global. Instead use TCL's CFLAGS plus necessary -I
-# directives.
-
-# Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as
-# needed
-override CPPFLAGS += $(TCL_DEFS)
-override CFLAGS = $(TCL_CFLAGS_OPTIMIZE) $(TCL_SHLIB_CFLAGS)
-
-
-#
-# DLOBJS is the dynamically-loaded object file.
-#
-DLOBJS= pltcl$(DLSUFFIX)
-
-INFILES= $(DLOBJS)
-
-#
-# plus exports files
-#
-ifdef EXPSUFF
-INFILES+= $(DLOBJS:.o=$(EXPSUFF))
-endif
-
-
-# Provide dummy targets for the case where we can't build the shared library.
+include $(top_srcdir)/src/Makefile.shlib
ifeq ($(TCL_SHARED_BUILD), 1)
-all: $(INFILES)
+all: all-lib
$(MAKE) -C modules $@
-pltcl$(DLSUFFIX): pltcl.o
-
install: all installdirs
- $(INSTALL_SHLIB) $(DLOBJS) $(DESTDIR)$(pkglibdir)/$(DLOBJS)
+ $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
$(MAKE) -C modules $@
installdirs:
@@ -99,21 +66,19 @@ installdirs:
$(MAKE) -C modules $@
uninstall:
- rm -f $(DESTDIR)$(pkglibdir)/$(DLOBJS)
+ rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
$(MAKE) -C modules $@
else # TCL_SHARED_BUILD = 0
-all install:
+# Provide dummy targets for the case where we can't build the shared library.
+all:
@echo "*****"; \
echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
echo "*****"
endif # TCL_SHARED_BUILD = 0
-Makefile.tcldefs: mkMakefile.tcldefs.sh
- $(SHELL) $< '$(TCL_CONFIG_SH)' '$@'
-
-clean distclean maintainer-clean:
- rm -f $(INFILES) pltcl.o Makefile.tcldefs
+clean distclean maintainer-clean: clean-lib
+ rm -f $(OBJS)
$(MAKE) -C modules $@
diff --git a/src/pl/tcl/mkMakefile.tcldefs.sh b/src/pl/tcl/mkMakefile.tcldefs.sh
deleted file mode 100644
index 04d09b7290d..00000000000
--- a/src/pl/tcl/mkMakefile.tcldefs.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/sh
-
-# $1 = path to tclConfig.sh ; $2 = output file
-
-# $Header: /cvsroot/pgsql/src/pl/tcl/Attic/mkMakefile.tcldefs.sh,v 1.2 2002/01/23 18:45:41 tgl Exp $
-
-if test x"$1" = x ; then
- echo "$0: No tclConfig.sh file specified. Did you use \`configure --with-tcl'?" 1>&2
- exit 1
-fi
-
-# Source the file to obtain the correctly expanded variable definitions
-. "$1"
-
-# Suppress bogus soname switch that RedHat RPMs put into tclConfig.sh
-TCL_SHLIB_LD=`echo "$TCL_SHLIB_LD" | sed 's/-Wl,-soname[^ ]*//'`
-
-# Read the file a second time as an easy way of getting the list of variable
-# definitions to output.
-cat "$1" |
- egrep '^TCL_|^TK_' |
- sed 's/^\([^=]*\)=.*$/\1/' |
- while read var
- do
- eval echo "\"$var = \$$var\""
- done > "$2"
-
-exit 0