summary refs log tree commit diff
path: root/configure.ac
blob: 3aca617c7f8a2f93719f391a6d7e87a4e0224ef1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# 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.

AC_INIT([libressl], m4_esyscmd([tr -d '\n' < VERSION]))
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]))

AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([subdir-objects foreign])
AC_CONFIG_MACRO_DIR([m4])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# This must be saved before AC_PROG_CC
USER_CFLAGS="$CFLAGS"

AC_PROG_CC([cc gcc])
AC_PROG_CC_STDC
AM_PROG_CC_C_O
LT_INIT([pic-only])

CHECK_OS_OPTIONS

CHECK_C_HARDENING_OPTIONS

DISABLE_AS_EXECUTABLE_STACK
AM_PROG_AS

DISABLE_COMPILER_WARNINGS

# Check if the certhash command should be built
AC_CHECK_FUNCS([symlink])
AM_CONDITIONAL([BUILD_CERTHASH], [test "x$ac_cv_func_symlink" = xyes])

# Check if funopen exists
AC_CHECK_FUNC([funopen])

CHECK_LIBC_COMPAT
CHECK_SYSCALL_COMPAT
CHECK_CRYPTO_COMPAT
CHECK_VA_COPY
CHECK_B64_NTOP

AC_ARG_WITH([openssldir],
	AS_HELP_STRING([--with-openssldir],
		       [Set the default openssl directory]),
	OPENSSLDIR="$withval"
	AC_SUBST(OPENSSLDIR)
)
AM_CONDITIONAL([OPENSSLDIR_DEFINED], [test x$with_openssldir != x])

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])

AC_ARG_ENABLE([tests],
       [AS_HELP_STRING([--disable-tests], [Disable tests @<:@default=enabled@:>@])],
       [
        if ! test "x${enable_tests}" = "xyes"; then
		enable_tests="no"
	fi],
       [enable_tests="yes"])
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = xyes])

