-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.ac
74 lines (63 loc) · 1.6 KB
/
configure.ac
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
69
70
71
72
73
74
#
# Copyright (c) 2013 Duo Security
# All rights reserved, all wrongs reversed.
AC_INIT([libduo], [2.1.0], [duo_unix@duosecurity.com])
AC_CONFIG_SRCDIR([duo.c])
AC_LANG([C])
# Determine platform
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([CANONICAL_HOST], ["${host}"], [Canonical host])
AC_AIX
AC_CONFIG_HEADER([config.h])
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_C_BIGENDIAN
# Checks for programs.
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_EGREP
AC_PATH_PROG([AR], [ar])
# Check for functions
AC_CHECK_FUNCS([getaddrinfo])
if test -z "$LD" ; then
LD=$CC
fi
AC_SUBST([LD])
# Compiler options
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall -D_FORTIFY_SOURCE=2"
AC_MSG_NOTICE([Adding gcc options: $CFLAGS])
fi
GGL_CHECK_STACK_PROTECTOR([has_stack_protector=yes], [has_stack_protector=no])
# XXX - disable -fstack-protector due to missing libssp_nonshared
case "$host_os" in
*aix*)
AC_MSG_NOTICE([-fstack-protector disabled on AIX])
has_stack_protector=no
;;
*sunos*)
AC_MSG_NOTICE([-fstack-protector disabled on SunOS])
has_stack_protector=no
;;
*solaris*)
AC_MSG_NOTICE([-fstack-protector disabled on Solaris])
has_stack_protector=no
;;
esac
if test x$has_stack_protector = xyes; then
CFLAGS="$CFLAGS -fstack-protector"
AC_MSG_NOTICE([-fstack-protector enabled in CFLAGS])
fi
# Check for platform features
AC_C_BIGENDIAN
AC_C_CONST
# Check headers
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h limits.h memory.h stdint.h stdlib.h string.h unistd.h])
# Check OpenSSL
AX_CHECK_OPENSSL([], AC_MSG_FAILURE([OpenSSL not found]))
# Output
AC_CONFIG_FILES([Makefile])
AC_OUTPUT