From 23815260a38df7966d9ba37e3355a80fe03b3f17 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 8 Oct 1998 23:45:19 +0000 Subject: I have had a few problems with the PL stuff recently committed. The following patches fix the problems (i.e., all regression tests pass) in what I hope to be a platform-independent fashion. The accomplish the following: Brook Milligan --- src/configure.in | 43 +++++++++++++- src/pl/plpgsql/src/Makefile | 84 -------------------------- src/pl/plpgsql/src/Makefile.in | 131 +++++++++++++++++++++++++++++++++++++++++ src/pl/tcl/Makefile | 4 +- src/pl/tcl/mkMakefile.tcldefs | 25 -------- 5 files changed, 175 insertions(+), 112 deletions(-) delete mode 100644 src/pl/plpgsql/src/Makefile create mode 100644 src/pl/plpgsql/src/Makefile.in delete mode 100755 src/pl/tcl/mkMakefile.tcldefs (limited to 'src') diff --git a/src/configure.in b/src/configure.in index bf72426de32..6c982efa498 100644 --- a/src/configure.in +++ b/src/configure.in @@ -799,6 +799,30 @@ if test "$USE_TCL" = "true"; then AC_SUBST(TCL_LIB) fi +dnl Check for Tcl configuration script tclConfig.sh +if test "$USE_TCL"; then + AC_MSG_CHECKING(for tclConfig.sh) + library_dirs="/usr/lib $LIBRARY_DIRS" + TCL_CONFIG_SH= + for dir in $library_dirs; do + for tcl_dir in $tcl_dirs; do + if test -z "$TCL_CONFIG_SH"; then + if test -d "$dir/$tcl_dir" -a -r "$dir/$tcl_dir/tclConfig.sh"; then + TCL_CONFIG_SH=$dir/$tcl_dir/tclConfig.sh + fi + fi + done + done + if test -z "$TCL_CONFIG_SH"; then + AC_MSG_RESULT(no) + AC_MSG_WARN(tcl support disabled; Tcl configuration script missing) + USE_TCL= + else + AC_MSG_RESULT($TCL_CONFIG_SH) + AC_SUBST(TCL_CONFIG_SH) + fi +fi + dnl Check for location of Tk support (only if Tcl used) dnl Disable Tcl support if Tk not found @@ -883,4 +907,21 @@ fi AC_CONFIG_HEADER(interfaces/odbc/config.h) -AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpq++/Makefile interfaces/libpgtcl/Makefile interfaces/ecpg/lib/Makefile include/version.h interfaces/odbc/Makefile.global interfaces/odbc/GNUmakefile) +AC_OUTPUT( + GNUmakefile + Makefile.global + backend/port/Makefile + backend/utils/Gen_fmgrtab.sh + bin/pg_dump/Makefile + bin/pg_version/Makefile + bin/psql/Makefile + include/version.h + interfaces/ecpg/lib/Makefile + interfaces/libpgtcl/Makefile + interfaces/libpq++/Makefile + interfaces/libpq/Makefile + interfaces/odbc/GNUmakefile + interfaces/odbc/Makefile.global + pl/plpgsql/src/Makefile + pl/tcl/mkMakefile.tcldefs.sh +) diff --git a/src/pl/plpgsql/src/Makefile b/src/pl/plpgsql/src/Makefile deleted file mode 100644 index 19adfa126ff..00000000000 --- a/src/pl/plpgsql/src/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -#------------------------------------------------------------------------- -# -# Makefile -# Makefile for the plpgsql shared object -# -# IDENTIFICATION -# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.1 1998/09/25 15:50:02 momjian Exp $ -# -#------------------------------------------------------------------------- - -# -# Tell make where the postgresql sources live -# -SRCDIR= ../../.. - -# -# Include the global and port specific Makefiles -# -include $(SRCDIR)/Makefile.global -include $(SRCDIR)/Makefile.port - -CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include -LFLAGS+= -i -l - -# For fmgr.h -CFLAGS+= -I$(SRCDIR)/backend - -LDADD+= -L$(LIBPQDIR) -lpq - -# -# DLOBJ is the dynamically-loaded object file. -# -DLOBJ= plpgsql$(DLSUFFIX) - -OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o - -ALL= $(DLOBJ) - -# -# Build the shared object -# -all: $(ALL) - -$(DLOBJ): $(OBJS) - -# -# Clean -# -clean: - rm -f $(ALL) - rm -f *.o y.tab.h pl.tab.h pl_gram.c gram.c pl_scan.c scan.c - -install: all - $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJ) $(DESTDIR)$(LIBDIR)/$(DLOBJ) - -$(DLOBJ): $(OBJS) - $(CC) -shared -o $@ $(OBJS) - -# $(LD) $(LDFLAGS_SL) -o $@ $(OBJS) - - -pl_handler.o: pl_handler.c plpgsql.h pl.tab.h - -pl_comp.o: pl_comp.c plpgsql.h pl.tab.h - -pl_exec.o: pl_exec.c plpgsql.h pl.tab.h - -pl_funcs.o: pl_funcs.c plpgsql.h pl.tab.h - -pl_parse.o: pl_gram.c pl_scan.c plpgsql.h - $(CC) $(CFLAGS) -c -o $@ pl_gram.c - -pl_gram.c: gram.c - sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl_gram.c - sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl.tab.h - -pl_scan.c: scan.c - sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl_scan.c - -gram.c: gram.y - -scan.c: scan.l - -pl.tab.h: pl_gram.c diff --git a/src/pl/plpgsql/src/Makefile.in b/src/pl/plpgsql/src/Makefile.in new file mode 100644 index 00000000000..95cdc6d13fc --- /dev/null +++ b/src/pl/plpgsql/src/Makefile.in @@ -0,0 +1,131 @@ +#------------------------------------------------------------------------- +# +# Makefile +# Makefile for the plpgsql shared object +# +# IDENTIFICATION +# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.1 1998/10/08 23:45:17 momjian Exp $ +# +#------------------------------------------------------------------------- + +# +# Tell make where the postgresql sources live +# +SRCDIR= ../../.. + +# +# Include the global and port specific Makefiles +# +include $(SRCDIR)/Makefile.global + +PORTNAME=@PORTNAME@ + +CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include +LFLAGS+= -i -l + +# For fmgr.h +CFLAGS+= -I$(SRCDIR)/backend + +LDADD+= -L$(LIBPQDIR) -lpq + +ifeq ($(PORTNAME), linux) + CFLAGS += $(CFLAGS_SL) + LDFLAGS_SL = -shared +endif + +ifeq ($(PORTNAME), bsd) + ifdef BSD_SHLIB + LDFLAGS_SL = -x -Bshareable -Bforcearchive + CFLAGS += $(CFLAGS_SL) + endif +endif + +ifeq ($(PORTNAME), bsdi) + ifdef BSD_SHLIB + ifeq ($(LDSUFFIX), .so) + LD := shlicc + LDFLAGS_SL += -O -shared + CFLAGS += $(CFLAGS_SL) + endif + ifeq ($(LDSUFFIX), .o) + LD := shlicc + LDFLAGS_SL += -O -r + CFLAGS += $(CFLAGS_SL) + endif + endif +endif + +ifeq ($(PORTNAME), solaris) + LDFLAGS_SL := -G -z text + CFLAGS += $(CFLAGS_SL) +endif + +ifeq ($(PORTNAME), unixware) + LDFLAGS_SL := -G -z text + CFLAGS += $(CFLAGS_SL) +endif + +ifeq ($(PORTNAME), univel) + LDFLAGS_SL := -G -z text + CFLAGS += $(CFLAGS_SL) +endif + +ifeq ($(PORTNAME), hpux) + LDFLAGS_SL := -b + CFLAGS += $(CFLAGS_SL) +endif + +# +# DLOBJ is the dynamically-loaded object file. +# +DLOBJ= plpgsql$(DLSUFFIX) + +OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o + +ALL= $(DLOBJ) + +# +# Build the shared object +# +all: $(ALL) + +$(DLOBJ): $(OBJS) + +# +# Clean +# +clean: + rm -f $(ALL) + rm -f *.o y.tab.h pl.tab.h pl_gram.c gram.c pl_scan.c scan.c + +install: all + $(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJ) $(DESTDIR)$(LIBDIR)/$(DLOBJ) + +$(DLOBJ): $(OBJS) + $(LD) $(LDFLAGS_SL) -o $@ $(OBJS) + + + +pl_handler.o: pl_handler.c plpgsql.h pl.tab.h + +pl_comp.o: pl_comp.c plpgsql.h pl.tab.h + +pl_exec.o: pl_exec.c plpgsql.h pl.tab.h + +pl_funcs.o: pl_funcs.c plpgsql.h pl.tab.h + +pl_parse.o: pl_gram.c pl_scan.c plpgsql.h + $(CC) $(CFLAGS) -c -o $@ pl_gram.c + +pl_gram.c: gram.c + sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl_gram.c + sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl.tab.h + +pl_scan.c: scan.c + sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' pl_scan.c + +gram.c: gram.y + +scan.c: scan.l + +pl.tab.h: pl_gram.c diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index c1768e82abd..781ccdd39de 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.5 1998/04/06 16:53:15 momjian Exp $ +# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.6 1998/10/08 23:45:18 momjian Exp $ # #------------------------------------------------------------------------- @@ -77,7 +77,7 @@ endif all: $(INFILES) Makefile.tcldefs: - ./mkMakefile.tcldefs + /bin/sh mkMakefile.tcldefs.sh # # Clean diff --git a/src/pl/tcl/mkMakefile.tcldefs b/src/pl/tcl/mkMakefile.tcldefs deleted file mode 100755 index 9881d6bf99e..00000000000 --- a/src/pl/tcl/mkMakefile.tcldefs +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -if [ -f ./tclConfig.sh ]; then - . ./tclConfig.sh -else - if [ -f /usr/lib/tclConfig.sh ]; then - echo "using tclConfig.sh from /usr/lib" - . /usr/lib/tclConfig.sh - elif [ -f /usr/contrib/lib/tclConfig.sh ]; then - echo "using tclConfig.sh from /usr/contrib/lib" - . /usr/contrib/lib/tclConfig.sh - else - if [ -f /usr/local/lib/tclConfig.sh ]; then - echo "using tclConfig.sh from /usr/local/lib" - . /usr/local/lib/tclConfig.sh - else - echo "tclConfig.sh not found in /usr/lib, /usr/contrib/lib, or /usr/local/lib" - echo "I need this file! Please make a symbolic link to this file" - echo "and start make again." - exit 1 - fi - fi -fi - -set | grep '^TCL' >Makefile.tcldefs -exit 0 -- cgit v1.2.3