blob: cacfa3faed31a341dd336affefdeea9dd8c07849 [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])
David Goulet0809df12012-07-31 23:27:34 -04007m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9LT_INIT
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010010
11# Debug and hardening flags all in one shot
12CFLAGS=" -g -O1 -Wall -fno-strict-aliasing "
13CFLAGS+=" -D_FORTIFY_SOURCE=2 -fstack-protector-all "
14CFLAGS+=" -fwrapv -fPIE -Wstack-protector "
15CFLAGS+=" --param ssp-buffer-size=1 "
16LDFLAGS=" -pie -z relro -z now "
17
Jacob Appelbaum96390032012-07-15 15:53:13 -040018dnl Here we should build a small program to fetch the build system time in a portable
19dnl manner. We have no Win32 users, we can fix this if we ever find one that
20dnl cares.
21COMPILE_DATE=`date +%s`
22AC_SUBST(COMPILE_DATE)
23AC_DEFINE_UNQUOTED([RECENT_COMPILE_DATE],
24 [(uint32_t) ${COMPILE_DATE}],
25 [Time in seconds since the Disco epoch at build time])
26
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010027# Required headers
28AC_CHECK_HEADERS(
29 stdio.h \
30 stdint.h \
31 stdlib.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010032 unistd.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010033 getopt.h \
34 sys/time.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010035 sys/types.h \
36 sys/wait.h \
37 sys/mman.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010038 time.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010039 pwd.h \
Jacob Appelbaum2c385d22012-02-21 14:04:15 -080040 grp.h \
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010041 arpa/inet.h \
42 openssl/bio.h \
43 openssl/ssl.h \
44 openssl/err.h \
Christian Grothoff191cd982012-02-14 00:48:45 +010045 openssl/evp.h
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010046, , AC_MSG_ERROR([Required headers missing; compilation will not succeed]))
47
Jacob Appelbaum96390032012-07-15 15:53:13 -040048AC_CHECK_FUNCS([setresuid gettimeofday])
Christian Grothoffbd15a222012-02-14 00:40:57 +010049
David Goulet0809df12012-07-31 23:27:34 -040050AC_OUTPUT(Makefile src/Makefile src/compat/Makefile)