-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile_tiff.sh
executable file
·57 lines (51 loc) · 1.55 KB
/
compile_tiff.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
#!/bin/bash
tiff_compile() {
echo "[|- MAKE $BUILDINGFOR]"
try make -j$CORESNUM
try make install
echo "[|- CP STATIC/DYLIB $BUILDINGFOR]"
cp $TIFF_LIB_DIR/lib/$LIBPATH_tiff $LIB_DIR/$LIBNAME_tiff.$BUILDINGFOR
cp $TIFF_LIB_DIR/lib/libtiff.5.dylib $LIB_DIR/tiff_${BUILDINGFOR}_dylib/libtiff.dylib
first=`echo $ARCHS | awk '{print $1;}'`
if [ "$BUILDINGFOR" == "$first" ]; then
echo "[|- CP include files (arch ref: $first)]"
# copy the include files
cp -r $TIFF_LIB_DIR/include/ $LIB_DIR/include/tiff/
fi
echo "[|- CLEAN $BUILDINGFOR]"
try make distclean
}
tiff () {
echo "[+ TIFF: $1]"
cd $TIFF_DIR
LIBPATH_tiff=libtiff.a
LIBNAME_tiff=`basename $LIBPATH_tiff`
if [ "$1" == "armv7" ] || [ "$1" == "armv7s" ] || [ "$1" == "arm64" ]; then
save
armflags $1
echo "[|- CONFIG $BUILDINGFOR]"
try ./configure prefix=$TIFF_LIB_DIR --enable-shared --enable-static --disable-cxx --host=arm-apple-darwin
tiff_compile
restore
elif [ "$1" == "i386" ] || [ "$1" == "x86_64" ]; then
save
intelflags $1
echo "[|- CONFIG $BUILDINGFOR]"
try ./configure prefix=$TIFF_LIB_DIR --enable-shared --enable-static --disable-cxx --host=${BUILDINGFOR}-apple-darwin
tiff_compile
restore
else
echo "[ERR: Nothing to do for $1]"
fi
joinlibs=$(check_for_archs $LIB_DIR/$LIBNAME_tiff)
if [ $joinlibs == "OK" ]; then
echo "[|- COMBINE $ARCHS]"
accumul=""
for i in $ARCHS; do
accumul="$accumul -arch $i $LIB_DIR/$LIBNAME_tiff.$i"
done
# combine the static libraries
try lipo $accumul -create -output $LIB_DIR/$LIBNAME_tiff
echo "[+ DONE]"
fi
}