From 725f4a37d04ae2e3e1a237296b2975e8c4b9da4f Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Mon, 16 Nov 2020 15:02:33 +0100 Subject: [PATCH] change configure to not have options --- Makefile.global.in | 3 +- configure | 76 ++---------------------- configure.in | 21 ++----- src/backend/columnar/cstore_customscan.c | 4 +- src/backend/columnar/cstore_tableam.c | 2 +- src/backend/columnar/mod.c | 23 +++---- src/include/citus_config.h.in | 11 +--- src/include/citus_version.h.in | 5 +- src/include/columnar/cstore_tableam.h | 2 +- src/test/regress/Makefile | 10 ++-- 10 files changed, 32 insertions(+), 125 deletions(-) diff --git a/Makefile.global.in b/Makefile.global.in index aba3be6f6..318766380 100644 --- a/Makefile.global.in +++ b/Makefile.global.in @@ -92,8 +92,7 @@ endif override CPPFLAGS := @CPPFLAGS@ @CITUS_CPPFLAGS@ -I '${citus_abs_top_srcdir}/src/include' -I'${citus_top_builddir}/src/include' $(CPPFLAGS) override LDFLAGS += @LDFLAGS@ @CITUS_LDFLAGS@ -USE_FDW:=@USE_FDW@ -USE_TABLEAM:=@USE_TABLEAM@ +HAS_TABLEAM:=@HAS_TABLEAM@ # optional file with user defined, additional, rules -include ${citus_abs_srcdir}/src/Makefile.custom diff --git a/configure b/configure index e29228855..619fef623 100755 --- a/configure +++ b/configure @@ -622,8 +622,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS -USE_TABLEAM -USE_FDW +HAS_TABLEAM HAS_DOTGIT POSTGRES_BUILDDIR POSTGRES_SRCDIR @@ -692,8 +691,6 @@ with_extra_version enable_coverage with_libcurl with_reports_hostname -with_columnar_tableam -with_columnar_fdw ' ac_precious_vars='build_alias host_alias @@ -1327,9 +1324,6 @@ Optional Packages: --with-reports-hostname=HOSTNAME Use HOSTNAME as hostname for statistics collection and update checks - --without-columnar-tableam - compile with table access methods for columnar - --without-columnar-fdw compile with foreign data wrappers for columnar Some influential environment variables: PG_CONFIG Location to find pg_config for target PostgreSQL instalation @@ -4476,69 +4470,13 @@ _ACEOF if test "$version_num" != '11'; then + HAS_TABLEAM=yes - - -# Check whether --with-columnar-tableam was given. -if test "${with_columnar_tableam+set}" = set; then : - withval=$with_columnar_tableam; - case $withval in - yes) - USE_TABLEAM=yes - ;; - no) - : - ;; - *) - as_fn_error $? "no argument expected for --with-columnar-tableam option" "$LINENO" 5 - ;; - esac +$as_echo "#define HAS_TABLEAM 1" >>confdefs.h else - with_columnar_tableam=yes -USE_TABLEAM=yes -fi - - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: postgres does not support table access methodds" >&5 -$as_echo "$as_me: postgres does not support table access methodds" >&6;} -fi; - -if test "$USE_TABLEAM" = yes; then - -$as_echo "#define USE_TABLEAM 1" >>confdefs.h - -fi; - - - - -# Check whether --with-columnar-fdw was given. -if test "${with_columnar_fdw+set}" = set; then : - withval=$with_columnar_fdw; - case $withval in - yes) - USE_FDW=yes - ;; - no) - : - ;; - *) - as_fn_error $? "no argument expected for --with-columnar-fdw option" "$LINENO" 5 - ;; - esac - -else - with_columnar_fdw=yes -USE_FDW=yes -fi - - -if test "$USE_FDW" = yes; then - -$as_echo "#define USE_FDW 1" >>confdefs.h - + { $as_echo "$as_me:${as_lineno-$LINENO}: postgres version does not support table access methodds" >&5 +$as_echo "$as_me: postgres version does not support table access methodds" >&6;} fi; # Check if git is installed, when installed the gitref of the checkout will be baked in the application @@ -4616,9 +4554,7 @@ POSTGRES_BUILDDIR="$POSTGRES_BUILDDIR" HAS_DOTGIT="$HAS_DOTGIT" -USE_FDW="$USE_FDW" - -USE_TABLEAM="$USE_TABLEAM" +HAS_TABLEAM="$HAS_TABLEAM" ac_config_files="$ac_config_files Makefile.global" diff --git a/configure.in b/configure.in index b31fc4ff5..07e87a878 100644 --- a/configure.in +++ b/configure.in @@ -213,22 +213,10 @@ AC_DEFINE_UNQUOTED(REPORTS_BASE_URL, "$REPORTS_BASE_URL", [Base URL for statistics collection and update checks]) if test "$version_num" != '11'; then - PGAC_ARG_BOOL(with, columnar-tableam, yes, - [compile with table access methods for columnar], - [USE_TABLEAM=yes]) + HAS_TABLEAM=yes + AC_DEFINE([HAS_TABLEAM], 1, [Define to 1 to build with table access method support, pg12 and up]) else - AC_MSG_NOTICE([postgres does not support table access methodds]) -fi; - -if test "$USE_TABLEAM" = yes; then - AC_DEFINE([USE_TABLEAM], 1, [Define to 1 to build with table access method support. (--with-columnar-tableam)]) -fi; - -PGAC_ARG_BOOL(with, columnar-fdw, yes, - [compile with foreign data wrappers for columnar], - [USE_FDW=yes]) -if test "$USE_FDW" = yes; then - AC_DEFINE([USE_FDW], 1, [Define to 1 to build with foreign datawrapper support. (--with-columnar-fdw)]) + AC_MSG_NOTICE([postgres version does not support table access methodds]) fi; # Check if git is installed, when installed the gitref of the checkout will be baked in the application @@ -241,8 +229,7 @@ AC_SUBST(CITUS_LDFLAGS, "$LIBS $CITUS_LDFLAGS") AC_SUBST(POSTGRES_SRCDIR, "$POSTGRES_SRCDIR") AC_SUBST(POSTGRES_BUILDDIR, "$POSTGRES_BUILDDIR") AC_SUBST(HAS_DOTGIT, "$HAS_DOTGIT") -AC_SUBST(USE_FDW, "$USE_FDW") -AC_SUBST(USE_TABLEAM, "$USE_TABLEAM") +AC_SUBST(HAS_TABLEAM, "$HAS_TABLEAM") AC_CONFIG_FILES([Makefile.global]) AC_CONFIG_HEADERS([src/include/citus_config.h] [src/include/citus_version.h]) diff --git a/src/backend/columnar/cstore_customscan.c b/src/backend/columnar/cstore_customscan.c index 3cca3ad29..5b5ffe39f 100644 --- a/src/backend/columnar/cstore_customscan.c +++ b/src/backend/columnar/cstore_customscan.c @@ -11,7 +11,7 @@ */ #include "citus_version.h" -#if USE_TABLEAM +#if HAS_TABLEAM #include "postgres.h" @@ -426,4 +426,4 @@ CStoreScan_ReScanCustomScan(CustomScanState *node) } -#endif /* USE_TABLEAM */ +#endif /* HAS_TABLEAM */ diff --git a/src/backend/columnar/cstore_tableam.c b/src/backend/columnar/cstore_tableam.c index d7c3aff11..6ede404bb 100644 --- a/src/backend/columnar/cstore_tableam.c +++ b/src/backend/columnar/cstore_tableam.c @@ -1,5 +1,5 @@ #include "citus_version.h" -#if USE_TABLEAM +#if HAS_TABLEAM #include "postgres.h" diff --git a/src/backend/columnar/mod.c b/src/backend/columnar/mod.c index ee3ba6d98..ad4605e24 100644 --- a/src/backend/columnar/mod.c +++ b/src/backend/columnar/mod.c @@ -18,27 +18,22 @@ #include "citus_version.h" #include "columnar/cstore.h" +#include "columnar/cstore_fdw.h" #include "columnar/mod.h" -#ifdef USE_TABLEAM +#ifdef HAS_TABLEAM #include "columnar/cstore_tableam.h" #endif -#ifdef USE_FDW -#include "columnar/cstore_fdw.h" -#endif void columnar_init(void) { cstore_init(); - -#ifdef USE_TABLEAM - cstore_tableam_init(); -#endif - -#ifdef USE_FDW cstore_fdw_init(); + +#ifdef HAS_TABLEAM + cstore_tableam_init(); #endif } @@ -46,11 +41,9 @@ columnar_init(void) void columnar_fini(void) { -#if USE_TABLEAM + cstore_fdw_finish(); + +#if HAS_TABLEAM cstore_tableam_finish(); #endif - -#ifdef USE_FDW - cstore_fdw_finish(); -#endif } diff --git a/src/include/citus_config.h.in b/src/include/citus_config.h.in index 679f91c09..64854b3ca 100644 --- a/src/include/citus_config.h.in +++ b/src/include/citus_config.h.in @@ -31,6 +31,9 @@ /* A string containing the version number, platform, and C compiler */ #undef CITUS_VERSION_STR +/* Define to 1 to build with table access method support, pg12 and up */ +#undef HAS_TABLEAM + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -87,11 +90,3 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS - -/* Define to 1 to build with foreign datawrapper support. - (--with-columnar-fdw) */ -#undef USE_FDW - -/* Define to 1 to build with table access method support. - (--with-columnar-tableam) */ -#undef USE_TABLEAM diff --git a/src/include/citus_version.h.in b/src/include/citus_version.h.in index 778d59233..939b0f4b9 100644 --- a/src/include/citus_version.h.in +++ b/src/include/citus_version.h.in @@ -27,8 +27,5 @@ /* Base URL for statistics collection and update checks */ #undef REPORTS_BASE_URL -/* columnar foreign data wrapper capability */ -#undef USE_FDW - /* columnar table access method capability */ -#undef USE_TABLEAM +#undef HAS_TABLEAM diff --git a/src/include/columnar/cstore_tableam.h b/src/include/columnar/cstore_tableam.h index 7bd879068..10b9a3874 100644 --- a/src/include/columnar/cstore_tableam.h +++ b/src/include/columnar/cstore_tableam.h @@ -1,5 +1,5 @@ #include "citus_version.h" -#if USE_TABLEAM +#if HAS_TABLEAM #include "postgres.h" #include "fmgr.h" diff --git a/src/test/regress/Makefile b/src/test/regress/Makefile index cf79f7b06..178bb6356 100644 --- a/src/test/regress/Makefile +++ b/src/test/regress/Makefile @@ -163,11 +163,11 @@ check-follower-cluster: all COLUMNAR_SCHEDULES = COLUMNAR_ISOLATION_SCHEDULES = -ifeq ($(USE_FDW),yes) - COLUMNAR_SCHEDULES += columnar_fdw_schedule - COLUMNAR_ISOLATION_SCHEDULES += columnar_fdw_isolation_schedule -endif -ifeq ($(USE_TABLEAM),yes) +# even though we always add the fdw schedules, keep them separate from the declaration +# above for easy removabl when fdw support is removed +COLUMNAR_SCHEDULES += columnar_fdw_schedule +COLUMNAR_ISOLATION_SCHEDULES += columnar_fdw_isolation_schedule +ifeq ($(HAS_TABLEAM),yes) COLUMNAR_SCHEDULES += columnar_am_schedule COLUMNAR_ISOLATION_SCHEDULES += columnar_am_isolation_schedule endif