Преглед изворни кода

Fix missing -llog when compiling for android

s1341 пре 4 година
родитељ
комит
ee05cc11db
2 измењених фајлова са 14 додато и 1 уклоњено
  1. 13 0
      configure.ac
  2. 1 1
      src/Makefile.am

+ 13 - 0
configure.ac

@@ -223,6 +223,19 @@ case "$target_os" in
 esac
 esac
 AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
 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,
 # 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
 #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
 #   too.
 #   too.

+ 1 - 1
src/Makefile.am

@@ -30,7 +30,7 @@ endif
 
 
 AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)
 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
 # If I say "dist_include_DATA", automake complains that $(includedir) is not
 # a "legitimate" directory for DATA.  Screw you, automake.
 # a "legitimate" directory for DATA.  Screw you, automake.