Update tools/make-windows-release to support the CLANG32 and CLANG64
MSYS2 environments, and update ci.yml to test them in GitHub Actions.
Also try to support CLANGARM64, though I have no way to test that yet.
Finally, make a couple more tweaks to make-windows-release:
- Run the configure script unless it's explicitly requested to be
skipped, as the previous logic was too fragile.
- Default to no docs and no zip.
strategy:
matrix:
include:
strategy:
matrix:
include:
- - { sys: mingw32, env: i686 }
- - { sys: mingw64, env: x86_64 }
+ - { msystem: mingw32, cc_pkg: mingw-w64-i686-gcc }
+ - { msystem: mingw64, cc_pkg: mingw-w64-x86_64-gcc }
+ - { msystem: clang32, cc_pkg: mingw-w64-clang-i686-clang }
+ - { msystem: clang64, cc_pkg: mingw-w64-clang-x86_64-clang }
defaults:
run:
shell: msys2 {0}
defaults:
run:
shell: msys2 {0}
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
- msystem: ${{matrix.sys}}
+ msystem: ${{matrix.msystem}}
update: true
install: >
autoconf
update: true
install: >
autoconf
- mingw-w64-${{matrix.env}}-gcc
- - run: CFLAGS="$DEF_CFLAGS" ./tools/make-windows-release --no-docs --no-zip
+ - run: CFLAGS="$DEF_CFLAGS" ./tools/make-windows-release
fuzz-with-libFuzzer:
name: Fuzz with libFuzzer (${{matrix.target}} ${{matrix.sanitizer}})
fuzz-with-libFuzzer:
name: Fuzz with libFuzzer (${{matrix.target}} ${{matrix.sanitizer}})
Improved the performance of the Windows binaries on CPUs that have SHA-1
instructions.
Improved the performance of the Windows binaries on CPUs that have SHA-1
instructions.
- Removed support for Windows XP.
-
Fixed a bug in 'wimsplit' where it didn't accept part sizes of 4 GiB or
larger on Windows and on 32-bit platforms.
Fixed a bug in 'wimsplit' where it didn't accept part sizes of 4 GiB or
larger on Windows and on 32-bit platforms.
+ The README.WINDOWS file and the tools/make-windows-release script have
+ been improved to make it easier to build wimlib on Windows. The
+ instructions now use MSYS2 (instead of Cygwin as they did before), and
+ both gcc and clang are supported.
+
+ Removed support for Windows XP.
+
Version 1.13.6:
wimsplit no longer prints a success message on failure.
Version 1.13.6:
wimsplit no longer prints a success message on failure.
First, install MSYS2 by running the installer from https://www.msys2.org/.
First, install MSYS2 by running the installer from https://www.msys2.org/.
-Then, open an MSYS2 shell and run the following command:
+Then, open any MSYS2 shell and run the following command:
-After that, open an MSYS2 shell again and run the following commands:
+After that, open any MSYS2 shell again and run the following commands:
pacman -Syu --noconfirm git
git clone git://wimlib.net/wimlib
pacman -Syu --noconfirm git
git clone git://wimlib.net/wimlib
repository; however, the make-windows-release script will not be available in
that case and you will need to handle more things yourself.
repository; however, the make-windows-release script will not be available in
that case and you will need to handle more things yourself.
-To build 64-bit (x86_64) binaries, close the MSYS2 shell you have open, then
-open "MSYS2 MinGW 64-bit" from the Start menu and run the following commands:
+Finally, to actually do a build, close the MSYS2 shell you have open, then open
+one of the following from the Start menu:
- cd wimlib
- tools/make-windows-release --install-msys2-packages --no-docs --no-zip
+ * "MSYS2 MINGW64" - for x86_64 binaries, built with gcc
+ * "MSYS2 CLANG64" - for x86_64 binaries, built with clang
+ * "MSYS2 MINGW32" - for i686 binaries, built with gcc
+ * "MSYS2 CLANG32" - for i686 binaries, built with clang
+ * "MSYS2 CLANGARM64" - for ARM64 binaries (EXPERIMENTAL, needs Windows ARM64)
-The output will be in a folder named like "wimlib-1.14.0-windows-x86_64-bin".
+(If unsure, use "MSYS2 MINGW64".) Then run the following commands:
-For 32-bit (i686) binaries, do the same but use "MSYS2 MinGW 32-bit" instead.
+ cd wimlib
+ tools/make-windows-release --install-msys2-packages
+
+The script will automatically download and install the MSYS2 packages needed to
+build wimlib in the chosen MSYS2 environment, then build wimlib. The output
+will be in a folder named similarly to "wimlib-1.14.0-windows-x86_64-bin". Note
+that your "home" folder within MSYS2 is C:\msys64\home\%USERNAME% by default.
+Therefore, the full path to the output folder will be similar to
+C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.0-windows-x86_64-bin.
libdeflate-gzip -12 $tarfile
for arch in i686 x86_64; do
libdeflate-gzip -12 $tarfile
for arch in i686 x86_64; do
- ./tools/make-windows-release --arch=$arch
+ ./tools/make-windows-release --arch=$arch --include-docs --zip
case "$MSYSTEM" in
MINGW32)
ARCH=i686
case "$MSYSTEM" in
MINGW32)
ARCH=i686
+ CC_PKG=mingw-w64-i686-gcc
+ CC_PKG=mingw-w64-x86_64-gcc
+ ;;
+ CLANG32)
+ ARCH=i686
+ CC_PKG=mingw-w64-clang-i686-clang
+ ;;
+ CLANG64)
+ ARCH=x86_64
+ CC_PKG=mingw-w64-clang-x86_64-clang
+ ;;
+ CLANGARM64)
+ ARCH=aarch64
+ CC_PKG=mingw-w64-clang-aarch64-clang
- echo 1>&2 "Unsupported MSYS2 environment: $MSYSTEM"
- echo 1>&2 "In MSYS2, you must use the MINGW32 or MINGW64 environment."
+ echo 1>&2 "Unsupported MSYS2 environment: $MSYSTEM. This script supports"
+ echo 1>&2 "MINGW32, MINGW64, CLANG32, CLANG64, and CLANGARM64."
echo 1>&2 "See https://www.msys2.org/docs/environments/"
exit 1
esac
fi
echo 1>&2 "See https://www.msys2.org/docs/environments/"
exit 1
esac
fi
INSTALL_MSYS2_PACKAGES=false
INSTALL_MSYS2_PACKAGES=false
-BUILD_DOCS=true
-BUILD_ZIP=true
+SKIP_CONFIGURE=false
+ZIP=false
longopts="help"
longopts+=",arch:"
longopts="help"
longopts+=",arch:"
+longopts+=",include-docs"
longopts+=",install-msys2-packages"
longopts+=",install-msys2-packages"
-longopts+=",no-docs"
-longopts+=",no-zip"
+longopts+=",skip-configure"
+longopts+=",zip"
usage()
{
cat << EOF
Usage: $SCRIPTNAME [OPTION]... [EXTRA_CONFIGURE_ARG]...
Options:
usage()
{
cat << EOF
Usage: $SCRIPTNAME [OPTION]... [EXTRA_CONFIGURE_ARG]...
Options:
- --arch=ARCH Specify the architecture. The default is taken
- from MSYSTEM if available, otherwise is x86_64.
- --install-msys2-packages Install prerequisite MSYS2 packages
- --no-docs Don't build and install PDF manual pages
- --no-zip Don't create the final zip file
+ --arch=ARCH Specify the CPU architecture. This is unnecessary
+ when using MSYS2.
+
+ --include-docs Build and install the PDF manual pages.
+
+ --install-msys2-packages Install the MSYS2 packages needed to build wimlib.
+ You can omit this if you have already done this for
+ the same MSYS2 environment.
+
+ --skip-configure Skip running the configure script again. You can
+ use this to save time in incremental builds if you
+ are sure you didn't change any options.
+
+ --zip Zip the output files up into a zip file.
+ --include-docs)
+ INCLUDE_DOCS=true
+ ;;
--install-msys2-packages)
if [ -z "$MSYSTEM" ]; then
echo 1>&2 "--install-msys2-packages is not allowed outside MSYS2."
--install-msys2-packages)
if [ -z "$MSYSTEM" ]; then
echo 1>&2 "--install-msys2-packages is not allowed outside MSYS2."
fi
INSTALL_MSYS2_PACKAGES=true
;;
fi
INSTALL_MSYS2_PACKAGES=true
;;
- --no-docs)
- BUILD_DOCS=false
+ --skip-configure)
+ SKIP_CONFIGURE=true
- --no-zip)
- BUILD_ZIP=false
EXTRA_CONFIGURE_ARGS=("$@")
case "$ARCH" in
EXTRA_CONFIGURE_ARGS=("$@")
case "$ARCH" in
;;
*)
echo 1>&2 "Unknown ARCH: $ARCH. Please specify a supported architecture with --arch"
;;
*)
echo 1>&2 "Unknown ARCH: $ARCH. Please specify a supported architecture with --arch"
# Install the required MSYS2 packages if requested.
if $INSTALL_MSYS2_PACKAGES; then
# Install the required MSYS2 packages if requested.
if $INSTALL_MSYS2_PACKAGES; then
- echo "Installing the MSYS2 packages required to build wimlib ($MSYSTEM)..."
+ echo "Installing the MSYS2 $MSYSTEM packages needed to build wimlib..."
pacman -Syu --noconfirm --needed \
autoconf \
automake \
git \
libtool \
make \
pacman -Syu --noconfirm --needed \
autoconf \
automake \
git \
libtool \
make \
- "mingw-w64-${ARCH}-gcc" \
- echo "Done installing the MSYS2 packages required to build wimlib ($MSYSTEM)."
+ echo "Done installing the MSYS2 $MSYSTEM packages needed to build wimlib."
fi
# Bootstrap the repository if not already done.
fi
# Bootstrap the repository if not already done.
-# Configure wimlib for the given $ARCH if not already done.
-if ! [ -e config.log ] ||
- ! grep -q "./configure --host=${ARCH}-w64-mingw32" config.log || \
- ! grep -q "configure: exit 0" config.log || \
- [ ${#EXTRA_CONFIGURE_ARGS[@]} -gt 0 ]
-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 wimlib.
+if ! [ -e config.log ] || ! $SKIP_CONFIGURE; then
echo "Configuring wimlib..."
echo "Configuring wimlib..."
- ./configure --host="${ARCH}-w64-mingw32" --disable-static \
- CC="${ARCH}-w64-mingw32-gcc -static-libgcc" \
- "${EXTRA_CONFIGURE_ARGS[@]}"
+ configure_args=("--host=${ARCH}-w64-mingw32")
+ configure_args+=("--disable-static")
+ # -static-libgcc is needed with gcc. It should go in the CFLAGS, but
+ # libtool strips it, so it must go directly in CC instead. See
+ # http://www.gnu.org/software/libtool/manual/libtool.html#Stripped-link-flags
+ if "${ARCH}-w64-mingw32-cc" --version | grep -q '(GCC)'; then
+ configure_args+=("CC=${ARCH}-w64-mingw32-cc -static-libgcc")
+ fi
+ configure_args+=("${EXTRA_CONFIGURE_ARGS[@]}")
+ ./configure "${configure_args[@]}"
MANPATH="./doc" man -t "$cmd" | ps2pdf - "$pdf"
}
MANPATH="./doc" man -t "$cmd" | ps2pdf - "$pdf"
}
echo "Installing manual pages..."
mkdir "$DESTDIR"/doc
for cmd in "${IMAGEX_CMDS[@]}"; do
echo "Installing manual pages..."
mkdir "$DESTDIR"/doc
for cmd in "${IMAGEX_CMDS[@]}"; do
cp .libs/libwim.dll.a "$DESTDIR"/devel/libwim.lib
cp include/wimlib.h "$DESTDIR"/devel/
cp .libs/libwim.dll.a "$DESTDIR"/devel/libwim.lib
cp include/wimlib.h "$DESTDIR"/devel/
echo "Creating zip file..."
cd "$DESTDIR"
7z -mx9 a ../"$ZIPFILE" . > /dev/null
echo "Creating zip file..."
cd "$DESTDIR"
7z -mx9 a ../"$ZIPFILE" . > /dev/null