AS_CASE([$host_cpu],
	[*arm*], [host_cpu=arm],
	[*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"])

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\n\t.ascii \"SSLv3_method is insecure\"\n\t.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)
])

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
AM_CONDITIONAL([HOST_ASM_ELF_ARM],
    [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "arm" -a "x$enable_asm" != "xno"])
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"])
AM_CONDITIONAL([HOST_ASM_MASM_X86_64],
    [test "x$HOST_ABI" = "xmasm" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
AM_CONDITIONAL([HOST_ASM_MINGW64_X86_64],
    [test "x$HOST_ABI" = "xmingw64" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])

# Check if time_t is sized correctly
AC_CHECK_SIZEOF([time_t], [time.h])

AC_CONFIG_FILES([
	Makefile
	include/Makefile
	include/openssl/Makefile
	crypto/Makefile
	ssl/Makefile
	tls/Makefile
	tests/Makefile
	apps/Makefile
	apps/ocspcheck/Makefile
	apps/openssl/Makefile
	apps/nc/Makefile
	man/Makefile
	libcrypto.pc
	libssl.pc
	libtls.pc
	openssl.pc
])

AM_CONDITIONAL([SMALL_TIME_T], [test "$ac_cv_sizeof_time_t" = "4"])
if test "$ac_cv_sizeof_time_t" = "4"; then
    AC_DEFINE([SMALL_TIME_T])
    echo " ** Warning, this system is unable to represent times past 2038"
    echo " ** It will behave incorrectly when handling valid RFC5280 dates"

    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
fi

AC_REQUIRE_AUX_FILE([tap-driver.sh])

AC_OUTPUT
38:35 +0200'>2015-08-13ui-tree: use "sane" isgraph()John Keeping Git's git-compat-util.h defines a "sane ctype" that does not use locale information and works with signed chars, but it does not include isgraph() so we have included ctype.h ourselves. However, this means we have to include a system header before git-compat-util.h which may lead to the system defining some macros (e.g. _FILE_OFFSET_BITS on Solaris) before git-compat-util.h redefines them with a different value. We cannot include ctype.h after git-compat-util.h because we have defined many of its functions as macros which causes a stream of compilation errors. Defining our own "sane" isgraph() using Git's sane isprint() and isspace() avoids all of these problems. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13cgit.h: move stdbool.h from ui-shared.hJohn Keeping Follow the Git policy of including system headers in only one place. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13cache.c: fix header orderJohn Keeping git-compat-util.h may define values that affect how system headers are interpreted, so move sys/sendfile.h after cgit.h (which includes git-compat-util.h). Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13configfile.c: don't include system headers directlyJohn Keeping git-compat-util.h may define various values that affect the interpretation of system headers. In most places we include cgit.h first, which pulls in git-compat-util.h, but this file does not depend on anything else in CGit, so use git-compat-util.h directly. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13Remove redundant includesJohn Keeping These are all included in git-compat-util.h (when necessary), which we include in cgit.h. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13Makefile: include Git's config.mak.unameJohn Keeping This pulls in the correct value of $(INSTALL) on a wide variety of systems. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13tests: allow shell to be overriddenJohn Keeping On some systems (e.g. Solaris), /bin/sh is not a POSIX shell. Git already provides suitable overrides in its config.mak.uname file and we provide cgit.conf to allow the user to further change this. The code for this is taken from Git's t/Makefile, meaning that we now invoke the tests in the same way that Git does. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-13redirect: cleanlinessJason A. Donenfeld 2015-08-13redirect: be more careful for different cgi setupsJason A. Donenfeld 2015-08-12ui-log: fix double countingJohn Keeping This crept in while rebasing the previous commit onto an updated upstream. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-12log: allow users to follow a fileJohn Keeping Teach the "log" UI to behave in the same way as "git log --follow", when given a suitable instruction by the user. The default behaviour remains to show the log without following renames, but the follow behaviour can be activated by following a link in the page header. Follow is not the default because outputting merges in follow mode is tricky ("git log --follow" will not show merges). We also disable the graph in follow mode because the commit graph is not simplified so we end up with frequent gaps in the graph and many lines that do not connect with any commits we're actually showing. We also teach the "diff" and "commit" UIs to respect the follow flag on URLs, causing the single-file version of these UIs to detect renames. This feature is needed only for commits that rename the path we're interested in. For commits before the file has been renamed (i.e. that appear later in the log list) we change the file path in the links from the log to point to the old name; this means that links to commits always limit by the path known to that commit. If we didn't do this we would need to walk down the log diff'ing every commit whenever we want to show a commit. The drawback is that the "Log" link in the top bar of such a page links to the log limited by the old name, so it will only show pre-rename commits. I consider this a reasonable trade-off since the "Back" button still works and the log matches the path displayed in the top bar. Since following renames requires running diff on every commit we consider, I've added a knob to the configuration file to globally enable/disable this feature. Note that we may consider a large number of commits the revision walking machinery no longer performs any path limitation so we have to examine every commit until we find a page full of commits that affect the target path or something related to it. Suggested-by: René Neumann <necoro@necoro.eu> Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-12shared: make cgit_diff_tree_cb publicJohn Keeping This will allow us to use this nice wrapper function elsewhere, avoiding dealing with the diff queue when we only need to inspect a filepair. Signed-off-by: John Keeping <john@keeping.me.uk> 2015-08-12t0110: Chain together using &&Jason A. Donenfeld 2015-08-12about: always ensure page has a trailing slashJason A. Donenfeld Otherwise we can't easily embed links to other /about/ pages. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2015-08-12filters: apply HTML escapingLazaros Koromilas http://www.w3.org/International/questions/qa-escapes#use 2015-08-12git: update to v2.5.0Christian Hesse Update to git version v2.5.0. * Upstream commit 5455ee0573a22bb793a7083d593ae1ace909cd4c (Merge branch 'bc/object-id') changed API: for_each_ref() callback functions were taught to name the objects not with "unsigned char sha1[20]" but with "struct object_id". * Upstream commit dcf692625ac569fefbe52269061230f4fde10e47 (path.c: make get_pathname() call sites return const char *) Signed-off-by: Christian Hesse <mail@eworm.de> 2015-08-12Fix processing of repo.hide and repo.ignoreDaniel Reichelt