summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2018-04-23 15:54:20 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-04-24 12:18:32 +0200
commit1e921ec868871bfd8954879c3f28ca1e286d2c86 (patch)
treecf509c9ef0f57d5a0e483c5066ea8d25841ed2c9
parent7904f409e2a11221b852505d6522b65b6c2900c7 (diff)
Android: check for extra libs needed for build
-rw-r--r--aclocal.m466
-rw-r--r--configure.ac18
2 files changed, 82 insertions, 2 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 365bfa81..58ad2cc5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -31,6 +31,72 @@ AC_DEFUN([BIRD_CHECK_PTHREADS],
CFLAGS="$bird_tmp_cflags"
])
+AC_DEFUN([BIRD_CHECK_ANDROID_GLOB],
+[
+ AC_CACHE_CHECK(
+ [for glob.h],
+ [bird_cv_lib_glob],
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ #include <glob.h>
+ #include <stdlib.h>
+ ],
+ [ glob(NULL, 0, NULL, NULL); ]
+ )
+ ],
+ [bird_cv_lib_glob=yes],
+ [
+ bird_tmp_libs="$LIBS"
+ LIBS="$LIBS -landroid-glob"
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ #include <glob.h>
+ #include <stdlib.h>
+ ],
+ [ glob(NULL, 0, NULL, NULL); ]
+ )
+ ],
+ [bird_cv_lib_glob=-landroid-glob],
+ [bird_cv_lib_glob=no]
+ )
+ LIBS="$bird_tmp_libs"
+ ]
+ )
+ )
+])
+
+AC_DEFUN([BIRD_CHECK_ANDROID_LOG],
+[
+ AC_CACHE_CHECK(
+ [for syslog lib flags],
+ [bird_cv_lib_log],
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [ #include <sys/syslog.h> ],
+ [ syslog(0, ""); ]
+ )
+ ],
+ [bird_cv_lib_log=yes],
+ [
+ bird_tmp_libs="$LIBS"
+ LIBS="$LIBS -llog"
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [ #include <sys/syslog.h> ],
+ [ syslog(0, ""); ]
+ )
+ ],
+ [bird_cv_lib_log=-llog],
+ [bird_cv_lib_log=no]
+ )
+ LIBS="$bird_tmp_libs"
+ ]
+ )
+ )
+])
+
AC_DEFUN([BIRD_CHECK_GCC_OPTION],
[
bird_tmp_cflags="$CFLAGS"
diff --git a/configure.ac b/configure.ac
index d135dc04..2c136526 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,6 +321,20 @@ AC_C_BIGENDIAN(
[AC_MSG_ERROR([Cannot determine CPU endianity.])]
)
+BIRD_CHECK_ANDROID_GLOB
+if test "$bird_cv_lib_glob" = no ; then
+ AC_MSG_ERROR([glob.h not found.])
+elif test "$bird_cv_lib_glob" != yes ; then
+ LIBS="$LIBS $bird_cv_lib_glob"
+fi
+
+BIRD_CHECK_ANDROID_LOG
+if test "$bird_cv_lib_log" = no ; then
+ AC_MSG_ERROR([don't know how to link syslog.])
+elif test "$bird_cv_lib_log" != yes ; then
+ LIBS="$LIBS $bird_cv_lib_log"
+fi
+
if test "$enable_debug" = yes ; then
AC_DEFINE([DEBUGGING], [1], [Define to 1 if debugging is enabled])
if test "$enable_memcheck" = yes ; then
@@ -382,7 +396,7 @@ AC_SUBST([CLIENT_LIBS])
mkdir -p $objdir/sysdep
AC_CONFIG_HEADERS([$objdir/sysdep/autoconf.h:sysdep/autoconf.h.in])
AC_CONFIG_COMMANDS([merge],
- [ export CPP="$CPP"; $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs ],
+ [ export CPP="$CPP"; sh $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs ],
[
srcdir=$srcdir
srcdir_rel=$srcdir_rel
@@ -405,4 +419,4 @@ AC_MSG_RESULT([ Debugging: $enable_debug])
AC_MSG_RESULT([ POSIX threads: $enable_pthreads])
AC_MSG_RESULT([ Routing protocols: $protocols])
AC_MSG_RESULT([ Client: $enable_client])
-rm -f $objdir/.*-stamp
+rm -f $objdir/.*-stamp \ No newline at end of file