From 745aac3f8edf4e78d89be49412bb24fc45193207 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Wed, 4 May 2011 20:07:32 +0400 Subject: [PATCH] src/rt/release.sh: Teach it to build bash Bash builds fine with standard configure/make in our environment. The only glitch is that msys sources must be cloned with core.autocrlf=false, or else, as documented in mingw wiki[1] there will be build failure in builtins/ I assume core.autocrlf is set to false in all msysgit developers setup, because as described in dd6ab17a (Set default core.autocrlf=true): """ Note, msysgit developers should override this changed default by explicitly setting core.autocrlf=false in msysgit and msysgit/git. Msysgit is not (yet) a real cross-platform project but more like a Unix project. """ If relying on this tweak is not ok, I suggest to put core.autocrlf=false as default in etc/gitconfig, and maybe tweak it to true when preparing installer. Configure options were taken from msys-build-bash in bash-3.1.17-4-msys-1.0.16-src.tar.lzma . [1] http://oldwiki.mingw.org/index.php/Build%20bash Signed-off-by: Kirill Smelkov --- src/rt/release.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/rt/release.sh b/src/rt/release.sh index df722c8c..2b86fbb7 100644 --- a/src/rt/release.sh +++ b/src/rt/release.sh @@ -12,11 +12,11 @@ debug= # see what to build case "$1" in - msys) + msys|bash) target=$1 ;; *) - die "$0 msys [options]" + die "$0 (msys|bash) [options]" ;; esac @@ -81,4 +81,34 @@ release_msys() { /share/msysGit/post-checkout-hook HEAD^ HEAD 1 } +# build bash.exe +release_bash() { + (export MSYSTEM=MSYS && + export PATH=/bin:$PATH && + cd packages/bash && + (test -d bld || mkdir bld) && + cd bld && + BASH=bash.exe && + (test -f Makefile && test -z "$debug_clean" || + ../3.1/configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-nls \ + --disable-rpath \ + --without-curses) && + (test -z "$debug" || perl -i.bak -pe 's/-O2//g' $(find -name Makefile)) && + (test -z "$debug_clean" || make clean) && + make && + test -f $BASH && + (test ! -z "$debug" || strip $BASH) && + cp $BASH /bin/new-bash.exe) && + cd / && + hash=$(git hash-object -w bin/new-bash.exe) && + git update-index --cacheinfo 100755 $hash bin/bash.exe && + git update-index --cacheinfo 100755 $hash bin/sh.exe && + git commit -s -m "Updated bash.exe to $release" && + /share/msysGit/post-checkout-hook HEAD^ HEAD 1 +} + release_$target -- 2.11.4.GIT