exit 1
fi
-if [ $# -ne 1 ]; then
- echo "Usage: $0 i686|x86_64" 1>&2
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 i686|x86_64 [EXTRA_CONFIGURE_ARG]..." 1>&2
exit 1
fi
# Compile wimlib
if ! grep -q "./configure --host=${ARCH}-w64-mingw32" config.log || \
- ! grep -q "configure: exit 0" config.log
+ ! grep -q "configure: exit 0" config.log || \
+ [ $# -gt 0 ]
then
extra_args=
if [ $ARCH = x86_64 ]; then
# http://www.gnu.org/software/libtool/manual/libtool.html#Stripped-link-flags
./configure --host=${ARCH}-w64-mingw32 --disable-static \
CC="${ARCH}-w64-mingw32-gcc -static-libgcc" \
- CFLAGS="-O2 -Wall" \
- CPPFLAGS="-I$SYSROOT/include -I$SYSROOT/include/libxml2 -DLIBXML_STATIC"\
+ CPPFLAGS="-I$SYSROOT/include" \
LDFLAGS="-L$SYSROOT/lib" \
- $extra_args
+ PKG_CONFIG_PATH="$SYSROOT/lib/pkgconfig" \
+ --without-libcrypto \
+ $extra_args "$@"
$MAKE clean
fi
$MAKE
cp NEWS README* COPYING* $DESTDIR
cp $WINDEPDIR/COPYING* $DESTDIR
+
+sed -n '/^#/q; s/^[\/\* ]*//; p' src/divsufsort.c > $DESTDIR/COPYING.libdivsufsort-lite
+if ! grep -q 'Copyright' $DESTDIR/COPYING.libdivsufsort-lite; then
+ echo "ERROR: failed to extract libdivsufsort-lite license text" 1>&2
+ exit 1
+fi
(
cd $DESTDIR
for fil in NEWS README* COPYING*; do
sed 's/$/\r/g' > ${DESTDIR}/wim${cmd}.cmd <<- EOF
@echo off
- %~dp0\\wimlib-imagex $cmd %*
+ "%~dp0\\wimlib-imagex" $cmd %*
EOF
chmod +x ${DESTDIR}/wim${cmd}.cmd
done