Update this sample to use binutils-2.19.
/trunk/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 9 5 4 0 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
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 # - awk must be GNU awk
10 # - makeinfo for building docs, even if discarded later on
11 # - others obvious... :-/
13 # Format of a pattern to check for, one per line:
14 # pattern := tool_test OR pattern|tool_test
15 # tool_test := tool/regexp
16 # tool := name of the tool OR absolute pathname to the tool
17 # regexp := valid grep(1) extended regular expression OR empty
19 # In case a pattern list is given (eg foo|bar|buz), then tests are performed
20 # from left to right, stopping at the first matching test (like the shell
21 # would parse 'foo || bar || buz' ).
24 # /bin/bash/^GNU bash, version 3\.
25 # will ensure that /bin/bash exists, and that $(/bin/bash --version)
26 # matches the regexp '^GNU bash, version 3\.'
27 # autoconf/(GNU Autoconf)|autoconf2.50/
29 # - 'autoconf' is to be found in the PATH, and that $(autoconf
30 # --version) matches the regexp '(GNU Autoconf)' (which btw is
31 # the signature of autoconf >= 2.50),
33 # - 'autoconf2.50' is to be found in the PATH
36 /bin/bash/^GNU bash, version 3\.
52 PREFIX_DEFAULT=/usr/local
65 # Simply print the error message, and exit. Obvious, he?
71 # A small function to test for existence of various tools
72 # Usage: has_or_abort test_pattern (see top of file, TOOLS_TO_CHECK, for
73 # complete pattern format)
75 { IFS="|"; for item in ${1}; do
78 printf "Checking for '${tool}'... "
79 where=$(which "${tool}" 2>/dev/null || true)
80 if [ -z "${where}" ]; then
85 if [ -n "${regexp}" ]; then
86 tool_version=$(${tool} --version 2>&1)
87 str=$(echo "${tool_version}" |grep -E "${regexp}" |head -n 1)
88 if [ -z "${str}" ]; then
89 echo "wrong version string: expecting regexp '${regexp}'"
99 [ ${FORCE} -eq 0 ] && do_error "Bailing out..."
103 # Given an option string and the following argument,
104 # echoes the value of the option.
105 # If --var=val => echoes val and returns 0, meaning second arg was not consumed
106 # If --var val => echoes val and returns non null, meaning second arg was used
111 echo "${1}" |cut -d '=' -f 2-
122 # The set_xxx functions will set the corresponding configuration variable
123 # They return 0 if second arg was not consumed, and non-zero if it was consumed.
125 PREFIX=$(get_optval "$1" "$2")
130 BINDIR=$(get_optval "$1" "$2")
135 LIBDIR=$(get_optval "$1" "$2")
140 DOCDIR=$(get_optval "$1" "$2")
145 MANDIR=$(get_optval "$1" "$2")
149 # The set_contrib function is different in that it will work like the others,
150 # except in two cases:
151 # If all => replaces all with the list of all available contribs
152 # If list => just echoes the list of all available contribs, and instructs
153 # caller to quit immediately by setting do_quit to non null.
154 # (can't use the return code, see above).
156 opt_val=$(get_optval "$1" "$2")
160 CONTRIB_list=$(LC_ALL=C ls -1 contrib/*.patch.lzma \
161 |xargs -I {} basename {} .patch.lzma \
162 |sed -r -e ':a; /$/N; s/\n/,/; ta;'
167 echo "Available contributions:"
168 LC_ALL=C ls -1 contrib/*.patch.lzma \
169 |xargs -I {} basename {} .patch.lzma \
172 *) CONTRIB_list="${CONTRIB_list},${opt_val}";;
179 \`configure' configures crosstool-NG ${VERSION} to adapt to many kind of systems.
181 USAGE: ./configure [OPTION]...
183 Defaults for the options are specified in brackets.
186 -h, --help display this help and exit
187 --force force ./configure to complete, even if one or more
188 tools were not found. Use at your own risk, only if
189 you know what you are doing!
191 Installation directories:
192 --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
193 --local don't install, and use current directory
195 By default, \`make install' will install all the files in
196 \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
197 an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
198 for instance \`--prefix=\${HOME}'.
200 For better control, use the options below.
202 Fine tuning of the installation directories:
203 --bindir=DIR user executables [PREFIX/bin]
204 --libdir=DIR object code libraries [PREFIX/lib]
205 --docdir=DIR info documentation [PREFIX/share/doc]
206 --mandir=DIR man documentation [PREFIX/share/man]
209 --with-contrib=XXX Include externally contributed features found in the
210 contrib/ sub-directory. Set to a comma-separated list
211 of features. Use 'all' to use all contributions, and
212 'list' to see which are available.
216 #---------------------------------------------------------------------
219 while [ $# -ne 0 ]; do
221 --prefix*) set_prefix "$1" "$2" && shift || shift 2;;
222 --bindir*) set_bindir "$1" "$2" && shift || shift 2;;
223 --libdir*) set_libdir "$1" "$2" && shift || shift 2;;
224 --docdir*) set_docdir "$1" "$2" && shift || shift 2;;
225 --mandir*) set_mandir "$1" "$2" && shift || shift 2;;
226 --local) LOCAL_set=1; shift;;
227 --force) FORCE=1; shift;;
229 set_contrib "$1" "$2" && shift || shift 2
230 [ "${do_quit}" = "1" ] && exit 0
232 --help|-h) do_help; exit 0;;
238 [ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
240 # Special case when installing locally
241 if [ "${LOCAL_set}" = "1" ]; then
245 set_docdir "" $(pwd)/docs
246 set_mandir "" $(pwd)/docs
249 #---------------------------------------------------------------------
250 # Some sanity checks, now
252 # If this version is a svn snapshot, try to get the revision number
253 # If we can't get the revision number, use date
254 printf "Computing version string... "
257 REVISION=$(LC_ALL=C svnversion)
258 case "${REVISION}" in
260 VERSION="${VERSION}unknown@$(date +%Y%m%d.%H%M%S)";;
262 URL=$(LC_ALL=C svn info 2>/dev/null |egrep 'URL: ' |cut -d ' ' -f 2-)
263 ROOT=$(LC_ALL=C svn info 2>/dev/null |egrep 'Repository Root: ' |cut -d ' ' -f 3-)
264 VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
267 # Arrange to have no / in the directory name, no need to create an
268 # arbitrarily deep directory structure
269 VERSION=$(echo "${VERSION}" |sed -r -e 's|/+|_|g;')
274 # Now we have the version string, we can build up the paths
275 [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
276 [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}"
277 [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
278 [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
280 # Check that install PATHs are absolute
281 for p in BIN LIB DOC MAN; do
286 *) do_error "'${var}' is not an absolute path: '${v}'"
290 # Check the existence of absolutely required tools
293 for tool in ${TOOLS_TO_CHECK}; do
294 has_or_abort "${tool}"
298 # It's safer to change all ',' to spaces rather than setting IFS
299 CONTRIB_list=$(echo "${CONTRIB_list}" |sed -r -e 's/,+/ /g; s/ +/ /g; s/^ //g; s/ $//g;')
300 if [ -n "${CONTRIB_list}" ]; then
301 has_or_abort 'lzcat/'
302 printf "Applying contributed code: "
303 for c in ${CONTRIB_list}; do
305 if [ ! -f "contrib/${c}.patch.lzma" ]; then
306 do_error "Contribution '${c}' does not exist"
308 lzcat "contrib/${c}.patch.lzma" |patch -p1 >/dev/null 2>&1
313 printf "Building up Makefile... "
314 sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
315 -e "s,@@LIBDIR@@,${LIBDIR},g;" \
316 -e "s,@@DOCDIR@@,${DOCDIR},g;" \
317 -e "s,@@MANDIR@@,${MANDIR},g;" \
318 -e "s,@@VERSION@@,${VERSION},g;" \
319 -e "s,@@DATE@@,${DATE},g;" \
320 -e "s,@@LOCAL@@,${LOCAL_set},g;" \
321 Makefile.in >Makefile
326 crosstool-NG configured as follows:
332 CONTRIB='${CONTRIB_list}'