1.1 --- a/configure Thu Jan 12 22:41:47 2012 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,645 +0,0 @@
1.4 -#!/bin/sh
1.5 -
1.6 -myname="${0##*/}"
1.7 -
1.8 -VERSION=$( cat .version )
1.9 -DATE=$( date +%Y%m%d )
1.10 -
1.11 -PREFIX_DEFAULT=/usr/local
1.12 -
1.13 -BINDIR_set=
1.14 -LIBDIR_set=
1.15 -DOCDIR_set=
1.16 -MANDIR_set=
1.17 -PROG_PFX=
1.18 -PROG_SFX=
1.19 -PROG_SED=
1.20 -LOCAL_set=
1.21 -FORCE=
1.22 -
1.23 -do_quit=
1.24 -
1.25 -# Simply print the error message, and exit. Obvious, he?
1.26 -do_error() {
1.27 - printf "${myname}: ${@}\n"
1.28 - exit 1
1.29 -}
1.30 -
1.31 -# Given an option string and the following argument,
1.32 -# echoes the value of the option.
1.33 -# If --var=val => echoes val and returns 0, meaning second arg was not consumed
1.34 -# If --var val => echoes val and returns non null, meaning second arg was used
1.35 -get_optval(){
1.36 - case "$1" in
1.37 - --*=?*)
1.38 - printf "${1#*=}"
1.39 - return 0
1.40 - ;;
1.41 - *)
1.42 - printf "${2}"
1.43 - return 1
1.44 - ;;
1.45 - esac
1.46 -}
1.47 -
1.48 -# The set_xxx functions will set the corresponding configuration variable
1.49 -# They return 0 if second arg was not consumed, and non-zero if it was consumed.
1.50 -set_prefix() {
1.51 - PREFIX="$( get_optval "$1" "$2" )"
1.52 -}
1.53 -set_bindir() {
1.54 - BINDIR_set=1
1.55 - BINDIR="$( get_optval "$1" "$2" )"
1.56 -}
1.57 -set_libdir() {
1.58 - LIBDIR_set=1
1.59 - LIBDIR="$( get_optval "$1" "$2" )"
1.60 -}
1.61 -set_docdir() {
1.62 - DOCDIR_set=1
1.63 - DOCDIR="$( get_optval "$1" "$2" )"
1.64 -}
1.65 -set_mandir() {
1.66 - MANDIR_set=1
1.67 - MANDIR="$( get_optval "$1" "$2" )"
1.68 -}
1.69 -set_program_prefix() {
1.70 - PROG_PFX="$( get_optval "$1" "$2" )"
1.71 -}
1.72 -set_program_suffix() {
1.73 - PROG_SFX="$( get_optval "$1" "$2" )"
1.74 -}
1.75 -set_program_transform_name() {
1.76 - PROG_SED="$( get_optval "$1" "$2" )"
1.77 -}
1.78 -set_tool() {
1.79 - local var_name="${1%%=*}"
1.80 - var_name="${var_name#--with-}"
1.81 - eval ${var_name}="\$( get_optval "$1" "$2" )"
1.82 -}
1.83 -
1.84 -# var_list is a list of variables, each one holding a path to a
1.85 -# tool, either detected by ./configure, or specified by the user.
1.86 -var_list=""
1.87 -kconfig_list=""
1.88 -
1.89 -# This function adds a variable name to the above list of variable names.
1.90 -# $1: the name of the variable to add to the list
1.91 -add_to_var_list() {
1.92 - local v
1.93 - for v in ${var_list}; do
1.94 - [ "${v}" = "${1}" ] && return 0
1.95 - done
1.96 - var_list="${var_list} ${1}"
1.97 -}
1.98 -add_to_kconfig_list() {
1.99 - local k
1.100 - for k in ${kconfig_list}; do
1.101 - [ "${k}" = "${1}" ] && return 0
1.102 - done
1.103 - kconfig_list="${kconfig_list} ${1}"
1.104 -}
1.105 -
1.106 -# A function to test for required tools/headers/libraries
1.107 -# Return 0 (true) if found, !0 (false) if not found
1.108 -#
1.109 -# $*: [prog|inc|lib]=<name[ name...]>
1.110 -# the name(s) of tool(s) to test for
1.111 -# mandatory
1.112 -# eg: prog=bash prog="curl wget"
1.113 -# $*: var=<var_name>
1.114 -# the name of the variable to test and set
1.115 -# optional
1.116 -# eg: var=bash if ${bash} is set and non-null, use that,
1.117 -# else check for bash and set bash=$(which bash)
1.118 -# $*: ver=<regexp>
1.119 -# for each 'prog', test if $(prog --version) matches 'regexp'
1.120 -# optional
1.121 -# eg: ver='^GNU bash, version [34]\.'
1.122 -# $*: lib_exts=<extension[ extension...]>
1.123 -# the list of allowed library extension
1.124 -# mandatory
1.125 -# eg: lib_exts="so dylib" lib_exts="so dylib a"
1.126 -# $*: err=<error_message>
1.127 -# the error message to print if tool is missing
1.128 -# optional, defaults to: '${prog}: none found'
1.129 -# eg: err="'bash' 3.x or above was not found"
1.130 -# Note: err may be printed by caller, not us
1.131 -# $*: kconfig=<var_name>
1.132 -# the name of a variable to pass down to kconfig if
1.133 -# the prog/inc/lib was found
1.134 -# optional, defaults to none
1.135 -# eg: kconfig=has_libncurses
1.136 -# $*: skip=[y|n|]
1.137 -# if set to 'y', skip the test, but still register the
1.138 -# kconfig and var variables; if 'n' or empty, do the
1.139 -# test.
1.140 -# optional, default to 'n'
1.141 -# eg: skip="${static_link_ko}"
1.142 -check_for() {
1.143 - local lib_exts
1.144 - local skip
1.145 - local val
1.146 - local item
1.147 - local where
1.148 - local status
1.149 - local ext
1.150 -
1.151 - # Note: prog/inc/lib and var/kconfig/ver/err are set here,
1.152 - # but declared by the caller (because it needs it)
1.153 - for item in "${@}"; do
1.154 - case "${item}" in
1.155 - prog=*|inc=*|lib=*|var=*|ver=*|err=*|kconfig=*|lib_exts=*|skip=*)
1.156 - eval ${item%%=*}=\"${item#*=}\"
1.157 - ;;
1.158 - *) do_error "check_for: incorrect parameters: '${item}'";;
1.159 - esac
1.160 - done
1.161 -
1.162 - case "${prog}:${inc}:${lib}" in
1.163 - ?*:?*:|?*::?*|:?*:?*|?*:?*:?*)
1.164 - if [ -n "${var}" ]; then
1.165 - do_error "check_for: the use of var is not compatible with passing several of [prog|inc|lib] at once"
1.166 - fi
1.167 - ;;
1.168 - ::) do_error "check_for: [prog|inc|lib] is mandatory";;
1.169 - esac
1.170 -
1.171 - if [ -n "${var}" ]; then
1.172 - add_to_var_list "${var}"
1.173 - fi
1.174 - if [ -n "${kconfig}" ]; then
1.175 - add_to_kconfig_list "${kconfig}"
1.176 - fi
1.177 -
1.178 - if [ "${skip}" = "y" ]; then
1.179 - return 0
1.180 - fi
1.181 -
1.182 - if [ -n "${prog}" ]; then
1.183 - for item in ${prog}; do
1.184 - printf "Checking for '${item}'... "
1.185 - if [ -n "${var}" ]; then
1.186 - eval val="\${${var}}"
1.187 - if [ -n "${val}" ]; then
1.188 - status="${val} (cached)\n"
1.189 - where="${val}"
1.190 - break
1.191 - fi
1.192 - fi
1.193 - where="$( which "${item}" 2>/dev/null )"
1.194 - if [ -z "${where}" ]; then
1.195 - printf "no\n"
1.196 - continue
1.197 - elif [ -n "${ver}" ]; then
1.198 - str=$( LC_ALL=C "${where}" --version 2>&1 \
1.199 - |grep -E "${ver}" \
1.200 - |head -n 1
1.201 - )
1.202 - if [ -z "${str}" ]; then
1.203 - printf "no\n"
1.204 - unset where
1.205 - continue
1.206 - fi
1.207 - fi
1.208 - status="${where}"
1.209 - break
1.210 - done
1.211 - if [ -z "${status}" ]; then
1.212 - return 1
1.213 - fi
1.214 - printf "${status}\n"
1.215 - unset status
1.216 - fi
1.217 -
1.218 - if [ -n "${inc}" ]; then
1.219 - for item in ${inc}; do
1.220 - printf "Checking for '${item}'... "
1.221 - if printf "#include \"${item}\"" |gcc -x c -c - -o /dev/null >/dev/null 2>&1; then
1.222 - where="${item}"
1.223 - status=yes
1.224 - break;
1.225 - fi
1.226 - printf "no\n"
1.227 - done
1.228 - if [ -z "${status}" ]; then
1.229 - return 1
1.230 - fi
1.231 - printf "${status}\n"
1.232 - unset status
1.233 - fi
1.234 -
1.235 - if [ -n "${lib}" ]; then
1.236 - if [ -z "${lib_exts}" ]; then
1.237 - do_error "check_for: no library extension specified for '${lib}'"
1.238 - fi
1.239 - for item in ${lib}; do
1.240 - for ext in ${lib_exts}; do
1.241 - printf "Checking for '${item}.${ext}'... "
1.242 - where="$( gcc -print-file-name="${item}.${ext}" )"
1.243 - if [ "${where}" != "${item}.${ext}" ]; then
1.244 - where="$( readlink "${where}" )"
1.245 - status=yes
1.246 - break 2;
1.247 - fi
1.248 - printf "no\n"
1.249 - done
1.250 - done
1.251 - if [ -z "${status}" ]; then
1.252 - return 1
1.253 - fi
1.254 - printf "${status}\n"
1.255 - unset status
1.256 - fi
1.257 -
1.258 - if [ -n "${var}" ]; then
1.259 - eval ${var}='"'"${where}"'"'
1.260 - fi
1.261 - if [ -n "${kconfig}" ]; then
1.262 - eval ${kconfig}=y
1.263 - fi
1.264 -}
1.265 -
1.266 -# This function checks for a tool, and aborts if not found
1.267 -# See check_for(), above, for how to call has_or_abort
1.268 -has_or_abort() {
1.269 - # We declare these 6 variables here, although they are
1.270 - # set in check_for(), called below
1.271 - local prog inc lib
1.272 - local var ver err kconfig
1.273 -
1.274 - if ! check_for "$@"; then
1.275 - printf " * A mandatory dependency is missing, or version mis-match:\n"
1.276 - printf " * - ${err:-${prog}${inc}${lib}: none found}\n"
1.277 - if [ -n "${var}" ]; then
1.278 - printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
1.279 - fi
1.280 - printf "\n"
1.281 - # Bail out if --force is not specified
1.282 - [ -z "${FORCE}" ] && do_error "Bailing out..."
1.283 - printf "<* *>\n"
1.284 - printf "<* FORCE in action: *>\n"
1.285 - printf "<* Continuing despite missing pre-requisite *>\n"
1.286 - printf "<* Prepare for breakage *>\n"
1.287 - printf "<* *>\n"
1.288 - printf "\n"
1.289 - fi
1.290 -}
1.291 -
1.292 -# This function checks for a tool, and warns if not found
1.293 -# See check_for(), above, for how to call has_or_abort
1.294 -# Note: if err is not set, then no error message is printed
1.295 -has_or_warn() {
1.296 - # We declare these 6 variables here, although they are
1.297 - # set in check_for(), called below
1.298 - local prog inc lib
1.299 - local var ver err kconfig
1.300 -
1.301 - if ! check_for "$@"; then
1.302 - printf " * An optional dependency is missing, some features will be disabled"
1.303 - printf "${err:+:\n * - ${err}}\n"
1.304 - if [ -n "${var}" ]; then
1.305 - printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
1.306 - fi
1.307 - fi
1.308 -}
1.309 -
1.310 -do_help() {
1.311 - cat <<__EOF__
1.312 -\`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems.
1.313 -
1.314 -USAGE: ./configure [OPTION]...
1.315 -
1.316 -Defaults for the options are specified in brackets.
1.317 -
1.318 -Configuration:
1.319 - -h, --help display this help and exit
1.320 - --force force configure to continue, even in case
1.321 - some pre-requisites are missing
1.322 -
1.323 -Installation directories:
1.324 - --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
1.325 - --local don't install, and use current directory
1.326 -
1.327 -By default, \`make install' will install all the files in
1.328 -\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
1.329 -an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
1.330 -for instance \`--prefix=\${HOME}'.
1.331 -
1.332 -For better control, use the options below.
1.333 -Note: options marked as \`ignored' are recognised, but not acted upon, as
1.334 -they make no sense for crosstool-NG, or they are not implemented yet.
1.335 -
1.336 -Fine tuning of the installation directories:
1.337 - --bindir=DIR user executables [PREFIX/bin]
1.338 - --libdir=DIR object code libraries [PREFIX/lib]
1.339 - --docdir=DIR info documentation [PREFIX/share/doc]
1.340 - --mandir=DIR man documentation [PREFIX/share/man]
1.341 - --infodir=DIR info documentation [DATAROOTDIR/info] (ignored)
1.342 - --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1.343 - (ignored)
1.344 - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] (ignored)
1.345 - --localstatedir=DIR modifiable single-machine data [PREFIX/var] (ignored)
1.346 -
1.347 -Program names:
1.348 - --program-prefix=PREFIX prepend PREFIX to installed program names
1.349 - --program-suffix=SUFFIX append SUFFIX to installed program names
1.350 - --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1.351 -
1.352 -System types:
1.353 - --build=BUILD configure for building on BUILD [guessed] (ignored)
1.354 - --host=HOST cross-compile to build programs to run on HOST [BUILD]
1.355 - (ignored)
1.356 -
1.357 -Optional Features:
1.358 - --enable-shared[=PKGS] build shared libraries [default=yes] (ignored)
1.359 - --enable-static[=PKGS] build static libraries [default=yes] (ignored)
1.360 -
1.361 -Optional Packages:
1.362 - --with-install=PATH Specify the full PATH to GNU install
1.363 - --with-make=PATH Specify the full PATH to GNU make >= 3.80
1.364 - --with-grep=PATH Specify the full PATH to GNU grep
1.365 - --with-sed=PATH Specify the full PATH to GNU sed
1.366 - --with-bash=PATH Specify the full PATH to bash >= 3.0
1.367 -__EOF__
1.368 -}
1.369 -
1.370 -#---------------------------------------------------------------------
1.371 -# Set user's options
1.372 -
1.373 -while [ $# -ne 0 ]; do
1.374 - case "$1" in
1.375 - --local) LOCAL_set="y"; shift;;
1.376 - --prefix*) set_prefix "$1" "$2" && shift || shift 2;;
1.377 - --bindir*) set_bindir "$1" "$2" && shift || shift 2;;
1.378 - --libdir*) set_libdir "$1" "$2" && shift || shift 2;;
1.379 - --docdir*) set_docdir "$1" "$2" && shift || shift 2;;
1.380 - --mandir*) set_mandir "$1" "$2" && shift || shift 2;;
1.381 - --with-*) set_tool "$1" "$2" && shift || shift 2;;
1.382 - --program-prefix=*|--program-prefix)
1.383 - set_program_prefix "$1" "$2" && shift || shift 2
1.384 - ;;
1.385 - --program-suffix=*|--program-suffix)
1.386 - set_program_suffix "$1" "$2" && shift || shift 2
1.387 - ;;
1.388 - --program-transform-name=*|--program-transform-name)
1.389 - set_program_transform_name "$1" "$2" && shift || shift 2
1.390 - ;;
1.391 - --force) FORCE=1; shift;;
1.392 - --help|-h) do_help; exit 0;;
1.393 - # Skip, auto-stuff compatibility
1.394 - --build=*|--host=*|--infodir=*|--datadir=*|--sysconfdir=*|--localstatedir=*) shift;;
1.395 - --build|--host|--infodir|--datadir|--sysconfdir|--localstatedir) shift 2;;
1.396 - --enable-shared|--disable-shared|--enable-static|--disable-static) shift;;
1.397 - *) printf "Unrecognised option: '${1}'\n"; do_help; exit 1;;
1.398 - esac
1.399 -done
1.400 -
1.401 -# Use defaults
1.402 -[ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
1.403 -
1.404 -# Special case when installing locally
1.405 -if [ "${LOCAL_set}" = "y" ]; then
1.406 - set_prefix "" "$( pwd )"
1.407 - set_bindir "" "$( pwd )"
1.408 - set_libdir "" "$( pwd )"
1.409 - set_docdir "" "$( pwd )/docs"
1.410 - set_mandir "" "$( pwd )/docs"
1.411 - set_program_prefix "" ""
1.412 - set_program_suffix "" ""
1.413 - set_program_transform_name "" ""
1.414 -fi
1.415 -
1.416 -#---------------------------------------------------------------------
1.417 -# Some sanity checks, now
1.418 -
1.419 -# We check for grep and sed manually, because they are used in check_for()
1.420 -printf "Checking for 'grep'... "
1.421 -if [ -n "${grep}" ]; then
1.422 - printf "${grep} (cached)\n"
1.423 -else
1.424 - grep="$( which grep 2>/dev/null )"
1.425 - if [ -z "${grep}" ]; then
1.426 - printf "not found\n"
1.427 - else
1.428 - printf "${grep}\n"
1.429 - printf "Checking whether '${grep}' supports -E... "
1.430 - if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
1.431 - printf "yes\n"
1.432 - else
1.433 - printf "no\n"
1.434 - grep=
1.435 - fi
1.436 - fi
1.437 -fi
1.438 -if [ -z "${grep}" ]; then
1.439 - printf "Either you are missing entirely the needed tool,\n"
1.440 - printf "or the version you have is too old.\n"
1.441 - printf "You can give the path to this tool using: --with-grep=PATH\n"
1.442 - do_error "Bailing out..."
1.443 -fi
1.444 -add_to_var_list grep
1.445 -
1.446 -printf "Checking for 'sed'... "
1.447 -if [ -n "${sed}" ]; then
1.448 - printf "${sed} (cached)\n"
1.449 -else
1.450 - sed="$( which sed 2>/dev/null )"
1.451 - if [ -z "${sed}" ]; then
1.452 - printf "not found\n"
1.453 - else
1.454 - printf "${sed}\n"
1.455 - printf "Checking whether '${sed}' supports -i and -e... "
1.456 - touch .ct-ng.sed.test
1.457 - if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
1.458 - printf "yes\n"
1.459 - else
1.460 - printf "no\n"
1.461 - sed=
1.462 - fi
1.463 - rm -f .ct-ng.sed.test
1.464 - fi
1.465 -fi
1.466 -if [ -z "${sed}" ]; then
1.467 - printf "Either you are missing entirely the needed tool,\n"
1.468 - printf "or the version you have is too old.\n"
1.469 - printf "You can give the path to this tool using: --with-sed=PATH\n"
1.470 - do_error "Bailing out..."
1.471 -fi
1.472 -add_to_var_list sed
1.473 -
1.474 -# The regular list of tools we can now easily check for
1.475 -has_or_abort prog=bash \
1.476 - var=bash \
1.477 - ver='^GNU bash, version (3\.[1-9]|4)' \
1.478 - err="'bash' 3.1 or above was not found"
1.479 -has_or_abort prog=cut
1.480 -has_or_abort prog=install var=install
1.481 -has_or_abort prog=make \
1.482 - var=make \
1.483 - ver='^GNU Make (3.[89][[:digit:]]|[4-9])' \
1.484 - err="GNU 'make' 3.80 or above was not found"
1.485 -has_or_abort prog=gcc
1.486 -has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
1.487 -has_or_abort prog=bison
1.488 -has_or_abort prog=flex
1.489 -has_or_abort prog=makeinfo
1.490 -has_or_abort prog=automake \
1.491 - ver='\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)' \
1.492 - err="'automake' 1.10 or above was not found"
1.493 -has_or_abort prog=libtool \
1.494 - var=libtool \
1.495 - ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
1.496 - err="'libtool' 1.5.26 or above was not found"
1.497 -has_or_abort prog=libtoolize \
1.498 - var=libtoolize \
1.499 - ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
1.500 - err="'libtoolize' 1.5.26 or above was not found"
1.501 -has_or_abort prog=stat
1.502 -has_or_abort prog=wget
1.503 -has_or_abort prog=patch
1.504 -has_or_abort prog=tar
1.505 -has_or_abort prog=gzip
1.506 -has_or_abort prog=bzip2
1.507 -has_or_warn prog=xz \
1.508 - kconfig=has_xzutils \
1.509 - err="xz-compressed tarballs will not be used"
1.510 -has_or_warn prog=lzma \
1.511 - kconfig=has_lzma \
1.512 - skip="${has_xzutils}" \
1.513 - err="lzma-compressed tarballs will not be used"
1.514 -has_or_abort prog=readlink
1.515 -has_or_abort prog=objcopy var=objcopy
1.516 -has_or_abort prog=objdump var=objdump
1.517 -has_or_abort prog=readelf var=readelf
1.518 -has_or_abort prog=patch var=patch
1.519 -has_or_warn prog=cvs \
1.520 - kconfig=has_cvs \
1.521 - err="it will not be possible to use newlib cvs snapshots"
1.522 -has_or_warn prog=svn \
1.523 - kconfig=has_svn \
1.524 - err="subversion is required to download eglibc"
1.525 -
1.526 -# Library checks
1.527 -libs_exts="so dylib a"
1.528 -
1.529 -ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
1.530 -ncurses_libs="libncursesw libncurses libcurses"
1.531 -has_or_abort lib="${ncurses_libs}" \
1.532 - lib_exts="${libs_exts}" \
1.533 - inc="${ncurses_hdrs}" \
1.534 - err="The 'ncurses' library is needed fo the menuconfig frontend"
1.535 -
1.536 -#---------------------------------------------------------------------
1.537 -# Compute the version string
1.538 -
1.539 -# If this version is n hg clone, try to get the revision number
1.540 -# If we can't get the revision number, use date
1.541 -printf "\nComputing version string... "
1.542 -
1.543 -# Pass the version to the version helper script, if present, to compute
1.544 -# a local version string, if needed.
1.545 -if [ -f version.sh -a -x version.sh ]; then
1.546 - V="$( ./version.sh "${VERSION}" 2>/dev/null |head -n 1 )"
1.547 -fi
1.548 -
1.549 -# If the script returns an empty string, revert to using the version
1.550 -# we just computed, above.
1.551 -if [ -n "${V}" ]; then
1.552 - VERSION="${V}"
1.553 -else
1.554 - case "${VERSION}" in
1.555 - *+hg|hg)
1.556 - rev_id="$( hg log -r . --template '{branch}-{node|short}\n' \
1.557 - 2>/dev/null \
1.558 - || true \
1.559 - )"
1.560 - VERSION="${VERSION}+${rev_id:-unknown-$( date +%Y%m%d.%H%M%S )}"
1.561 - ;;
1.562 - esac
1.563 -fi
1.564 -
1.565 -# Arrange to have no / in the directory name, no need to create an
1.566 -# arbitrarily deep directory structure
1.567 -VERSION="$( printf "${VERSION}" |"${sed}" -r -e 's:/+:_:g;' )"
1.568 -
1.569 -printf "${VERSION}\n"
1.570 -
1.571 -#---------------------------------------------------------------------
1.572 -# Compute and check install paths
1.573 -
1.574 -# Now we have the version string, we can build up the paths
1.575 -[ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
1.576 -[ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib"
1.577 -[ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc"
1.578 -[ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man"
1.579 -
1.580 -# Install support files in our own sub-dir, so as not to mangle (system)
1.581 -# files and dirs, but only if not --local
1.582 -if [ -z "${LOCAL_set}" ]; then
1.583 - LIBDIR="${LIBDIR}/ct-ng-${VERSION}"
1.584 - DOCDIR="${DOCDIR}/ct-ng-${VERSION}"
1.585 -fi
1.586 -
1.587 -# Check that install PATHs are absolute
1.588 -for p in BIN LIB DOC MAN; do
1.589 - var="${p}DIR"
1.590 - eval v='"${'"${var}"'}"'
1.591 - case "${v}" in
1.592 - /*) ;;
1.593 - *) do_error "'${var}' is not an absolute path: '${v}'";;
1.594 - esac
1.595 -done
1.596 -case "${PROG_PFX}" in
1.597 - */*) do_error "program prefix '${PROG_PFX}' contains a '/'";;
1.598 -esac
1.599 -case "${PROG_SFX}" in
1.600 - */*) do_error "program suffix '${PROG_SFX}' contains a '/'";;
1.601 -esac
1.602 -
1.603 -#---------------------------------------------------------------------
1.604 -# That's all, folks!
1.605 -
1.606 -printf "Building up Makefile... "
1.607 -var_sed="$( for var_name in ${var_list}; do
1.608 - eval echo 's,@@${var_name}@@,${'"${var_name}"'},g'
1.609 - done
1.610 - )"
1.611 -kconfig_sed="s/@@KCONFIG@@/$( for k_name in ${kconfig_list}; do
1.612 - eval printf \"${k_name}=\${${k_name}} \"
1.613 - done
1.614 - )/"
1.615 -"${sed}" -r -e "s,@@BINDIR@@,${BINDIR},g" \
1.616 - -e "s,@@LIBDIR@@,${LIBDIR},g" \
1.617 - -e "s,@@DOCDIR@@,${DOCDIR},g" \
1.618 - -e "s,@@MANDIR@@,${MANDIR},g" \
1.619 - -e "s,@@PROG_PFX@@,${PROG_PFX},g" \
1.620 - -e "s,@@PROG_SFX@@,${PROG_SFX},g" \
1.621 - -e "s,@@PROG_SED@@,${PROG_SED},g" \
1.622 - -e "s,@@VERSION@@,${VERSION},g" \
1.623 - -e "s,@@DATE@@,${DATE},g" \
1.624 - -e "s,@@LOCAL@@,${LOCAL_set},g" \
1.625 - -e "${var_sed}" \
1.626 - -e "${kconfig_sed}" \
1.627 - Makefile.in \
1.628 - >Makefile
1.629 -echo "done"
1.630 -
1.631 -cat <<__EOF__
1.632 -
1.633 -crosstool-NG configured as follows:
1.634 - PREFIX='${PREFIX}'
1.635 - BINDIR='${BINDIR}'
1.636 - LIBDIR='${LIBDIR}'
1.637 - DOCDIR='${DOCDIR}'
1.638 - MANDIR='${MANDIR}'
1.639 - PROG_PFX='${PROG_PFX}'
1.640 - PROG_SFX='${PROG_SFX}'
1.641 - PROG_SED='${PROG_SED}'
1.642 -
1.643 -Now run:
1.644 - make
1.645 -__EOF__
1.646 -if [ "${LOCAL_set}" != "y" ]; then
1.647 - printf " make install\n"
1.648 -fi