diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index 40ead1604..f14b3812c 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -3,35 +3,22 @@ AC_INIT(firejail, 0.9.61, netblue30@yahoo.com, , https://firejail.wordpress.com) | |||
3 | AC_CONFIG_SRCDIR([src/firejail/main.c]) | 3 | AC_CONFIG_SRCDIR([src/firejail/main.c]) |
4 | #AC_CONFIG_HEADERS([config.h]) | 4 | #AC_CONFIG_HEADERS([config.h]) |
5 | 5 | ||
6 | AC_CONFIG_MACRO_DIR([m4]) | ||
7 | |||
6 | AC_PROG_CC | 8 | AC_PROG_CC |
7 | #AC_PROG_CXX | 9 | #AC_PROG_CXX |
8 | AC_PROG_INSTALL | 10 | AC_PROG_INSTALL |
9 | AC_PROG_RANLIB | 11 | AC_PROG_RANLIB |
10 | 12 | ||
11 | HAVE_SPECTRE="no" | 13 | HAVE_SPECTRE="no" |
12 | AC_MSG_CHECKING(for Spectre mitigation support in gcc or clang compiler) | 14 | AX_CHECK_COMPILE_FLAG( |
13 | AS_IF([test "$CC" = "gcc"], [ | 15 | [-mindirect-branch=thunk], |
14 | HAVE_SPECTRE="yes" | 16 | [HAVE_SPECTRE="yes" && EXTRA_CFLAGS+=" -mindirect-branch=thunk"] |
15 | $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no" | 17 | ) |
16 | rm -f dummy.o | 18 | AX_CHECK_COMPILE_FLAG( |
17 | AS_IF([test "$HAVE_SPECTRE" = "yes"], [ | 19 | [-mretpoline], |
18 | EXTRA_CFLAGS+=" -mindirect-branch=thunk " | 20 | [HAVE_SPECTRE="yes" && EXTRA_CFLAGS+=" -mretpoline"] |
19 | ]) | 21 | ) |
20 | ]) | ||
21 | AS_IF([test "$CC" = "clang"], [ | ||
22 | HAVE_SPECTRE="yes" | ||
23 | $CC -mretpoline -c dummy.c || HAVE_SPECTRE="no" | ||
24 | rm -f dummy.o | ||
25 | AS_IF([test "$HAVE_SPECTRE" = "yes"], [ | ||
26 | EXTRA_CFLAGS+=" -mretpoline " | ||
27 | ]) | ||
28 | ]) | ||
29 | AS_IF([test "$HAVE_SPECTRE" = "yes"], [ | ||
30 | AC_MSG_RESULT(yes) | ||
31 | ]) | ||
32 | AS_IF([test "$HAVE_SPECTRE" = "no"], [ | ||
33 | AC_MSG_RESULT(... not available) | ||
34 | ]) | ||
35 | AC_SUBST([EXTRA_CFLAGS]) | 22 | AC_SUBST([EXTRA_CFLAGS]) |
36 | 23 | ||
37 | HAVE_APPARMOR="" | 24 | HAVE_APPARMOR="" |