[PATCH] Configure outside of source tree
Kyle Grieb
grieb.kyle@gmail.com
Thu Mar 17 03:33:00 GMT 2011
This will allow 'configure' to be called outside of the sources tree.
Example: /tmp/foo/crosstool-ng/configure
--
Kyle Grieb
-------------- next part --------------
# HG changeset patch
# User Kyle Grieb <Grieb.Kyle@Gmail.com>
# Date 1300332448 21600
# Node ID f449fb72f867f7af47e79cc20944db9b32a47c45
# Parent 805e9f2a06fafd071f261cb4a70aecb8fb90aa65
Configure outside source tree.
diff -r 805e9f2a06fa -r f449fb72f867 configure
--- a/configure Mon Mar 14 22:16:01 2011 +0100
+++ b/configure Wed Mar 16 21:27:28 2011 -0600
@@ -1,8 +1,9 @@
#!/bin/sh
myname="${0##*/}"
+mypath="${0%/*}"
-VERSION=$( cat .version )
+VERSION=$( cat "${mypath}/.version" )
DATE=$( date +%Y%m%d )
PREFIX_DEFAULT=/usr/local
@@ -391,12 +392,12 @@
printf "Computing version string... "
case "${VERSION}" in
*+hg|hg)
- REVISION="$( hg id -n 2>/dev/null || true )"
+ REVISION="$( hg --cwd "$mypath" id -n 2>/dev/null || true )"
case "${REVISION}" in
"")
VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
*)
- VERSION="${VERSION}_$( hg id -b )@${REVISION%%+}_$( hg id -i )"
+ VERSION="${VERSION}_$( hg --cwd "$mypath" id -b )@${REVISION%%+}_$( hg --cwd "$mypath" id -i )"
;;
esac
# Arrange to have no / in the directory name, no need to create an
@@ -447,7 +448,7 @@
s,@@VERSION@@,${VERSION},g
s,@@DATE@@,${DATE},g
${var_sed}
- s,@@LOCAL@@,${LOCAL_set},g" Makefile.in >Makefile
+ s,@@LOCAL@@,${LOCAL_set},g" "${mypath}/Makefile.in" >"${mypath}/Makefile"
echo "done"
cat <<__EOF__
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list