blob: df5ebcca057c08d6b20014d50bba1df937a99129 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From cc6fce587f2628c8b342764e06fb0fc27c1e8274 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Mon, 3 Aug 2015 20:33:44 -0700
4Subject: [PATCH] configure.ac: add arg --with-libunwind
5
6Add arg --with-libunwind for configure so it's optional to check
7libunwind, which is helpfull to make deterministic builds.
8
9Upstream-Status: Submitted [wayland-devel]
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 configure.ac | 19 ++++++++++++++-----
14 1 file changed, 14 insertions(+), 5 deletions(-)
15
16diff --git a/configure.ac b/configure.ac
17index 314b0d4..242d251 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -60,13 +60,22 @@ PKG_PROG_PKG_CONFIG()
21 PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
22 PKG_CHECK_MODULES(LIBUDEV, [libudev])
23 PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
24-PKG_CHECK_MODULES(LIBUNWIND,
25+
26+AC_ARG_WITH(libunwind,
27+ AS_HELP_STRING([--without-libunwind],[Do not use libunwind]))
28+
29+AS_IF([test "x$with_libunwind" != "xno"],
30+ [PKG_CHECK_MODULES(LIBUNWIND,
31 [libunwind],
32 [HAVE_LIBUNWIND=yes],
33- [HAVE_LIBUNWIND=no])
34-if test "x$HAVE_LIBUNWIND" = "xyes"; then
35- AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
36-fi
37+ [HAVE_LIBUNWIND=no])],
38+ [HAVE_LIBUNWIND=no])
39+
40+AS_IF([test "x$HAVE_LIBUNWIND" = "xyes"],
41+ [AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])],
42+ [AS_IF([test "x$with_libunwind" = "xyes"],
43+ [AC_MSG_ERROR([libunwind requested but not found])])])
44+
45 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
46 AC_PATH_PROG(ADDR2LINE, [addr2line])
47 if test "x$ADDR2LINE" != "x"; then
48--
492.3.5
50