aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <digit@google.com>2015-07-16 10:56:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-07-16 10:56:59 +0000
commit2bbffc5021814475d142714a5d960cf935570638 (patch)
tree0c7720bdf7a1ee0aee01dcaa394b69e2a4a76c0f
parenta04c81f2396d6fc2b93c8b77acd8985923959c22 (diff)
parent9c54d8784ff8f094e1566c5982bed902d0923b4a (diff)
downloadqemu-2bbffc5021814475d142714a5d960cf935570638.tar.gz
Merge "Added support for building e2fsprogs in Windows" into studio-1.4-dev
-rwxr-xr-xandroid-rebuild.sh2
-rw-r--r--android/dependencies/PACKAGES.TXT11
-rwxr-xr-xandroid/scripts/build-e2fsprogs.sh93
3 files changed, 78 insertions, 28 deletions
diff --git a/android-rebuild.sh b/android-rebuild.sh
index 7347915f42..8a3b36820d 100755
--- a/android-rebuild.sh
+++ b/android-rebuild.sh
@@ -282,8 +282,6 @@ if true; then
continue
fi
run cp -a "$E2FS_SRCDIR"/sbin/* "$E2FS_DSTDIR" || "Could not copy e2fsprogs binaries!"
- # TODO: For Windows, probably copy the Cygwin DLL from somewhere
- # and place it into $E2FS_DSTDIR
done
fi # Again, intentional, will disappear in a future patch.
fi
diff --git a/android/dependencies/PACKAGES.TXT b/android/dependencies/PACKAGES.TXT
index a30b6b2e17..8bef2bd76c 100644
--- a/android/dependencies/PACKAGES.TXT
+++ b/android/dependencies/PACKAGES.TXT
@@ -21,3 +21,14 @@ SHA1=53ec316946bce7b63327f73c40ac9be1f50e31b2 URL=ftp://ftp.freedesktop.org/p
# e2fsprogs
SHA1=2d008b9902a169bd6767058ba98fce334328c763 URL=https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.13/e2fsprogs-1.42.13.tar.xz PATCHES=e2fsprogs-1.42.13-patches.tar.xz
+# Windows distributions of e2fsprogs
+SHA1=5f8d9badb74cd2979ea163cf14e5ceb31f0a4923 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/e2fsprogs/e2fsprogs-1.42.12-1.tar.xz BASENAME=e2fsprogs-windows
+SHA1=c90c00a5818aafdd4c3d55c7eb37d268d86154c9 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/cygwin/cygwin-2.0.4-1.tar.xz BASENAME=cygwin
+SHA1=951446cb21cf695bbdb7d014ae63388ec33977a2 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/e2fsprogs/libcom_err2/libcom_err2-1.42.12-2.tar.xz BASENAME=libcom_err2
+SHA1=907dfb79bcc50c00da9f2863563893dab640d870 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/e2fsprogs/libe2p2/libe2p2-1.42.12-2.tar.xz BASENAME=libe2p2
+SHA1=8b855cbd3b499d7d33bcc1c68a1a86c9546c80bf URL=http://mirrors.sonic.net/cygwin/x86/release/util-linux/libblkid1/libblkid1-2.25.2-1.tar.xz BASENAME=libblkid1
+SHA1=8004e216a3745bc564e07542ee71d959f707815b URL=http://mirrors.sonic.net/cygwin/x86/release/util-linux/libuuid1/libuuid1-2.25.2-2.tar.xz BASENAME=libuuid1
+SHA1=73ab0a008adf2b6a87fed598db1a9df5d3179674 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/e2fsprogs/libext2fs2/libext2fs2-1.42.12-2.tar.xz BASENAME=libext2fs2
+SHA1=b695a0a5c8ebac0763569670a875da2531994d66 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/gcc/libgcc1/libgcc1-4.9.3-1.tar.xz BASENAME=libgcc1
+SHA1=89bcd3a153152362e1931bce0af8d1cb98696287 URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/libiconv/libiconv2/libiconv2-1.14-3.tar.xz BASENAME=libiconv2
+SHA1=876f10834f6569ae94772ba7ecf430d803db26eb URL=https://mirrors.kernel.org/sourceware/cygwin/x86/release/gettext/libintl8/libintl8-0.19.4-1.tar.xz BASENAME=libintl8 \ No newline at end of file
diff --git a/android/scripts/build-e2fsprogs.sh b/android/scripts/build-e2fsprogs.sh
index d045ea1618..2d978941a5 100755
--- a/android/scripts/build-e2fsprogs.sh
+++ b/android/scripts/build-e2fsprogs.sh
@@ -23,11 +23,15 @@ shell_import utils/option_parser.shi
shell_import utils/package_list_parser.shi
shell_import utils/package_builder.shi
-# This script cannot build Windows binaries on Linux, so limit the default
-# host systems list to linux ones.
+# This script cannot build windows-x86_64 binaries - only 32-bit support
+# is achievable as the 64-bit distribution of e2fsprogs requires a newer
+# version of a dll dependency than is available. The available dependencies
+# (version 1.42.7) do not export the ext2fs_close_free function that was
+# added to a later version of e2fsprogs (at version 1.42.11), and no early
+# enough executable version of e2fsprogs is readily available from Cygwin.
case $(get_build_os) in
linux)
- DEFAULT_HOST_SYSTEMS="linux-x86,linux-x86_64"
+ DEFAULT_HOST_SYSTEMS="linux-x86,linux-x86_64,windows-x86"
;;
esac
@@ -86,6 +90,41 @@ unpack_package_source () {
fi
}
+# For windows we have already downloaded the executables
+# so just uncompress them to the correct directory in
+# preparation for android-rebuild.sh.
+# $1: Destination directory of dependencies
+WINDOWS_DEPENDENCIES="e2fsprogs-windows cygwin libcom_err2\
+ libe2p2 libblkid1 libuuid1 libext2fs2 libgcc1 libiconv2 libintl8"
+unpack_windows_dependencies () {
+ local DEP DSTDIR
+ DSTDIR=$1
+ for DEP in $WINDOWS_DEPENDENCIES; do
+ run mkdir -p "$BUILD_SRC_DIR/$(package_list_get_unpack_src_dir $DEP)"
+ unpack_package_source "$DEP"
+ done
+
+ copy_directory_files \
+ "$BUILD_SRC_DIR/usr/bin" \
+ "$DSTDIR/sbin" \
+ cygblkid-1.dll \
+ cygcom_err-2.dll \
+ cyge2p-2.dll \
+ cygext2fs-2.dll \
+ cyggcc_s-1.dll \
+ cygiconv-2.dll \
+ cygintl-8.dll \
+ cyguuid-1.dll \
+ cygwin1.dll
+
+ copy_directory_files \
+ "$BUILD_SRC_DIR/usr" \
+ "$DSTDIR" \
+ sbin/e2fsck.exe \
+ sbin/resize2fs.exe \
+ sbin/tune2fs.exe
+}
+
# $1: Package basename (e.g. 'libpthread-stubs-0.3')
# $2+: Extra configuration options.
build_package () {
@@ -100,7 +139,7 @@ build_package () {
case $SYSTEM in
darwin*)
# Required for proper build on Darwin!
- build_disable_verbose_install
+ builder_disable_verbose_install
;;
esac
builder_build_autotools_package \
@@ -166,16 +205,7 @@ fi
for SYSTEM in $LOCAL_HOST_SYSTEMS; do
(
- case $SYSTEM in
- windows*)
- echo "ERROR: Sorry, cannot build Windows binaries with this script!" >&2
- echo "Please use Cygwin on Windows to build e2fsprogs instead!"
- exit 1
- ;;
- *)
- builder_prepare_for_host_no_binprefix "$SYSTEM" "$AOSP_DIR"
- ;;
- esac
+ builder_prepare_for_host_no_binprefix "$SYSTEM" "$AOSP_DIR"
dump "$(builder_text) Building e2fsprogs"
@@ -188,18 +218,29 @@ for SYSTEM in $LOCAL_HOST_SYSTEMS; do
--disable-testio-debug \
--disable-rpath \
- build_package e2fsprogs $CONFIGURE_FLAGS
-
- # Copy binaries necessary for the build itself as well as static
- # libraries.
- copy_directory_files \
- "$(builder_install_prefix)" \
- "$INSTALL_DIR/$SYSTEM" \
- sbin/e2fsck \
- sbin/fsck.ext4 \
- sbin/mkfs.ext4 \
- sbin/resize2fs \
- sbin/tune2fs \
+ case $SYSTEM in
+ windows-x86)
+ unpack_windows_dependencies "$INSTALL_DIR/$SYSTEM"
+ ;;
+ windows-x86_64)
+ dump "WARNING: windows-x86_64 isn't supported with this script!"
+ ;;
+ *)
+ build_package e2fsprogs $CONFIGURE_FLAGS
+
+ # Copy binaries necessary for the build itself as well as static
+ # libraries.
+ copy_directory_files \
+ "$(builder_install_prefix)" \
+ "$INSTALL_DIR/$SYSTEM" \
+ sbin/e2fsck \
+ sbin/fsck.ext4 \
+ sbin/mkfs.ext4 \
+ sbin/resize2fs \
+ sbin/tune2fs \
+ ;;
+ esac
+
) || panic "[$SYSTEM] Could not build e2fsprogs!"