summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/Makefile7
-rw-r--r--src/bin/psql/mainloop.c12
2 files changed, 16 insertions, 3 deletions
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index 01049d8af24..06d75834808 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.63 2009/06/23 03:46:00 tgl Exp $
+# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.63.2.1 2009/11/10 23:12:21 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -21,7 +21,7 @@ override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_du
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
startup.o prompt.o variables.o large_obj.o print.o describe.o \
- psqlscan.o tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
+ tab-complete.o mbprint.o dumputils.o keywords.o kwlookup.o \
$(WIN32RES)
FLEXFLAGS = -Cfe
@@ -43,6 +43,9 @@ kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
$(srcdir)/sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
$(PERL) $< $(REFDOCDIR) $@
+# psqlscan is compiled as part of mainloop
+mainloop.o: psqlscan.c
+
$(srcdir)/psqlscan.c: psqlscan.l
ifdef FLEX
$(FLEX) $(FLEXFLAGS) -o'$@' $<
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index c63219bd13e..e47f464d14f 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.95 2009/06/11 14:49:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.95.2.1 2009/11/10 23:12:21 tgl Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -407,3 +407,13 @@ MainLoop(FILE *source)
return successResult;
} /* MainLoop() */
+
+
+/*
+ * psqlscan.c is #include'd here instead of being compiled on its own.
+ * This is because we need postgres_fe.h to be read before any system
+ * include files, else things tend to break on platforms that have
+ * multiple infrastructures for stdio.h and so on. flex is absolutely
+ * uncooperative about that, so we can't compile psqlscan.c on its own.
+ */
+#include "psqlscan.c"