forked from stlab/adobe_source_libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·111 lines (82 loc) · 2.77 KB
/
configure.sh
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
#!/bin/bash
# Run a command, and echo before doing so. Also checks the exit
# status and quits if there was an error.
echo_run ()
{
echo "EXEC : $@"
"$@"
r=$?
if test $r -ne 0 ; then
exit $r
fi
}
BOOST_MAJOR=1
BOOST_MINOR=76
BOOST_DOT=0
BOOST_DT_VER=${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_DOT}
BOOST_US_VER=${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_DOT}
BOOST_DIR=boost_${BOOST_US_VER}
BOOST_TAR=$BOOST_DIR.tar.gz
#
# Make sure we're at the top-level directory when we set up all our siblings.
#
cd ..
#
# If need be, download Boost and unzip it, moving it to the appropriate location.
#
if [ ! -e 'boost_libraries' ]; then
echo "INFO : boost_libraries not found: setting up."
if [ ! -e $BOOST_TAR ]; then
echo "INFO : $BOOST_TAR not found: downloading."
echo_run curl -L "http://sourceforge.net/projects/boost/files/boost/$BOOST_DT_VER/$BOOST_TAR/download" -o $BOOST_TAR;
else
echo "INFO : $BOOST_TAR found: skipping download."
fi
echo_run rm -rf $BOOST_DIR
echo_run tar -xf $BOOST_TAR
echo_run rm -rf boost_libraries
echo_run mv $BOOST_DIR boost_libraries
else
echo "INFO : boost_libraries found: skipping setup."
fi
#
# If we have a patch for the version of Boost we are using, patch boost.
#
# The patchfile should be created with something like the following:
# diff -wur --unidirectional-new-file -xstatus -xadobe_information -xp4config -x'bin.*' -xmacosxx86_64 -x'*.log' -xproject-config.jam -xb2 -xbjam -xjam0 -x'.DS_Store' ./boost_1_54_0/ ./boost_libraries/ > adobe_source_libraries/tools/boost_1_54_0_patches.txt
#
PATCHFILE=boost_${BOOST_US_VER}_patches.txt
FULL_PATCHFILE=adobe_source_libraries/tools/$PATCHFILE
if [ -e "$FULL_PATCHFILE" ] ; then
if [ -e "boost_libraries/$PATCHFILE" ] ; then
echo "INFO : Patchfile previously applied. Skipping."
else
echo "INFO : Applying $PATCHFILE..."
# Copying the patchfile into the boost_libraries folder
# lets us use it as a marker to see if the patch has
# already been applied to this instance of Boost.
echo_run cp $FULL_PATCHFILE boost_libraries/
echo_run cd boost_libraries
echo_run patch -uN -p2 -g0 -i $PATCHFILE
echo "Boost patched OK."
echo_run cd ..
fi
else
echo "INFO : No patchfile found for this version of Boost. Skipping."
fi
#
# Create b2/bjam via boostrapping, again if need be.
#
if [ ! -e './boost_libraries/b2' ]; then
echo "INFO : b2 not found: boostrapping."
echo_run cd boost_libraries;
echo_run ./bootstrap.sh --with-toolset=${TOOLSET:-clang}
echo_run cd ..
else
echo "INFO : b2 found: skipping boostrap."
fi
#
# A blurb of diagnostics to make sure everything is set up properly.
#
ls -alF
echo "INFO : You are ready to go!"