~ubuntu-branches/ubuntu/utopic/tlsdate/utopic-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Jacob Appelbaum
  • Date: 2013-01-22 23:08:21 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130122230821-820ay2kh785on6yc
Tags: 0.0.5-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
AC_INIT([tlsdate],[0.0.4],[jacob at appelbaum.net])
 
1
AC_INIT([tlsdate],[0.0.5],[jacob at appelbaum.net])
2
2
AC_CONFIG_AUX_DIR([config])
3
3
AC_CONFIG_MACRO_DIR([m4])
4
4
 
12
12
 
13
13
AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
14
14
 
 
15
PKG_PROG_PKG_CONFIG
15
16
LT_PREREQ([2.2])
16
17
LT_INIT
17
18
LT_LANG([C])
29
30
                   [(uint32_t) ${COMPILE_DATE}],
30
31
                   [Time in seconds since the Disco epoch at build time])
31
32
 
32
 
# Build up the directory we will use to install certs
 
33
dnl Build up the directory we will use to install certs
33
34
TLSDATE_CA_ROOTS="${sysconfdir}/$PACKAGE_NAME/ca-roots"
34
35
AC_SUBST([TLSDATE_CA_ROOTS])
35
36
 
36
 
# Required headers
37
 
# First check to see if openssl is installed
 
37
dnl Place we install our config file
 
38
TLSDATE_CONF_DIR="${sysconfdir}/$PACKAGE_NAME/"
 
39
AC_SUBST([TLSDATE_CONF_DIR])
 
40
 
 
41
dnl Required headers
 
42
dnl First check to see if openssl is installed
38
43
AC_CHECK_HEADERS([openssl/ssl.h], ,[AC_MSG_ERROR([OpenSSL is not installed, openssl/sslh is missing])])
39
44
 
40
45
AC_CHECK_HEADERS([arpa/inet.h], ,[AC_MSG_ERROR([Required headers missing; compilation will not succeed])])
57
62
AC_CHECK_FUNCS([setresuid])
58
63
AC_CHECK_FUNCS([gettimeofday])
59
64
 
60
 
# Check for -lrt
61
 
AC_CHECK_LIB([rt], [clock_gettime], [
62
 
              RT_LIB="-lrt"
63
 
              AC_SUBST(RT_LIB)
64
 
              AC_DEFINE([HAVE_LIBRT], [1], [Have clock_gettime])
65
 
              ],[
66
 
                 AC_MSG_ERROR([Your system lacks clock_gettime])
67
 
              ])
68
 
 
69
 
# Debug and hardening flags all in one shot
70
 
# Alwas do this at the end, otherwise you end up filtering system/other libraries
 
65
AC_MSG_CHECKING([user/group to drop privs to])
 
66
 
 
67
AC_ARG_WITH([unpriv-user],
 
68
            [AS_HELP_STRING([--with-unpriv-user=<user>],
 
69
                            [User to drop privs to @<:@default: nobody@:>@])])
 
70
AS_CASE([$with_unpriv_user],
 
71
        [""|yes|no], [UNPRIV_USER="nobody"],
 
72
        [*], [UNPRIV_USER=$with_unpriv_user])
 
73
AC_DEFINE_UNQUOTED([UNPRIV_USER], ["${UNPRIV_USER}"], [Unprivileged user])
 
74
 
 
75
AC_ARG_WITH([unpriv-group],
 
76
            [AS_HELP_STRING([--with-unpriv-group=<group>],
 
77
                            [Group to drop privs to @<:@default: nogroup@:>@])])
 
78
AS_CASE([$with_unpriv_group],
 
79
        [""|yes|no], [UNPRIV_GROUP="nogroup"],
 
80
        [*], [UNPRIV_GROUP=$with_unpriv_group])
 
81
AC_DEFINE_UNQUOTED([UNPRIV_GROUP], ["${UNPRIV_GROUP}"], [Unprivileged group])
 
82
 
 
83
AC_MSG_RESULT(${UNPRIV_USER}:${UNPRIV_GROUP})
 
84
 
 
85
dnl Check for clock_gettime.  Some systems put it into -lc, while
 
86
dnl others use -lrt.  Try the first and fallback to the latter.
 
87
RT_LIB=
 
88
AC_CHECK_FUNC([clock_gettime], [:],
 
89
              [AC_CHECK_LIB([rt], [clock_gettime], [RT_LIB="-lrt"],
 
90
                            [AC_MSG_ERROR([Your system lacks clock_gettime])])])
 
91
AC_SUBST(RT_LIB)
 
92
 
 
93
AC_ARG_ENABLE([dbus],
 
94
              [AS_HELP_STRING([--disable-dbus],
 
95
                              [Disable automatically dbus support])])
 
