]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
configure.ac: Add code to detect bionic C library
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 8 Jan 2013 17:02:51 +0000 (12:02 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 9 Jan 2013 14:35:19 +0000 (09:35 -0500)
This adds a new IS_BIONIC define that can be used to detect whether we are
building with eglibc or with bionic.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
configure.ac

index 2add6a3f927b7790e129de1061c47172192099ab..9694d30945afdaf695d74dca4d6af58b27bfc0d4 100644 (file)
@@ -192,6 +192,22 @@ else
 fi
 AC_SUBST([CAP_LIBS])
 
+# Check for alternate C libraries
+AC_MSG_CHECKING(for bionic libc)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+    [[#ifndef __ANDROID__
+error: Not bionic!
+#endif]])],
+                   [is_bionic=yes],
+                   [is_bionic=no])
+if test "x$is_bionic" = "xyes"; then
+        AC_DEFINE([IS_BIONIC], 1, ["bionic libc"])
+        AC_MSG_RESULT([yes])
+else
+        AC_MSG_RESULT([no])
+fi
+AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
+
 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])