mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-18 18:56:31 +00:00
configure: do not test for static libs if static link is impossible
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
30d160d636
commit
66f5e1919b
43
configure
vendored
43
configure
vendored
@ -118,8 +118,15 @@ add_to_kconfig_list() {
|
|||||||
# the prog/inc/lib was found
|
# the prog/inc/lib was found
|
||||||
# optional, defaults to none
|
# optional, defaults to none
|
||||||
# eg: kconfig=has_libncurses
|
# eg: kconfig=has_libncurses
|
||||||
|
# $*: 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}"
|
||||||
check_for() {
|
check_for() {
|
||||||
local lib_exts
|
local lib_exts
|
||||||
|
local skip
|
||||||
local val
|
local val
|
||||||
local item
|
local item
|
||||||
local where
|
local where
|
||||||
@ -130,7 +137,7 @@ check_for() {
|
|||||||
# but declared by the caller (because it needs it)
|
# but declared by the caller (because it needs it)
|
||||||
for item in "${@}"; do
|
for item in "${@}"; do
|
||||||
case "${item}" in
|
case "${item}" in
|
||||||
prog=*|inc=*|lib=*|var=*|ver=*|err=*|kconfig=*|lib_exts=*)
|
prog=*|inc=*|lib=*|var=*|ver=*|err=*|kconfig=*|lib_exts=*|skip=*)
|
||||||
eval ${item%%=*}=\"${item#*=}\"
|
eval ${item%%=*}=\"${item#*=}\"
|
||||||
;;
|
;;
|
||||||
*) do_error "check_for: incorrect parameters: '${item}'";;
|
*) do_error "check_for: incorrect parameters: '${item}'";;
|
||||||
@ -146,19 +153,25 @@ check_for() {
|
|||||||
::) do_error "check_for: [prog|inc|lib] is mandatory";;
|
::) do_error "check_for: [prog|inc|lib] is mandatory";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ -n "${var}" ]; then
|
||||||
|
add_to_var_list "${var}"
|
||||||
|
fi
|
||||||
if [ -n "${kconfig}" ]; then
|
if [ -n "${kconfig}" ]; then
|
||||||
add_to_kconfig_list "${kconfig}"
|
add_to_kconfig_list "${kconfig}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${skip}" = "y" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${prog}" ]; then
|
if [ -n "${prog}" ]; then
|
||||||
for item in ${prog}; do
|
for item in ${prog}; do
|
||||||
printf "Checking for '${item}'... "
|
printf "Checking for '${item}'... "
|
||||||
if [ -n "${var}" ]; then
|
if [ -n "${var}" ]; then
|
||||||
eval val="\${${var}}"
|
eval val="\${${var}}"
|
||||||
if [ -n "${val}" ]; then
|
if [ -n "${val}" ]; then
|
||||||
printf "${val} (cached)\n"
|
status="${val} (cached)\n"
|
||||||
add_to_var_list "${var}"
|
break
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
where="$( which "${item}" 2>/dev/null )"
|
where="$( which "${item}" 2>/dev/null )"
|
||||||
@ -228,7 +241,6 @@ check_for() {
|
|||||||
|
|
||||||
if [ -n "${var}" ]; then
|
if [ -n "${var}" ]; then
|
||||||
eval ${var}='"'"${where}"'"'
|
eval ${var}='"'"${where}"'"'
|
||||||
add_to_var_list "${var}"
|
|
||||||
fi
|
fi
|
||||||
if [ -n "${kconfig}" ]; then
|
if [ -n "${kconfig}" ]; then
|
||||||
eval ${kconfig}=y
|
eval ${kconfig}=y
|
||||||
@ -475,8 +487,10 @@ case "${host}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ "${static_link_ok}" = "y" ]; then
|
if [ "${static_link_ok}" = "y" ]; then
|
||||||
|
static_link_ko=""
|
||||||
printf "yes\n"
|
printf "yes\n"
|
||||||
else
|
else
|
||||||
|
static_link_ko="y"
|
||||||
printf "no\n"
|
printf "no\n"
|
||||||
printf " * An optional host feature is missing, some features will be disabled:\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"
|
printf " * - It will not be possible to statically link toolchain's binaries\n"
|
||||||
@ -484,7 +498,10 @@ fi
|
|||||||
add_to_kconfig_list static_link_ok
|
add_to_kconfig_list static_link_ok
|
||||||
|
|
||||||
# Library checks
|
# Library checks
|
||||||
libs_exts="so dylib a"
|
libs_exts="so dylib"
|
||||||
|
if [ "${static_link_ok}" = "y" ]; then
|
||||||
|
libs_exts+=" a"
|
||||||
|
fi
|
||||||
|
|
||||||
ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
|
ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
|
||||||
ncurses_libs="libncursesw libncurses libcurses"
|
ncurses_libs="libncursesw libncurses libcurses"
|
||||||
@ -501,10 +518,11 @@ has_or_abort lib="libstdc++" \
|
|||||||
# The first is because we need one instance of libstdc++ (shared or static)
|
# 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
|
# 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.
|
# required for static-linking, and if missing, the option is removed.
|
||||||
has_or_warn lib="libstdc++" \
|
has_or_warn lib="libstdc++" \
|
||||||
lib_exts="a" \
|
lib_exts="a" \
|
||||||
err="static 'libstdc++' is needed to statically link the toolchain's executables" \
|
err="static 'libstdc++' is needed to statically link the toolchain's executables" \
|
||||||
kconfig=has_static_libstdcxx
|
kconfig=has_static_libstdcxx \
|
||||||
|
skip="${static_link_ko}"
|
||||||
|
|
||||||
has_or_warn inc="expat.h" \
|
has_or_warn inc="expat.h" \
|
||||||
lib="libexpat" \
|
lib="libexpat" \
|
||||||
@ -516,10 +534,11 @@ has_or_warn inc="expat.h" \
|
|||||||
# The first is because we need one instance of libexpat (shared or static)
|
# 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
|
# 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.
|
# is required for static-linking, and if missing, the option is removed.
|
||||||
has_or_warn lib="libexpat" \
|
has_or_warn lib="libexpat" \
|
||||||
lib_exts="a" \
|
lib_exts="a" \
|
||||||
err="static 'expat' is needed to statically link cross-gdb's executables" \
|
err="static 'expat' is needed to statically link cross-gdb's executables" \
|
||||||
kconfig=has_static_expat
|
kconfig=has_static_expat \
|
||||||
|
skip="${static_link_ko}"
|
||||||
|
|
||||||
for v in 7 6 5 4; do
|
for v in 7 6 5 4; do
|
||||||
python_incs="${python_incs} python2.${v}/Python.h"
|
python_incs="${python_incs} python2.${v}/Python.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user