diff options
author | Brent Cook <busterb@gmail.com> | 2014-07-10 06:07:09 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2014-07-10 06:07:09 -0500 |
commit | e9eff5016a4ec2153c037c1b888acd2755965755 (patch) | |
tree | 2b452b71a3fe94a9b25ce06404c55e1d0ea2dd95 /configure.ac | |
download | portable-e9eff5016a4ec2153c037c1b888acd2755965755.tar.gz portable-e9eff5016a4ec2153c037c1b888acd2755965755.tar.bz2 portable-e9eff5016a4ec2153c037c1b888acd2755965755.zip |
initial top-level import
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..898b6ed --- /dev/null +++ b/configure.ac | |||
@@ -0,0 +1,95 @@ | |||
1 | AC_INIT([libressl], [1.0.0]) | ||
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 -Werror -std=c99 -g -Wno-pointer-sign -DHAVE_CRYPTODEV -DLIBRESSL_INTERNAL" | ||
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 | ;; | ||
20 | *solaris*) | ||
21 | TARGET_OS=solaris; | ||
22 | CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" | ||
23 | AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) | ||
24 | ;; | ||
25 | *) ;; | ||
26 | esac | ||
27 | |||
28 | AM_CONDITIONAL(TARGET_DARWIN, test x$TARGET_OS = xdarwin) | ||
29 | AM_CONDITIONAL(TARGET_LINUX, test x$TARGET_OS = xlinux) | ||
30 | AM_CONDITIONAL(TARGET_SOLARIS, test x$TARGET_OS = xsolaris) | ||
31 | |||
32 | AC_PROG_CC | ||
33 | AC_PROG_LIBTOOL | ||
34 | AC_PROG_CC_STDC | ||
35 | AM_PROG_CC_C_O | ||
36 | |||
37 | AC_CHECK_FUNC(strlcpy,[AC_SEARCH_LIBS(strlcpy,, [NO_STRLCPY=], | ||
38 | [NO_STRLCPY=yes])], [NO_STRLCPY=yes]) | ||
39 | AC_SUBST(NO_STRLCPY) | ||
40 | AM_CONDITIONAL(NO_STRLCPY, test "x$NO_STRLCPY" = "xyes") | ||
41 | |||
42 | AC_CHECK_FUNC(strlcat,[AC_SEARCH_LIBS(strlcat,, [NO_STRLCAT=], | ||
43 | [NO_STRLCAT=yes])], [NO_STRLCAT=yes]) | ||
44 | AC_SUBST(NO_STRLCAT) | ||
45 | AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes") | ||
46 | |||
47 | AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=], | ||
48 | [NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes]) | ||
49 | AC_SUBST(NO_REALLOCARRAY) | ||
50 | AM_CONDITIONAL(NO_REALLOCARRAY, test "x$NO_REALLOCARRAY" = "xyes") | ||
51 | |||
52 | AC_CHECK_FUNC(timingsafe_bcmp,[AC_SEARCH_LIBS(timingsafe_bcmp,, [NO_TIMINGSAFE_BCMP=], | ||
53 | [NO_TIMINGSAFE_BCMP=yes])], [NO_TIMINGSAFE_BCMP=yes]) | ||
54 | AC_SUBST(NO_TIMINGSAFE_BCMP) | ||
55 | AM_CONDITIONAL(NO_TIMINGSAFE_BCMP, test "x$NO_TIMINGSAFE_BCMP" = "xyes") | ||
56 | |||
57 | AC_CHECK_FUNC(timingsafe_memcmp,[AC_SEARCH_LIBS(timingsafe_memcmp,, [NO_TIMINGSAFE_MEMCMP=], | ||
58 | [NO_TIMINGSAFE_MEMCMP=yes])], [NO_TIMINGSAFE_MEMCMP=yes]) | ||
59 | AC_SUBST(NO_TIMINGSAFE_MEMCMP) | ||
60 | AM_CONDITIONAL(NO_TIMINGSAFE_MEMCMP, test "x$NO_TIMINGSAFE_MEMCMP" = "xyes") | ||
61 | |||
62 | AC_CHECK_FUNC(arc4random_buf,[AC_SEARCH_LIBS(write,, [NO_ARC4RANDOM_BUF=], | ||
63 | [NO_ARC4RANDOM_BUF=yes])], [NO_ARC4RANDOM_BUF=yes]) | ||
64 | AC_SUBST(NO_ARC4RANDOM_BUF) | ||
65 | AM_CONDITIONAL(NO_ARC4RANDOM_BUF, test "x$NO_ARC4RANDOM_BUF" = "xyes") | ||
66 | |||
67 | # overrides for arc4random_buf implementations with known issues | ||
68 | AM_CONDITIONAL(NO_ARC4RANDOM_BUF, | ||
69 | test x$TARGET_OS = xdarwin \ | ||
70 | -o x$TARGET_OS = xsolaris \ | ||
71 | -o x$NO_ARC4RANDOM_BUF = xyes) | ||
72 | |||
73 | AC_CHECK_FUNC(getentropy,[AC_SEARCH_LIBS(write,, [NO_GETENTROPY=], | ||
74 | [NO_GETENTROPY=yes])], [NO_GETENTROPY=yes]) | ||
75 | AC_SUBST(NO_GETENTROPY) | ||
76 | AM_CONDITIONAL(NO_GETENTROPY, test "x$NO_GETENTROPY" = "xyes") | ||
77 | |||
78 | AC_CHECK_FUNC(issetugid,[AC_SEARCH_LIBS(write,, [NO_ISSETUGID=], | ||
79 | [NO_ISSETUGID=yes])], [NO_ISSETUGID=yes]) | ||
80 | AC_SUBST(NO_ISSETUGID) | ||
81 | AM_CONDITIONAL(NO_ISSETUGID, test "x$NO_ISSETUGID" = "xyes") | ||
82 | |||
83 | AC_CHECK_FUNC(strtonum,[AC_SEARCH_LIBS(write,, [NO_STRTONUM=], | ||
84 | [NO_STRTONUM=yes])], [NO_STRTONUM=yes]) | ||
85 | AC_SUBST(NO_STRTONUM) | ||
86 | AM_CONDITIONAL(NO_STRTONUM, test "x$NO_STRTONUM" = "xyes") | ||
87 | |||
88 | AC_CHECK_FUNC(getauxval, AC_DEFINE(HAVE_GETAUXVAL)) | ||
89 | |||
90 | AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN)) | ||
91 | |||
92 | LT_INIT | ||
93 | |||
94 | AC_OUTPUT(Makefile include/Makefile include/openssl/Makefile ssl/Makefile | ||
95 | crypto/Makefile tests/Makefile apps/Makefile) | ||