-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_binaries
executable file
·49 lines (38 loc) · 2.32 KB
/
build_binaries
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
#!/bin/sh
### # Check for minimum number of arguments.
### REQUIRED_ARGS=1 # Script requires 3 argument
### if [ $# -lt "$REQUIRED_ARGS" ]
### then
### echo "Usage: `basename $0` <treescan_src directory> <boost directory> <binaries output directory>])"
### echo " example: `basename $0` /Users/treescan/prj/treescan.development/treescan /Users/treescan/prj/boost/boost_1_81_0 /Users/treescan/prj/treescan.development/binaries/mac"
### exit 1
### fi
(
cpp_compiler="/usr/bin/g++"
c_compiler="/usr/bin/gcc"
osx_min_version="-mmacosx-version-min=10.13"
binaries="${3:-/Users/treescan/prj/treescan.development/binaries/mac}"
treescan_src="${1:-/Users/treescan/prj/treescan.development/treescan}"
boost_src="${2:-/Users/treescan/prj/boost/boost_1_81_0}"
processors="-j2"
rm -f $binaries/*
# Intel command-line binary
echo building TreeScan for x86_64 64-bit system
./makescript.mac.sh $binaries/treescan_x86_64 $treescan_src $boost_src -m64 -O3 $cpp_compiler $c_compiler "-arch x86_64" $osx_min_version $processors
# M1 command-line binary
echo building TreeScan for M1 system
./makescript.mac.sh $binaries/treescan_arm64 $treescan_src $boost_src -m64 -O3 $cpp_compiler $c_compiler "-arch arm64" $osx_min_version $processors
# Intel JNI library
echo building TreeScan shared object for x86_64 64-bit system
./makescript.so.mac.sh $binaries/libtreescan.jnilib $treescan_src $boost_src -m64 -O3 $cpp_compiler $c_compiler "-arch x86_64" $osx_min_version $processors
# codesign binaries
security unlock-keychain $HOME/Library/Keychains/login.keychain
codesign --force -v --deep -s "Developer ID Application: Information Management Services, Inc. (VF82MCMA83)" $binaries/treescan_x86_64
codesign --force -v --deep -s "Developer ID Application: Information Management Services, Inc. (VF82MCMA83)" $binaries/treescan_arm64
# Create universal binary for command-line.
echo creating universal binary for x86_64 and arm64.
lipo -create $binaries/treescan_x86_64 $binaries/treescan_arm64 -output $binaries/treescan
rm $binaries/treescan_x86_64 $binaries/treescan_arm64
codesign --force -v --deep -s "Developer ID Application: Information Management Services, Inc. (VF82MCMA83)" $binaries/treescan
codesign --force -v --deep -s "Developer ID Application: Information Management Services, Inc. (VF82MCMA83)" $binaries/libtreescan.jnilib
) 1> build.stdout 2> build.stderr