3 echo "Downloading Expat"
4 if ! curl -L -k -s -o expat-2.2.9.tar.gz https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.gz;
6 echo "Failed to download Expat"
10 echo "Unpacking Expat"
12 if ! tar -xf expat-2.2.9.tar.gz;
14 echo "Failed to unpack Expat"
18 cd expat-2.2.9 || exit 1
20 export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig"
22 echo "Configuring Expat"
24 --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \
25 --prefix="$IOS_PREFIX" ; then
26 echo "Error: Failed to configure Expat"
31 # Cleanup warnings, https://github.com/libexpat/libexpat/issues/383
32 echo "Fixing Makefiles"
33 (IFS="" find "$PWD" -name 'Makefile' -print | while read -r file
35 cp -p "$file" "$file.fixed"
36 sed 's|-Wduplicated-cond ||g; s|-Wduplicated-branches ||g; s|-Wlogical-op ||g' "$file" > "$file.fixed"
37 mv "$file.fixed" "$file"
39 cp -p "$file" "$file.fixed"
40 sed 's|-Wrestrict ||g; s|-Wjump-misses-init ||g; s|-Wmisleading-indentation ||g' "$file" > "$file.fixed"
41 mv "$file.fixed" "$file"
46 echo "Failed to build Expat"
50 echo "Installing Expat"
51 if ! make install; then
52 echo "Failed to install Expat"