diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index c7d3336266..2ee96cb3d2 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -170,8 +170,10 @@ external: $(MAKE) -C $(ROOT)/extern/decNumber ln -sf $(ROOT)/extern/decNumber/libdecFloat.a $(LIB) +ifeq ($(RE2_BUILD_FLG),Y) CXXFLAGS="-O3 -g -fPIC" $(MAKE) -C $(ROOT)/extern/re2 ln -sf $(ROOT)/extern/re2/obj/libre2.a $(LIB) +endif ifeq ($(TOMMATH_BUILD_FLG),Y) CFLAGS="$(CFLAGS)" $(MAKE) -C $(ROOT)/extern/libtommath -f makefile.shared GCC=$(GCC) diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 1ba56ccbad..30d3010495 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -50,6 +50,7 @@ EXA_ROOT=$(ROOT)/examples IsCross=@IS_CROSS@ TOMMATH_BUILD_FLG=@TOMMATH_BUILD@ TOMCRYPT_BUILD_FLG=@TOMCRYPT_BUILD@ +RE2_BUILD_FLG=@RE2_BUILD@ FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird ifeq ($(IsCross), Y) diff --git a/builds/posix/make.rules b/builds/posix/make.rules index 3afd891141..a075da8a1f 100644 --- a/builds/posix/make.rules +++ b/builds/posix/make.rules @@ -32,7 +32,7 @@ # Please don't use compiler/platform specific flags here - nmcc 02-Nov-2002 -WFLAGS =-I$(SRC_ROOT)/include/gen -I$(SRC_ROOT)/include -I$(ROOT)/extern/re2 $(CPPFLAGS) $(LTCSOURCE) +WFLAGS =-I$(SRC_ROOT)/include/gen -I$(SRC_ROOT)/include $(CPPFLAGS) $(LTCSOURCE) ifeq ($(TOMMATH_BUILD_FLG),Y) WFLAGS += -I$(TOMMATH_INC) @@ -42,6 +42,10 @@ ifeq ($(TOMCRYPT_BUILD_FLG),Y) WFLAGS += -I$(TOMCRYPT_INC) endif +ifeq ($(RE2_BUILD_FLG),Y) + WFLAGS += -I$(ROOT)/extern/re2 +endif + ifeq ($(LSB_FLG),Y) WFLAGS += -DLSB_BUILD endif diff --git a/configure.ac b/configure.ac index 928bd90998..9f3fb4dc1e 100644 --- a/configure.ac +++ b/configure.ac @@ -554,6 +554,12 @@ AC_ARG_WITH(termlib, [ --with-termlib build with explicitly specified termcap support library], [TERMLIB=${withval}]) +RE2_BUILD=Y +AC_ARG_WITH(system-re2, + [ --with-system-re2 use system-wide re2 library instead of embedded copy], + [RE2_BUILD=N]) +AC_SUBST(RE2_BUILD) + dnl Avoid dumb '-g -O2' autoconf's default dnl Debugging information and optimization flags should be set in prefix.$platform file dnl Should be replaced with AC_PROG_GCC_DEFAULT_FLAGS() when available @@ -609,6 +615,7 @@ if test "$LSB_FLG" = "Y"; then CXXFLAGS="$CXXFLAGS --lsb-besteffort --lsb-shared-libs=fbclient:ib_util:tommath:tomcrypt --lsb-target-version=4.1" AC_SUBST(TOMMATH_BUILD, Y) AC_SUBST(TOMCRYPT_BUILD, Y) + AC_SUBST(RE2_BUILD, Y) AC_PATH_PROG(CC, lsbcc, "", [$PATH$PATH_SEPARATOR/opt/lsb/bin$PATH_SEPARATOR]) AC_PATH_PROG(CXX, lsbc++, "", [$PATH$PATH_SEPARATOR/opt/lsb/bin$PATH_SEPARATOR]) if test "x$CC" = "x" || test "x$CXX" = "x" ; then @@ -874,6 +881,17 @@ if test "$EDITLINE_FLG" = "Y"; then AC_SUBST(TERMLIB) fi +dnl check for re2 presence +if test "$RE2_BUILD" != "Y"; then + XE_SAVE_ENV() + AC_LANG_PUSH(C++) + AC_CHECK_HEADER(re2/re2.h, RE2LIB=-lre2, + AC_MSG_ERROR(Include file for re2 not found - please install development re2 package or drop --with-system-re2)) + AC_LANG_POP(C++) + XE_RESTORE_ENV() +fi +AC_SUBST(RE2LIB) + dnl Check for libraries AC_SEARCH_LIBS(dlopen, dl) AC_CHECK_LIB(m, main)