1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
AC_INIT(potd, 1.0, matzeton@googlemail.com)
AC_CONFIG_HEADERS([src/config.h])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE
if test -z "$CFLAGS"; then
CFLAGS="-Os -g"
fi
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_INSTALL
AC_TYPE_SIZE_T
# check for spectre mitigation
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mindirect-branch=thunk"
AC_MSG_CHECKING([if ${CC} supports -mindirect-branch=thunk spectre mitigation])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
[ AC_MSG_RESULT([yes])
SPECTRE_MIT="-mindirect-branch=thunk" ],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS"
AC_SUBST(SPECTRE_MIT)
# check for -fvisibility=hidden compiler support (GCC >= 4)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden -fvisibility-inlines-hidden])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
[ AC_MSG_RESULT([yes])
SYMBOL_VISIBILITY="-fvisibility=hidden" ],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
AC_CHECK_LIB(socket, connect)
AC_CHECK_LIB(pthread, pthread_create)
dnl libssh-dev
PKG_CHECK_MODULES([libssh], [libssh >= 0.7.3])
AC_SUBST([libssh_CFLAGS])
AC_SUBST([libssh_LIBS])
dnl libseccomp-dev
PKG_CHECK_MODULES([libseccomp], [libseccomp >= 2.3.1])
AC_SUBST([libseccomp_CFLAGS])
AC_SUBST([libseccomp_LIBS])
dnl Check for std header files
AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h string.h ctype.h assert.h sched.h signal.h errno.h])
dnl Check for system specific header files
AC_CHECK_HEADERS([pty.h linux/capability.h sys/types.h sys/wait.h sys/stat.h])
AC_CHECK_HEADERS([libutil.h pthread.h pty.h strings.h syslog.h sys/prctl.h \
sys/uio.h poll.h sys/epoll.h util.h])
dnl Most systems require linking against libutil.so in order to get forkpty()
AC_CHECK_FUNCS(forkpty, [],
[AC_CHECK_LIB(util, forkpty,
[LIBS="-lutil $LIBS"
AC_DEFINE(HAVE_FORKPTY)])])
AC_OUTPUT(Makefile src/Makefile)
|