diff options
author | Michael Paquier | 2012-10-30 07:02:14 +0000 |
---|---|---|
committer | Michael Paquier | 2012-10-30 07:02:14 +0000 |
commit | 16992e6b07d28d66c183adf45dd8e1cae2cdf25b (patch) | |
tree | 3baa678435b7fcd3b4ab2b7a6a91733699653b4d | |
parent | 6bf96922d2e0b140820d5f8f62d86b90de628e1f (diff) |
Move GTM configuration APIs in src/gtm/common to new folder src/gtm/config
This is part of the effort to eliminate the duplications in GTM code with things
of PG src/backend. src/gtm/common had a dependency with the binary postgres when
it is built so this dependency with GTM configuration is unnecessary. Even if
GTM should rely on the APIs of guc-file.l for configuration file treatment, for
the time being this permits to split each functionality correctly.
-rw-r--r-- | src/gtm/Makefile | 2 | ||||
-rw-r--r-- | src/gtm/common/Makefile | 13 | ||||
-rw-r--r-- | src/gtm/config/.gitignore (renamed from src/gtm/common/.gitignore) | 0 | ||||
-rw-r--r-- | src/gtm/config/Makefile | 44 | ||||
-rw-r--r-- | src/gtm/config/gtm_opt_handler.c (renamed from src/gtm/common/gtm_opt_handler.c) | 2 | ||||
-rw-r--r-- | src/gtm/config/gtm_opt_scanner.l (renamed from src/gtm/common/gtm_opt_scanner.l) | 0 | ||||
-rw-r--r-- | src/gtm/main/Makefile | 3 | ||||
-rw-r--r-- | src/gtm/proxy/Makefile | 10 |
8 files changed, 55 insertions, 19 deletions
diff --git a/src/gtm/Makefile b/src/gtm/Makefile index 480d1bf49e..40ee1b7168 100644 --- a/src/gtm/Makefile +++ b/src/gtm/Makefile @@ -12,7 +12,7 @@ subdir = src/gtm top_builddir = ../.. include $(top_builddir)/src/Makefile.global -WANTED_DIRS=common path libpq client recovery main proxy gtm_ctl +WANTED_DIRS=common config path libpq client recovery main proxy gtm_ctl all: @for dir in $(WANTED_DIRS); do \ diff --git a/src/gtm/common/Makefile b/src/gtm/common/Makefile index 31e0c25ff9..d9b345151a 100644 --- a/src/gtm/common/Makefile +++ b/src/gtm/common/Makefile @@ -20,22 +20,13 @@ SO_MAJOR_VERSION= 1 SO_MINOR_VERSION= 0 LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq -LIBS=-lpthread +LIBS += $(PTHREAD_LIBS) -OBJS = gtm_opt_handler.o aset.o mcxt.o gtm_utils.o elog.o assert.o stringinfo.o gtm_lock.o \ +OBJS = aset.o mcxt.o gtm_utils.o elog.o assert.o stringinfo.o gtm_lock.o \ gtm_list.o gtm_serialize.o gtm_serialize_debug.o all:all-lib -gtm_opt_handler.o: gtm_opt_scanner.c - -gtm_opt_scanner.c: gtm_opt_scanner.l -ifdef FLEX - $(FLEX) $(FLEXFLAGS) -o'$@' $< -else - @$(missing) flex $< $@ -endif - # Shared library stuff include $(top_srcdir)/src/Makefile.shlib diff --git a/src/gtm/common/.gitignore b/src/gtm/config/.gitignore index 5963e7b19a..5963e7b19a 100644 --- a/src/gtm/common/.gitignore +++ b/src/gtm/config/.gitignore diff --git a/src/gtm/config/Makefile b/src/gtm/config/Makefile new file mode 100644 index 0000000000..ffc0398a1c --- /dev/null +++ b/src/gtm/config/Makefile @@ -0,0 +1,44 @@ +#---------------------------------------------------------------------------- +# +# Postgres-XC GTM conf makefile +# +# Copyright(c) 2010-2012 Postgres-XC Development Group +# +# src/gtm/config/Makefile +# +#----------------------------------------------------------------------------- +top_builddir=../../.. +include $(top_builddir)/src/Makefile.global +subdir=src/gtm/config + +override CPPFLAGS := -I. -I$(libpq_srcdir) $(CPPFLAGS) + +NAME = gtmconfig + +SO_MAJOR_VERSION= 1 +SO_MINOR_VERSION= 0 + +OBJS = gtm_opt_handler.o + +all: all-lib + +# Shared library stuff +include $(top_srcdir)/src/Makefile.shlib + +gtm_opt_handler.o: gtm_opt_scanner.c + +gtm_opt_scanner.c: gtm_opt_scanner.l +ifdef FLEX + $(FLEX) $(FLEXFLAGS) -o'$@' $< +else + @$(missing) flex $< $@ +endif + +# Note that gtm_opt_scanner.c is not deleted by make clean as we want it in distribution tarballs +clean: + rm -f $(OBJS) + rm -f rm -f libgtmconfig.so libgtmconfig.so.1 libgtmconfig.so.1.0 + +distclean: clean + +maintainer-clean: distclean diff --git a/src/gtm/common/gtm_opt_handler.c b/src/gtm/config/gtm_opt_handler.c index 61c2476599..3c7a585c0f 100644 --- a/src/gtm/common/gtm_opt_handler.c +++ b/src/gtm/config/gtm_opt_handler.c @@ -297,7 +297,7 @@ ProcessConfigFile(GtmOptContext context) char *pre_value = NULL; if (set_config_option(item->name, item->value, context, - GTMC_S_FILE, true)) + GTMC_S_FILE, true)) { set_config_sourcefile(item->name, item->filename, item->sourceline); diff --git a/src/gtm/common/gtm_opt_scanner.l b/src/gtm/config/gtm_opt_scanner.l index f9be2cbfbe..f9be2cbfbe 100644 --- a/src/gtm/common/gtm_opt_scanner.l +++ b/src/gtm/config/gtm_opt_scanner.l diff --git a/src/gtm/main/Makefile b/src/gtm/main/Makefile index d207e32dcc..60990e94e4 100644 --- a/src/gtm/main/Makefile +++ b/src/gtm/main/Makefile @@ -17,7 +17,8 @@ endif OBJS=main.o gtm_thread.o gtm_txn.o gtm_seq.o gtm_snap.o gtm_time.o gtm_standby.o gtm_opt.o -OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a ../../port/libpgport.a +OTHERS= ../libpq/libpqcomm.a ../config/libgtmconfig.a ../path/libgtmpath.a \ + ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a ../../port/libpgport.a LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq diff --git a/src/gtm/proxy/Makefile b/src/gtm/proxy/Makefile index c1ab2018d8..9dc84504fe 100644 --- a/src/gtm/proxy/Makefile +++ b/src/gtm/proxy/Makefile @@ -15,16 +15,16 @@ ifneq ($(PORTNAME), win32) override CFLAGS += $(PTHREAD_CFLAGS) endif -OBJS=proxy_main.o proxy_thread.o proxy_utils.o gtm_proxy_opt.o +OBJS = proxy_main.o proxy_thread.o proxy_utils.o gtm_proxy_opt.o -OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a +OTHERS = ../config/libgtmconfig.a ../libpq/libpqcomm.a ../path/libgtmpath.a \ + ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq - LIBS=-lpthread -gtm_proxy:$(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $^ $(OTHERS) ../../port/libpgport_srv.a -o gtm_proxy +gtm_proxy: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $^ $(OTHERS) ../../port/libpgport_srv.a -o $@ all:gtm_proxy |