Some more ARM sample to build gfortran...
/trunk/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 11 6 5 0 ++++++-----
/trunk/samples/armeb-unknown-linux-gnu/crosstool.config | 11 6 5 0 ++++++-----
/trunk/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 11 6 5 0 ++++++-----
3 files changed, 18 insertions(+), 15 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... :-/
26 PREFIX_DEFAULT=/usr/local
39 # Simply print the error message, and exit. Obvious, he?
45 # A small function to test for existence of various tools
46 # Usage: has_or_abort foobar
47 # -> foobar must exist in PATH
48 # Usage: has_or_abort foobar/string
49 # -> foobar must exist in PATH, and $(foobar --version) must contain 'string'
51 tool=$(echo "${1}/" |cut -d / -f 1)
52 regexp=$(echo "${1}/" |cut -d / -f 2)
53 printf "Checking for '${tool}'... "
54 where=$(which "${tool}" 2>/dev/null || true)
55 if [ -z "${where}" ]; then
57 [ ${FORCE} -eq 0 ] && do_error " bailing out..."
61 if [ -n "${regexp}" ]; then
62 str=$(${tool} --version 2>&1 |egrep "${regexp}" |head -n 1)
63 if [ -z "${str}" ]; then
64 printf " failed: '${tool} --version' does not match regexp '${regexp}'"
65 [ ${FORCE} -eq 0 ] && do_error " bailing out..."
73 # Given an option string and the following argument,
74 # echoes the value of the option.
75 # If --var=val => echoes val and returns 0, meaning second arg was not consumed
76 # If --var val => echoes val and returns non null, meaning second arg was used
81 echo "${1}" |cut -d '=' -f 2-
92 # The set_xxx functions will set the corresponding configuration variable
93 # They return 0 if second arg was not consumed, and non-zero if it was consumed.
95 PREFIX=$(get_optval "$1" "$2")
100 BINDIR=$(get_optval "$1" "$2")
105 LIBDIR=$(get_optval "$1" "$2")
110 DOCDIR=$(get_optval "$1" "$2")
115 MANDIR=$(get_optval "$1" "$2")
119 # The set_contrib function is different in that it will work like the others,
120 # except in two cases:
121 # If all => replaces all with the list of all available contribs
122 # If list => just echoes the list of all available contribs, and instructs
123 # caller to quit immediately by setting do_quit to non null.
124 # (can't use the return code, see above).
126 opt_val=$(get_optval "$1" "$2")
130 CONTRIB_list=$(LC_ALL=C ls -1 contrib/*.patch.lzma \
131 |xargs -I {} basename {} .patch.lzma \
132 |sed -r -e ':a; /$/N; s/\n/,/; ta;'
137 echo "Available contributions:"
138 LC_ALL=C ls -1 contrib/*.patch.lzma \
139 |xargs -I {} basename {} .patch.lzma \
142 *) CONTRIB_list="${CONTRIB_list},${opt_val}";;
149 \`configure' configures crosstool-NG ${VERSION} to adapt to many kind of systems.
151 USAGE: ./configure [OPTION]...
153 Defaults for the options are specified in brackets.
156 -h, --help display this help and exit
158 Installation directories:
159 --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
160 --local don't install, and use current directory
161 --force force ./configure to run, even if a tool was not
162 found. Use at your own risk, only if you know
165 By default, \`make install' will install all the files in
166 \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
167 an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
168 for instance \`--prefix=\${HOME}'.
170 For better control, use the options below.
172 Fine tuning of the installation directories:
173 --bindir=DIR user executables [PREFIX/bin]
174 --libdir=DIR object code libraries [PREFIX/lib]
175 --docdir=DIR info documentation [PREFIX/share/doc]
176 --mandir=DIR man documentation [PREFIX/share/man]
179 --with-contrib=XXX Include externally contributed features found in the
180 contrib/ sub-directory. Set to a comma-separated list
181 of features. Use 'all' to use all contributions, and
182 'list' to see which are available.
186 #---------------------------------------------------------------------
189 while [ $# -ne 0 ]; do
191 --prefix*) set_prefix "$1" "$2" && shift || shift 2;;
192 --bindir*) set_bindir "$1" "$2" && shift || shift 2;;
193 --libdir*) set_libdir "$1" "$2" && shift || shift 2;;
194 --docdir*) set_docdir "$1" "$2" && shift || shift 2;;
195 --mandir*) set_mandir "$1" "$2" && shift || shift 2;;
196 --local) LOCAL_set=1; shift;;
197 --force) FORCE=1; shift;;
199 set_contrib "$1" "$2" && shift || shift 2
200 [ "${do_quit}" = "1" ] && exit 0
202 --help|-h) do_help; exit 0;;
208 [ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
210 # Special case when installing locally
211 if [ "${LOCAL_set}" = "1" ]; then
215 set_docdir "" $(pwd)/docs
216 set_mandir "" $(pwd)/docs
219 #---------------------------------------------------------------------
220 # Some sanity checks, now
222 # If this version is a svn snapshot, try to get the revision number
223 # If we can't get the revision number, use date
224 printf "Computing version string... "
227 REVISION=$(LC_ALL=C svnversion)
228 case "${REVISION}" in
230 VERSION="${VERSION}unknown@$(date +%Y%m%d.%H%M%S)";;
232 URL=$(LC_ALL=C svn info 2>/dev/null |egrep 'URL: ' |cut -d ' ' -f 2-)
233 ROOT=$(LC_ALL=C svn info 2>/dev/null |egrep 'Repository Root: ' |cut -d ' ' -f 3-)
234 VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
237 # Arrange to have no / in the directory name, no need to create an
238 # arbitrarily deep directory structure
239 VERSION=$(echo "${VERSION}" |sed -r -e 's|/+|_|g;')
244 # Now we have the version string, we can build up the paths
245 [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
246 [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}"
247 [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
248 [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
250 # Check bash is present, and at least version 3.0
251 printf "Checking '/bin/bash' is at least bash-3.0... "
252 [ -x /bin/bash ] || do_error "bash 3.0 or above was not found in '/bin/bash'"
253 bash_version=$(/bin/bash -c 'echo ${BASH_VERSION}')
254 bash_major=$(/bin/bash -c 'echo ${BASH_VERSINFO[0]}')
255 [ ${bash_major} -ge 3 ] || do_error "bash 3.0 or above is needed ('/bin/bash' is '${bash_version}')"
256 echo "${bash_version}"
258 # Check the existence of absolutely required tools
259 for tool in ${TOOLS_TO_CHECK}; do
260 has_or_abort "${tool}"
263 # It's safer to change all ',' to spaces rather than setting IFS
264 CONTRIB_list=$(echo "${CONTRIB_list}" |sed -r -e 's/,+/ /g;')
265 if [ -n "${CONTRIB_list}" ]; then
267 printf "Applying contributed code: "
268 for c in ${CONTRIB_list}; do
270 if [ ! -f "contrib/${c}.patch.lzma" ]; then
271 do_error "Contribution '${c}' does not exist"
273 lzcat "contrib/${c}.patch.lzma" |patch -p1 >/dev/null 2>&1
278 printf "Building up Makefile... "
279 sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
280 -e "s,@@LIBDIR@@,${LIBDIR},g;" \
281 -e "s,@@DOCDIR@@,${DOCDIR},g;" \
282 -e "s,@@MANDIR@@,${MANDIR},g;" \
283 -e "s,@@VERSION@@,${VERSION},g;" \
284 -e "s,@@DATE@@,${DATE},g;" \
285 -e "s,@@LOCAL@@,${LOCAL_set},g;" \
286 Makefile.in >Makefile
291 crosstool-NG configured as follows:
297 CONTRIB='${CONTRIB_list}'