summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane1998-10-17 23:33:23 +0000
committerTom Lane1998-10-17 23:33:23 +0000
commitf2ca34dfb3f2e20b9babe075a88b096f63f85709 (patch)
tree189b6e33ce32d1402e5ce1085a1845e862afa9fe
parent5f27ac6b5ec198715dd2e888e83b304867d09a4c (diff)
Add code to pltcl's Makefile to cope with the situation where
libtcl has been installed as a non-shared library. pltcl cannot be built in that situation; we want to do nothing and let the overall Postgres build complete, rather than failing.
-rw-r--r--src/pl/tcl/Makefile53
1 files changed, 46 insertions, 7 deletions
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile
index 8cc79e9e19..d21164c009 100644
--- a/src/pl/tcl/Makefile
+++ b/src/pl/tcl/Makefile
@@ -4,7 +4,7 @@
# Makefile for the pltcl shared object
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.7 1998/10/13 16:30:49 momjian Exp $
+# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.8 1998/10/17 23:33:23 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -14,12 +14,30 @@
SRCDIR= ../../../src
include $(SRCDIR)/Makefile.global
-
#
# Include definitions from the tclConfig.sh file
+# NOTE: GNU make will make this file automatically if it doesn't exist,
+# using the make rule that appears below. Cute, eh?
#
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 about building pltcl.
+# In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD for us, but in
+# older Tcl releases it doesn't. In that case we guess based on
+# the name of the Tcl library.
+#
+ifndef TCL_SHARED_BUILD
+ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE)))
+TCL_SHARED_BUILD=1
+else
+TCL_SHARED_BUILD=0
+endif
+endif
+
+
# 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,
@@ -62,22 +80,43 @@ ifdef EXPSUFF
INFILES+= $(DLOBJS:.o=$(EXPSUFF))
endif
+
+ifeq ($(TCL_SHARED_BUILD),1)
+
#
# Build the shared lib
#
all: $(INFILES)
-Makefile.tcldefs:
+install: all
+ $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS)
+
+else
+
+#
+# Oops, can't build it
+#
+all:
+ @echo "Cannot build pltcl because Tcl is not a shared library; skipping it."
+
+install:
+ @echo "Cannot build pltcl because Tcl is not a shared library; skipping it."
+
+endif
+
+#
+# Make targets that are still valid when we can't build pltcl
+# should be below here.
+#
+
+Makefile.tcldefs: mkMakefile.tcldefs.sh
/bin/sh mkMakefile.tcldefs.sh
#
# Clean
#
clean:
- rm -f $(INFILES)
+ rm -f $(INFILES) *.o
rm -f Makefile.tcldefs
-install: all
- $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS)
-
dep depend: