2007-07-01 19:04:20 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-05-01 16:16:53 +00:00
|
|
|
myname="${0##*/}"
|
|
|
|
|
2008-12-22 18:21:51 +00:00
|
|
|
VERSION=$( cat .version )
|
|
|
|
DATE=$( date +%Y%m%d )
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-01 20:52:34 +00:00
|
|
|
PREFIX_DEFAULT=/usr/local
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
BINDIR_set=
|
|
|
|
LIBDIR_set=
|
|
|
|
DOCDIR_set=
|
|
|
|
MANDIR_set=
|
2011-08-17 21:05:01 +00:00
|
|
|
PROG_PFX=
|
2011-08-19 20:43:01 +00:00
|
|
|
PROG_SFX=
|
2011-08-21 21:11:26 +00:00
|
|
|
PROG_SED=
|
2007-07-22 17:44:27 +00:00
|
|
|
LOCAL_set=
|
2009-05-01 16:16:53 +00:00
|
|
|
FORCE=
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-07-07 21:22:25 +00:00
|
|
|
do_quit=
|
2008-06-25 08:34:47 +00:00
|
|
|
|
2008-07-16 21:59:49 +00:00
|
|
|
# Simply print the error message, and exit. Obvious, he?
|
|
|
|
do_error() {
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${myname}: ${@}\n"
|
2008-07-16 21:59:49 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2008-07-07 21:22:25 +00:00
|
|
|
# Given an option string and the following argument,
|
|
|
|
# echoes the value of the option.
|
|
|
|
# If --var=val => echoes val and returns 0, meaning second arg was not consumed
|
|
|
|
# If --var val => echoes val and returns non null, meaning second arg was used
|
2007-07-01 19:04:20 +00:00
|
|
|
get_optval(){
|
|
|
|
case "$1" in
|
|
|
|
--*=?*)
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${1#*=}"
|
2008-12-22 18:21:51 +00:00
|
|
|
return 0
|
2007-07-01 19:04:20 +00:00
|
|
|
;;
|
|
|
|
*)
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${2}"
|
2008-12-22 18:21:51 +00:00
|
|
|
return 1
|
2007-07-01 19:04:20 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2008-07-07 21:22:25 +00:00
|
|
|
# The set_xxx functions will set the corresponding configuration variable
|
|
|
|
# They return 0 if second arg was not consumed, and non-zero if it was consumed.
|
2007-07-01 19:04:20 +00:00
|
|
|
set_prefix() {
|
2008-12-22 18:21:51 +00:00
|
|
|
PREFIX="$( get_optval "$1" "$2" )"
|
2007-07-01 19:04:20 +00:00
|
|
|
}
|
|
|
|
set_bindir() {
|
|
|
|
BINDIR_set=1
|
2008-12-22 18:21:51 +00:00
|
|
|
BINDIR="$( get_optval "$1" "$2" )"
|
2007-07-01 19:04:20 +00:00
|
|
|
}
|
|
|
|
set_libdir() {
|
|
|
|
LIBDIR_set=1
|
2008-12-22 18:21:51 +00:00
|
|
|
LIBDIR="$( get_optval "$1" "$2" )"
|
2007-07-01 19:04:20 +00:00
|
|
|
}
|
|
|
|
set_docdir() {
|
|
|
|
DOCDIR_set=1
|
2008-12-22 18:21:51 +00:00
|
|
|
DOCDIR="$( get_optval "$1" "$2" )"
|
2007-07-01 19:04:20 +00:00
|
|
|
}
|
|
|
|
set_mandir() {
|
|
|
|
MANDIR_set=1
|
2008-12-22 18:21:51 +00:00
|
|
|
MANDIR="$( get_optval "$1" "$2" )"
|
2007-07-01 19:04:20 +00:00
|
|
|
}
|
2011-08-17 21:05:01 +00:00
|
|
|
set_program_prefix() {
|
|
|
|
PROG_PFX="$( get_optval "$1" "$2" )"
|
|
|
|
}
|
2011-08-19 20:43:01 +00:00
|
|
|
set_program_suffix() {
|
|
|
|
PROG_SFX="$( get_optval "$1" "$2" )"
|
|
|
|
}
|
2011-08-21 21:11:26 +00:00
|
|
|
set_program_transform_name() {
|
|
|
|
PROG_SED="$( get_optval "$1" "$2" )"
|
|
|
|
}
|
2009-01-18 15:08:28 +00:00
|
|
|
set_tool() {
|
|
|
|
local var_name="${1%%=*}"
|
|
|
|
var_name="${var_name#--with-}"
|
|
|
|
eval ${var_name}="\$( get_optval "$1" "$2" )"
|
2008-06-25 08:34:47 +00:00
|
|
|
}
|
|
|
|
|
2009-05-01 16:16:53 +00:00
|
|
|
# var_list is a list of variables, each one holding a path to a
|
|
|
|
# tool, either detected by ./configure, or specified by the user.
|
|
|
|
var_list=""
|
2011-05-26 20:51:03 +00:00
|
|
|
kconfig_list=""
|
2009-05-01 16:16:53 +00:00
|
|
|
|
|
|
|
# This function adds a variable name to the above list of variable names.
|
|
|
|
# $1: the name of the variable to add to the list
|
|
|
|
add_to_var_list() {
|
2011-05-26 20:51:03 +00:00
|
|
|
local v
|
|
|
|
for v in ${var_list}; do
|
|
|
|
[ "${v}" = "${1}" ] && return 0
|
|
|
|
done
|
2009-05-01 16:16:53 +00:00
|
|
|
var_list="${var_list} ${1}"
|
|
|
|
}
|
2011-05-26 20:51:03 +00:00
|
|
|
add_to_kconfig_list() {
|
|
|
|
local k
|
|
|
|
for k in ${kconfig_list}; do
|
|
|
|
[ "${k}" = "${1}" ] && return 0
|
|
|
|
done
|
|
|
|
kconfig_list="${kconfig_list} ${1}"
|
|
|
|
}
|
2009-05-01 16:16:53 +00:00
|
|
|
|
|
|
|
# A function to test for required tools/headers/libraries
|
2009-10-03 16:49:23 +00:00
|
|
|
# Return 0 (true) if found, !0 (false) if not found
|
|
|
|
#
|
2009-05-01 16:16:53 +00:00
|
|
|
# $*: [prog|inc|lib]=<name[ name...]>
|
|
|
|
# the name(s) of tool(s) to test for
|
|
|
|
# mandatory
|
|
|
|
# eg: prog=bash prog="curl wget"
|
|
|
|
# $*: var=<var_name>
|
|
|
|
# the name of the variable to test and set
|
|
|
|
# optional
|
|
|
|
# eg: var=bash if ${bash} is set and non-null, use that,
|
|
|
|
# else check for bash and set bash=$(which bash)
|
|
|
|
# $*: ver=<regexp>
|
|
|
|
# for each 'prog', test if $(prog --version) matches 'regexp'
|
|
|
|
# optional
|
|
|
|
# eg: ver='^GNU bash, version [34]\.'
|
2011-06-27 22:29:02 +00:00
|
|
|
# $*: lib_exts=<extension[ extension...]>
|
|
|
|
# the list of allowed library extension
|
|
|
|
# mandatory
|
|
|
|
# eg: lib_exts="so dylib" lib_exts="so dylib a"
|
2009-05-01 16:16:53 +00:00
|
|
|
# $*: err=<error_message>
|
|
|
|
# the error message to print if tool is missing
|
|
|
|
# optional, defaults to: '${prog}: none found'
|
|
|
|
# eg: err="'bash' 3.x or above was not found"
|
2011-05-26 16:33:53 +00:00
|
|
|
# Note: err may be printed by caller, not us
|
2011-05-26 20:51:03 +00:00
|
|
|
# $*: kconfig=<var_name>
|
|
|
|
# the name of a variable to pass down to kconfig if
|
|
|
|
# the prog/inc/lib was found
|
|
|
|
# optional, defaults to none
|
|
|
|
# eg: kconfig=has_libncurses
|
2011-06-27 22:52:33 +00:00
|
|
|
# $*: skip=[y|n|]
|
|
|
|
# if set to 'y', skip the test, but still register the
|
|
|
|
# kconfig and var variables; if 'n' or empty, do the
|
|
|
|
# test.
|
|
|
|
# optional, default to 'n'
|
|
|
|
# eg: skip="${static_link_ko}"
|
2009-10-03 16:49:23 +00:00
|
|
|
check_for() {
|
2011-06-27 22:29:02 +00:00
|
|
|
local lib_exts
|
2011-06-27 22:52:33 +00:00
|
|
|
local skip
|
2009-05-01 16:16:53 +00:00
|
|
|
local val
|
|
|
|
local item
|
|
|
|
local where
|
2009-05-02 18:23:58 +00:00
|
|
|
local status
|
2011-06-27 22:29:02 +00:00
|
|
|
local ext
|
2009-05-01 16:16:53 +00:00
|
|
|
|
2011-05-26 20:51:03 +00:00
|
|
|
# Note: prog/inc/lib and var/kconfig/ver/err are set here,
|
2011-05-26 16:40:53 +00:00
|
|
|
# but declared by the caller (because it needs it)
|
2009-05-01 16:16:53 +00:00
|
|
|
for item in "${@}"; do
|
|
|
|
case "${item}" in
|
2011-06-27 22:52:33 +00:00
|
|
|
prog=*|inc=*|lib=*|var=*|ver=*|err=*|kconfig=*|lib_exts=*|skip=*)
|
2011-06-02 17:58:05 +00:00
|
|
|
eval ${item%%=*}=\"${item#*=}\"
|
2009-05-01 16:16:53 +00:00
|
|
|
;;
|
2011-06-27 22:29:02 +00:00
|
|
|
*) do_error "check_for: incorrect parameters: '${item}'";;
|
2009-05-01 16:16:53 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2011-06-08 13:47:03 +00:00
|
|
|
case "${prog}:${inc}:${lib}" in
|
|
|
|
?*:?*:|?*::?*|:?*:?*|?*:?*:?*)
|
|
|
|
if [ -n "${var}" ]; then
|
|
|
|
do_error "check_for: the use of var is not compatible with passing several of [prog|inc|lib] at once"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
::) do_error "check_for: [prog|inc|lib] is mandatory";;
|
|
|
|
esac
|
|
|
|
|
2011-06-27 22:52:33 +00:00
|
|
|
if [ -n "${var}" ]; then
|
|
|
|
add_to_var_list "${var}"
|
|
|
|
fi
|
2011-05-26 20:51:03 +00:00
|
|
|
if [ -n "${kconfig}" ]; then
|
|
|
|
add_to_kconfig_list "${kconfig}"
|
|
|
|
fi
|
|
|
|
|
2011-06-27 22:52:33 +00:00
|
|
|
if [ "${skip}" = "y" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2011-06-08 13:47:03 +00:00
|
|
|
if [ -n "${prog}" ]; then
|
|
|
|
for item in ${prog}; do
|
|
|
|
printf "Checking for '${item}'... "
|
|
|
|
if [ -n "${var}" ]; then
|
|
|
|
eval val="\${${var}}"
|
|
|
|
if [ -n "${val}" ]; then
|
2011-06-27 22:52:33 +00:00
|
|
|
status="${val} (cached)\n"
|
2011-08-22 07:41:35 +00:00
|
|
|
where="${val}"
|
2011-06-27 22:52:33 +00:00
|
|
|
break
|
2009-05-01 16:16:53 +00:00
|
|
|
fi
|
2011-06-08 13:47:03 +00:00
|
|
|
fi
|
|
|
|
where="$( which "${item}" 2>/dev/null )"
|
|
|
|
if [ -z "${where}" ]; then
|
|
|
|
printf "no\n"
|
|
|
|
continue
|
|
|
|
elif [ -n "${ver}" ]; then
|
|
|
|
str=$( LC_ALL=C "${where}" --version 2>&1 \
|
|
|
|
|grep -E "${ver}" \
|
|
|
|
|head -n 1
|
|
|
|
)
|
|
|
|
if [ -z "${str}" ]; then
|
2009-05-02 18:23:58 +00:00
|
|
|
printf "no\n"
|
2011-06-08 13:47:03 +00:00
|
|
|
unset where
|
2009-05-01 16:16:53 +00:00
|
|
|
continue
|
|
|
|
fi
|
2011-06-08 13:47:03 +00:00
|
|
|
fi
|
|
|
|
status="${where}"
|
|
|
|
break
|
|
|
|
done
|
|
|
|
if [ -z "${status}" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
printf "${status}\n"
|
|
|
|
unset status
|
|
|
|
fi
|
2009-10-03 16:49:23 +00:00
|
|
|
|
2011-06-08 13:47:03 +00:00
|
|
|
if [ -n "${inc}" ]; then
|
|
|
|
for item in ${inc}; do
|
|
|
|
printf "Checking for '${item}'... "
|
|
|
|
if printf "#include \"${item}\"" |gcc -x c -c - -o /dev/null >/dev/null 2>&1; then
|
|
|
|
where="${item}"
|
|
|
|
status=yes
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
printf "no\n"
|
|
|
|
done
|
|
|
|
if [ -z "${status}" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
printf "${status}\n"
|
|
|
|
unset status
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${lib}" ]; then
|
2011-06-27 22:29:02 +00:00
|
|
|
if [ -z "${lib_exts}" ]; then
|
|
|
|
do_error "check_for: no library extension specified for '${lib}'"
|
|
|
|
fi
|
2011-06-08 13:47:03 +00:00
|
|
|
for item in ${lib}; do
|
2011-06-27 22:29:02 +00:00
|
|
|
for ext in ${lib_exts}; do
|
|
|
|
printf "Checking for '${item}.${ext}'... "
|
|
|
|
where="$( gcc -print-file-name="${item}.${ext}" )"
|
|
|
|
if [ "${where}" != "${item}.${ext}" ]; then
|
|
|
|
where="$( readlink "${where}" )"
|
|
|
|
status=yes
|
|
|
|
break 2;
|
|
|
|
fi
|
|
|
|
printf "no\n"
|
|
|
|
done
|
2011-06-08 13:47:03 +00:00
|
|
|
done
|
|
|
|
if [ -z "${status}" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
printf "${status}\n"
|
|
|
|
unset status
|
2009-10-03 16:49:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${var}" ]; then
|
|
|
|
eval ${var}='"'"${where}"'"'
|
|
|
|
fi
|
2011-05-26 20:51:03 +00:00
|
|
|
if [ -n "${kconfig}" ]; then
|
|
|
|
eval ${kconfig}=y
|
|
|
|
fi
|
2009-10-03 16:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This function checks for a tool, and aborts if not found
|
|
|
|
# See check_for(), above, for how to call has_or_abort
|
|
|
|
has_or_abort() {
|
2011-05-26 16:40:53 +00:00
|
|
|
# We declare these 6 variables here, although they are
|
|
|
|
# set in check_for(), called below
|
|
|
|
local prog inc lib
|
2011-05-26 20:51:03 +00:00
|
|
|
local var ver err kconfig
|
2011-05-26 16:40:53 +00:00
|
|
|
|
2009-10-03 16:49:23 +00:00
|
|
|
if ! check_for "$@"; then
|
2011-07-03 10:00:37 +00:00
|
|
|
printf " * A mandatory dependency is missing, or version mis-match:\n"
|
|
|
|
printf " * - ${err:-${prog}${inc}${lib}: none found}\n"
|
2011-05-26 16:40:53 +00:00
|
|
|
if [ -n "${var}" ]; then
|
2011-06-02 19:43:36 +00:00
|
|
|
printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
|
2011-05-26 16:40:53 +00:00
|
|
|
fi
|
2009-05-02 18:23:58 +00:00
|
|
|
printf "\n"
|
2011-05-26 16:40:53 +00:00
|
|
|
# Bail out if --force is not specified
|
|
|
|
[ -z "${FORCE}" ] && do_error "Bailing out..."
|
2009-05-02 18:23:58 +00:00
|
|
|
printf "<* *>\n"
|
|
|
|
printf "<* FORCE in action: *>\n"
|
|
|
|
printf "<* Continuing despite missing pre-requisite *>\n"
|
|
|
|
printf "<* Prepare for breakage *>\n"
|
|
|
|
printf "<* *>\n"
|
|
|
|
printf "\n"
|
|
|
|
fi
|
2009-05-01 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2011-05-26 16:33:53 +00:00
|
|
|
# This function checks for a tool, and warns if not found
|
|
|
|
# See check_for(), above, for how to call has_or_abort
|
|
|
|
# Note: if err is not set, then no error message is printed
|
|
|
|
has_or_warn() {
|
|
|
|
# We declare these 6 variables here, although they are
|
|
|
|
# set in check_for(), called below
|
|
|
|
local prog inc lib
|
2011-05-26 20:51:03 +00:00
|
|
|
local var ver err kconfig
|
2011-05-26 16:33:53 +00:00
|
|
|
|
|
|
|
if ! check_for "$@"; then
|
2011-07-03 10:00:37 +00:00
|
|
|
printf " * An optional dependency is missing, some features will be disabled"
|
|
|
|
printf "${err:+:\n * - ${err}}\n"
|
2011-05-26 16:33:53 +00:00
|
|
|
if [ -n "${var}" ]; then
|
2011-06-02 19:43:36 +00:00
|
|
|
printf " * --> You can give the path to this tool using: --with-${var}=PATH\n"
|
2011-05-26 16:33:53 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2007-07-01 20:52:34 +00:00
|
|
|
do_help() {
|
|
|
|
cat <<__EOF__
|
2009-01-18 15:08:28 +00:00
|
|
|
\`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems.
|
2007-07-01 20:52:34 +00:00
|
|
|
|
|
|
|
USAGE: ./configure [OPTION]...
|
|
|
|
|
|
|
|
Defaults for the options are specified in brackets.
|
|
|
|
|
|
|
|
Configuration:
|
2008-12-22 18:21:51 +00:00
|
|
|
-h, --help display this help and exit
|
2009-05-01 16:16:53 +00:00
|
|
|
--force force configure to continue, even in case
|
|
|
|
some pre-requisites are missing
|
2008-06-25 08:38:51 +00:00
|
|
|
|
|
|
|
Installation directories:
|
2007-07-01 21:21:11 +00:00
|
|
|
--prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
|
2007-07-22 17:44:27 +00:00
|
|
|
--local don't install, and use current directory
|
2007-07-01 20:52:34 +00:00
|
|
|
|
|
|
|
By default, \`make install' will install all the files in
|
|
|
|
\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
|
|
|
|
an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
|
|
|
|
for instance \`--prefix=\${HOME}'.
|
|
|
|
|
|
|
|
For better control, use the options below.
|
2011-08-17 20:23:21 +00:00
|
|
|
Note: options marked as \`ignored' are recognised, but not acted upon, as
|
|
|
|
they make no sense for crosstool-NG, or they are not implemented yet.
|
2007-07-01 20:52:34 +00:00
|
|
|
|
|
|
|
Fine tuning of the installation directories:
|
2008-07-18 21:03:04 +00:00
|
|
|
--bindir=DIR user executables [PREFIX/bin]
|
|
|
|
--libdir=DIR object code libraries [PREFIX/lib]
|
|
|
|
--docdir=DIR info documentation [PREFIX/share/doc]
|
|
|
|
--mandir=DIR man documentation [PREFIX/share/man]
|
2011-08-17 20:23:21 +00:00
|
|
|
--infodir=DIR info documentation [DATAROOTDIR/info] (ignored)
|
|
|
|
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
|
|
|
|
(ignored)
|
|
|
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] (ignored)
|
|
|
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var] (ignored)
|
|
|
|
|
|
|
|
Program names:
|
|
|
|
--program-prefix=PREFIX prepend PREFIX to installed program names
|
2011-08-19 20:43:01 +00:00
|
|
|
--program-suffix=SUFFIX append SUFFIX to installed program names
|
2011-08-21 21:11:26 +00:00
|
|
|
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
|
2011-08-17 20:23:21 +00:00
|
|
|
|
|
|
|
System types:
|
|
|
|
--build=BUILD configure for building on BUILD [guessed] (ignored)
|
|
|
|
--host=HOST cross-compile to build programs to run on HOST [BUILD]
|
|
|
|
(ignored)
|
2008-06-25 08:34:47 +00:00
|
|
|
|
|
|
|
Optional Features:
|
2011-08-17 20:23:21 +00:00
|
|
|
--enable-shared[=PKGS] build shared libraries [default=yes] (ignored)
|
|
|
|
--enable-static[=PKGS] build static libraries [default=yes] (ignored)
|
|
|
|
|
|
|
|
Optional Packages:
|
2009-01-18 15:08:28 +00:00
|
|
|
--with-install=PATH Specify the full PATH to GNU install
|
2009-05-01 16:16:53 +00:00
|
|
|
--with-make=PATH Specify the full PATH to GNU make >= 3.80
|
2009-01-18 15:08:28 +00:00
|
|
|
--with-grep=PATH Specify the full PATH to GNU grep
|
|
|
|
--with-sed=PATH Specify the full PATH to GNU sed
|
|
|
|
--with-bash=PATH Specify the full PATH to bash >= 3.0
|
2007-07-01 20:52:34 +00:00
|
|
|
__EOF__
|
|
|
|
}
|
|
|
|
|
2007-09-12 20:44:15 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# Set user's options
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
while [ $# -ne 0 ]; do
|
|
|
|
case "$1" in
|
2009-04-20 19:57:16 +00:00
|
|
|
--local) LOCAL_set="y"; shift;;
|
2007-07-01 19:04:20 +00:00
|
|
|
--prefix*) set_prefix "$1" "$2" && shift || shift 2;;
|
|
|
|
--bindir*) set_bindir "$1" "$2" && shift || shift 2;;
|
|
|
|
--libdir*) set_libdir "$1" "$2" && shift || shift 2;;
|
|
|
|
--docdir*) set_docdir "$1" "$2" && shift || shift 2;;
|
|
|
|
--mandir*) set_mandir "$1" "$2" && shift || shift 2;;
|
2009-01-18 15:08:28 +00:00
|
|
|
--with-*) set_tool "$1" "$2" && shift || shift 2;;
|
2011-08-17 21:05:01 +00:00
|
|
|
--program-prefix=*|--program-prefix)
|
|
|
|
set_program_prefix "$1" "$2" && shift || shift 2
|
|
|
|
;;
|
2011-08-19 20:43:01 +00:00
|
|
|
--program-suffix=*|--program-suffix)
|
|
|
|
set_program_suffix "$1" "$2" && shift || shift 2
|
|
|
|
;;
|
2011-08-21 21:11:26 +00:00
|
|
|
--program-transform-name=*|--program-transform-name)
|
|
|
|
set_program_transform_name "$1" "$2" && shift || shift 2
|
|
|
|
;;
|
2009-05-01 16:16:53 +00:00
|
|
|
--force) FORCE=1; shift;;
|
2007-07-01 20:52:34 +00:00
|
|
|
--help|-h) do_help; exit 0;;
|
2010-01-17 16:57:53 +00:00
|
|
|
# Skip, auto-stuff compatibility
|
|
|
|
--build=*|--host=*|--infodir=*|--datadir=*|--sysconfdir=*|--localstatedir=*) shift;;
|
|
|
|
--build|--host|--infodir|--datadir|--sysconfdir|--localstatedir) shift 2;;
|
2011-07-14 15:59:33 +00:00
|
|
|
--enable-shared|--disable-shared|--enable-static|--disable-static) shift;;
|
2009-05-11 20:44:47 +00:00
|
|
|
*) printf "Unrecognised option: '${1}'\n"; do_help; exit 1;;
|
2007-07-01 19:04:20 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2008-07-07 21:22:25 +00:00
|
|
|
# Use defaults
|
2007-07-01 21:21:11 +00:00
|
|
|
[ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
|
2008-07-07 21:22:25 +00:00
|
|
|
|
|
|
|
# Special case when installing locally
|
2009-04-20 19:57:16 +00:00
|
|
|
if [ "${LOCAL_set}" = "y" ]; then
|
2008-12-22 18:21:51 +00:00
|
|
|
set_prefix "" "$( pwd )"
|
|
|
|
set_bindir "" "$( pwd )"
|
|
|
|
set_libdir "" "$( pwd )"
|
|
|
|
set_docdir "" "$( pwd )/docs"
|
|
|
|
set_mandir "" "$( pwd )/docs"
|
2011-08-17 21:05:01 +00:00
|
|
|
set_program_prefix "" ""
|
2011-08-19 20:43:01 +00:00
|
|
|
set_program_suffix "" ""
|
2011-08-21 21:11:26 +00:00
|
|
|
set_program_transform_name "" ""
|
2007-07-22 17:44:27 +00:00
|
|
|
fi
|
2007-07-01 20:52:34 +00:00
|
|
|
|
2007-09-12 20:44:15 +00:00
|
|
|
#---------------------------------------------------------------------
|
2009-01-18 15:08:28 +00:00
|
|
|
# Some sanity checks, now
|
|
|
|
|
2009-10-03 16:49:23 +00:00
|
|
|
# We check for grep and sed manually, because they are used in check_for()
|
2009-01-18 15:08:28 +00:00
|
|
|
printf "Checking for 'grep'... "
|
|
|
|
if [ -n "${grep}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${grep} (cached)\n"
|
2009-01-18 15:08:28 +00:00
|
|
|
else
|
|
|
|
grep="$( which grep 2>/dev/null )"
|
2009-02-01 18:40:16 +00:00
|
|
|
if [ -z "${grep}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "not found\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
else
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${grep}\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
printf "Checking whether '${grep}' supports -E... "
|
|
|
|
if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "yes\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
else
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "no\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
grep=
|
|
|
|
fi
|
|
|
|
fi
|
2009-01-18 15:08:28 +00:00
|
|
|
fi
|
2009-02-01 18:40:16 +00:00
|
|
|
if [ -z "${grep}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "Either you are missing entirely the needed tool,\n"
|
|
|
|
printf "or the version you have is too old.\n"
|
|
|
|
printf "You can give the path to this tool using: --with-grep=PATH\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
do_error "Bailing out..."
|
2008-12-23 22:20:25 +00:00
|
|
|
fi
|
2009-05-01 16:16:53 +00:00
|
|
|
add_to_var_list grep
|
2008-12-23 22:20:25 +00:00
|
|
|
|
2009-01-18 15:08:28 +00:00
|
|
|
printf "Checking for 'sed'... "
|
|
|
|
if [ -n "${sed}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${sed} (cached)\n"
|
2009-01-18 15:08:28 +00:00
|
|
|
else
|
|
|
|
sed="$( which sed 2>/dev/null )"
|
2009-02-01 18:40:16 +00:00
|
|
|
if [ -z "${sed}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "not found\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
else
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "${sed}\n"
|
2009-04-02 22:28:10 +00:00
|
|
|
printf "Checking whether '${sed}' supports -i and -e... "
|
2009-02-01 18:40:16 +00:00
|
|
|
touch .ct-ng.sed.test
|
|
|
|
if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "yes\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
else
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "no\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
sed=
|
|
|
|
fi
|
|
|
|
rm -f .ct-ng.sed.test
|
|
|
|
fi
|
2009-01-18 15:08:28 +00:00
|
|
|
fi
|
2009-02-01 18:40:16 +00:00
|
|
|
if [ -z "${sed}" ]; then
|
2009-05-11 20:44:47 +00:00
|
|
|
printf "Either you are missing entirely the needed tool,\n"
|
|
|
|
printf "or the version you have is too old.\n"
|
|
|
|
printf "You can give the path to this tool using: --with-sed=PATH\n"
|
2009-02-01 18:40:16 +00:00
|
|
|
do_error "Bailing out..."
|
2009-01-18 15:08:28 +00:00
|
|
|
fi
|
2009-05-01 16:16:53 +00:00
|
|
|
add_to_var_list sed
|
|
|
|
|
|
|
|
# The regular list of tools we can now easily check for
|
|
|
|
has_or_abort prog=bash \
|
|
|
|
var=bash \
|
2009-08-19 17:41:24 +00:00
|
|
|
ver='^GNU bash, version (3\.[1-9]|4)' \
|
|
|
|
err="'bash' 3.1 or above was not found"
|
2009-05-01 16:16:53 +00:00
|
|
|
has_or_abort prog=cut
|
|
|
|
has_or_abort prog=install var=install
|
|
|
|
has_or_abort prog=make \
|
|
|
|
var=make \
|
|
|
|
ver='^GNU Make (3.[89][[:digit:]]|[4-9])' \
|
|
|
|
err="GNU 'make' 3.80 or above was not found"
|
|
|
|
has_or_abort prog=gcc
|
2009-07-22 18:42:23 +00:00
|
|
|
has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
|
2009-05-01 16:16:53 +00:00
|
|
|
has_or_abort prog=bison
|
|
|
|
has_or_abort prog=flex
|
|
|
|
has_or_abort prog=makeinfo
|
|
|
|
has_or_abort prog=automake \
|
2009-08-01 17:18:12 +00:00
|
|
|
ver='\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)' \
|
2009-05-01 16:16:53 +00:00
|
|
|
err="'automake' 1.10 or above was not found"
|
|
|
|
has_or_abort prog=libtool \
|
2010-05-23 14:34:15 +00:00
|
|
|
var=libtool \
|
2009-05-01 16:16:53 +00:00
|
|
|
ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
|
|
|
|
err="'libtool' 1.5.26 or above was not found"
|
2011-08-22 07:40:31 +00:00
|
|
|
has_or_abort prog=libtoolize \
|
|
|
|
var=libtoolize \
|
|
|
|
ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
|
|
|
|
err="'libtoolize' 1.5.26 or above was not found"
|
2010-05-17 09:29:26 +00:00
|
|
|
has_or_abort prog=stat
|
2010-11-16 09:00:27 +00:00
|
|
|
has_or_abort prog="curl wget"
|
2009-05-01 16:16:53 +00:00
|
|
|
has_or_abort prog=patch
|
|
|
|
has_or_abort prog=tar
|
|
|
|
has_or_abort prog=gzip
|
|
|
|
has_or_abort prog=bzip2
|
2011-08-10 21:13:46 +00:00
|
|
|
has_or_warn prog=xz \
|
|
|
|
kconfig=has_xzutils \
|
2011-08-25 22:05:20 +00:00
|
|
|
err="xz-compressed tarballs will not be used"
|
2009-05-02 21:50:09 +00:00
|
|
|
has_or_abort prog=readlink
|
2010-05-17 12:11:08 +00:00
|
|
|
has_or_abort prog=objcopy var=objcopy
|
|
|
|
has_or_abort prog=objdump var=objdump
|
|
|
|
has_or_abort prog=readelf var=readelf
|
|
|
|
has_or_abort prog=patch var=patch
|
2011-07-04 20:53:49 +00:00
|
|
|
has_or_warn prog=cvs \
|
|
|
|
kconfig=has_cvs \
|
|
|
|
err="it will not be possible to use newlib cvs snapshots"
|
2011-08-01 20:46:57 +00:00
|
|
|
has_or_warn prog=svn \
|
2011-07-04 22:54:06 +00:00
|
|
|
kconfig=has_svn \
|
|
|
|
err="subversion is required to download eglibc"
|
2009-05-01 16:16:53 +00:00
|
|
|
|
2011-06-28 15:25:02 +00:00
|
|
|
# Host system checks
|
|
|
|
|
|
|
|
printf "Checking for host system... "
|
|
|
|
host="$( uname -s )"
|
|
|
|
printf "%s\n" "${host}"
|
|
|
|
case "${host}" in
|
|
|
|
Linux) ;;
|
|
|
|
Cygwin) ;;
|
|
|
|
*)
|
|
|
|
printf " * Runing under %s is not fully tested\n" "${host}"
|
|
|
|
printf " * You may encounter some weird behavior\n"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2011-06-27 19:03:40 +00:00
|
|
|
printf "Checking if static linking is possible... "
|
|
|
|
static_link_ok=""
|
|
|
|
case "${host}" in
|
|
|
|
Darwin) ;;
|
|
|
|
*) tmp=.static.tmp
|
2011-07-04 20:37:44 +00:00
|
|
|
if gcc -xc - -static -o "${tmp}" >/dev/null 2>&1 <<-_EOF_
|
2011-06-27 19:03:40 +00:00
|
|
|
int main() { return 0; }
|
|
|
|
_EOF_
|
|
|
|
then
|
|
|
|
static_link_ok="y"
|
|
|
|
fi
|
|
|
|
rm -f "${tmp}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ "${static_link_ok}" = "y" ]; then
|
2011-06-27 22:52:33 +00:00
|
|
|
static_link_ko=""
|
2011-06-27 19:03:40 +00:00
|
|
|
printf "yes\n"
|
|
|
|
else
|
2011-06-27 22:52:33 +00:00
|
|
|
static_link_ko="y"
|
2011-06-27 19:03:40 +00:00
|
|
|
printf "no\n"
|
|
|
|
printf " * An optional host feature is missing, some features will be disabled:\n"
|
|
|
|
printf " * - It will not be possible to statically link toolchain's binaries\n"
|
|
|
|
fi
|
|
|
|
add_to_kconfig_list static_link_ok
|
|
|
|
|
|
|
|
# Library checks
|
2011-06-27 22:52:33 +00:00
|
|
|
libs_exts="so dylib"
|
|
|
|
if [ "${static_link_ok}" = "y" ]; then
|
2011-07-04 20:37:44 +00:00
|
|
|
libs_exts="${libs_exts} a"
|
2011-06-27 22:52:33 +00:00
|
|
|
fi
|
2011-06-27 22:29:02 +00:00
|
|
|
|
2011-06-08 17:32:20 +00:00
|
|
|
ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
|
2011-06-27 22:29:02 +00:00
|
|
|
ncurses_libs="libncursesw libncurses libcurses"
|
2011-06-08 17:32:20 +00:00
|
|
|
has_or_abort lib="${ncurses_libs}" \
|
2011-06-27 22:29:02 +00:00
|
|
|
lib_exts="${libs_exts}" \
|
2011-06-08 17:32:20 +00:00
|
|
|
inc="${ncurses_hdrs}" \
|
2011-06-04 17:17:26 +00:00
|
|
|
err="The 'ncurses' library is needed fo the menuconfig frontend"
|
2009-01-18 15:08:28 +00:00
|
|
|
|
2011-06-27 22:29:02 +00:00
|
|
|
has_or_abort lib="libstdc++" \
|
|
|
|
lib_exts="${libs_exts}" \
|
2011-06-04 17:17:26 +00:00
|
|
|
err="The 'libstdc++' library is needed to build gcc"
|
2011-06-02 17:49:36 +00:00
|
|
|
|
2011-06-02 17:50:12 +00:00
|
|
|
# Yes, we may be checking twice for libstdc++.a
|
|
|
|
# The first is because we need one instance of libstdc++ (shared or static)
|
|
|
|
# because it is needed for PPL; the second is because the static version is
|
|
|
|
# required for static-linking, and if missing, the option is removed.
|
2011-06-27 22:52:33 +00:00
|
|
|
has_or_warn lib="libstdc++" \
|
|
|
|
lib_exts="a" \
|
2011-06-02 17:50:12 +00:00
|
|
|
err="static 'libstdc++' is needed to statically link the toolchain's executables" \
|
2011-06-27 22:52:33 +00:00
|
|
|
kconfig=has_static_libstdcxx \
|
|
|
|
skip="${static_link_ko}"
|
2011-06-02 17:50:12 +00:00
|
|
|
|
2011-06-27 22:29:02 +00:00
|
|
|
has_or_warn inc="expat.h" \
|
|
|
|
lib="libexpat" \
|
|
|
|
lib_exts="${libs_exts}" \
|
debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.
Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"
Hence, expat should be considered mandatory.
On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.
This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.
Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 13:47:43 +00:00
|
|
|
err="The 'expat' header file and library are needed to link cross-gdb's executables" \
|
|
|
|
kconfig=has_expat
|
|
|
|
|
|
|
|
# Yes, we may be checking twice for libexpat.a
|
|
|
|
# The first is because we need one instance of libexpat (shared or static)
|
|
|
|
# because it is needed for cross-gdb; the second is because the static version
|
|
|
|
# is required for static-linking, and if missing, the option is removed.
|
2011-06-27 22:52:33 +00:00
|
|
|
has_or_warn lib="libexpat" \
|
|
|
|
lib_exts="a" \
|
debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.
Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"
Hence, expat should be considered mandatory.
On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.
This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.
Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 13:47:43 +00:00
|
|
|
err="static 'expat' is needed to statically link cross-gdb's executables" \
|
2011-06-27 22:52:33 +00:00
|
|
|
kconfig=has_static_expat \
|
|
|
|
skip="${static_link_ko}"
|
debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.
Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"
Hence, expat should be considered mandatory.
On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.
This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.
Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 13:47:43 +00:00
|
|
|
|
|
|
|
for v in 7 6 5 4; do
|
2011-06-27 22:29:02 +00:00
|
|
|
python_incs="${python_incs} python2.${v}/Python.h"
|
|
|
|
python_libs="${python_libs} libpython2.${v}"
|
debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.
Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"
Hence, expat should be considered mandatory.
On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.
This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.
Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 13:47:43 +00:00
|
|
|
done
|
2011-06-27 22:29:02 +00:00
|
|
|
has_or_warn inc="${python_incs}" \
|
|
|
|
lib="${python_libs}" \
|
|
|
|
lib_exts="${libs_exts}" \
|
debug/cross-gdb: check host dependencies
Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.
Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"
Hence, expat should be considered mandatory.
On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.
This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.
Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-08 13:47:43 +00:00
|
|
|
err="The 'python' header file and library are needed for some features of cross-gdb"
|
|
|
|
|
2008-12-23 22:20:25 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# Compute the version string
|
2007-09-12 20:44:15 +00:00
|
|
|
|
2009-10-10 11:12:28 +00:00
|
|
|
# If this version is n hg clone, try to get the revision number
|
2008-02-17 22:58:57 +00:00
|
|
|
# If we can't get the revision number, use date
|
2011-06-02 19:43:36 +00:00
|
|
|
printf "\nComputing version string... "
|
2008-02-17 22:58:57 +00:00
|
|
|
case "${VERSION}" in
|
2009-06-17 08:46:28 +00:00
|
|
|
*+hg|hg)
|
2010-01-17 22:06:02 +00:00
|
|
|
REVISION="$( hg id -n 2>/dev/null || true )"
|
2008-12-22 18:21:51 +00:00
|
|
|
case "${REVISION}" in
|
2009-06-17 08:46:28 +00:00
|
|
|
"")
|
2008-12-22 18:21:51 +00:00
|
|
|
VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
|
|
|
|
*)
|
2009-07-15 07:22:47 +00:00
|
|
|
VERSION="${VERSION}_$( hg id -b )@${REVISION%%+}_$( hg id -i )"
|
2008-12-22 18:21:51 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
# Arrange to have no / in the directory name, no need to create an
|
|
|
|
# arbitrarily deep directory structure
|
2009-05-11 20:44:47 +00:00
|
|
|
VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
|
2008-04-17 19:21:32 +00:00
|
|
|
;;
|
2008-02-17 22:58:57 +00:00
|
|
|
esac
|
2010-01-17 22:06:02 +00:00
|
|
|
printf "${VERSION}\n"
|
2008-02-17 22:58:57 +00:00
|
|
|
|
2008-12-23 22:20:25 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# Compute and check install paths
|
|
|
|
|
2008-06-25 08:34:47 +00:00
|
|
|
# Now we have the version string, we can build up the paths
|
2008-06-11 21:45:57 +00:00
|
|
|
[ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
|
2009-12-10 14:09:13 +00:00
|
|
|
[ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib"
|
|
|
|
[ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc"
|
2010-07-15 20:34:31 +00:00
|
|
|
[ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man"
|
2008-06-11 21:45:57 +00:00
|
|
|
|
2009-12-10 14:09:13 +00:00
|
|
|
# Install support files in our own sub-dir, so as not to mangle (system)
|
|
|
|
# files and dirs, but only if not --local
|
|
|
|
if [ -z "${LOCAL_set}" ]; then
|
|
|
|
LIBDIR="${LIBDIR}/ct-ng-${VERSION}"
|
|
|
|
DOCDIR="${DOCDIR}/ct-ng-${VERSION}"
|
|
|
|
fi
|
|
|
|
|
2008-11-16 21:55:46 +00:00
|
|
|
# Check that install PATHs are absolute
|
|
|
|
for p in BIN LIB DOC MAN; do
|
2008-12-22 18:21:51 +00:00
|
|
|
var="${p}DIR"
|
|
|
|
eval v='"${'"${var}"'}"'
|
|
|
|
case "${v}" in
|
|
|
|
/*) ;;
|
2011-08-17 21:05:01 +00:00
|
|
|
*) do_error "'${var}' is not an absolute path: '${v}'";;
|
2008-12-22 18:21:51 +00:00
|
|
|
esac
|
2008-11-16 21:55:46 +00:00
|
|
|
done
|
2011-08-17 21:05:01 +00:00
|
|
|
case "${PROG_PFX}" in
|
|
|
|
*/*) do_error "program prefix '${PROG_PFX}' contains a '/'";;
|
|
|
|
esac
|
2011-08-19 20:43:01 +00:00
|
|
|
case "${PROG_SFX}" in
|
|
|
|
*/*) do_error "program suffix '${PROG_SFX}' contains a '/'";;
|
|
|
|
esac
|
2008-11-16 21:55:46 +00:00
|
|
|
|
2008-12-23 22:20:25 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# That's all, folks!
|
2008-06-25 08:34:47 +00:00
|
|
|
|
2008-07-07 21:22:25 +00:00
|
|
|
printf "Building up Makefile... "
|
2009-01-18 15:08:28 +00:00
|
|
|
var_sed="$( for var_name in ${var_list}; do
|
|
|
|
eval echo 's,@@${var_name}@@,${'"${var_name}"'},g'
|
2011-05-26 20:51:03 +00:00
|
|
|
done
|
2009-01-18 15:08:28 +00:00
|
|
|
)"
|
2011-05-26 20:51:03 +00:00
|
|
|
kconfig_sed="s/@@KCONFIG@@/$( for k_name in ${kconfig_list}; do
|
|
|
|
eval printf \"${k_name}=\${${k_name}} \"
|
|
|
|
done
|
|
|
|
)/"
|
|
|
|
"${sed}" -r -e "s,@@BINDIR@@,${BINDIR},g" \
|
|
|
|
-e "s,@@LIBDIR@@,${LIBDIR},g" \
|
|
|
|
-e "s,@@DOCDIR@@,${DOCDIR},g" \
|
|
|
|
-e "s,@@MANDIR@@,${MANDIR},g" \
|
2011-08-17 21:05:01 +00:00
|
|
|
-e "s,@@PROG_PFX@@,${PROG_PFX},g" \
|
2011-08-19 20:43:01 +00:00
|
|
|
-e "s,@@PROG_SFX@@,${PROG_SFX},g" \
|
2011-08-21 21:11:26 +00:00
|
|
|
-e "s,@@PROG_SED@@,${PROG_SED},g" \
|
2011-05-26 20:51:03 +00:00
|
|
|
-e "s,@@VERSION@@,${VERSION},g" \
|
|
|
|
-e "s,@@DATE@@,${DATE},g" \
|
|
|
|
-e "s,@@LOCAL@@,${LOCAL_set},g" \
|
|
|
|
-e "${var_sed}" \
|
|
|
|
-e "${kconfig_sed}" \
|
|
|
|
Makefile.in \
|
|
|
|
>Makefile
|
2008-07-16 21:59:49 +00:00
|
|
|
echo "done"
|
2007-07-01 21:21:11 +00:00
|
|
|
|
|
|
|
cat <<__EOF__
|
2008-07-16 21:59:49 +00:00
|
|
|
|
2007-07-02 19:40:54 +00:00
|
|
|
crosstool-NG configured as follows:
|
2008-06-11 21:45:57 +00:00
|
|
|
PREFIX='${PREFIX}'
|
|
|
|
BINDIR='${BINDIR}'
|
|
|
|
LIBDIR='${LIBDIR}'
|
|
|
|
DOCDIR='${DOCDIR}'
|
|
|
|
MANDIR='${MANDIR}'
|
2011-08-17 21:05:01 +00:00
|
|
|
PROG_PFX='${PROG_PFX}'
|
2011-08-19 20:43:01 +00:00
|
|
|
PROG_SFX='${PROG_SFX}'
|
2011-08-21 21:11:26 +00:00
|
|
|
PROG_SED='${PROG_SED}'
|
2008-12-23 22:20:25 +00:00
|
|
|
|
|
|
|
Now run:
|
|
|
|
make
|
2007-07-01 21:21:11 +00:00
|
|
|
__EOF__
|
2009-04-20 20:14:53 +00:00
|
|
|
if [ "${LOCAL_set}" != "y" ]; then
|
2009-04-20 19:57:16 +00:00
|
|
|
printf " make install\n"
|
|
|
|
fi
|