96
AS_IF([test "x$enable_dbus" = xyes], [
 
97
    PKG_CHECK_MODULES([DBUS], [dbus-1], [
 
98
            AC_DEFINE([HAVE_DBUS], [1], [Enable dbus support])
 
99
            AC_MSG_CHECKING([user/group to use for dbus])
 
100
            AC_ARG_WITH([dbus-user],
 
101
                        [AS_HELP_STRING([--with-dbus-user=<user>],
 
102
                                        [User to send dbus signals from @<:@default: nobody@:>@])])
 
103
            AS_CASE([$with_dbus_user],
 
104
                    [""|yes|no], [DBUS_USER="nobody"],
 
105
                    [*], [DBUS_USER=$with_dbus_user])
 
106
            AC_ARG_WITH([dbus-group],
 
107
                        [AS_HELP_STRING([--with-dbus-group=<group>],
 
108
                                        [Group to send dbus signals from @<:@default: nogroup@:>@])])
 
109
            AS_CASE([$with_dbus_group],
 
110
                    [""|yes|no], [DBUS_GROUP="nogroup"],
 
111
                    [*], [DBUS_GROUP=$with_dbus_group])
 
112
            AC_MSG_RESULT(${DBUS_USER}:${DBUS_GROUP})
 
113
            AC_DEFINE_UNQUOTED([DBUS_USER], ["${DBUS_USER}"], [DBus user])
 
114
            AC_DEFINE_UNQUOTED([DBUS_GROUP], ["${DBUS_GROUP}"], [DBus group])
 
115
        ], [
 
116
            AS_IF([test "x$enable_dbus" = xyes],
 
117
                  [AC_MSG_ERROR([dbus requested but not found])])
 
118
        ])
 
119
    ])
 
120
 
 
121
AC_SUBST(DBUS_CFLAGS)
 
122
AC_SUBST(DBUS_LIBS)
 
123
 
 
124
dnl Debug and hardening flags all in one shot
 
125
dnl Always do this at the end, otherwise you end up filtering system/other libraries
 
126
AC_ARG_ENABLE([hardened-checks],
 
127
              [AS_HELP_STRING([--disable-hardened-checks],
 
128
                              [Disable automatically enabling hardened toolchain options])])
71
129
AC_DEFUN([LOCAL_CHECK_FLAGS],[
72
130
          AC_REQUIRE([AX_CHECK_LINK_FLAG])
73
131
          AC_REQUIRE([AX_APPEND_COMPILE_FLAGS])
74
132
          AC_LANG_PUSH([C])
75
 
          CFLAGS=
76
 
          LIBS=
77
 
          AX_APPEND_COMPILE_FLAGS([-g -O1 -Wall])
78
 
          AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing])
79
 
          AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2 -fstack-protector-all])
80
 
          AX_APPEND_COMPILE_FLAGS([-fwrapv -fPIE -Wstack-protector])
81
 
          AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1])
82
 
          AX_CHECK_LINK_FLAG([-z relro -z now])
83
 
          AX_CHECK_LINK_FLAG([-pie])
 
133
          AS_IF([test "x$enable_hardened_checks" != xno], [
 
134
              CFLAGS=
 
135
              LIBS=
 
136
              AX_APPEND_COMPILE_FLAGS([-g -O1])
 
137
          ], [
 
138
              AC_MSG_WARN([using hardened flags is HIGHLY RECOMMENDED and disabling them is a BAD IDEA])
 
139
          ])
 
140
          AX_APPEND_COMPILE_FLAGS([-Wall -fno-strict-aliasing])
 
141
          AS_IF([test "x$enable_hardened_checks" != xno], [
 
142
              AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2 -fstack-protector-all])
 
143
              AX_APPEND_COMPILE_FLAGS([-fwrapv -fPIE -Wstack-protector])
 
144
              AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1])
 
145
              AX_CHECK_LINK_FLAG([-z relro -z now])
 
146
              AX_CHECK_LINK_FLAG([-pie])
 
147
          ])
84
148
          AC_LANG_POP
85
149
          ])
86
150
LOCAL_CHECK_FLAGS
87
151
 
 
152
AC_ARG_ENABLE([code-coverage-checks],
 
153
              [AS_HELP_STRING([--enable-code-coverage-checks],
 
154
                              [Enable gcov/lcov compile time options])],
 
155
              [AX_APPEND_COMPILE_FLAGS([-ftest-coverage -fprofile-arcs])])
 
156
 
88
157
AC_CONFIG_FILES([Makefile])
89
158
AC_OUTPUT