From: Ulya Trofimovich Date: Wed, 20 Feb 2019 17:29:03 +0000 (+0000) Subject: libre2c (benchmark): do not try to link with re2 if it's not available. X-Git-Tag: 1.2~140 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a59e5e33a6e5db14d7edeb283007a5d6c60e207;p=re2c libre2c (benchmark): do not try to link with re2 if it's not available. --- diff --git a/re2c/Makefile.lib.am b/re2c/Makefile.lib.am index c81170ae..37e942eb 100644 --- a/re2c/Makefile.lib.am +++ b/re2c/Makefile.lib.am @@ -180,7 +180,7 @@ check_PROGRAMS += test_libre2c bench_libre2c_SOURCES = lib/bench.cc bench_libre2c_CXXFLAGS = $(AM_CXXFLAGS) -std=c++11 -bench_libre2c_LDFLAGS = -lre2 +bench_libre2c_LDFLAGS = $(LDFLAGS_RE2) bench_libre2c_LDADD = libre2c.la check_PROGRAMS += bench_libre2c diff --git a/re2c/configure.ac b/re2c/configure.ac index 11db3a90..3cb2b808 100644 --- a/re2c/configure.ac +++ b/re2c/configure.ac @@ -35,8 +35,9 @@ AM_COND_IF([REBUILD_DOCS], [ AC_ARG_ENABLE([libs], [AS_HELP_STRING([--enable-libs], [build libraries])]) AM_CONDITIONAL([WITH_LIBS], [test "x$enable_libs" = "xyes"]) AM_COND_IF([WITH_LIBS], [ + AC_SUBST(LDFLAGS_RE2, []) AC_LANG_PUSH([C++]) - AC_CHECK_HEADERS([re2/re2.h], [], [], [[]]) + AC_CHECK_HEADERS([re2/re2.h], [AS_VAR_SET([LDFLAGS_RE2], ["-lre2"])], [], [[]]) AC_LANG_POP([C++]) ])