Jacob Appelbaum | 3b0cec5 | 2012-07-09 22:32:41 +0200 | [diff] [blame] | 1 | AC_INIT([tlsdate], [0.0.1], [jacob at appelbaum.net]) |
Jacob Appelbaum | 4c6e57d | 2012-07-15 13:20:10 +0200 | [diff] [blame] | 2 | AC_CONFIG_AUX_DIR(config) |
| 3 | AM_CONFIG_HEADER([config/tlsdate-config.h]) |
Jacob Appelbaum | 3b0cec5 | 2012-07-09 22:32:41 +0200 | [diff] [blame] | 4 | AM_INIT_AUTOMAKE([tlsdate], [0.0.1]) |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 5 | AC_CANONICAL_HOST |
Christian Grothoff | bd15a22 | 2012-02-14 00:40:57 +0100 | [diff] [blame] | 6 | AH_TOP([#define _GNU_SOURCE 1]) |
David Goulet | 0809df1 | 2012-07-31 23:27:34 -0400 | [diff] [blame^] | 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 8 | |
| 9 | LT_INIT |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 10 | |
| 11 | # Debug and hardening flags all in one shot |
| 12 | CFLAGS=" -g -O1 -Wall -fno-strict-aliasing " |
| 13 | CFLAGS+=" -D_FORTIFY_SOURCE=2 -fstack-protector-all " |
| 14 | CFLAGS+=" -fwrapv -fPIE -Wstack-protector " |
| 15 | CFLAGS+=" --param ssp-buffer-size=1 " |
| 16 | LDFLAGS=" -pie -z relro -z now " |
| 17 | |
Jacob Appelbaum | 9639003 | 2012-07-15 15:53:13 -0400 | [diff] [blame] | 18 | dnl Here we should build a small program to fetch the build system time in a portable |
| 19 | dnl manner. We have no Win32 users, we can fix this if we ever find one that |
| 20 | dnl cares. |
| 21 | COMPILE_DATE=`date +%s` |
| 22 | AC_SUBST(COMPILE_DATE) |
| 23 | AC_DEFINE_UNQUOTED([RECENT_COMPILE_DATE], |
| 24 | [(uint32_t) ${COMPILE_DATE}], |
| 25 | [Time in seconds since the Disco epoch at build time]) |
| 26 | |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 27 | # Required headers |
| 28 | AC_CHECK_HEADERS( |
| 29 | stdio.h \ |
| 30 | stdint.h \ |
| 31 | stdlib.h \ |
Christian Grothoff | 191cd98 | 2012-02-14 00:48:45 +0100 | [diff] [blame] | 32 | unistd.h \ |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 33 | getopt.h \ |
| 34 | sys/time.h \ |
Christian Grothoff | 191cd98 | 2012-02-14 00:48:45 +0100 | [diff] [blame] | 35 | sys/types.h \ |
| 36 | sys/wait.h \ |
| 37 | sys/mman.h \ |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 38 | time.h \ |
Christian Grothoff | 191cd98 | 2012-02-14 00:48:45 +0100 | [diff] [blame] | 39 | pwd.h \ |
Jacob Appelbaum | 2c385d2 | 2012-02-21 14:04:15 -0800 | [diff] [blame] | 40 | grp.h \ |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 41 | arpa/inet.h \ |
| 42 | openssl/bio.h \ |
| 43 | openssl/ssl.h \ |
| 44 | openssl/err.h \ |
Christian Grothoff | 191cd98 | 2012-02-14 00:48:45 +0100 | [diff] [blame] | 45 | openssl/evp.h |
Jacob Appelbaum | 5de8b0a | 2012-02-02 01:43:22 +0100 | [diff] [blame] | 46 | , , AC_MSG_ERROR([Required headers missing; compilation will not succeed])) |
| 47 | |
Jacob Appelbaum | 9639003 | 2012-07-15 15:53:13 -0400 | [diff] [blame] | 48 | AC_CHECK_FUNCS([setresuid gettimeofday]) |
Christian Grothoff | bd15a22 | 2012-02-14 00:40:57 +0100 | [diff] [blame] | 49 | |
David Goulet | 0809df1 | 2012-07-31 23:27:34 -0400 | [diff] [blame^] | 50 | AC_OUTPUT(Makefile src/Makefile src/compat/Makefile) |