added .gitignore converted from svn:ignore
[TestXSLT.git] / libs / compile_libs.sh
1 #!/bin/sh
2
3 echo executing $0
4 echo ACTION is $ACTION
5
6 SDKFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
7
8 LIBS_TAR_DIR="`pwd`/libs"
9 LIBS_DEST_DIR="$BUILD_DIR/libs"
10 LIBS_INST_DIR="$LIBS_DEST_DIR/inst"
11 LIBS_SRC_DIR="$LIBS_DEST_DIR/src"
12
13 TAR_LIBXML2="$LIBS_TAR_DIR/libxml2-2.6.17.tar.gz"
14 TAR_LIBXSLT="$LIBS_TAR_DIR/libxslt-1.1.12.tar.gz"
15 TAR_EXPAT="$LIBS_TAR_DIR/expat-2005-01-28.tar.gz"
16 TAR_SABLOT="$LIBS_TAR_DIR/Sablot-1.0.2.tar.gz"
17
18 echo $LIBS_TAR_DIR / $LIBS_DEST_DIR / $LIBS_INST_DIR / $LIBS_BUILD_DIR
19
20 [ -e "$LIBS_TAR_DIR" ]  || exit 1
21 [ -e "$LIBS_DEST_DIR" ] || mkdir -p "$LIBS_DEST_DIR"  || exit 1
22 [ -e "$LIBS_INST_DIR" ] || mkdir -p "$LIBS_INST_DIR"  || exit 1
23 [ -e "$LIBS_SRC_DIR" ]  || mkdir -p "$LIBS_SRC_DIR"   || exit 1
24
25
26
27
28 #### setup libxml2
29 LIB="$LIBS_DEST_DIR/libxml2.dylib"
30 if [ ! -e "$LIB" ]; then
31
32
33         echo building "$LIB"
34
35         cd "$LIBS_SRC_DIR"
36         tar -xzf "$TAR_LIBXML2"
37         cd libxml2-*
38         make distclean
39         ./configure --without-python --prefix="$LIBS_INST_DIR"
40         make install
41
42         lipo -create "$LIBS_INST_DIR/lib/libxml2.dylib" -output "$LIB"
43         perl "$LIBS_TAR_DIR/fix_install_paths.pl" "$LIB" "$BUILD_DIR"
44
45         #cp "$LIBS_INST_DIR/lib/libxml2.dylib" "$LIB"
46
47 fi
48
49
50
51 #### setup libxslt
52 LIB="$LIBS_DEST_DIR/libxslt.dylib"
53 if [ ! -e "$LIB" ]; then
54
55         echo building "$LIB"
56
57         cd "$LIBS_SRC_DIR"
58         tar -xzf "$TAR_LIBXSLT"
59         cd libxslt-*
60         make distclean
61         ./configure --prefix="$LIBS_INST_DIR" --with-libxml-prefix="$LIBS_INST_DIR"
62         make install
63
64
65         lipo -create "$LIBS_INST_DIR/lib/libxslt.dylib" -output "$LIB"
66         perl "$LIBS_TAR_DIR/fix_install_paths.pl" "$LIB" "$BUILD_DIR"
67
68         lipo -create "$LIBS_INST_DIR/lib/libexslt.dylib" -output "$LIBS_DEST_DIR/libexslt.dylib"
69         perl "$LIBS_TAR_DIR/fix_install_paths.pl" "$LIBS_DEST_DIR/libexslt.dylib" "$BUILD_DIR"
70
71
72
73 fi
74
75
76 #### setup libexpat
77 LIB="$LIBS_DEST_DIR/libexpat.dylib"
78 if [ ! -e "$LIB" ]; then
79
80
81         echo building "$LIB"
82
83         cd "$LIBS_SRC_DIR"
84         tar -xzf "$TAR_EXPAT"
85         cd expat-*
86         make distclean
87         ./configure --prefix="$LIBS_INST_DIR"
88         INSTALL_ROOT="/" make -e install
89         
90         #cp "$LIBS_INST_DIR/lib/libexpat.dylib" "$LIB"
91         lipo -create "$LIBS_INST_DIR/lib/libexpat.dylib" -output "$LIB"
92         perl "$LIBS_TAR_DIR/fix_install_paths.pl" "$LIB" "$BUILD_DIR"
93         
94 fi
95
96
97 #### setup libSablot
98 LIB="$LIBS_DEST_DIR/libSablot.dylib"
99 if [ ! -e "$LIB" ]; then
100
101         echo building "$LIB"
102
103         cd "$LIBS_SRC_DIR"
104         tar -xzf "$TAR_SABLOT"
105         cd Sablot-*
106         make distclean
107
108         ./configure --disable-adding-meta --with-expat="$LIBS_INST_DIR" --prefix="$LIBS_INST_DIR"
109         make install
110         
111         #cp "$LIBS_INST_DIR/lib/libSablot.dylib" "$LIB"
112         lipo -create "$LIBS_INST_DIR/lib/libSablot.dylib" -output "$LIB"
113         perl "$LIBS_TAR_DIR/fix_install_paths.pl" "$LIB" "$BUILD_DIR"
114
115 fi
116
117
118 exit
119