2014-11-04 04:05:47 +01:00
|
|
|
AC_INIT([libressl], m4_esyscmd([tr -d '\n' < VERSION]))
|
2014-12-07 01:59:25 +01:00
|
|
|
AC_SUBST([LIBCRYPTO_VERSION], m4_esyscmd([tr -d '\n' < crypto/VERSION]))
|
|
|
|
AC_SUBST([LIBSSL_VERSION], m4_esyscmd([tr -d '\n' < ssl/VERSION]))
|
|
|
|
AC_SUBST([LIBTLS_VERSION], m4_esyscmd([tr -d '\n' < tls/VERSION]))
|
|
|
|
|
2014-07-18 04:20:34 +02:00
|
|
|
AC_CANONICAL_HOST
|
2014-07-10 13:07:09 +02:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2015-04-19 21:55:25 +02:00
|
|
|
# This must be called before AC_PROG_CC
|
|
|
|
USER_CFLAGS="$CFLAGS"
|
|
|
|
|
2015-03-22 12:03:43 +01:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CC_STDC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
LT_INIT
|
|
|
|
|
2015-04-15 05:12:52 +02:00
|
|
|
CFLAGS="$CFLAGS -Wall -std=gnu99"
|
|
|
|
|
2014-07-18 04:20:34 +02:00
|
|
|
case $host_os in
|
2015-02-11 06:49:31 +01:00
|
|
|
*aix*)
|
|
|
|
HOST_OS=aix
|
2015-04-19 21:55:25 +02:00
|
|
|
if [ $CC != "gcc" ]; then
|
|
|
|
CFLAGS="$USER_CFLAGS"
|
|
|
|
fi
|
2015-02-11 06:49:31 +01:00
|
|
|
AC_SUBST([PLATFORM_LDADD], ['-lperfstat -lpthread'])
|
|
|
|
;;
|
2015-03-03 16:37:23 +01:00
|
|
|
*cygwin*)
|
|
|
|
HOST_OS=cygwin
|
|
|
|
;;
|
2014-07-10 13:07:09 +02:00
|
|
|
*darwin*)
|
2014-12-07 01:43:58 +01:00
|
|
|
HOST_OS=darwin
|
|
|
|
HOST_ABI=macosx
|
2014-07-10 13:07:09 +02:00
|
|
|
;;
|
2014-10-28 01:22:03 +01:00
|
|
|
*freebsd*)
|
2014-12-07 01:43:58 +01:00
|
|
|
HOST_OS=freebsd
|
|
|
|
HOST_ABI=elf
|
2014-10-28 01:22:03 +01:00
|
|
|
AC_SUBST([PROG_LDADD], ['-lthr'])
|
|
|
|
;;
|
2014-12-08 03:08:45 +01:00
|
|
|
*hpux*)
|
|
|
|
HOST_OS=hpux;
|
2015-04-19 21:55:25 +02:00
|
|
|
if [ $CC = "gcc" ]; then
|
|
|
|
CFLAGS="$CFLAGS -mlp64"
|
|
|
|
else
|
|
|
|
CFLAGS="-g -O2 +DD64 $USER_CFLAGS"
|
|
|
|
fi
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT"
|
2014-12-08 03:08:45 +01:00
|
|
|
AC_SUBST([PLATFORM_LDADD], ['-lpthread'])
|
|
|
|
;;
|
2014-07-10 13:07:09 +02:00
|
|
|
*linux*)
|
2014-12-07 01:43:58 +01:00
|
|
|
HOST_OS=linux
|
|
|
|
HOST_ABI=elf
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
|
2014-07-10 13:07:09 +02:00
|
|
|
;;
|
2015-01-21 13:14:24 +01:00
|
|
|
*netbsd*)
|
|
|
|
HOST_OS=netbsd
|
2015-03-22 14:14:27 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE"
|
2015-01-21 13:14:24 +01:00
|
|
|
;;
|
2014-07-10 23:02:49 +02:00
|
|
|
*openbsd*)
|
2014-12-07 01:43:58 +01:00
|
|
|
HOST_ABI=elf
|
2014-07-10 23:02:49 +02:00
|
|
|
AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
|
|
|
|
;;
|
2014-07-18 04:20:34 +02:00
|
|
|
*mingw*)
|
2014-10-29 21:59:35 +01:00
|
|
|
HOST_OS=win
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_POSIX -D_POSIX_SOURCE -D__USE_MINGW_ANSI_STDIO"
|
|
|
|
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
|
|
|
|
CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SPEED -DNO_SYSLOG"
|
|
|
|
CFLAGS="$CFLAGS -static-libgcc"
|
2015-03-07 19:04:29 +01:00
|
|
|
LDFLAGS="$LDFLAGS -static-libgcc"
|
2014-11-19 13:26:38 +01:00
|
|
|
AC_SUBST([PLATFORM_LDADD], ['-lws2_32'])
|
2014-07-18 04:20:34 +02:00
|
|
|
;;
|
2014-12-07 01:43:58 +01:00
|
|
|
*solaris*)
|
|
|
|
HOST_OS=solaris
|
|
|
|
HOST_ABI=elf
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
|
2014-12-07 01:43:58 +01:00
|
|
|
AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
|
|
|
|
;;
|
2014-07-10 13:07:09 +02:00
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
2015-02-11 06:49:31 +01:00
|
|
|
AM_CONDITIONAL([HOST_AIX], [test x$HOST_OS = xaix])
|
2015-03-03 16:37:23 +01:00
|
|
|
AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin])
|
2014-12-07 01:43:58 +01:00
|
|
|
AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
|
|
|
|
AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
|
2014-12-08 03:08:45 +01:00
|
|
|
AM_CONDITIONAL([HOST_HPUX], [test x$HOST_OS = xhpux])
|
2014-12-07 01:43:58 +01:00
|
|
|
AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
|
2015-01-21 13:14:24 +01:00
|
|
|
AM_CONDITIONAL([HOST_NETBSD], [test x$HOST_OS = xnetbsd])
|
2014-12-07 01:43:58 +01:00
|
|
|
AM_CONDITIONAL([HOST_SOLARIS], [test x$HOST_OS = xsolaris])
|
|
|
|
AM_CONDITIONAL([HOST_WIN], [test x$HOST_OS = xwin])
|
2014-07-10 13:07:09 +02:00
|
|
|
|
2014-07-12 17:08:39 +02:00
|
|
|
AC_CHECK_FUNC([clock_gettime],,
|
|
|
|
[AC_SEARCH_LIBS([clock_gettime],[rt posix4])])
|
|
|
|
|
2014-07-27 13:15:26 +02:00
|
|
|
AC_CHECK_FUNC([dl_iterate_phdr],,
|
|
|
|
[AC_SEARCH_LIBS([dl_iterate_phdr],[dl])])
|
|
|
|
|
2014-12-23 13:38:43 +01:00
|
|
|
AC_MSG_CHECKING([if compiling with clang])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
|
|
|
|
#ifndef __clang__
|
|
|
|
not clang
|
|
|
|
#endif
|
|
|
|
]])],
|
|
|
|
[CLANG=yes],
|
|
|
|
[CLANG=no]
|
|
|
|
)
|
2014-12-31 16:06:49 +01:00
|
|
|
AC_MSG_RESULT([$CLANG])
|
2015-01-06 21:16:51 +01:00
|
|
|
AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
|
2014-12-23 13:38:43 +01:00
|
|
|
|
2015-03-22 12:05:49 +01:00
|
|
|
CFLAGS="$CFLAGS $CLANG_FLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $CLANG_FLAGS"
|
|
|
|
|
2015-01-06 03:14:54 +01:00
|
|
|
# We want to check for compiler flag support. Prior to clang v5.1, there was no
|
|
|
|
# way to make clang's "argument unused" warning fatal. So we invoke the
|
|
|
|
# compiler through a wrapper script that greps for this message.
|
2014-12-23 14:24:24 +01:00
|
|
|
saved_CC="$CC"
|
|
|
|
saved_LD="$LD"
|
|
|
|
flag_wrap="$srcdir/scripts/wrap-compiler-for-flag-check"
|
|
|
|
CC="$flag_wrap $CC"
|
|
|
|
LD="$flag_wrap $LD"
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([hardening],
|
2015-01-06 03:14:54 +01:00
|
|
|
[AS_HELP_STRING([--disable-hardening],
|
|
|
|
[Disable options to frustrate memory corruption exploits])],
|
|
|
|
[], [enable_hardening=yes])
|
|
|
|
|
2015-02-25 02:39:16 +01:00
|
|
|
AC_ARG_ENABLE([windows-ssp],
|
|
|
|
[AS_HELP_STRING([--enable-windows-ssp],
|
|
|
|
[Enable building the stack smashing protection on
|
|
|
|
Windows. This currently distributing libssp-0.dll.])])
|
|
|
|
|
2015-01-06 04:21:23 +01:00
|
|
|
AC_DEFUN([CHECK_CFLAG], [
|
2015-01-06 03:31:34 +01:00
|
|
|
AC_LANG_ASSERT(C)
|
|
|
|
AC_MSG_CHECKING([if $saved_CC supports "$1"])
|
|
|
|
old_cflags="$CFLAGS"
|
2015-01-07 00:45:14 +01:00
|
|
|
CFLAGS="$1 -Wall -Werror"
|
2015-01-06 03:31:34 +01:00
|
|
|
AC_TRY_LINK([
|
|
|
|
#include <stdio.h>
|
|
|
|
],
|
|
|
|
[printf("Hello")],
|
|
|
|
AC_MSG_RESULT([yes])
|
2015-01-06 04:21:23 +01:00
|
|
|
CFLAGS=$old_cflags
|
2015-01-06 03:31:34 +01:00
|
|
|
HARDEN_CFLAGS="$HARDEN_CFLAGS $1",
|
|
|
|
AC_MSG_RESULT([no])
|
2015-01-06 04:21:23 +01:00
|
|
|
CFLAGS=$old_cflags
|
|
|
|
[$2])
|
|
|
|
])
|
2015-01-06 03:14:54 +01:00
|
|
|
|
2015-01-06 04:21:23 +01:00
|
|
|
AC_DEFUN([CHECK_LDFLAG], [
|
2015-01-06 03:31:34 +01:00
|
|
|
AC_LANG_ASSERT(C)
|
|
|
|
AC_MSG_CHECKING([if $saved_LD supports "$1"])
|
|
|
|
old_ldflags="$LDFLAGS"
|
2015-01-07 00:45:14 +01:00
|
|
|
LDFLAGS="$1 -Wall -Werror"
|
2015-01-06 03:31:34 +01:00
|
|
|
AC_TRY_LINK([
|
|
|
|
#include <stdio.h>
|
|
|
|
],
|
|
|
|
[printf("Hello")],
|
|
|
|
AC_MSG_RESULT([yes])
|
2015-01-06 04:21:23 +01:00
|
|
|
LDFLAGS=$old_ldflags
|
2015-01-06 03:31:34 +01:00
|
|
|
HARDEN_LDFLAGS="$HARDEN_LDFLAGS $1",
|
|
|
|
AC_MSG_RESULT([no])
|
2015-01-06 04:21:23 +01:00
|
|
|
LDFLAGS=$old_ldflags
|
|
|
|
[$2])
|
|
|
|
])
|
2015-01-06 03:31:34 +01:00
|
|
|
|
2015-01-06 21:16:51 +01:00
|
|
|
AS_IF([test "x$enable_hardening" = "xyes"], [
|
2014-12-23 14:24:24 +01:00
|
|
|
# Tell GCC to NOT optimize based on signed arithmetic overflow
|
2015-01-06 03:31:34 +01:00
|
|
|
CHECK_CFLAG([[-fno-strict-overflow]])
|
2014-12-23 14:24:24 +01:00
|
|
|
|
|
|
|
# _FORTIFY_SOURCE replaces builtin functions with safer versions.
|
2015-01-06 03:31:34 +01:00
|
|
|
CHECK_CFLAG([[-D_FORTIFY_SOURCE=2]])
|
2014-12-23 14:24:24 +01:00
|
|
|
|
|
|
|
# Enable read only relocations
|
2015-01-06 03:31:34 +01:00
|
|
|
CHECK_LDFLAG([[-Wl,-z,relro]])
|
|
|
|
CHECK_LDFLAG([[-Wl,-z,now]])
|
2014-12-23 14:24:24 +01:00
|
|
|
|
2015-02-25 02:39:16 +01:00
|
|
|
# Windows security flags
|
|
|
|
AS_IF([test "x$HOST_OS" = "xwin"], [
|
|
|
|
CHECK_LDFLAG([[-Wl,--nxcompat]])
|
|
|
|
CHECK_LDFLAG([[-Wl,--dynamicbase]])
|
|
|
|
CHECK_LDFLAG([[-Wl,--high-entropy-va]])
|
|
|
|
])
|
|
|
|
|
|
|
|
# Use stack-protector-strong if available; if not, fallback to
|
|
|
|
# stack-protector-all which is considered to be overkill
|
|
|
|
AS_IF([test "x$enable_windows_ssp" = "xyes" -o "x$HOST_OS" != "xwin"], [
|
|
|
|
CHECK_CFLAG([[-fstack-protector-strong]],
|
|
|
|
CHECK_CFLAG([[-fstack-protector-all]],
|
|
|
|
AC_MSG_WARN([compiler does not appear to support stack protection])
|
|
|
|
)
|
2015-01-06 03:31:34 +01:00
|
|
|
)
|
2015-02-25 02:39:16 +01:00
|
|
|
AS_IF([test "x$HOST_OS" = "xwin"], [
|
|
|
|
AC_SEARCH_LIBS([__stack_chk_guard],[ssp])
|
|
|
|
])
|
|
|
|
])
|
2015-01-06 03:31:34 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-12-23 14:24:24 +01:00
|
|
|
# Restore CC, LD
|
|
|
|
CC="$saved_CC"
|
|
|
|
LD="$saved_LD"
|
|
|
|
|
|
|
|
CFLAGS="$CFLAGS $HARDEN_CFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS"
|
|
|
|
|
2015-04-15 05:12:52 +02:00
|
|
|
# Removing the dependency on -Wno-pointer-sign should be a goal
|
|
|
|
save_cflags="$CFLAGS"
|
|
|
|
CFLAGS=-Wno-pointer-sign
|
|
|
|
AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
|
|
|
[AC_MSG_RESULT([yes])]
|
|
|
|
[AM_CFLAGS=-Wno-pointer-sign],
|
|
|
|
[AC_MSG_RESULT([no])]
|
|
|
|
)
|
|
|
|
CFLAGS="$save_cflags $AM_CFLAGS"
|
|
|
|
|
2014-12-22 06:14:02 +01:00
|
|
|
save_cflags="$CFLAGS"
|
|
|
|
CFLAGS=
|
|
|
|
AC_MSG_CHECKING([whether AS supports .note.GNU-stack])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
__asm__(".section .note.GNU-stack,\"\",@progbits");]])],
|
|
|
|
[AC_MSG_RESULT([yes])]
|
|
|
|
[AM_CFLAGS=-DHAVE_GNU_STACK],
|
|
|
|
[AC_MSG_RESULT([no])]
|
|
|
|
)
|
|
|
|
CFLAGS="$save_cflags $AM_CFLAGS"
|
2015-04-15 05:12:52 +02:00
|
|
|
AM_PROG_AS
|
2014-12-22 06:14:02 +01:00
|
|
|
|
2014-10-29 21:44:36 +01:00
|
|
|
AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval])
|
2015-04-14 14:55:23 +02:00
|
|
|
AC_CHECK_FUNCS([getentropy memmem poll reallocarray])
|
2015-02-15 03:03:39 +01:00
|
|
|
AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum])
|
2015-02-23 16:48:04 +01:00
|
|
|
AC_CHECK_FUNCS([symlink])
|
2014-10-29 21:44:36 +01:00
|
|
|
AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp])
|
|
|
|
|
|
|
|
# Share test results with automake
|
|
|
|
AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], [test "x$ac_cv_func_arc4random_buf" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_EXPLICIT_BZERO], [test "x$ac_cv_func_explicit_bzero" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes])
|
add minimal poll(2) implementation for Windows
This provides sufficient functionality to run openssl(1) from a Windows
console. This is based on the original select-based version from from
songdongsheng@live.cn. Changes:
* use nfds_t directly for iterating the fds.
* add WSAGetLastError -> errno mappings
* handle POLLHUP and the OOB data cases for revents
* handle sparse arrays of fds correctly
* KNF style updates
* teach poll how to handle file handles as well as sockets
This handles the socket/non-socket issue by alternating a loop between
WaitForMultipleObjects for non-sockets and and select for sockets. One
would think this would be terrible for performance, but as of this
writing, poll consumes about 6% of the time doing a bulk transfer
between a Linux box and 'openssl.exe s_server'.
I tried to implement this all in terms of WaitForMultipleObjects with a
select 'poll' at the end to get extra specific socket status. However,
the cost of setting up an event handle for each socket, setting the
WSAEventSelect attributes, and cleaning them up reliably was pretty
high. Since the event handle associated with a socket is also global,
creating a new one cancels the previous one or can be disabled
externally.
In addition, the 'FD_WRITE' status of a socket event handle does not
behave in an expected fashion, being triggered by an edge on a write
event rather than being level triggered.
Another fun horror story is how stdin in windows might be a console, it
might be a pipe, it might be something else. If these all worked in the
same way, it would be great. But, since a console-stdin can also signal
on a mouse or window event, it means we can easily get stuck in a
blocking read (you can't make stdin non-blocking) if the non-character
events are not filtered out. So, poll does that too.
See here for various additional horror stories:
http://www.postgresql.org/message-id/4351.1336927207@sss.pgh.pa.us
2014-11-20 07:24:20 +01:00
|
|
|
AM_CONDITIONAL([HAVE_POLL], [test "x$ac_cv_func_poll" = xyes])
|
2014-10-29 21:44:36 +01:00
|
|
|
AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_STRNDUP], [test "x$ac_cv_func_strndup" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes])
|
2015-02-15 03:03:39 +01:00
|
|
|
AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes])
|
2014-10-29 21:44:36 +01:00
|
|
|
AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes])
|
|
|
|
AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes])
|
2015-02-23 16:48:04 +01:00
|
|
|
AM_CONDITIONAL([BUILD_CERTHASH], [test "x$ac_cv_func_symlink" = xyes])
|
2014-07-21 14:50:32 +02:00
|
|
|
|
2014-10-28 02:01:21 +01:00
|
|
|
# overrides for arc4random_buf implementations with known issues
|
|
|
|
AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF],
|
2015-01-21 13:14:24 +01:00
|
|
|
[test "x$HOST_OS" != xdarwin \
|
|
|
|
-a "x$HOST_OS" != xfreebsd \
|
|
|
|
-a "x$HOST_OS" != xnetbsd \
|
|
|
|
-a "x$ac_cv_func_arc4random_buf" = xyes])
|
2014-10-28 02:01:21 +01:00
|
|
|
|
2014-07-30 13:53:02 +02:00
|
|
|
AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <stdarg.h>
|
|
|
|
va_list x,y;
|
|
|
|
]], [[ va_copy(x,y); ]])],
|
|
|
|
[ ac_cv_have_va_copy="yes" ],
|
|
|
|
[ ac_cv_have_va_copy="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
if test "x$ac_cv_have_va_copy" = "xyes" ; then
|
|
|
|
AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <stdarg.h>
|
|
|
|
va_list x,y;
|
|
|
|
]], [[ __va_copy(x,y); ]])],
|
|
|
|
[ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
if test "x$ac_cv_have___va_copy" = "xyes" ; then
|
|
|
|
AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists])
|
|
|
|
fi
|
|
|
|
|
2014-10-29 21:44:36 +01:00
|
|
|
AC_CHECK_HEADERS([sys/sysctl.h err.h])
|
2014-07-21 14:34:01 +02:00
|
|
|
|
2014-07-12 12:28:21 +02:00
|
|
|
AC_ARG_WITH([openssldir],
|
2014-12-07 01:43:58 +01:00
|
|
|
AS_HELP_STRING([--with-openssldir],
|
|
|
|
[Set the default openssl directory]),
|
2014-07-12 12:28:21 +02:00
|
|
|
AC_DEFINE_UNQUOTED(OPENSSLDIR, "$withval")
|
2014-07-14 15:43:18 +02:00
|
|
|
)
|
2014-07-12 12:28:21 +02:00
|
|
|
|
|
|
|
AC_ARG_WITH([enginesdir],
|
2014-12-07 01:43:58 +01:00
|
|
|
AS_HELP_STRING([--with-enginesdir],
|
|
|
|
[Set the default engines directory (use with openssldir)]),
|
2014-07-12 12:28:21 +02:00
|
|
|
AC_DEFINE_UNQUOTED(ENGINESDIR, "$withval")
|
2014-07-14 15:43:18 +02:00
|
|
|
)
|
2014-07-12 12:28:21 +02:00
|
|
|
|
2014-08-17 14:58:32 +02:00
|
|
|
AC_ARG_ENABLE([asm],
|
|
|
|
AS_HELP_STRING([--disable-asm], [Disable assembly]))
|
2014-12-07 01:43:58 +01:00
|
|
|
AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"])
|
|
|
|
|
2015-03-22 01:04:54 +01:00
|
|
|
AC_ARG_ENABLE([extratests],
|
|
|
|
AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms]))
|
|
|
|
AM_CONDITIONAL([ENABLE_EXTRATESTS], [test "x$enable_extratests" = xyes])
|
|
|
|
|
2015-03-01 23:30:23 +01:00
|
|
|
old_cflags=$CFLAGS
|
2015-03-22 12:18:18 +01:00
|
|
|
CFLAGS="$CFLAGS -I$srcdir/include"
|
2015-03-09 01:56:03 +01:00
|
|
|
AC_MSG_CHECKING([if BSWAP4 builds without __STRICT_ALIGNMENT])
|
2015-03-01 23:30:23 +01:00
|
|
|
AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"],
|
|
|
|
[int a = 0; BSWAP4(a);],
|
2015-03-09 01:56:03 +01:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
BSWAP4=yes,
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
BSWAP4=no)
|
2015-03-01 23:30:23 +01:00
|
|
|
CFLAGS="$old_cflags"
|
|
|
|
|
|
|
|
case $host_cpu in
|
|
|
|
*sparc*)
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"
|
2015-03-01 23:30:23 +01:00
|
|
|
;;
|
|
|
|
*arm*)
|
|
|
|
AS_IF([test "x$BSWAP4" = "xyes"],,
|
2015-03-22 12:18:18 +01:00
|
|
|
CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT")
|
2015-03-01 23:30:23 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-12-07 01:43:58 +01:00
|
|
|
AM_CONDITIONAL([HOST_ASM_ELF_X86_64],
|
|
|
|
[test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
|
|
|
|
AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64],
|
|
|
|
[test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
|
2014-08-17 14:58:32 +02:00
|
|
|
|
2014-07-12 10:34:08 +02:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
include/Makefile
|
|
|
|
include/openssl/Makefile
|
|
|
|
crypto/Makefile
|
2014-12-05 05:37:22 +01:00
|
|
|
ssl/Makefile
|
|
|
|
tls/Makefile
|
2014-07-12 10:34:08 +02:00
|
|
|
tests/Makefile
|
|
|
|
apps/Makefile
|
|
|
|
man/Makefile
|
|
|
|
libcrypto.pc
|
|
|
|
libssl.pc
|
2015-03-19 01:12:42 +01:00
|
|
|
libtls.pc
|
2014-07-12 10:34:08 +02:00
|
|
|
openssl.pc
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|