1.4: update version to 1.4.0+svn.
-------- diffstat follows --------
/branches/1.4/.version | 2 1 1 0 +-
1 file changed, 1 insertion(+), 1 deletion(-)
3 VERSION=$( cat .version )
6 # All absolutely required tools, one per line to ease diff.
7 # See function 'has_or_abort', below, for syntax
8 # - Hopefully, if gcc is present, then all associated tools will be
9 # - makeinfo for building docs, even if discarded later on
10 # - others obvious... :-/
12 # Format of a pattern to check for, one per line:
13 # pattern := var_name : tool_pattern OR tool_pattern
14 # tool_pattern := tool_test OR tool_pattern || tool_test
15 # tool_test := tool=regexp OR tool
16 # tool := basename of the tool OR absolute pathname to the tool
17 # regexp := valid grep(1) extended regular expression, $( tool --version)
18 # will be matched against this regexp.
20 # In case a pattern list is given (eg foo || bar || buz), then tests are performed
21 # from left to right, stopping at the first matching test (like the shell
22 # would parse 'foo || bar || buz' ).
25 # bash:bash=^GNU bash, version 3\.
26 # - if ${bash} is set and non-null, does nothing
27 # - else ensures that bash exists in the PATH, and that $( bash --version )
28 # matches the regexp '^GNU bash, version 3\.'
29 # - if so, then sets bash="$( which bash )"
30 # autoconf=(GNU Autoconf) || autoconf2.50
31 # - does not look at an existing variable
33 # - 'autoconf' is to be found in the PATH, and that $( autoconf --version )
34 # matches the regexp '(GNU Autoconf)' (which btw is the signature of
37 # - 'autoconf2.50' is to be found in the PATH
40 bash:bash=^GNU bash, version [34]\.
43 install:install=GNU coreutils
50 automake=\(GNU automake\) (1\.[[:digit:]]{2,}\.|[2-9][[:digit:]]*\.)
51 libtool=\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)
59 PREFIX_DEFAULT=/usr/local
69 # Simply print the error message, and exit. Obvious, he?
75 # A small function to test for existence of various tools
76 # Usage: has_or_abort test_pattern (see top of file, TOOLS_TO_CHECK, for
77 # complete pattern format)
85 var_name="$( echo "${1}" |"${sed}" -r -e 's/^(([^=:]+):.+|[^:=]+=.+|[^:=]+)$/\2/;' )"
86 field="${var_name:+2}"
88 tool_pattern="$( echo "${1}" |cut -d : -f ${field}- |"${sed}" -r -e 's/ *\|\| */\n/g;' )"
94 for item in ${tool_pattern}; do
105 printf "Checking for '${tool}'... "
106 if [ -n "${var_name}" ]; then
107 eval var_value='"${'"${var_name}"'}"'
108 if [ -n "${var_value}" ]; then
109 echo "${var_value} (cached)"
113 where=$( which "${tool}" 2>/dev/null )
114 if [ -z "${where}" ]; then
118 elif [ -n "${regexp}" ]; then
119 tool_version=$( ${tool} --version 2>&1 )
120 str=$( echo "${tool_version}" |"${grep}" -E "${regexp}" |head -n 1 )
121 if [ -z "${str}" ]; then
129 if [ -z "${where}" ]; then
130 for item in ${tool_pattern}; do
140 printf " could not find '${tool}'"
141 [ -n "${regexp}" ] && printf " matching regexp '${regexp}'"
144 echo "Either you are missing entirely the needed tool,"
145 echo "or the version you have is too old."
146 if [ -n "${var_name}" ]; then
147 echo "You can give the path to this tool using: --with-${var_name}=PATH"
149 # FORCE can be set in the environment
150 [ -z "${FORCE}" ] && do_error "Bailing out..."
153 if [ -n "${var_name}" ]; then
154 eval ${var_name}='"'"${where}"'"'
161 # Given an option string and the following argument,
162 # echoes the value of the option.
163 # If --var=val => echoes val and returns 0, meaning second arg was not consumed
164 # If --var val => echoes val and returns non null, meaning second arg was used
178 # The set_xxx functions will set the corresponding configuration variable
179 # They return 0 if second arg was not consumed, and non-zero if it was consumed.
181 PREFIX="$( get_optval "$1" "$2" )"
185 BINDIR="$( get_optval "$1" "$2" )"
189 LIBDIR="$( get_optval "$1" "$2" )"
193 DOCDIR="$( get_optval "$1" "$2" )"
197 MANDIR="$( get_optval "$1" "$2" )"
200 local var_name="${1%%=*}"
201 var_name="${var_name#--with-}"
202 eval ${var_name}="\$( get_optval "$1" "$2" )"
207 \`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems.
209 USAGE: ./configure [OPTION]...
211 Defaults for the options are specified in brackets.
214 -h, --help display this help and exit
216 Installation directories:
217 --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
218 --local don't install, and use current directory
220 By default, \`make install' will install all the files in
221 \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
222 an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
223 for instance \`--prefix=\${HOME}'.
225 For better control, use the options below.
227 Fine tuning of the installation directories:
228 --bindir=DIR user executables [PREFIX/bin]
229 --libdir=DIR object code libraries [PREFIX/lib]
230 --docdir=DIR info documentation [PREFIX/share/doc]
231 --mandir=DIR man documentation [PREFIX/share/man]
234 --with-install=PATH Specify the full PATH to GNU install
235 --with-make=PATH Specify the full PATH to GNU make
236 --with-grep=PATH Specify the full PATH to GNU grep
237 --with-sed=PATH Specify the full PATH to GNU sed
238 --with-bash=PATH Specify the full PATH to bash >= 3.0
242 #---------------------------------------------------------------------
245 while [ $# -ne 0 ]; do
247 --local) LOCAL_set="y"; shift;;
248 --prefix*) set_prefix "$1" "$2" && shift || shift 2;;
249 --bindir*) set_bindir "$1" "$2" && shift || shift 2;;
250 --libdir*) set_libdir "$1" "$2" && shift || shift 2;;
251 --docdir*) set_docdir "$1" "$2" && shift || shift 2;;
252 --mandir*) set_mandir "$1" "$2" && shift || shift 2;;
253 --with-*) set_tool "$1" "$2" && shift || shift 2;;
254 --help|-h) do_help; exit 0;;
255 *) echo "Unrecognised option: '${1}'"; do_help; exit 1;;
260 [ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
262 # Special case when installing locally
263 if [ "${LOCAL_set}" = "y" ]; then
264 set_prefix "" "$( pwd )"
265 set_bindir "" "$( pwd )"
266 set_libdir "" "$( pwd )"
267 set_docdir "" "$( pwd )/docs"
268 set_mandir "" "$( pwd )/docs"
271 #---------------------------------------------------------------------
272 # Some sanity checks, now
274 # We check for grep and sed manually, because they are used in has_or_abort
275 printf "Checking for 'grep'... "
276 if [ -n "${grep}" ]; then
277 echo "${grep} (cached)"
279 grep="$( which grep 2>/dev/null )"
280 if [ -z "${grep}" ]; then
284 printf "Checking whether '${grep}' supports -E... "
285 if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
293 if [ -z "${grep}" ]; then
294 echo "Either you are missing entirely the needed tool,"
295 echo "or the version you have is too old."
296 echo "You can give the path to this tool using: --with-grep=PATH"
297 do_error "Bailing out..."
300 printf "Checking for 'sed'... "
301 if [ -n "${sed}" ]; then
302 echo "${sed} (cached)"
304 sed="$( which sed 2>/dev/null )"
305 if [ -z "${sed}" ]; then
309 printf "Checking whether '${sed}' supports -i and -e... "
310 touch .ct-ng.sed.test
311 if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
317 rm -f .ct-ng.sed.test
320 if [ -z "${sed}" ]; then
321 echo "Either you are missing entirely the needed tool,"
322 echo "or the version you have is too old."
323 echo "You can give the path to this tool using: --with-sed=PATH"
324 do_error "Bailing out..."
327 # Check the existence of absolutely required tools
331 for tool in ${TOOLS_TO_CHECK}; do
332 has_or_abort "${tool}"
336 #---------------------------------------------------------------------
337 # Compute the version string
339 # If this version is a svn snapshot, try to get the revision number
340 # If we can't get the revision number, use date
341 printf "Computing version string... "
344 REVISION="$( LC_ALL=C svnversion )"
345 case "${REVISION}" in
347 VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
349 URL="$( LC_ALL=C svn info 2>/dev/null \
353 ROOT="$( LC_ALL=C svn info 2>/dev/null \
354 |"${grep}" '^Repository Root: ' \
357 VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
360 # Arrange to have no / in the directory name, no need to create an
361 # arbitrarily deep directory structure
362 VERSION="$( echo "${VERSION}" |"${sed}" -r -e 's|/+|_|g;' )"
367 #---------------------------------------------------------------------
368 # Compute and check install paths
370 # Now we have the version string, we can build up the paths
371 [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
372 [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}"
373 [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
374 [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
376 # Check that install PATHs are absolute
377 for p in BIN LIB DOC MAN; do
379 eval v='"${'"${var}"'}"'
382 *) do_error "'${var}' is not an absolute path: '${v}'"
386 #---------------------------------------------------------------------
389 printf "Building up Makefile... "
392 $( printf "${TOOLS_TO_CHECK}" \
393 |"${sed}" -r -e 's/^(([^=:]+):.+|[^:=]+=.+|[^:=]+)$/\2/;'
395 var_sed="$( for var_name in ${var_list}; do
396 eval echo 's,@@${var_name}@@,${'"${var_name}"'},g'
399 "${sed}" -r -e "s,@@BINDIR@@,${BINDIR},g
400 s,@@LIBDIR@@,${LIBDIR},g
401 s,@@DOCDIR@@,${DOCDIR},g
402 s,@@MANDIR@@,${MANDIR},g
403 s,@@VERSION@@,${VERSION},g
406 s,@@LOCAL@@,${LOCAL_set},g" Makefile.in >Makefile
411 crosstool-NG configured as follows:
421 if [ "${LOCAL_set}" != "y" ]; then
422 printf " make install\n"