Add CITUS_NAME and CITUS_EDITION

Unambiguous places to check whether we're running simply Citus or Citus
Enterprise, or to check for 'community' or 'enterprise'.
pull/1700/head
Jason Petersen 2017-10-12 11:52:09 -06:00
parent 8544878c4b
commit f2c593b25c
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
4 changed files with 44 additions and 0 deletions

20
configure vendored
View File

@ -2342,6 +2342,26 @@ fi
done
# CITUS_NAME definition
cat >>confdefs.h <<_ACEOF
#define CITUS_NAME "$PACKAGE_NAME"
_ACEOF
case $PACKAGE_NAME in
'Citus Enterprise') citus_edition=enterprise ;;
Citus) citus_edition=community ;;
*) as_fn_error $? "Unrecognized package name." "$LINENO" 5 ;;
esac
# CITUS_EDITION definition
cat >>confdefs.h <<_ACEOF
#define CITUS_EDITION "$citus_edition"
_ACEOF
# CITUS_MAJORVERSION definition
CITUS_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`

View File

@ -12,6 +12,18 @@ AC_COPYRIGHT([Copyright (c) 2012-2017, Citus Data, Inc.])
AC_PROG_SED
AC_PROG_AWK
# CITUS_NAME definition
AC_DEFINE_UNQUOTED(CITUS_NAME, "$PACKAGE_NAME", [Citus full name as a string])
case $PACKAGE_NAME in
'Citus Enterprise') citus_edition=enterprise ;;
Citus) citus_edition=community ;;
*) AC_MSG_ERROR([Unrecognized package name.]) ;;
esac
# CITUS_EDITION definition
AC_DEFINE_UNQUOTED(CITUS_EDITION, "$citus_edition", [Citus edition as a string])
# CITUS_MAJORVERSION definition
[CITUS_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`]
AC_DEFINE_UNQUOTED(CITUS_MAJORVERSION, "$CITUS_MAJORVERSION", [Citus major version as a string])

View File

@ -10,12 +10,18 @@
*/
/* Citus edition as a string */
#undef CITUS_EDITION
/* Extension version expected by this Citus build */
#undef CITUS_EXTENSIONVERSION
/* Citus major version as a string */
#undef CITUS_MAJORVERSION
/* Citus full name as a string */
#undef CITUS_NAME
/* Citus version as a string */
#undef CITUS_VERSION

View File

@ -1,5 +1,11 @@
/* This file is created manually */
/* Citus full name as a string */
#undef CITUS_NAME
/* Citus edition as a string */
#undef CITUS_EDITION
/* Extension version expected by this Citus build */
#undef CITUS_EXTENSIONVERSION