File: configure.ac

package info (click to toggle)
osslsigncode 2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 656 kB
  • sloc: ansic: 5,953; sh: 2,362; python: 121; makefile: 25
file content (126 lines) | stat: -rw-r--r-- 2,483 bytes parent folder | download
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
AC_PREREQ(2.60)

AC_INIT([osslsigncode], [2.2.0], [Michal.Trojnara@stunnel.org])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE

AC_CONFIG_SRCDIR([osslsigncode.c])

dnl Checks for programs.
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS

AC_ARG_ENABLE(
	[strict],
	[AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@disabled@:>@])],
	,
	[enable_strict="no"]
)

AC_ARG_ENABLE(
	[pedantic],
	[AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@disabled@:>@])],
	,
	[enable_pedantic="no"]
)

AC_ARG_WITH(
	[curl],
	[AS_HELP_STRING([--with-curl],[enable curl @<:@enabled@:>@])],
	,
	[with_curl="yes"]
)

if test "${enable_pedantic}" = "yes"; then
	enable_strict="yes";
	CFLAGS="${CFLAGS} -pedantic"
fi
if test "${enable_strict}" = "yes"; then
	CFLAGS="${CFLAGS} -Wall -Wextra"
fi

PKG_PROG_PKG_CONFIG
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_SED
AC_PROG_MAKE_SET

AC_C_CONST
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(
	[sys/mman.h],
	[AC_CHECK_FUNC(
		[mmap],
		[AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])],
		[AC_MSG_ERROR([Need mmap to build.])]
	)],
	[have_mmap=no]
)
AC_CHECK_HEADERS(
	[windows.h],
	[],
	[have_MapViewOfFile=no]
)
AS_IF([test "x$have_mmap$have_MapViewOfFile" = "xnono"],
	[AC_MSG_ERROR([Need file mapping function to buid.])])

AC_CHECK_LIB(
	[dl],
	[dlopen],
	[DL_LIBS="-ldl"]
)

AC_CHECK_HEADERS([termios.h])
AC_CHECK_FUNCS(getpass)

PKG_CHECK_MODULES(
	[OPENSSL],
	[libcrypto >= 1.1.1],
	,
	[PKG_CHECK_MODULES(
		[OPENSSL],
		[openssl >= 1.1.1],
		,
		[AC_CHECK_LIB(
			[crypto],
			[EVP_MD_CTX_new],
			[OPENSSL_LIBS="-lcrypto ${SOCKETS_LIBS} ${DL_LIBS}"],
			[AC_MSG_ERROR([OpenSSL 1.1.1 or later is required. https://www.openssl.org/])],
			[${DL_LIBS}]
		)]
	)]
)

PKG_CHECK_MODULES(
	[LIBCURL],
	[libcurl >= 7.12.0],
	,
	[AC_CHECK_LIB(
		[curl],
		[curl_easy_strerror],
		[LIBCURL_LIBS="-lcurl"],
		,
		[${DL_LIBS}]
	)]
)

if test "${with_curl}" = "yes"; then
	test -z "${LIBCURL_LIBS}" && AC_MSG_ERROR([Curl 7.12.0 or later is required for timestamping support. http://curl.haxx.se/])
	OPTIONAL_LIBCURL_CFLAGS="${LIBCURL_CFLAGS}"
	OPTIONAL_LIBCURL_LIBS="${LIBCURL_LIBS}"
	AC_DEFINE([ENABLE_CURL], [1], [libcurl is enabled])
fi

AC_SUBST([OPTIONAL_LIBCURL_CFLAGS])
AC_SUBST([OPTIONAL_LIBCURL_LIBS])

AC_DEFINE_UNQUOTED([CA_BUNDLE_PATH], ["$(curl-config --ca 2>/dev/null)"], [CA bundle install path])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

# vim: set ts=4 noexpandtab: