-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathconfigure.ac
187 lines (155 loc) · 4.86 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# configure.ac
#
# Copyright (C) 2006-2022 wolfSSL Inc.
# All rights reserved.
#
# This file is part of wolfssl command line utility.
#
#
#requires user to have AutoConf version 2.63 or greater.
AC_PREREQ([2.63])
AC_INIT([wolfclu], [0.1.6], [http://www.wolfssl.com])
#a helpful directory to keep clutter out of root
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([src/config.h])
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AM_INIT_AUTOMAKE([1.14.1 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests])
AC_ARG_PROGRAM
AC_DEFUN([PROTECT_AC_USE_SYSTEM_EXTENSIONS],
[AX_SAVE_FLAGS
AC_LANG_PUSH([C])
AC_USE_SYSTEM_EXTENSIONS
AC_LANG_POP([C])
AX_RESTORE_FLAGS
])
#PROTECT_AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_MACRO_DIR([m4])
#requires user to have LibTool version 2.2 or greater
LT_PREREQ([2.2])
LT_INIT([disable-static],[win32-dll])
LT_LANG([C])
gl_VISIBILITY
AS_IF([ test -n "$CFLAG_VISIBILITY" ], [
AM_CPPFLAGS="$AM_CPPFLAGS $CFLAG_VISIBILITY"
CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY"
])
#silent
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
# Checks for headers/libraries
AC_CHECK_HEADERS([sys/time.h string.h termios.h unistd.h])
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_FUNCS([gettimeofday memset alarm])
AC_FUNC_MALLOC
AC_TYPE_INT64_T
# Filesystem Build
ENABLED_FILESYSTEM_DEFAULT=yes
AC_ARG_ENABLE([filesystem],
[AS_HELP_STRING([--enable-filesystem],[Enable Filesystem support (default: enabled)])],
[ ENABLED_FILESYSTEM=$enableval ],
[ ENABLED_FILESYSTEM=$ENABLED_FILESYSTEM_DEFAULT ]
)
if test "$ENABLED_FILESYSTEM" = "no"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFCLU_NO_FILESYSTEM"
fi
#wolfssl
AC_MSG_CHECKING([for wolfSSL])
if test "x$prefix" = "xNONE"
then
wcpath=$ac_default_prefix
else
wcpath=$prefix
fi
AC_MSG_NOTICE([prefix ${prefix}])
WOLFSSL_URL="http://www.wolfssl.com/download.html"
AC_ARG_WITH(wolfssl,
[AS_HELP_STRING([--with-wolfssl=PATH], [PATH to wolfssl install (default /usr/local)])],
[
if test "x$withval" != "xno" ; then
if test -d "${withval}/lib" && test -d "${withval}/include"; then
wcpath=${withval}
LDFLAGS="$LDFLAGS -L${wcpath}/lib"
AM_LDFLAGS="$AM_LDFLAGS -L${wcpath}/lib"
CPPFLAGS="$CPPFLAGS -I${wcpath}/include"
AM_CPPFLAGS="$AM_CPPFLAGS -I${wcpath}/include"
else
AC_MSG_ERROR([wolfSSL path error (${withval}): missing lib and include])
fi
fi
]
)
# wolfCLU requires libwolfssl.
AC_CHECK_LIB([wolfssl],[wolfCrypt_Init],,[AC_MSG_ERROR([libwolfssl is required and wasn't found on the system. It can be obtained from https://www.wolfssl.com/download.html/.])])
# since we have autoconf available, we can use wolfssl options header
AM_CFLAGS="$AM_CFLAGS -DHAVE_WOLFSSL_OPTIONS"
# check for some conditional functions
AC_CHECK_FUNC([wolfSSL_X509_CRL_print],
[],
[AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_CRL_PRINT"])
AC_CHECK_FUNC([wolfSSL_X509_REQ_print],
[],
[AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_REQ_PRINT"])
AC_CHECK_FUNC([wc_EncodeObjectId],
[],
[AM_CFLAGS="$AM_CFLAGS -DNO_WC_ENCODE_OBJECT_ID"])
###############################################
# #
# Need a genKey check #
# #
# Need aes-cbc-[128][192][256] check #
# Need aes-ctr-[128][192][256] check #
# Need 3des-cbc-[056][112][168] check #
# Need Camellia-cbc-[128][192][256] check #
# #
###############################################
# Checks for typedefs, structures, and compiler characteristics.
if test "$ac_cv_sizeof_long" = "8"; then
AM_CFLAGS="$AM_CFLAGS -DSIZEOF_LONG=8"
else
if test "$ac_cv_sizeof_long_long" = "8"; then
AM_CFLAGS="$AM_CFLAGS -DSIZEOF_LONG_LONG=8"
fi
fi
# Add Wall to CFLAGS
AX_HARDEN_CC_COMPILER_FLAGS
if test "$GCC" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
fi
CREATE_HEX_VERSION
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
# FINAL
AC_CONFIG_FILES([Makefile
wolfclu/version.h
])
#AX_CREATE_GENERIC_CONFIG
AX_AM_JOBSERVER([yes])
AC_OUTPUT()
# force make clean
echo "---"
echo "Running make clean..."
make clean >/dev/null 2>&1
echo
# output config summary
echo "---"
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
echo ""
echo " * Installation prefix: $prefix"
echo " * System type: $host_vendor-$host_os"
echo " * Host CPU: $host_cpu"
echo " * C Compiler: $CC_VERSION"
echo " * C Flags: $CFLAGS"
echo " * CPP Flags: $CPPFLAGS"
echo " * LIB Flags: $LIB"