forked from opencryptoki/openssl-ibmpkcs11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
53 lines (44 loc) · 1.37 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
#
# configure.in for the OpenSSL IBM PKCS#11 engine project
#
AC_INIT(openssl-ibmpkcs11, 1.0.2, opencryptoki-users@lists.sf.net)
AC_CONFIG_SRCDIR([src/e_pkcs11.c]) #sanity check
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(1.6.3)
# Debugging support
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [turn on all debugging flags [default is off]]),
[enable_debug="yes"
AC_MSG_RESULT([*** Enabling debugging at user request ***])],)
# custom openssl location
AC_ARG_WITH(openssl,
[ --with-openssl[[=DIR]] build with OpenSSL support [[/usr/local/ssl]]],
[openssl_prefix=$withval],
[openssl_prefix=]
)
if test "x$openssl_prefix" != x; then
AC_MSG_RESULT([*** Using OpenSSL directory $openssl_prefix ***])
LDFLAGS="-L$openssl_prefix/lib $LDFLAGS"
CFLAGS="-I$openssl_prefix/include $CFLAGS"
fi
# If the user has not set CFLAGS, do something appropriate
test_CFLAGS=${CFLAGS+set}
if test "$test_CFLAGS" != set; then
if test "x$enable_debug" == "xyes"; then
CFLAGS="-O0 -g -DDEBUG -DPKCS11_DEBUG"
else
CFLAGS="-O2"
fi
fi
# OpenSSL location
AC_MSG_CHECKING([OpenSSL])
AC_CHECK_LIB(crypto, RAND_add, [], \
AC_MSG_ERROR([*** libcrypto not found]))
AC_DISABLE_STATIC
AC_PROG_CC
LT_INIT
CFLAGS="$CFLAGS -Wall -DLINUX -DOPENCRYPTOKI"
AC_SUBST(CFLAGS)
AC_SUBST(LIBDIR, $libdir)
AC_OUTPUT(Makefile src/Makefile openssl.cnf.sample)
echo "CFLAGS=$CFLAGS"