aboutsummaryrefslogtreecommitdiff
path: root/configure.ac.tpl
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2014-07-12 03:36:32 -0600
committerBrent Cook <bcook@openbsd.org>2014-07-12 04:02:35 -0600
commit596ef45803c04d8f5b7beeeabea8996993559e32 (patch)
treea49e2b7255c2e8d9da51e88a2df0b2ec7c53bdbf /configure.ac.tpl
parente14147356dc072bf5a1411444cfd3cf5c4850ec9 (diff)
downloadportable-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.tpl99
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 @@
1AC_INIT([libressl], [VERSION])
2AC_CANONICAL_TARGET
3AM_INIT_AUTOMAKE([subdir-objects])
4AC_CONFIG_MACRO_DIR([m4])
5
6m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
7
8AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS")
9CFLAGS="$CFLAGS -Wall -std=c99 -g -Wno-pointer-sign"
10
11case $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 *) ;;
30esac
31
32AM_CONDITIONAL(TARGET_DARWIN, test x$TARGET_OS = xdarwin)
33AM_CONDITIONAL(TARGET_LINUX, test x$TARGET_OS = xlinux)
34AM_CONDITIONAL(TARGET_SOLARIS, test x$TARGET_OS = xsolaris)
35
36AC_PROG_CC
37AC_PROG_LIBTOOL
38AC_PROG_CC_STDC
39AM_PROG_CC_C_O
40
41AC_CHECK_FUNC(strlcpy,[AC_SEARCH_LIBS(strlcpy,, [NO_STRLCPY=],
42 [NO_STRLCPY=yes])], [NO_STRLCPY=yes])
43AC_SUBST(NO_STRLCPY)
44AM_CONDITIONAL(NO_STRLCPY, test "x$NO_STRLCPY" = "xyes")
45
46AC_CHECK_FUNC(strlcat,[AC_SEARCH_LIBS(strlcat,, [NO_STRLCAT=],
47 [NO_STRLCAT=yes])], [NO_STRLCAT=yes])
48AC_SUBST(NO_STRLCAT)
49AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes")
50
51AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=],
52 [NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes])
53AC_SUBST(NO_REALLOCARRAY)
54AM_CONDITIONAL(NO_REALLOCARRAY, test "x$NO_REALLOCARRAY" = "xyes")
55
56AC_CHECK_FUNC(timingsafe_bcmp,[AC_SEARCH_LIBS(timingsafe_bcmp,, [NO_TIMINGSAFE_BCMP=],
57 [NO_TIMINGSAFE_BCMP=yes])], [NO_TIMINGSAFE_BCMP=yes])
58AC_SUBST(NO_TIMINGSAFE_BCMP)
59AM_CONDITIONAL(NO_TIMINGSAFE_BCMP, test "x$NO_TIMINGSAFE_BCMP" = "xyes")
60
61AC_CHECK_FUNC(timingsafe_memcmp,[AC_SEARCH_LIBS(timingsafe_memcmp,, [NO_TIMINGSAFE_MEMCMP=],
62 [NO_TIMINGSAFE_MEMCMP=yes])], [NO_TIMINGSAFE_MEMCMP=yes])
63AC_SUBST(NO_TIMINGSAFE_MEMCMP)
64AM_CONDITIONAL(NO_TIMINGSAFE_MEMCMP, test "x$NO_TIMINGSAFE_MEMCMP" = "xyes")
65
66AC_CHECK_FUNC(arc4random_buf,[AC_SEARCH_LIBS(write,, [NO_ARC4RANDOM_BUF=],
67 [NO_ARC4RANDOM_BUF=yes])], [NO_ARC4RANDOM_BUF=yes])
68AC_SUBST(NO_ARC4RANDOM_BUF)
69AM_CONDITIONAL(NO_ARC4RANDOM_BUF, test "x$NO_ARC4RANDOM_BUF" = "xyes")
70
71# overrides for arc4random_buf implementations with known issues
72AM_CONDITIONAL(NO_ARC4RANDOM_BUF,
73 test x$TARGET_OS = xdarwin \
74 -o x$TARGET_OS = xsolaris \
75 -o x$NO_ARC4RANDOM_BUF = xyes)
76
77AC_CHECK_FUNC(getentropy,[AC_SEARCH_LIBS(write,, [NO_GETENTROPY=],
78 [NO_GETENTROPY=yes])], [NO_GETENTROPY=yes])
79AC_SUBST(NO_GETENTROPY)
80AM_CONDITIONAL(NO_GETENTROPY, test "x$NO_GETENTROPY" = "xyes")
81
82AC_CHECK_FUNC(issetugid,[AC_SEARCH_LIBS(write,, [NO_ISSETUGID=],
83 [NO_ISSETUGID=yes])], [NO_ISSETUGID=yes])
84AC_SUBST(NO_ISSETUGID)
85AM_CONDITIONAL(NO_ISSETUGID, test "x$NO_ISSETUGID" = "xyes")
86
87AC_CHECK_FUNC(strtonum,[AC_SEARCH_LIBS(write,, [NO_STRTONUM=],
88 [NO_STRTONUM=yes])], [NO_STRTONUM=yes])
89AC_SUBST(NO_STRTONUM)
90AM_CONDITIONAL(NO_STRTONUM, test "x$NO_STRTONUM" = "xyes")
91
92AC_CHECK_FUNC(getauxval, AC_DEFINE(HAVE_GETAUXVAL))
93
94AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN))
95
96LT_INIT
97
98AC_OUTPUT(Makefile include/Makefile include/openssl/Makefile ssl/Makefile
99 crypto/Makefile tests/Makefile apps/Makefile man/Makefile)