-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_build_libyaml.sh
More file actions
executable file
·36 lines (29 loc) · 887 Bytes
/
_build_libyaml.sh
File metadata and controls
executable file
·36 lines (29 loc) · 887 Bytes
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
#!/bin/bash
set -xe
_SC_DIR="$(cd "`dirname "$0"`"; pwd)"
_VER="${5:-0.2.5}"
_PKG="yaml-$_VER"
_PREFIX="$1"
_SCRATCH_DIR="$2"
_UNIVERSAL="$3"
_RPATH="$4"
_NO_TESTS="$6"
if [[ ! -e "$_PREFIX/lib/libyaml.dylib" ]]
then
cd "$_SCRATCH_DIR"
[[ -s "$_PKG.tar.gz" ]] || \
curl -OkfSL "https://github.com/yaml/libyaml/releases/download/$_VER/$_PKG.tar.gz"
rm -rf "$_PKG"
tar -xf "$_PKG.tar.gz"
# Build options
_CFLAGS=-O2
[[ "$_UNIVERSAL" != 1 ]] || _CFLAGS="$_CFLAGS -arch i386 -arch x86_64"
cd "$_PKG"
./configure --disable-dependency-tracking "--prefix=$_PREFIX" --disable-static \
"CFLAGS=$_CFLAGS"
# Disable tests completely
[[ "$_NO_TESTS" == 0 ]] || sed -i- 's/^\(SUBDIRS *=.*\) tests$/\1/' Makefile
make -j2 V=1 install
[[ "$_NO_TESTS" != 0 ]] || make check
[[ "$_RPATH" != 1 ]] || "$_SC_DIR/change_to_rpath.sh" "$_PREFIX/lib/libyaml.dylib"
fi