Make building safestringlib on some distros easier (#3616)

On some distros (e.g. Redhat 7) there is cmake version 2 and cmake version 3,
safestringlib requires cmake version 3. On those distros the binary is called
cmake3, so try to use that one before falling back to regular cmake binary.
pull/3621/head
Jelte Fennema 2020-03-16 11:34:30 +01:00 committed by GitHub
parent f3d2265d80
commit 99c5b0add7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,13 @@ safestringlib_builddir = $(citus_top_builddir)/vendor/safestringlib/build
safestringlib_a = $(safestringlib_builddir)/libsafestring_static.a
safestringlib_sources = $(wildcard $(safestringlib_srcdir)/safeclib/*)
# Use cmake3 if it exists, otherwise just use the string "cmake" and let bash
# figure out its exact path later.
# Using "which cmake" instead will make the error very hard to understand if
# you have neither "cmake3" or "cmake" in path. In that case the "CMAKE3"
# variable would be an empty string.
CMAKE3 = $(shell which cmake3 || echo cmake)
MODULE_big = citus
EXTENSION = citus
@ -56,7 +63,7 @@ $(safestringlib_a): $(safestringlib_sources)
@# Makefile are not used
+cd $(safestringlib_builddir) && \
export LDFLAGS='' && export CPPFLAGS='' && \
cmake $(safestringlib_srcdir) && make
$(CMAKE3) $(safestringlib_srcdir) && make
citus.so: $(safestringlib_a)