-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathjava.sh
More file actions
executable file
·60 lines (54 loc) · 2.19 KB
/
java.sh
File metadata and controls
executable file
·60 lines (54 loc) · 2.19 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
#!/bin/bash
# Native JNI shared library compilation script
#
# This script compiles the native JNI sources into a shared library named
# either libwolfssljni.so/.dylib by invoking the Makefile native target.
# Compiling on Linux/Unix and Mac OSX are currently supported.
#
# JAVA_HOME detection is handled by the Makefile. To explicitly use a Java
# home location, set the JAVA_HOME environment variable prior to running
# this script.
#
# This script will try to link against a wolfSSL library installed to the
# default location of /usr/local. This script accepts two arguments on the
# command line. The first argument can point to a custom wolfSSL installation
# location. A custom install location would match the directory set at wolfSSL
# ./configure --prefix=<DIR>.
#
# The second argument represents the wolfSSL library name that should be
# linked against. This is helpful if a non-standard library name has been
# used with wolfSSL, for example the ./configure --with-libsuffix option
# has been used to add a suffix to the wolfSSL library name. Note that to
# use this argument, an installation location must be specified via the
# first argument.
#
# For example, if wolfSSL was configured with --with-libsuffix=jsse, then
# this script could be called like so using the default installation
# path of /usr/local.
#
# java.sh /usr/local wolfssljsse
# Fail on any errors
set -euo pipefail
if [ -z "${1-}" ]; then
# default install location is /usr/local
WOLFSSL_INSTALL_DIR="/usr/local"
else
# use custom wolfSSL install location
# should match directory set at wolfSSL ./configure --prefix=<DIR>
WOLFSSL_INSTALL_DIR="$1"
fi
if [ -z "${2-}" ]; then
# default wolfSSL library name is libwolfssl
WOLFSSL_LIBNAME="wolfssl"
else
# use custom wolfSSL library name
# should match wolfsslSUFFIX as set using ./configure --with-libsuffix
WOLFSSL_LIBNAME="$2"
fi
echo "Compiling Native JNI library:"
echo " WOLFSSL_INSTALL_DIR = $WOLFSSL_INSTALL_DIR"
echo " WOLFSSL_LIBNAME = $WOLFSSL_LIBNAME"
# Do a clean build of the native library to preserve legacy script behavior.
make clean-native native \
WOLFSSL_INSTALL_DIR="$WOLFSSL_INSTALL_DIR" \
WOLFSSL_LIBNAME="$WOLFSSL_LIBNAME"