This is an automated email from the ASF dual-hosted git repository.

tuhaihe pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 0180e48b8c1 Add makefile and preprocessin guards for --without-zstd 
configure
0180e48b8c1 is described below

commit 0180e48b8c1c5ad9a0b432b0a69e6f76d93a285f
Author: reshke <[email protected]>
AuthorDate: Wed Aug 19 09:18:38 2026 +0000

    Add makefile and preprocessin guards for --without-zstd configure
---
 gpcontrib/zstd/Makefile           | 9 +++++++++
 gpcontrib/zstd/zstd_compression.c | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/gpcontrib/zstd/Makefile b/gpcontrib/zstd/Makefile
index 0b7a9016f1b..136014b13b3 100644
--- a/gpcontrib/zstd/Makefile
+++ b/gpcontrib/zstd/Makefile
@@ -13,7 +13,14 @@ ifdef USE_PGXS
 else
   top_builddir = ../..
   include $(top_builddir)/src/Makefile.global
+
+  ifneq "$(with_zstd)" "yes"
+  all install:
+       @echo "ERROR: gp_zstd_compression requires --with-zstd 
(with_zstd=$(with_zstd)); this build was configured without zstd support." >&2
+       @false
+  else
   include $(top_srcdir)/contrib/contrib-global.mk
+  endif
 endif
 
 
@@ -23,7 +30,9 @@ endif
 install-data:
        $(INSTALL_DATA) zstd_compression.sql 
'$(DESTDIR)$(datadir)/cdb_init.d/zstd_compression.sql'
 
+ifeq "$(with_zstd)" "yes"
 install: install-data
+endif
 
 .PHONY: uninstall-data
 
diff --git a/gpcontrib/zstd/zstd_compression.c 
b/gpcontrib/zstd/zstd_compression.c
index 0257e4e369c..881b0dca831 100644
--- a/gpcontrib/zstd/zstd_compression.c
+++ b/gpcontrib/zstd/zstd_compression.c
@@ -10,6 +10,10 @@
 
 #include "postgres.h"
 
+#ifndef USE_ZSTD
+#error "zstd support is not enabled; reconfigure with --with-zstd to build the 
gp_zstd_compression extension"
+#endif
+
 #include "access/genam.h"
 #include "catalog/pg_compression.h"
 #include "fmgr.h"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to