Use header define rather than -D flag

Eclipse apparently doesn't scan build output looking for -D flags, so
having the value actually appear in a header is nicer for those of us
using IDEs.
pull/1701/head
Jason Petersen 2017-10-12 16:38:25 -06:00 committed by Hadi Moshayedi
parent 946659aebe
commit 01353cb7cb
4 changed files with 11 additions and 5 deletions

7
configure vendored
View File

@ -3349,7 +3349,9 @@ if test "${with_libcurl+set}" = set; then :
withval=$with_libcurl; withval=$with_libcurl;
case $withval in case $withval in
yes) yes)
:
$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
;; ;;
no) no)
: :
@ -3362,6 +3364,8 @@ if test "${with_libcurl+set}" = set; then :
else else
with_libcurl=yes with_libcurl=yes
$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
fi fi
@ -3826,7 +3830,6 @@ Use --without-libcurl to disable libcurl support." "$LINENO" 5
fi fi
CITUS_CFLAGS="$CITUS_CFLAGS -DHAVE_LIBCURL"
fi fi
CITUS_CFLAGS="$CITUS_CFLAGS" CITUS_CFLAGS="$CITUS_CFLAGS"

View File

@ -144,7 +144,8 @@ fi
# libcurl # libcurl
# #
PGAC_ARG_BOOL(with, libcurl, yes, PGAC_ARG_BOOL(with, libcurl, yes,
[do not use libcurl for anonymous statistics collection]) [do not use libcurl for anonymous statistics collection],
[AC_DEFINE([HAVE_LIBCURL], 1, [Define to 1 to build with libcurl support. (--with-libcurl)])])
if test "$with_libcurl" = yes; then if test "$with_libcurl" = yes; then
AC_CHECK_LIB(curl, curl_global_init, [], AC_CHECK_LIB(curl, curl_global_init, [],
@ -156,7 +157,6 @@ Use --without-libcurl to disable anonymous statistics collection.])])
If you have libcurl already installed, see config.log for details on the If you have libcurl already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory. failure. It is possible the compiler isn't looking in the proper directory.
Use --without-libcurl to disable libcurl support.])]) Use --without-libcurl to disable libcurl support.])])
CITUS_CFLAGS="$CITUS_CFLAGS -DHAVE_LIBCURL"
fi fi
AC_SUBST(CITUS_CFLAGS, "$CITUS_CFLAGS") AC_SUBST(CITUS_CFLAGS, "$CITUS_CFLAGS")

View File

@ -12,7 +12,7 @@
bool EnableStatisticsCollection = true; /* send basic usage statistics to Citus */ bool EnableStatisticsCollection = true; /* send basic usage statistics to Citus */
#if HAVE_LIBCURL #ifdef HAVE_LIBCURL
#include <curl/curl.h> #include <curl/curl.h>
#include <sys/utsname.h> #include <sys/utsname.h>

View File

@ -11,3 +11,6 @@
/* Citus version as a number */ /* Citus version as a number */
#undef CITUS_VERSION_NUM #undef CITUS_VERSION_NUM
/* Define to 1 if you have the `curl' library (-lcurl). */
#undef HAVE_LIBCURL