the target files do not yet exist. (Broken since v1.7.0, but actually a
result of a Microsoft bug.)
+ The Windows binary distribution no longer contain third party DLLs.
+ These dependencies are instead compiled directly into libwim.dll.
+
More fixes for wimlib on non-x86 architectures such as ARM.
Slight performance improvements in compression and decompression.
* The documentation, including this file, the generic README.txt, and
PDF documentation for wimlib-imagex in the 'doc' directory.
- * Various DLL (.dll) files, including the wimlib library itself
- (libwim-15.dll). The C header wimlib.h is not included; download the source
- if you want it.
+ * The library itself (libwim-15.dll). The C header wimlib.h is not
+ included; download the source if you want it.
* License files for all software included. These are all free software
licenses.
+++ /dev/null
-scan-build --use-analyzer=/bin/clang clang src/*.c programs/imagex.c -o imagex -D_FILE_OFFSET_BITS=64 -std=gnu99 -lntfs-3g -lxml2 -lfuse -lpthread -lrt -Iinclude/ -I./ -I/usr/include/libxml2/ -D HAVE_CONFIG_H -Wno-pointer-sign -D_GNU_SOURCE -lcrypto
AX_PTHREAD([], [AC_MSG_ERROR(["cannot find pthreads library"])])
# ------------------------------ libxml2 --------------------------------------
-AC_CHECK_LIB([xml2], [xmlParseFile], [],
+AC_CHECK_LIB([xml2], [xmlReadMemory], [],
[AC_MSG_ERROR(["cannot find libxml2"])])
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES libxml-2.0"
+++ /dev/null
-#!/bin/bash
-
-set -e -u
-
-./configure && make distcheck
-for arch in i686 x86_64; do
- ./make-windows-release ${arch}
-done
+++ /dev/null
-#!/bin/bash
-
-set -e
-
-WIMLIB_ARCH=i686
-if [ $# -ge 1 ]; then
- WIMLIB_ARCH=$1
- shift
-fi
-
-if [[ $WIMLIB_ARCH = i686 ]] ; then
- DESTDIR=/mnt/tmp/wimlib
-elif [[ $WIMLIB_ARCH = x86_64 ]]; then
- DESTDIR=/mnt/tmp/x64/wimlib
-else
- echo "Unknown architecture $1" 1>&2
- exit 2
-fi
-
-CONF_EXTRA_ARGS=("$@")
-
-VERSION=$(grep 'This is wimlib version' README | \
- grep -o '\<[0-9]\+\.[0-9]\+\.[0-9]\+\(-BETA\)\?\>')
-ZIPFILE=wimlib-${VERSION}-windows-${WIMLIB_ARCH}-bin.zip
-
-if ! grep -q "./configure --host=${WIMLIB_ARCH}-w64-mingw32" config.log; then
- ./configure --host=${WIMLIB_ARCH}-w64-mingw32 "${CONF_EXTRA_ARGS[@]}"
- make clean
-fi
-
-make -j2
-
-rm -f $DESTDIR/{libwim-*.dll,doc/*,wim*.bat,wim*.cmd}
-
-TEXTFILES=(NEWS README* COPYING*)
-
-cp .libs/wimlib-imagex.exe $DESTDIR/wimlib-imagex.exe
-cp .libs/libwim-*.dll $DESTDIR
-cp "${TEXTFILES[@]}" $DESTDIR
-
-function genman() {
- local name=$1
- local dest=$DESTDIR/doc/${name}.pdf
-
- echo "Generating $dest"
-
- MANPATH="./doc" man -t $name | ps2pdf - $dest
-}
-
-for fil in ./doc/man1/wimlib-imagex-*.1; do
- base=`basename $fil`
- base=${base%%.1}
- cmd=$(echo $base | sed s/wimlib-imagex-//)
- if [ $cmd == mount -o $cmd == mountrw -o $cmd == unmount ]; then
- continue
- fi
-
- genman $base
-
- sed 's/$/\r/g' > $DESTDIR/wim${cmd}.cmd <<- EOF
- @echo off
- %~dp0\\wimlib-imagex $cmd %*
- EOF
-done
-
-genman wimlib-imagex
-
-for fil in "${TEXTFILES[@]/#/$DESTDIR/}"; do
- sed < $fil > ${fil}.txt -e 's/$/\r/g'
- rm $fil
-done
-
-${WIMLIB_ARCH}-w64-mingw32-strip $DESTDIR/*.{dll,exe}
-
-rm -f $ZIPFILE
-(
- dir=$PWD
- cd $DESTDIR
- zip -r $dir/$ZIPFILE .
-)
--- /dev/null
+#!/bin/sh
+
+exec scan-build --use-analyzer=/usr/bin/clang /usr/bin/clang \
+ src/*.c programs/imagex.c -o wimlib-imagex \
+ -std=c99 -Wno-pointer-sign \
+ -D_GNU_SOURCE -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 \
+ -Iinclude -I. -I/usr/include/libxml2 \
+ -lntfs-3g -lxml2 -lfuse -lpthread -lrt -lcrypto
--- /dev/null
+#!/bin/bash
+
+set -e
+
+MAKE="make -j$(grep -c processor /proc/cpuinfo)"
+
+./configure && $MAKE distcheck
+
+# Recompress with 7-Zip
+gzfile=$(ls wimlib-*.tar.gz | tail -1)
+tarfile=${gzfile%.gz}
+gunzip $gzfile
+7z -mx9 a $gzfile $tarfile
+rm -f $tarfile
+
+for arch in i686 x86_64; do
+ ./tools/make-windows-release $arch
+done
--- /dev/null
+#!/bin/bash
+#
+# This script prepares a Windows binary distribution of wimlib on Linux using
+# MinGW-w64. The desired architecture must be passed as the first argument.
+
+set -e
+
+if [ ! -e src/wim.c ]; then
+ echo "This script must be run from the toplevel directory" 1>&2
+ exit 1
+fi
+
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 i686|x86_64" 1>&2
+ exit 1
+fi
+
+ARCH="$1"
+shift
+
+case "$ARCH" in
+i686|x86_64)
+ ;;
+*)
+ echo "ERROR: ARCH must be i686 or x86_64" 1>&2
+ exit 1
+ ;;
+esac
+
+VERSION=$(grep 'This is wimlib version' README | \
+ grep -o '\<[0-9]\+\.[0-9]\+\.[0-9]\+\(-BETA\)\?\>')
+DESTDIR=wimlib-${VERSION}-windows-${ARCH}-bin
+ZIPFILE=wimlib-${VERSION}-windows-${ARCH}-bin.zip
+MAKE="make -j $(grep -c processor /proc/cpuinfo)"
+WINDEPDIR=./tools/windeps
+SYSROOT=$WINDEPDIR/sysroot_${ARCH}
+
+# Prepare third party libraries
+
+if [ ! -e $SYSROOT ]; then
+ $MAKE -C $WINDEPDIR sysroot_${ARCH}
+fi
+
+# Compile wimlib
+
+if ! grep -q "./configure --host=${ARCH}-w64-mingw32" config.log || \
+ ! grep -q "configure: exit 0" config.log
+then
+ # Note: putting -static-libgcc in CC is a workaround for libtool
+ # stripping it:
+ # 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"\
+ LDFLAGS="-L$SYSROOT/lib"
+ $MAKE clean
+fi
+$MAKE
+
+# Create empty destination directory
+
+rm -rf $DESTDIR
+mkdir $DESTDIR
+
+# Install binaries
+
+cp .libs/*.{dll,exe} $DESTDIR
+${ARCH}-w64-mingw32-strip $DESTDIR/*.{dll,exe}
+
+# Install text files
+
+cp NEWS README* COPYING* $DESTDIR
+cp $WINDEPDIR/COPYING* $DESTDIR
+(
+ cd $DESTDIR
+ for fil in NEWS README* COPYING*; do
+ sed < $fil > ${fil}.txt -e 's/$/\r/g'
+ rm $fil
+ done
+)
+
+
+# Install man pages
+
+mkdir $DESTDIR/doc
+
+function gen_pdf_from_man_page() {
+ local manbase=$1
+ local pdf=${DESTDIR}/doc/${manbase}.pdf
+
+ echo "Generating $pdf"
+
+ MANPATH="./doc" man -t $manbase | ps2pdf - $pdf
+}
+
+for fil in ./doc/man1/wimlib-imagex-*.1; do
+ manbase=`basename $fil`
+ manbase=${manbase%%.1}
+ cmd=$(echo $manbase | sed s/wimlib-imagex-//)
+ if [ $cmd == mount -o $cmd == mountrw -o $cmd == unmount ]; then
+ continue
+ fi
+
+ gen_pdf_from_man_page $manbase
+
+ sed 's/$/\r/g' > ${DESTDIR}/wim${cmd}.cmd <<- EOF
+ @echo off
+ %~dp0\\wimlib-imagex $cmd %*
+ EOF
+ chmod +x ${DESTDIR}/wim${cmd}.cmd
+done
+
+gen_pdf_from_man_page wimlib-imagex
+
+# Generate ZIP file
+
+rm -f $ZIPFILE
+(
+ dir=$PWD
+ cd $DESTDIR
+ 7z -mx9 a "$dir/$ZIPFILE" .
+)
-e 's/\(the library interface of wimlib \)'$oldver'/\1'$newver'/' \
include/wimlib.h
-sed -i -e "1s/$oldmonth $oldyear/$newmonth $newyear/;s/wimlib $oldver/wimlib $newver/" \
+sed -i -e "1s/$oldmonth $oldyear/$newmonth $newyear/;1s/wimlib $oldver/wimlib $newver/" \
doc/man[1-9]/*.[1-9]
sed -i "s/pkgver=$oldver/pkgver=$newver/" archlinux/PKGBUILD
--- /dev/null
+#
+# This Makefile builds the third-party libraries needed to build a standalone
+# libwim.dll for Windows. We build these third-party libraries ourselves mainly
+# to cut down on bloat.
+#
+# Among other things, this Makefile requires MinGW-w64 (i686 and x86_64
+# versions) and a windeps.wim containing the following images:
+#
+# - libxml2-2.9.2
+# - winpthreads
+# - win-iconv-0.0.6
+
+ARCHITECTURES := i686 x86_64
+LIBXML_VERSION := 2-2.9.2
+WINPTHREADS_VERSION :=
+WINICONV_VERSION := -0.0.6
+
+LIBXML_SRCDIR := libxml$(LIBXML_VERSION)
+SOURCE_TARGETS += $(LIBXML_SRCDIR)
+$(LIBXML_SRCDIR):
+ wimapply --unix-data windeps.wim $(LIBXML_SRCDIR) $(LIBXML_SRCDIR)
+ cp $(LIBXML_SRCDIR)/COPYING COPYING.libxml2
+MAKE_CLEAN_FILES += $(LIBXML_SRCDIR) COPYING.libxml2
+
+WINPTHREADS_SRCDIR := winpthreads$(WINPTHREADS_VERSION)
+SOURCE_TARGETS += $(WINPTHREADS_SRCDIR)
+$(WINPTHREADS_SRCDIR):
+ wimapply --unix-data windeps.wim $(WINPTHREADS_SRCDIR) $(WINPTHREADS_SRCDIR)
+ cp $(WINPTHREADS_SRCDIR)/COPYING COPYING.winpthreads
+MAKE_CLEAN_FILES += $(WINPTHREADS_SRCDIR) COPYING.winpthreads
+
+WINICONV_SRCDIR := win-iconv$(WINICONV_VERSION)
+SOURCE_TARGETS += $(WINICONV_SRCDIR)
+$(WINICONV_SRCDIR):
+ wimapply --unix-data windeps.wim $(WINICONV_SRCDIR) $(WINICONV_SRCDIR)
+# win-iconv is public domain, so there's no license file.
+MAKE_CLEAN_FILES += $(WINICONV_SRCDIR)
+
+#
+# declare_libxml_target(arch)
+#
+define declare_libxml_target
+libxml_$(1):$(LIBXML_SRCDIR)
+ builddir=build_libxml_$(1); \
+ rm -rf $$$$builddir; \
+ mkdir $$$$builddir; \
+ cd $$$$builddir; \
+ ../$(LIBXML_SRCDIR)/configure \
+ --host=$(1)-w64-mingw32 \
+ --enable-static \
+ --disable-shared \
+ --prefix=$$$$PWD/../sysroot_$(1) \
+ CFLAGS=-Os \
+ --with-minimum \
+ --without-lzma \
+ --with-writer; \
+ $(MAKE) install; \
+ rm -f ../sysroot_$(1)/lib/libxml2.la;
+
+$(1)_BUILD_TARGETS += libxml_$(1)
+MAKE_CLEAN_FILES += build_libxml_$(1)
+endef
+
+#
+# declare_winpthreads_target(arch)
+#
+define declare_winpthreads_target
+winpthreads_$(1):$(WINPTHREADS_SRCDIR)
+ builddir=build_winpthreads_$(1); \
+ rm -rf $$$$builddir; \
+ cp -r $(WINPTHREADS_SRCDIR) $$$$builddir; \
+ cd $$$$builddir; \
+ ./configure \
+ --host=$(1)-w64-mingw32 \
+ --enable-static \
+ --disable-shared \
+ --prefix=$$$$PWD/../sysroot_$(1) \
+ CFLAGS=-O2; \
+ $(MAKE) install; \
+ sed -i 's/if defined DLL_EXPORT/if 0/' ../sysroot_$(1)/include/pthread.h;
+
+$(1)_BUILD_TARGETS += winpthreads_$(1)
+MAKE_CLEAN_FILES += build_winpthreads_$(1)
+endef
+
+#
+# declare_winiconv_target(arch)
+#
+define declare_winiconv_target
+winiconv_$(1):$(WINICONV_SRCDIR)
+ builddir=build_winiconv_$(1); \
+ rm -rf $$$$builddir; \
+ cp -r $(WINICONV_SRCDIR) $$$$builddir; \
+ cd $$$$builddir; \
+ $(MAKE) CC=$(1)-w64-mingw32-gcc \
+ AR=$(1)-w64-mingw32-ar \
+ RANLIB=$(1)-w64-mingw32-ranlib \
+ DLLTOOL=$(1)-w64-mingw32-dlltool \
+ CFLAGS=-O2 \
+ prefix=$$$$PWD/../sysroot_$(1) \
+ install; \
+ rm -f ../sysroot_$(1)/lib/libiconv.dll.a;
+
+$(1)_BUILD_TARGETS += winiconv_$(1)
+MAKE_CLEAN_FILES += build_winiconv_$(1)
+endef
+
+#
+# declare_arch_targets(arch)
+#
+define declare_arch_targets
+$(eval $(call declare_libxml_target,$(1)))
+$(eval $(call declare_winpthreads_target,$(1)))
+$(eval $(call declare_winiconv_target,$(1)))
+
+sysroot_$(1): $($(1)_BUILD_TARGETS)
+
+ALL_SYSROOTS += sysroot_$(1)
+MAKE_CLEAN_FILES += sysroot_$(1)
+endef
+
+$(foreach arch,$(ARCHITECTURES),$(eval $(call declare_arch_targets,$(arch))))
+
+all: $(ALL_SYSROOTS)
+
+clean:
+ rm -rf $(MAKE_CLEAN_FILES)
+
+.PHONY: all clean $(SOURCE_TARGETS)
+
+.DEFAULT_GOAL = all