blob: a8314479359401f0c69e0131ef5f8d1f46aacb54 [file] [log] [blame]
Jacob Appelbaum3b0cec52012-07-09 22:32:41 +02001AC_INIT([tlsdate], [0.0.1], [jacob at appelbaum.net])
Jacob Appelbaum4c6e57d2012-07-15 13:20:10 +02002AC_CONFIG_AUX_DIR(config)
3AM_CONFIG_HEADER([config/tlsdate-config.h])
Jacob Appelbaum3b0cec52012-07-09 22:32:41 +02004AM_INIT_AUTOMAKE([tlsdate], [0.0.1])
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +01005AC_CANONICAL_HOST
Christian Grothoffbd15a222012-02-14 00:40:57 +01006AH_TOP([#define _GNU_SOURCE 1])
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +01007
8# Debug and hardening flags all in one shot
9CFLAGS=" -g -O1 -Wall -fno-strict-aliasing "
10CFLAGS+=" -D_FORTIFY_SOURCE=2 -fstack-protector-all "
11CFLAGS+=" -fwrapv -fPIE -Wstack-protector "
12CFLAGS+=" --param ssp-buffer-size=1 "
13LDFLAGS=" -pie -z relro -z now "
14
Jacob Appelbaum96390032012-07-15 15:53:13 -040015dnl Here we should build a small program to fetch the build system time in a portable
16dnl manner. We have no Win32 users, we can fix this if we ever find one that
17dnl cares.
18COMPILE_DATE=`date +%s`
19AC_SUBST(COMPILE_DATE)
20AC_DEFINE_UNQUOTED([RECENT_COMPILE_DATE],
21 [(uint32_t) ${COMPILE_DATE}],
22 [Time in seconds since the Disco epoch at build time])
23
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010024# Required headers
25AC_CHECK_HEADERS(
26 stdio.h \
27 stdint.h \
28 stdlib.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010029 unistd.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010030 getopt.h \
31 sys/time.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010032 sys/types.h \
33 sys/wait.h \
34 sys/mman.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010035 time.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010036 pwd.h \
Jacob Appelbaum2c385d22012-02-21 14:04:15 -080037 grp.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010038 arpa/inet.h \
39 openssl/bio.h \
40 openssl/ssl.h \
41 openssl/err.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010042 openssl/evp.h
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010043, , AC_MSG_ERROR([Required headers missing; compilation will not succeed]))
44
Jacob Appelbaum96390032012-07-15 15:53:13 -040045AC_CHECK_FUNCS([setresuid gettimeofday])
Christian Grothoffbd15a222012-02-14 00:40:57 +010046
Jacob Appelbaum4c6e57d2012-07-15 13:20:10 +020047AC_OUTPUT(Makefile src/Makefile)