2015-05-01 14:18:12 +02:00
|
|
|
# Copyright (c) 2014-2015 Brent Cook
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
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
|
2015-06-14 05:31:26 +02:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign])
|
2014-07-10 13:07:09 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
# This must be saved before AC_PROG_CC
|
2015-04-19 21:55:25 +02:00
|
|
|
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-05-01 14:18:12 +02:00
|
|
|
CHECK_OS_OPTIONS
|
2015-01-06 03:31:34 +01:00
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
CHECK_C_HARDENING_OPTIONS
|
2015-01-06 03:31:34 +01:00
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
DISABLE_AS_EXECUTABLE_STACK
|
2015-04-15 05:12:52 +02:00
|
|
|
AM_PROG_AS
|
2014-12-22 06:14:02 +01:00
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
DISABLE_COMPILER_WARNINGS
|
2014-10-29 21:44:36 +01:00
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
# Check if the certhash command should be built
|
|
|
|
AC_CHECK_FUNCS([symlink])
|
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
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
# Check if funopen exists
|
|
|
|
AC_CHECK_FUNC([funopen])
|
2014-07-30 13:53:02 +02:00
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
CHECK_LIBC_COMPAT
|
2015-10-07 15:55:05 +02:00
|
|
|
CHECK_SYSCALL_COMPAT
|
|
|
|
CHECK_CRYPTO_COMPAT
|
2015-05-01 14:18:12 +02:00
|
|
|
CHECK_VA_COPY
|
2015-10-01 14:40:26 +02:00
|
|
|
CHECK_B64_NTOP
|
2014-07-30 13:53:02 +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]),
|
2015-07-16 03:00:21 +02:00
|
|
|
OPENSSLDIR="$withval"
|
|
|
|
AC_SUBST(OPENSSLDIR)
|
2014-07-14 15:43:18 +02:00
|
|
|
)
|
2015-07-16 03:00:21 +02:00
|
|
|
AM_CONDITIONAL([OPENSSLDIR_DEFINED], [test x$with_openssldir != x])
|
2014-07-12 12:28:21 +02:00
|
|
|
|
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-05-01 14:18:12 +02:00
|
|
|
# Add CPU-specific alignment flags
|
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"
|
|
|
|
|
2017-07-09 00:46:16 +02:00
|
|
|
AS_CASE([$host_cpu],
|
|
|
|
[*sparc*], [CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"],
|
|
|
|
[*arm*], AS_IF([test "x$BSWAP4" = "xyes"],,
|
|
|
|
CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"),
|
|
|
|
[*amd64*], [host_cpu=x86_64, HOSTARCH=intel],
|
|
|
|
[i?86], [HOSTARCH=intel],
|
|
|
|
[x86_64], [HOSTARCH=intel]
|
|
|
|
)
|
|
|
|
AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"])
|
2015-03-01 23:30:23 +01:00
|
|
|
|
2015-07-17 23:54:23 +02:00
|
|
|
AC_MSG_CHECKING([if .gnu.warning accepts long strings])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|
|
|
extern void SSLv3_method();
|
|
|
|
__asm__(".section .gnu.warning.SSLv3_method; .ascii \"SSLv3_method is insecure\" ; .text");
|
|
|
|
int main() {return 0;}
|
|
|
|
]])], [
|
|
|
|
AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
|
2015-05-01 14:18:12 +02:00
|
|
|
AC_ARG_ENABLE([asm],
|
|
|
|
AS_HELP_STRING([--disable-asm], [Disable assembly]))
|
|
|
|
AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"])
|
|
|
|
|
|
|
|
# Conditionally enable assembly by default
|
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
|
|
|
|
2015-10-18 06:32:21 +02:00
|
|
|
# Check if time_t is sized correctly
|
|
|
|
AC_CHECK_SIZEOF([time_t], [time.h])
|
|
|
|
|
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
|
2017-01-24 13:06:07 +01:00
|
|
|
apps/ocspcheck/Makefile
|
2015-09-12 14:48:06 +02:00
|
|
|
apps/openssl/Makefile
|
|
|
|
apps/nc/Makefile
|
2014-07-12 10:34:08 +02:00
|
|
|
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
|
|
|
|
])
|
|
|
|
|
2015-10-18 06:32:21 +02:00
|
|
|
AM_CONDITIONAL([SMALL_TIME_T], [test "$ac_cv_sizeof_time_t" = "4"])
|
|
|
|
if test "$ac_cv_sizeof_time_t" = "4"; then
|
2017-08-14 19:15:00 +02:00
|
|
|
AC_DEFINE([SMALL_TIME_T])
|
2015-10-18 06:32:21 +02:00
|
|
|
echo " ** Warning, this system is unable to represent times past 2038"
|
|
|
|
echo " ** It will behave incorrectly when handling valid RFC5280 dates"
|
2017-02-15 23:04:04 +01:00
|
|
|
|
|
|
|
if test "$host_os" = "mingw32" ; then
|
|
|
|
echo " **"
|
|
|
|
echo " ** You can solve this by adjusting the build flags in your"
|
|
|
|
echo " ** mingw-w64 toolchain. Refer to README.windows for details."
|
|
|
|
fi
|
2015-10-18 06:32:21 +02:00
|
|
|
fi
|
|
|
|
|
2015-10-18 17:36:31 +02:00
|
|
|
AC_REQUIRE_AUX_FILE([tap-driver.sh])
|
|
|
|
|
2014-07-12 10:34:08 +02:00
|
|
|
AC_OUTPUT
|