-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
89 lines (79 loc) · 2.68 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
85
86
87
88
89
# autoconf template for the configure script
AC_INIT
AC_CONFIG_MACRO_DIR([m4])
#AC_CANONICAL_SYSTEM
if test -z "$GNUSTEP_MAKEFILES"; then
GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null`
fi
if test -z "$GNUSTEP_MAKEFILES"; then
AC_MSG_ERROR([You must run the GNUstep initialization script first!])
fi
#--------------------------------------------------------------------
# Find the compiler
#--------------------------------------------------------------------
if test "$CC" = ""; then
CC=`gnustep-config --variable=CC`
fi
if test "$CPP" = ""; then
CPP=`gnustep-config --variable=CPP`
fi
if test "$CXX" = ""; then
CXX=`gnustep-config --variable=CXX`
fi
PKG_PROG_PKG_CONFIG([])
#--------------------------------------------------------------------
# Check for nettle
#--------------------------------------------------------------------
PKG_CHECK_MODULES([NETTLE], [nettle], [HAVE_NETTLE=1], [HAVE_NETTLE=0])
if test "x$HAVE_NETTLE" = "x1"; then
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
NETTLE_CFLAGS=`pkg-config --cflags nettle`
NETTLE_LDFLAGS=`pkg-config --libs-only-L nettle`
NETTLE_OTHERFLAGS=`pkg-config --libs-only-other nettle`
NETTLE_LIBS=`pkg-config --libs-only-l nettle`
CFLAGS="$CFLAGS $NETTLE_CFLAGS"
LIBS="$NETTLE_OTHERFLAGS $NETTLE_LDFLAGS $NETTLE_LIBS $LIBS"
AC_CHECK_FUNCS(nettle_sha3_512_init)
if test "$ac_cv_func_nettle_sha3_512_init" = "no"; then
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
AC_DEFINE([HAVE_NETTLE], [0])
fi
fi
AC_SUBST(NETTLE_CFLAGS)
AC_SUBST(NETTLE_LDFLAGS)
AC_SUBST(NETTLE_OTHERFLAGS)
AC_SUBST(NETTLE_LIBS)
AC_SUBST(HAVE_NETTLE)
if test "x$HAVE_NETTLE" = "x0"; then
AC_MSG_WARN("Nettle not available (or too old); advanced hash digest disabled.")
fi
#--------------------------------------------------------------------
# Check for gnutls
#--------------------------------------------------------------------
PKG_CHECK_MODULES([GNUTLS], [gnutls], [HAVE_GNUTLS=1], [HAVE_GNUTLS=0])
if test "x$HAVE_GNUTLS" = "x1"; then
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
GNUTLS_CFLAGS=`pkg-config --cflags gnutls`
GNUTLS_LDFLAGS=`pkg-config --libs-only-L gnutls`
GNUTLS_LIBS=`pkg-config --libs-only-l gnutls`
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
LIBS="$GNUTLS_LDFLAGS $GNUTLS_LIBS $LIBS"
AC_CHECK_FUNCS(gnutls_hash_fast)
if test "$ac_cv_func_gnutls_hash_fast" = "no"; then
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
HAVE_GNUTLS=0
fi
fi
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LDFLAGS)
AC_SUBST(GNUTLS_LIBS)
AC_SUBST(HAVE_GNUTLS)
if test "x$HAVE_GNUTLS" = "x0"; then
AC_MSG_WARN("GnuTLS not available (or too old); advanced cryptographic functions are disabled.")
fi
AC_CONFIG_FILES([config.make config.h GWSHash.h])
AC_OUTPUT