WAGYU_LIB=libwagyu.la
AC_SUBST([WAGYU_LIB])
+ dnl ============================================================
+ dnl We force to use the same compiler as Postgresql
+ dnl ============================================================
+ CXX_SAVE="$CXX"
+ CC_SAVE="$CC"
+ CFLAGS_SAVE="$CFLAGS"
+ CXXFLAGS_SAVE="$CXXFLAGS"
+ CPPFLAGS_SAVE="$CPPFLAGS_SAVE"
+
+ WAGYU_CXX=`"$PG_CONFIG" --cc`
+ CPPFLAGS="-x c++"
+ CFLAGS=""
+ CXX="$WAGYU_CXX"
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
+ WAGYU_CXX="$CXX -x c++"
+
+ dnl ============================================================
+ dnl Check if we can declare the c++ stdlib
+ dnl ============================================================
+ CC="$WAGYU_CXX"
+
+ AC_CHECK_LIB(c++, main, [HAVE_CPP=yes], [HAVE_CPP=no])
+ AC_CHECK_LIB(stdc++, main, [HAVE_STDCPP=yes], [HAVE_STDCPP=no])
+
+ if test "x$HAVE_CPP" = "xyes"; then
+ WAGYU_LDFLAGS="-lc++"
+ elif test "x$HAVE_STDCPP" = "xyes"; then
+ WAGYU_LDFLAGS="-lstdc++"
+ else
+ AC_MSG_WARN("Could not find a C++ standard library")
+ WAGYU_LDFLAGS=""
+ fi
+
+ CXX="$CXX_SAVE"
+ CC="$CC_SAVE"
+ CFLAGS="$CFLAGS_SAVE"
+ CXXFLAGS="$CXXFLAGS_SAVE"
+ CPPFLAGS="$CPPFLAGS_SAVE"
AC_DEFINE([HAVE_WAGYU], [1], [Define to 1 if wagyu is being built])
AC_SUBST([HAVE_WAGYU])
+ AC_SUBST([WAGYU_CXX])
+ AC_SUBST([WAGYU_LDFLAGS])
+
DEPS_MAKEFILE_LIST="$DEPS_MAKEFILE_LIST
deps/wagyu/Makefile"
fi
AC_MSG_RESULT([ -------------- Compiler Info ------------- ])
AC_MSG_RESULT([ C compiler: ${CC} ${CFLAGS}])
if test "x$HAVE_WAGYU" = "xyes"; then
- AC_MSG_RESULT([ C++ compiler: ${CXX} ${CXXFLAGS}])
+ AC_MSG_RESULT([ C++ compiler (Wagyu): ${WAGYU_CXX} ${CXXFLAGS}])
fi
AC_MSG_RESULT([ CPPFLAGS: $CPPFLAGS])
AC_MSG_RESULT([ SQL preprocessor: ${SQLPP}])
AC_MSG_WARN([ | Alternatively, you may set the environment variables PCRE_CFLAGS and |])
AC_MSG_WARN([ | PCRE_LIBS to avoid the need to call pkg-config. |])
fi
-fi
\ No newline at end of file
+fi
To enable ST_AsMVT protobuf-c library (for usage) and the protoc-c compiler (for building) are required.
Also, pkg-config is required to verify the correct minimum version of protobuf-c.
See <ulink url="https://github.com/protobuf-c/protobuf-c">protobuf-c</ulink>.
- To use Wagyu to validate MVT polygons faster, a c++11 compiler is required. It will use the CXX and CXXFLAGS and needs <varname>--with-wagyu</varname> to be passed during configure.
+ To use Wagyu to validate MVT polygons faster, a c++11 compiler is required. It requires <varname>--with-wagyu</varname> to be passed during configure; and it will use CXXFLAGS and the same compiler as the PostgreSQL installation.
</para>
</listitem>