2014-08-12 13:20:58 +02:00
|
|
|
+AC_INIT([libressl], m4_esyscmd([tr -d '\n' < 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])])
|
|
|
|
|
|
|
|
AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS")
|
2014-08-16 21:16:01 +02:00
|
|
|
CFLAGS="$CFLAGS -Wall -std=gnu99 -g"
|
2014-07-10 13:07:09 +02:00
|
|
|
|
2014-07-18 04:20:34 +02:00
|
|
|
case $host_os in
|
2014-07-10 13:07:09 +02:00
|
|
|
*darwin*)
|
2014-07-18 04:20:34 +02:00
|
|
|
HOST_OS=darwin;
|
2014-07-10 13:07:09 +02:00
|
|
|
LDFLAGS="$LDFLAGS -Qunused-arguments"
|
|
|
|
;;
|
|
|
|
*linux*)
|
2014-07-18 04:20:34 +02:00
|
|
|
HOST_OS=linux;
|
2014-08-16 15:17:32 +02:00
|
|
|
CFLAGS="$CFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
|
2014-07-10 13:07:09 +02:00
|
|
|
;;
|
|
|
|
*solaris*)
|
2014-07-18 04:20:34 +02:00
|
|
|
HOST_OS=solaris;
|
2014-07-10 13:07:09 +02:00
|
|
|
CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
|
|
|
|
AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
|
|
|
|
;;
|
2014-07-10 23:02:49 +02:00
|
|
|
*openbsd*)
|
|
|
|
AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
|
|
|
|
;;
|
2014-07-18 04:20:34 +02:00
|
|
|
*mingw*)
|
|
|
|
HOST_OS=win32
|
|
|
|
;;
|
2014-07-10 13:07:09 +02:00
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
2014-07-18 04:20:34 +02:00
|
|
|
AM_CONDITIONAL(HOST_DARWIN, test x$HOST_OS = xdarwin)
|
|
|
|
AM_CONDITIONAL(HOST_LINUX, test x$HOST_OS = xlinux)
|
|
|
|
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-07-10 13:07:09 +02:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_CC_STDC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
2014-07-20 21:45:26 +02:00
|
|
|
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-07-28 19:09:38 +02:00
|
|
|
AC_CHECK_FUNC(strlcpy,
|
|
|
|
AM_CONDITIONAL(NO_STRLCPY, false),
|
|
|
|
AC_DEFINE(NO_STRLCPY)
|
|
|
|
AM_CONDITIONAL(NO_STRLCPY, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(strlcat,
|
|
|
|
AM_CONDITIONAL(NO_STRLCAT, false),
|
|
|
|
AC_DEFINE(NO_STRLCAT)
|
|
|
|
AM_CONDITIONAL(NO_STRLCAT, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(strndup,
|
|
|
|
AM_CONDITIONAL(NO_STRNDUP, false),
|
|
|
|
AC_DEFINE(NO_STRNDUP)
|
|
|
|
AM_CONDITIONAL(NO_STRNDUP, true))
|
|
|
|
|
2014-08-03 04:43:56 +02:00
|
|
|
AC_CHECK_FUNC(strnlen,
|
|
|
|
AM_CONDITIONAL(NO_STRNLEN, false),
|
|
|
|
AC_DEFINE(NO_STRNLEN)
|
|
|
|
AM_CONDITIONAL(NO_STRNLEN, true))
|
|
|
|
|
2014-07-29 02:26:15 +02:00
|
|
|
AC_CHECK_FUNC(asprintf,
|
|
|
|
AM_CONDITIONAL(NO_ASPRINTF, false),
|
|
|
|
AC_DEFINE(NO_ASPRINTF)
|
|
|
|
AM_CONDITIONAL(NO_ASPRINTF, true))
|
|
|
|
|
2014-07-28 19:09:38 +02:00
|
|
|
AC_CHECK_FUNC(reallocarray,
|
|
|
|
AM_CONDITIONAL(NO_REALLOCARRAY, false),
|
|
|
|
AC_DEFINE(NO_REALLOCARRAY)
|
|
|
|
AM_CONDITIONAL(NO_REALLOCARRAY, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(timingsafe_bcmp,
|
|
|
|
AM_CONDITIONAL(NO_TIMINGSAFE_BCMP, false),
|
|
|
|
AC_DEFINE(NO_TIMINGSAFE_BCMP)
|
|
|
|
AM_CONDITIONAL(NO_TIMINGSAFE_BCMP, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(timingsafe_memcmp,
|
|
|
|
AM_CONDITIONAL(NO_TIMINGSAFE_MEMCMP, false),
|
|
|
|
AC_DEFINE(NO_TIMINGSAFE_MEMCMP)
|
|
|
|
AM_CONDITIONAL(NO_TIMINGSAFE_MEMCMP, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(arc4random_buf,
|
|
|
|
AM_CONDITIONAL(NO_ARC4RANDOM_BUF, false),
|
|
|
|
AC_DEFINE(NO_ARC4RANDOM_BUF)
|
|
|
|
AM_CONDITIONAL(NO_ARC4RANDOM_BUF, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(getentropy,
|
|
|
|
AM_CONDITIONAL(NO_GETENTROPY, false),
|
|
|
|
AC_DEFINE(NO_GETENTROPY)
|
|
|
|
AM_CONDITIONAL(NO_GETENTROPY, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(issetugid,
|
|
|
|
AM_CONDITIONAL(NO_ISSETUGID, false),
|
|
|
|
AC_DEFINE(NO_ISSETUGID)
|
|
|
|
AM_CONDITIONAL(NO_ISSETUGID, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(strtonum,
|
|
|
|
AM_CONDITIONAL(NO_STRTONUM, false),
|
|
|
|
AC_DEFINE(NO_STRTONUM)
|
|
|
|
AM_CONDITIONAL(NO_STRTONUM, true))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(explicit_bzero,
|
|
|
|
AM_CONDITIONAL(NO_EXPLICIT_BZERO, false),
|
|
|
|
AC_DEFINE(NO_EXPLICIT_BZERO)
|
|
|
|
AM_CONDITIONAL(NO_EXPLICIT_BZERO, true))
|
2014-07-21 14:50:32 +02: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-07-10 13:07:09 +02:00
|
|
|
AC_CHECK_FUNC(getauxval, AC_DEFINE(HAVE_GETAUXVAL))
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN))
|
|
|
|
|
2014-07-12 01:09:49 +02:00
|
|
|
AC_CHECK_HEADER(sys/sysctl.h, AC_DEFINE(HAVE_SYS_SYSCTL_H))
|
|
|
|
|
2014-07-21 14:34:01 +02:00
|
|
|
AC_CHECK_HEADER(err.h, AC_DEFINE(HAVE_ERR_H))
|
|
|
|
|
2014-07-12 12:28:21 +02:00
|
|
|
AC_ARG_WITH([openssldir],
|
|
|
|
AS_HELP_STRING([--with-openssldir], [Set the default openssl directory]),
|
|
|
|
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],
|
|
|
|
AS_HELP_STRING([--with-enginesdir], [Set the default engines directory (use with openssldir)]),
|
|
|
|
AC_DEFINE_UNQUOTED(ENGINESDIR, "$withval")
|
2014-07-14 15:43:18 +02:00
|
|
|
)
|
2014-07-12 12:28:21 +02:00
|
|
|
|
2014-07-10 13:07:09 +02:00
|
|
|
LT_INIT
|
|
|
|
|
2014-07-12 10:34:08 +02:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
include/Makefile
|
|
|
|
include/openssl/Makefile
|
|
|
|
ssl/Makefile
|
|
|
|
crypto/Makefile
|
|
|
|
tests/Makefile
|
|
|
|
apps/Makefile
|
|
|
|
man/Makefile
|
|
|
|
libcrypto.pc
|
|
|
|
libssl.pc
|
|
|
|
openssl.pc
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|