-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_libxml2.sh
More file actions
63 lines (50 loc) · 1.51 KB
/
_libxml2.sh
File metadata and controls
63 lines (50 loc) · 1.51 KB
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
_download_and_extract_tar "$LIBXML2_URL" "$LIBXML2_DIR/build" "$LIBXML2_SHA256"
_pushd "$LIBXML2_DIR/build"
rm -f test/icu_parse_test.xml # no icu
CONFIGURE_ARGS=()
if [ -n "${TARGET:-}" ]; then
CONFIGURE_ARGS+=( --host=$HOST_TRIPLE --build=$(_clang_triple $TARGET) )
fi
if [ -n "${SYSROOT:-}" ]; then
CONFIGURE_ARGS+=( --with-sysroot=$SYSROOT )
fi
./configure \
--prefix= \
--with-pic \
--enable-static \
--with-zlib="$ZLIB_DIR" \
--disable-shared \
--disable-dependency-tracking \
--disable-maintainer-mode \
--without-catalog \
--without-debug \
--without-ftp \
--without-http \
--without-html \
--without-iconv \
--without-history \
--without-legacy \
--without-python \
--without-readline \
--without-modules \
--without-lzma \
${CONFIGURE_ARGS[@]:-}
make -j$(nproc)
rm -rf "$LIBXML2_DIR"/{bin,lib,include,share,usr}
make DESTDIR="$LIBXML2_DIR" install # don't use -j here
# rewrite bin/xml2-config to be relative to its install location
cp "$LIBXML2_DIR/bin/xml2-config" xml2-config
sed -E -e \
's/^prefix=.*/prefix="`cd "$(dirname "$0")\/.."; pwd`"/' \
xml2-config > "$LIBXML2_DIR/bin/xml2-config"
# remove unwanted programs
# (can't figure out how to disable building and/or installing these)
rm -f "$LIBXML2_DIR/bin/xmlcatalog" "$LIBXML2_DIR/bin/xmllint"
# remove libtool file
rm -f "$LIBXML2_DIR/lib/libxml2.la"
# # remove cmake dir
# rm -rf "$LIBXML2_DIR/lib/cmake"
# # remove pkgconfig dir
# rm -rf "$LIBXML2_DIR/lib/pkgconfig"
_popd
$NO_CLEANUP || rm -rf "$LIBXML2_DIR/build"