-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
84 lines (61 loc) · 2.21 KB
/
configure.ac
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
dnl -- Process this file with autoconf to generate a `configure' script. --
AC_PREREQ([2.69])
AC_INIT([rudgiosync], [1.0.0-dev], [[email protected]])
AC_CONFIG_SRCDIR([src/descriptions.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
AM_INIT_AUTOMAKE([1.11.6 -Wall -Werror])
# Options for enabling/disabling optional features.
AC_ARG_ENABLE([checksum],
[AS_HELP_STRING([--enable-checksum],
[enable support for checksum-based file comparison, requires nettle [default=auto]])],
[enable_checksum=$enableval], [enable_checksum=auto])
# Minimal versions of glib.
MIN_GLIB_VER=2.32.4
# Check for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AR
# Check for glib and friends.
PKG_CHECK_MODULES([glib], [
glib-2.0 >= $MIN_GLIB_VER,
gobject-2.0 >= $MIN_GLIB_VER,
gio-2.0 >= $MIN_GLIB_VER
], [], [
AC_MSG_ERROR([Unable to find glib >= $MIN_GLIB_VER. Please ensure that both the runtime libraries and development files of glib are installed and of the correct version.])])
AC_SUBST(glib_CFLAGS)
AC_SUBST(glib_LIBS)
# Check for system headers.
AC_CHECK_HEADERS([errno.h])
# Check for checksum support.
have_checksum=no
if test x"$enable_checksum" != x"no"; then
have_nettle_sha2=no
AC_CHECK_HEADER([nettle/sha2.h], [have_nettle_sha2=yes])
if test x"$enable_checksum" = x"yes"; then
if test x"$have_nettle_sha2" != x"yes"; then
AC_MSG_ERROR([Could not find the nettle/sha2.h header file, which is required for checksum support.])
fi
fi
if test x"$have_nettle_sha2" = x"yes"; then
have_nettle_lib=no
AC_CHECK_LIB([nettle], [nettle_sha256_init], [have_nettle_lib=yes])
if test x"$enable_checksum" = x"yes"; then
if test x"$have_nettle_lib" != x"yes"; then
AC_MSG_ERROR([Could not find the nettle library file, which is required for checksum support.])
fi
fi
if test x"$have_nettle_lib" = x"yes"; then
have_checksum=yes
fi
fi
fi
AM_CONDITIONAL([RUDGIOSYNC_CHECKSUM_ENABLED], [test x"$have_checksum" = x"yes"])
AC_OUTPUT
echo ""
echo ""
echo "Configuration summary for rudgiosync:"
echo ""
echo "Checksum support: $have_checksum"