OSDN Git Service

Add code to pltcl's Makefile to cope with the situation where
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 Oct 1998 23:33:23 +0000 (23:33 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 Oct 1998 23:33:23 +0000 (23:33 +0000)
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.

src/pl/tcl/Makefile

index 8cc79e9..d21164c 100644 (file)
@@ -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 $
 #
 #-------------------------------------------------------------------------
 
 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: