-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfigure.sh
More file actions
84 lines (67 loc) · 2.31 KB
/
Copy pathconfigure.sh
File metadata and controls
84 lines (67 loc) · 2.31 KB
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
export makl_conf_h="include/scs_conf.h"
. "${MAKL_DIR}/cf/makl.init"
makl_args_init "$@"
# Source option hooks.
. build/opt_crypto
. build/opt_gnu_debug
. build/opt_extra_cflags
# libscs-x.y.z
makl_pkg_name "libscs"
makl_pkg_version
target=`makl_target_name`
case ${target} in
*darwin*)
makl_set_var "OS_DARWIN"
;;
*linux*)
makl_set_var "OS_LINUX"
;;
esac
# Some handy CC flags.
makl_add_var_mk "SRCDIR" "`pwd`"
makl_add_var_mk "CFLAGS" "-I\$(SRCDIR)/include"
makl_add_var_mk "CFLAGS" "-W -Wall -Wextra"
# Check functions for which we need to provide replacement
makl_checkfunc 0 "strlcpy" 3 "" "<string.h>"
makl_checkfunc 0 "arc4random" 0 "" "<stdlib.h>"
# Third party library dependencies (i.e. libz + a suitable crypto library).
makl_optional 1 "lib" "z" "" "-lz"
makl_add_var_mk "CFLAGS" "\$(LIBZ_CFLAGS)"
makl_add_var_mk "LDFLAGS" "\$(LIBZ_LDFLAGS)"
# After user supplied arguments have been parsed, we'll check whether the
# requested crypto toolkit has been found.
# We just need the "crypto" side of OpenSSL.
makl_optional 1 "lib" "openssl" "" "-lcrypto"
# CyaSSL default install goes to /usr/local{include/cyassl,lib}.
makl_optional 1 "lib" "cyassl" "" "-lcyassl"
# Binary dependencies (for bindings)
makl_optional 1 "featx" "swig"
makl_optional 1 "featx" "python"
makl_optional 1 "featx" "python-config" "PYTHON_CONFIG" # -dev package
makl_optional 1 "featx" "php"
makl_optional 1 "featx" "php-config" "PHP_CONFIG" # -dev package
# Docs
makl_optional 1 "featx" "doxygen"
#
# Handle command line arguments.
#
makl_args_handle "$@"
# Now check if we have found the requested crypto library.
if [ "`makl_get_var_mk "USE_OPENSSL"`" ]
then
[ -z "`makl_get_var_mk "HAVE_LIBOPENSSL"`" ] && \
makl_err 1 "Required OpenSSL not found !"
makl_add_var_mk "CFLAGS" "\$(LIBOPENSSL_CFLAGS)"
makl_add_var_mk "LDFLAGS" "\$(LIBOPENSSL_LDFLAGS)"
fi
if [ "`makl_get_var_mk "USE_CYASSL"`" ]
then
[ -z "`makl_get_var_mk "HAVE_LIBCYASSL"`" ] && \
makl_err 1 "Required CyaSSL not found !"
makl_add_var_mk "CFLAGS" "\$(LIBCYASSL_CFLAGS)"
makl_add_var_mk "LDFLAGS" "\$(LIBCYASSL_LDFLAGS)"
fi
# Install headers in a private subdir
makl_set_var "INCDIR" "`makl_get_var_mk \"INCDIR\"`/scs"
# Send configuration to Makefile.conf and include/conf.h files.
. "${MAKL_DIR}/cf/makl.term"