diff options
author | Brent Cook <bcook@openbsd.org> | 2014-07-12 03:36:32 -0600 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2014-07-12 04:02:35 -0600 |
commit | 596ef45803c04d8f5b7beeeabea8996993559e32 (patch) | |
tree | a49e2b7255c2e8d9da51e88a2df0b2ec7c53bdbf /configure.ac.tpl | |
parent | e14147356dc072bf5a1411444cfd3cf5c4850ec9 (diff) | |
download | portable-596ef45803c04d8f5b7beeeabea8996993559e32.tar.gz portable-596ef45803c04d8f5b7beeeabea8996993559e32.tar.bz2 portable-596ef45803c04d8f5b7beeeabea8996993559e32.zip |
source library version from a common place, speed man builds
grab library version from VERSION file
build manpages only on changes
ok beck@
Diffstat (limited to 'configure.ac.tpl')
-rw-r--r-- | configure.ac.tpl | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/configure.ac.tpl b/configure.ac.tpl new file mode 100644 index 0000000..55f5690 --- /dev/null +++ b/configure.ac.tpl | |||
@@ -0,0 +1,99 @@ | |||
1 | AC_INIT([libressl], [VERSION]) | ||
2 | AC_CANONICAL_TARGET | ||
3 | AM_INIT_AUTOMAKE([subdir-objects]) | ||
4 | AC_CONFIG_MACRO_DIR([m4]) | ||
5 | |||
6 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
7 | |||
8 | AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS") | ||
9 | CFLAGS="$CFLAGS -Wall -std=c99 -g -Wno-pointer-sign" | ||
10 | |||
11 | case $target_os in | ||
12 | *darwin*) | ||
13 | TARGET_OS=darwin; | ||
14 | LDFLAGS="$LDFLAGS -Qunused-arguments" | ||
15 | ;; | ||
16 | *linux*) | ||
17 | TARGET_OS=linux; | ||
18 | CFLAGS="$CFLAGS -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" | ||
19 | AC_SUBST([PLATFORM_LDADD], ['-lrt']) | ||
20 | ;; | ||
21 | *solaris*) | ||
22 | TARGET_OS=solaris; | ||
23 | CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" | ||
24 | AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) | ||
25 | ;; | ||
26 | *openbsd*) | ||
27 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded]) | ||
28 | ;; | ||
29 | *) ;; | ||
30 | esac | ||
31 | |||
32 | AM_CONDITIONAL(TARGET_DARWIN, test x$TARGET_OS = xdarwin) | ||
33 | AM_CONDITIONAL(TARGET_LINUX, test x$TARGET_OS = xlinux) | ||
34 | AM_CONDITIONAL(TARGET_SOLARIS, test x$TARGET_OS = xsolaris) | ||
35 | |||
36 | AC_PROG_CC | ||
37 | AC_PROG_LIBTOOL | ||
38 | AC_PROG_CC_STDC | ||
39 | AM_PROG_CC_C_O | ||
40 | |||
41 | AC_CHECK_FUNC(strlcpy,[AC_SEARCH_LIBS(strlcpy,, [NO_STRLCPY=], | ||
42 | [NO_STRLCPY=yes])], [NO_STRLCPY=yes]) | ||
43 | AC_SUBST(NO_STRLCPY) | ||
44 | AM_CONDITIONAL(NO_STRLCPY, test "x$NO_STRLCPY" = "xyes") | ||
45 | |||
46 | AC_CHECK_FUNC(strlcat,[AC_SEARCH_LIBS(strlcat,, [NO_STRLCAT=], | ||
47 | [NO_STRLCAT=yes])], [NO_STRLCAT=yes]) | ||
48 | AC_SUBST(NO_STRLCAT) | ||
49 | AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes") | ||
50 | |||
51 | AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=], | ||
52 | [NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes]) | ||
53 | AC_SUBST(NO_REALLOCARRAY) | ||
54 | AM_CONDITIONAL(NO_REALLOCARRAY, test "x$NO_REALLOCARRAY" = "xyes") | ||
55 | |||
56 | AC_CHECK_FUNC(timingsafe_bcmp,[AC_SEARCH_LIBS(timingsafe_bcmp,, [NO_TIMINGSAFE_BCMP=], | ||
57 | [NO_TIMINGSAFE_BCMP=yes])], [NO_TIMINGSAFE_BCMP=yes]) | ||
58 | AC_SUBST(NO_TIMINGSAFE_BCMP) | ||
59 | AM_CONDITIONAL(NO_TIMINGSAFE_BCMP, test "x$NO_TIMINGSAFE_BCMP" = "xyes") | ||
60 | |||
61 | AC_CHECK_FUNC(timingsafe_memcmp,[AC_SEARCH_LIBS(timingsafe_memcmp,, [NO_TIMINGSAFE_MEMCMP=], | ||
62 | [NO_TIMINGSAFE_MEMCMP=yes])], [NO_TIMINGSAFE_MEMCMP=yes]) | ||
63 | AC_SUBST(NO_TIMINGSAFE_MEMCMP) | ||
64 | AM_CONDITIONAL(NO_TIMINGSAFE_MEMCMP, test "x$NO_TIMINGSAFE_MEMCMP" = "xyes") | ||
65 | |||
66 | AC_CHECK_FUNC(arc4random_buf,[AC_SEARCH_LIBS(write,, [NO_ARC4RANDOM_BUF=], | ||
67 | [NO_ARC4RANDOM_BUF=yes])], [NO_ARC4RANDOM_BUF=yes]) | ||
68 | AC_SUBST(NO_ARC4RANDOM_BUF) | ||
69 | AM_CONDITIONAL(NO_ARC4RANDOM_BUF, test "x$NO_ARC4RANDOM_BUF" = "xyes") | ||
70 | |||
71 | # overrides for arc4random_buf implementations with known issues | ||
72 | AM_CONDITIONAL(NO_ARC4RANDOM_BUF, | ||
73 | test x$TARGET_OS = xdarwin \ | ||
74 | -o x$TARGET_OS = xsolaris \ | ||
75 | -o x$NO_ARC4RANDOM_BUF = xyes) | ||
76 | |||
77 | AC_CHECK_FUNC(getentropy,[AC_SEARCH_LIBS(write,, [NO_GETENTROPY=], | ||
78 | [NO_GETENTROPY=yes])], [NO_GETENTROPY=yes]) | ||
79 | AC_SUBST(NO_GETENTROPY) | ||
80 | AM_CONDITIONAL(NO_GETENTROPY, test "x$NO_GETENTROPY" = "xyes") | ||
81 | |||
82 | AC_CHECK_FUNC(issetugid,[AC_SEARCH_LIBS(write,, [NO_ISSETUGID=], | ||
83 | [NO_ISSETUGID=yes])], [NO_ISSETUGID=yes]) | ||
84 | AC_SUBST(NO_ISSETUGID) | ||
85 | AM_CONDITIONAL(NO_ISSETUGID, test "x$NO_ISSETUGID" = "xyes") | ||
86 | |||
87 | AC_CHECK_FUNC(strtonum,[AC_SEARCH_LIBS(write,, [NO_STRTONUM=], | ||
88 | [NO_STRTONUM=yes])], [NO_STRTONUM=yes]) | ||
89 | AC_SUBST(NO_STRTONUM) | ||
90 | AM_CONDITIONAL(NO_STRTONUM, test "x$NO_STRTONUM" = "xyes") | ||
91 | |||
92 | AC_CHECK_FUNC(getauxval, AC_DEFINE(HAVE_GETAUXVAL)) | ||
93 | |||
94 | AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN)) | ||
95 | |||
96 | LT_INIT | ||
97 | |||
98 | AC_OUTPUT(Makefile include/Makefile include/openssl/Makefile ssl/Makefile | ||
99 | crypto/Makefile tests/Makefile apps/Makefile man/Makefile) | ||