Fix breakage in making pgpool_adm.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 6 Oct 2023 21:15:30 +0000 (06:15 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 6 Oct 2023 21:22:04 +0000 (06:22 +0900)
Since commit f54efc50 "Fix compiler warnings regarding
DEFAULT_PGSOCKET_DIR.", src/sql/pgpool_adm cannot be compiled with
error:
In file included from pgpool_adm.c:35:0:
../../include/pcp/libpcp_ext.h:32:37: fatal error: parser/pg_config_manual.h: No such file or directory
 #include "parser/pg_config_manual.h"

Since pgpool_adm is a PostgreSQL extension module, it should not
include Pgpool-II's pg_config_manual.h.  Rather than fixing pgpool_adm
to allow to include pgpool's pg_config_manual.h, modify libpcp_ext.h
so that it does not include pgpool's pg_config_manual.h if PGPOOL_ADM
is defined.

src/include/pcp/libpcp_ext.h
src/sql/pgpool_adm/Makefile

index a290258be74ae77cd79b02785e79a9faef4e5ef8..3c9d1d6bb9b247e7e643430a7194675699024dc8 100644 (file)
@@ -29,7 +29,9 @@
 #include <signal.h>
 #include <stdio.h>
 
+#ifndef PGPOOL_ADM
 #include "parser/pg_config_manual.h"
+#endif
 
 /*
  * startup packet definitions (v2) stolen from PostgreSQL
index 9dcdd74e58de379a0cda326526141e439cc83850..199772207ddb4ebb86b19a5088eacb1c406fb93d 100644 (file)
@@ -2,7 +2,7 @@
 
 MODULE_big = pgpool_adm
 OBJS = pgpool_adm.o
-PG_CPPFLAGS = -I$(libpq_srcdir) -I../../include/pcp
+PG_CPPFLAGS = -I$(libpq_srcdir) -I../../include/pcp -DPGPOOL_ADM
 
 EXTENSION = pgpool_adm
 DATA = pgpool_adm--1.0.sql pgpool_adm--1.1.sql pgpool_adm--1.2.sql pgpool_adm--1.3.sql \