From c823b1eedccde57ec405228bfcc2335fd93ef4a7 Mon Sep 17 00:00:00 2001
From: Michael Meskes <meskes@postgresql.org>
Date: Tue, 7 Nov 2000 08:41:15 +0000
Subject: [PATCH] Added more patches by Cristif Petig.

---
 src/interfaces/ecpg/ChangeLog |  4 ++
 src/interfaces/ecpg/Makefile  | 79 ++++++++++++++++++++++++++++++-----
 2 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 221ad7dd41d..d26d1bbf110 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1009,5 +1009,9 @@ Fri Nov  3 11:34:43 CET 2000
 
 	- Synced pgc.l with scan.l.
 	- Synced gram.y and preproc.y.
+
+Sat Nov  4 17:42:43 CET 2000
+
+	- Added patch by Christof Petig to fix several small bugs.
 	- Set ecpg version to 2.8.0. 
 	- Set library version to 3.2.0.
diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile
index 2637a2ed015..945cba8c1fe 100644
--- a/src/interfaces/ecpg/Makefile
+++ b/src/interfaces/ecpg/Makefile
@@ -1,13 +1,72 @@
-subdir = src/interfaces/ecpg
-top_builddir = ../../..
+subdir = src/interfaces/ecpg/preproc
+top_builddir = ../../../..
 include $(top_builddir)/src/Makefile.global
 
-all install installdirs uninstall dep depend distprep:
-	$(MAKE) -C include $@
-	$(MAKE) -C lib $@
-	$(MAKE) -C preproc $@
+MAJOR_VERSION=2
+MINOR_VERSION=8
+PATCHLEVEL=0
 
-clean distclean maintainer-clean:
-	-$(MAKE) -C include $@
-	-$(MAKE) -C lib $@
-	-$(MAKE) -C preproc $@
+override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
+	-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
+	-DINCLUDE_PATH=\"$(includedir)\" 
+# -DYYDEBUG -g
+
+OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
+    keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
+
+all: ecpg
+
+ifdef SNPRINTF
+OBJS+=$(top_builddir)/src/backend/port/snprintf.o
+
+$(top_builddir)/src/backend/port/snprintf.o:
+	$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
+endif
+
+
+ecpg: $(OBJS)
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
+	$(YACC) -d $(YFLAGS) $<
+	mv y.tab.c $(srcdir)/preproc.c
+	mv y.tab.h $(srcdir)/preproc.h
+
+$(srcdir)/pgc.c: pgc.l
+ifdef FLEX
+	$(FLEX) $(FLEXFLAGS) -o'$@' $<
+else
+	@$(missing) flex $< $@
+endif
+
+distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
+
+install: all installdirs
+	$(INSTALL_PROGRAM) ecpg$(X) $(DESTDIR)$(bindir)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+
+uninstall:
+	rm -f $(DESTDIR)$(bindir)/ecpg$(X)
+
+clean distclean:
+	rm -f *.o ecpg$(X)
+# garbage from partial builds
+	@rm -f y.tab.c y.tab.h
+# garbage from development
+	@rm -f core a.out *~ *.output *.tab.c
+
+# `make clean' does not remove preproc.c, preproc.h, or pgc.c since we
+# want to ship those files in the distribution for people with
+# inadequate tools.
+maintainer-clean: distclean
+	rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
+
+
+depend dep: preproc.c pgc.c
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif
-- 
GitLab