From ee05cc11db9dca7a97e53f27ec206d4edad0ab62 Mon Sep 17 00:00:00 2001 From: s1341 Date: Thu, 11 Feb 2021 10:38:48 +0200 Subject: [PATCH] Fix missing -llog when compiling for android --- configure.ac | 13 +++++++++++++ src/Makefile.am | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index eb70a76e165a..5188e305d1ad 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,19 @@ case "$target_os" in esac AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1]) +AC_MSG_CHECKING(whether -llog is needed) +ANDROID_TEST=no +case "$target_os" in + *android*) + ANDROID_TEST=yes + ;; +esac +AC_MSG_RESULT($ANDROID_TEST) +if test "x$ANDROID_TEST" = xyes; then + LIBLOG_LIBS="-llog" +fi +AC_SUBST([LIBLOG_LIBS]) + # HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, # since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock # too. diff --git a/src/Makefile.am b/src/Makefile.am index 5940ce187ec1..503ed2ec5485 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,7 @@ endif AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -AM_LDFLAGS = $(PTHREAD_CFLAGS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) ${LIBLOG_LIBS} # If I say "dist_include_DATA", automake complains that $(includedir) is not # a "legitimate" directory for DATA. Screw you, automake.