2006-05-02 23:35:55 +02:00
|
|
|
#!/bin/sh
|
2007-02-09 13:32:21 +01:00
|
|
|
# vi: set sw=4 ts=4:
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2007-03-21 19:15:02 +01:00
|
|
|
export LC_ALL=C
|
support/dependencies: detect and bailout when PATH contains spaces/TABs
In Makefiles, variables are split, filtered, and otherwise mangled on
a space as a separator. In a shell, they will also be split on TABs.
We split and filter and iterate on variables in a lot of places, and
most importantly, spaces in PATH is very seldom tested, if at all, so
a lot of packages will not be working properly in such a situation.
For example, the config.guess contains constructs that are not resilient
to a space in PATH:
PATH=$PATH:/.attbin ; export PATH
Also, our fakedate will iterate over PATH:
for P in `echo $PATH | tr ':' ' '`; do
Those are only two cases, but the first means basically all
autotools-based packages are susceptible to subtle breakage.
Furthermore, Buildroot itself does not support that the top-level or
output directories are in a path with spaces anyway.
So, instead of chasing all cases that might be potentially broken,
let's just detect the case and bail out, like we already do when PATH
contains a \n, or when it contains the current working directory.
Reported-by: Dan Raymond <draymond@foxvalley.net>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-03-06 10:19:30 +01:00
|
|
|
TAB="$(printf '\t')"
|
|
|
|
NL="
|
|
|
|
"
|
2006-12-13 08:21:16 +01:00
|
|
|
|
2009-12-16 08:33:38 +01:00
|
|
|
# Verify that grep works
|
2007-01-19 18:11:05 +01:00
|
|
|
echo "WORKS" | grep "WORKS" >/dev/null 2>&1
|
|
|
|
if test $? != 0 ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "grep doesn't work"
|
2007-01-19 18:11:05 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-05-09 19:59:24 +02:00
|
|
|
# Sanity check for CWD in LD_LIBRARY_PATH
|
|
|
|
case ":${LD_LIBRARY_PATH:-unset}:" in
|
|
|
|
(*::*|*:.:*)
|
|
|
|
echo
|
|
|
|
echo "You seem to have the current working directory in your"
|
|
|
|
echo "LD_LIBRARY_PATH environment variable. This doesn't work."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2007-01-19 18:11:05 +01:00
|
|
|
|
2018-05-09 19:59:24 +02:00
|
|
|
# Sanity check for CWD in PATH. Having the current working directory
|
|
|
|
# in the PATH makes various packages (e.g. toolchain, coreutils...)
|
|
|
|
# build process break.
|
|
|
|
# PATH should not contain a newline, otherwise it fails in spectacular
|
|
|
|
# ways as soon as PATH is referenced in a package rule
|
|
|
|
# An empty PATH is technically possible, but in practice we would not
|
|
|
|
# even arrive here if that was the case.
|
|
|
|
case ":${PATH:-unset}:" in
|
|
|
|
(*::*|*:.:*)
|
|
|
|
echo
|
|
|
|
echo "You seem to have the current working directory in your"
|
|
|
|
echo "PATH environment variable. This doesn't work."
|
|
|
|
exit 1
|
|
|
|
;;
|
support/dependencies: detect and bailout when PATH contains spaces/TABs
In Makefiles, variables are split, filtered, and otherwise mangled on
a space as a separator. In a shell, they will also be split on TABs.
We split and filter and iterate on variables in a lot of places, and
most importantly, spaces in PATH is very seldom tested, if at all, so
a lot of packages will not be working properly in such a situation.
For example, the config.guess contains constructs that are not resilient
to a space in PATH:
PATH=$PATH:/.attbin ; export PATH
Also, our fakedate will iterate over PATH:
for P in `echo $PATH | tr ':' ' '`; do
Those are only two cases, but the first means basically all
autotools-based packages are susceptible to subtle breakage.
Furthermore, Buildroot itself does not support that the top-level or
output directories are in a path with spaces anyway.
So, instead of chasing all cases that might be potentially broken,
let's just detect the case and bail out, like we already do when PATH
contains a \n, or when it contains the current working directory.
Reported-by: Dan Raymond <draymond@foxvalley.net>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-03-06 10:19:30 +01:00
|
|
|
(*" "*|*"${TAB}"*|*"${NL}"*)
|
|
|
|
printf "\n"
|
|
|
|
printf "Your PATH contains spaces, TABs, and/or newline (\\\n) characters.\n"
|
2017-05-20 10:20:05 +02:00
|
|
|
printf "This doesn't work. Fix you PATH.\n"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-05-04 00:45:43 +02:00
|
|
|
check_prog_host()
|
|
|
|
{
|
|
|
|
prog="$1"
|
2021-10-01 20:08:32 +02:00
|
|
|
if ! which $prog > /dev/null ; then
|
2014-05-04 00:45:43 +02:00
|
|
|
echo >&2
|
|
|
|
echo "You must install '$prog' on your build machine" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
2006-11-29 11:39:30 +01:00
|
|
|
|
2021-10-01 20:04:25 +02:00
|
|
|
# Verify that which is installed
|
|
|
|
check_prog_host "which"
|
2014-05-04 00:45:43 +02:00
|
|
|
# Verify that sed is installed
|
|
|
|
check_prog_host "sed"
|
2007-03-09 09:33:34 +01:00
|
|
|
|
support/dependencies: ensure we have 'file' on the host
Recently, the autoconf macros for libtool started using '/usr/bin/file'
to determine the type of library that is generated by the toolchain.
Packages that use this recent version of the libtool autoconf macros
will fail in a rather dramatic way when /usr/bin/file is not present
on the host: the package will still build but no shared library is
generated, which in turn may cause build failures in other packages
that link with it.
For example, libpng's configure determines that it is not possible to
build a shared library on MIPS64 because the expected output from 'file'
is not present. Therefore, only a static libpng.a is built. Later,
bandwithd links with -lpng but it doesn't use the pkg-config's
Private-Libs (because it's not linking statically) and it doesn't have
access to the NEEDED reference from the shared library. Therefore, it
doesn't link with zlib and fails with
pngrutil.c:(.text+0x55c): undefined reference to `inflate'
We cant use host-file because it is itself an autotools package and is
itself using libtool, so this would be a chicken-n-egg problem. Besides,
the libtool script really wants to call /usr/bin/file, so it would not
even find our host-file anyway.
So, just require that '/usr/bin/file' is present on the host.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-12-26 18:58:30 +01:00
|
|
|
# 'file' must be present and must be exactly /usr/bin/file,
|
|
|
|
# otherwise libtool fails in incomprehensible ways.
|
|
|
|
check_prog_host "/usr/bin/file"
|
|
|
|
|
2009-12-16 08:33:38 +01:00
|
|
|
# Check make
|
2021-10-01 20:08:32 +02:00
|
|
|
MAKE=$(which make 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$MAKE" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You must install 'make' on your build machine";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2010-09-30 23:09:39 +02:00
|
|
|
MAKE_VERSION=$($MAKE --version 2>&1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$MAKE_VERSION" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You must install 'make' on your build machine";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2010-09-30 23:09:39 +02:00
|
|
|
MAKE_MAJOR=$(echo $MAKE_VERSION | sed -e "s/\..*//g")
|
|
|
|
MAKE_MINOR=$(echo $MAKE_VERSION | sed -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g" -e "s/[a-zA-Z].*//g")
|
2009-09-30 09:03:40 +02:00
|
|
|
if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You have make '$MAKE_VERSION' installed. GNU make >=3.81 is required"
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
2009-12-16 08:33:38 +01:00
|
|
|
# Check host gcc
|
2021-10-01 20:08:32 +02:00
|
|
|
COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$COMPILER" ] ; then
|
2021-10-01 20:08:32 +02:00
|
|
|
COMPILER=$(which cc 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
fi;
|
2006-11-29 11:39:30 +01:00
|
|
|
if [ -z "$COMPILER" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You must install 'gcc' on your build machine";
|
2006-11-29 11:39:30 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
2010-09-30 23:09:39 +02:00
|
|
|
COMPILER_VERSION=$($COMPILER -v 2>&1 | sed -n '/^gcc version/p' |
|
|
|
|
sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$COMPILER_VERSION" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You must install 'gcc' on your build machine";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2010-09-30 23:09:39 +02:00
|
|
|
COMPILER_MAJOR=$(echo $COMPILER_VERSION | sed -e "s/\..*//g")
|
|
|
|
COMPILER_MINOR=$(echo $COMPILER_VERSION | sed -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g")
|
2019-10-26 16:53:23 +02:00
|
|
|
if [ $COMPILER_MAJOR -lt 4 -o $COMPILER_MAJOR -eq 4 -a $COMPILER_MINOR -lt 8 ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
2019-10-26 16:53:23 +02:00
|
|
|
echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 4.8 is required"
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
2007-02-09 13:32:21 +01:00
|
|
|
# check for host CXX
|
2021-10-01 20:08:32 +02:00
|
|
|
CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
|
2007-02-09 13:32:21 +01:00
|
|
|
if [ -z "$CXXCOMPILER" ] ; then
|
2021-10-01 20:08:32 +02:00
|
|
|
CXXCOMPILER=$(which c++ 2> /dev/null)
|
2007-02-09 13:32:21 +01:00
|
|
|
fi
|
2014-02-05 19:25:49 +01:00
|
|
|
|
2007-02-09 13:32:21 +01:00
|
|
|
if [ -z "$CXXCOMPILER" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You may have to install 'g++' on your build machine"
|
2007-02-09 13:32:21 +01:00
|
|
|
fi
|
|
|
|
if [ ! -z "$CXXCOMPILER" ] ; then
|
2010-09-30 23:09:39 +02:00
|
|
|
CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | sed -n '/^gcc version/p' |
|
|
|
|
sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
2007-02-09 13:32:21 +01:00
|
|
|
if [ -z "$CXXCOMPILER_VERSION" ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
|
|
|
echo "You may have to install 'g++' on your build machine"
|
2007-02-09 13:32:21 +01:00
|
|
|
fi
|
2014-11-12 14:31:44 +01:00
|
|
|
fi
|
2007-02-09 13:32:21 +01:00
|
|
|
|
2014-11-12 14:31:44 +01:00
|
|
|
if [ -n "$CXXCOMPILER_VERSION" ] ; then
|
2010-09-30 23:09:39 +02:00
|
|
|
CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/\..*//g")
|
|
|
|
CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
|
2019-10-26 16:53:23 +02:00
|
|
|
if [ $CXXCOMPILER_MAJOR -lt 4 -o $CXXCOMPILER_MAJOR -eq 4 -a $CXXCOMPILER_MINOR -lt 8 ] ; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
2019-10-26 16:53:23 +02:00
|
|
|
echo "You have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 4.8 is required"
|
2007-02-09 13:32:21 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2009-12-16 08:33:38 +01:00
|
|
|
# Check bash
|
2014-03-19 00:33:49 +01:00
|
|
|
# We only check bash is available, setting SHELL appropriately is done
|
|
|
|
# in the top-level Makefile, and we mimick the same sequence here
|
|
|
|
if [ -n "${BASH}" ]; then :
|
|
|
|
elif [ -x /bin/bash ]; then :
|
|
|
|
elif [ -z "$( sh -c 'echo $BASH' )" ]; then
|
2014-01-22 19:48:52 +01:00
|
|
|
echo
|
2014-03-19 00:33:49 +01:00
|
|
|
echo "You must install 'bash' on your build machine"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2009-12-16 08:33:38 +01:00
|
|
|
# Check that a few mandatory programs are installed
|
2013-03-23 23:26:44 +01:00
|
|
|
missing_progs="no"
|
2022-08-15 22:50:11 +02:00
|
|
|
for prog in perl tar wget cpio unzip rsync bc cmp find xargs ${DL_TOOLS} ; do
|
2021-10-01 20:08:32 +02:00
|
|
|
if ! which $prog > /dev/null ; then
|
2014-02-05 19:25:49 +01:00
|
|
|
echo "You must install '$prog' on your build machine";
|
|
|
|
missing_progs="yes"
|
|
|
|
if test $prog = "svn" ; then
|
|
|
|
echo " svn is usually part of the subversion package in your distribution"
|
|
|
|
elif test $prog = "hg" ; then
|
|
|
|
echo " hg is usually part of the mercurial package in your distribution"
|
|
|
|
elif test $prog = "zcat" ; then
|
|
|
|
echo " zcat is usually part of the gzip package in your distribution"
|
|
|
|
elif test $prog = "bzcat" ; then
|
|
|
|
echo " bzcat is usually part of the bzip2 package in your distribution"
|
2022-07-27 00:00:21 +02:00
|
|
|
elif test $prog = "cmp" ; then
|
|
|
|
echo " cmp is usually part of the diffutils package in your distribution"
|
2022-08-15 22:50:11 +02:00
|
|
|
elif test $prog = "find" ; then
|
|
|
|
echo " find is usually part of the findutils package in your distribution"
|
|
|
|
elif test $prog = "xargs" ; then
|
|
|
|
echo " xargs is usually part of the findutils package in your distribution"
|
2014-02-05 19:25:49 +01:00
|
|
|
fi
|
2009-12-16 08:33:38 +01:00
|
|
|
fi
|
2023-02-07 18:00:40 +01:00
|
|
|
|
|
|
|
# we need git >= 2.0.0 for shallow clones / vendoring
|
|
|
|
if test $prog = "git" ; then
|
|
|
|
GIT_VERSION="$(git --version | sed -n 's/^git version \(.*\)/\1/p')"
|
|
|
|
GIT_MAJOR="$(echo "${GIT_VERSION}" | cut -d . -f 1)"
|
|
|
|
if [ "${GIT_MAJOR}" -lt 2 ]; then
|
|
|
|
echo "You have git '${GIT_VERSION}' installed. Git >= 2.0.0 is required"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2009-12-16 08:33:38 +01:00
|
|
|
done
|
2010-08-11 13:10:54 +02:00
|
|
|
|
2013-03-23 23:26:44 +01:00
|
|
|
if test "${missing_progs}" = "yes" ; then
|
2014-02-05 19:25:49 +01:00
|
|
|
exit 1
|
2013-03-23 23:26:44 +01:00
|
|
|
fi
|
|
|
|
|
2021-05-19 05:28:48 +02:00
|
|
|
PATCH_VERSION="$(patch -v 2>/dev/null | sed -n 's/^GNU patch \(.*\)/\1/p')"
|
|
|
|
if [ -z "${PATCH_VERSION}" ] ; then
|
|
|
|
echo
|
|
|
|
echo "You must install GNU patch"
|
2020-10-06 22:46:20 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-05-19 05:28:48 +02:00
|
|
|
PATCH_MAJOR="$(echo "${PATCH_VERSION}" | cut -d . -f 1)"
|
|
|
|
PATCH_MINOR="$(echo "${PATCH_VERSION}" | cut -d . -f 2)"
|
|
|
|
if [ "${PATCH_MAJOR}" -lt 2 ] || [ "${PATCH_MAJOR}" -eq 2 -a "${PATCH_MINOR}" -lt 7 ] ; then
|
|
|
|
echo
|
|
|
|
echo "You have GNU patch '${PATCH_VERSION}' installed. GNU patch >= 2.7 is required"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2020-10-06 22:46:20 +02:00
|
|
|
|
2023-02-07 18:21:05 +01:00
|
|
|
if grep -q ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG ; then
|
2021-10-01 20:08:32 +02:00
|
|
|
if ! which locale > /dev/null ; then
|
2014-02-05 19:25:49 +01:00
|
|
|
echo
|
|
|
|
echo "You need locale support on your build machine to build a toolchain supporting locales"
|
|
|
|
exit 1 ;
|
|
|
|
fi
|
support/dependencies: unbreak check for UTF-8 locale
Although the UTF-8 locales in mainstream distributions all are suffixed
with just 'utf8', the nomenclature is a bit ambiguous with the way they
are to be specified with the various LC_* variables, suffixed there with
'UTF-8'.
Also, POSIX, ISO, and IEC do not enforce any specific suffix in LC_*
variables:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
"""
If the locale value has the form:
language[_territory][.codeset]
it refers to an implementation-provided locale, where settings of
language, territory, and codeset are implementation-defined.
"""
To avoid any confusion, use a regexp that is a bit more lax when
matching locales.
Also, quote the regexp, so that the '?' and '$' are not interpreted by
the shell.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-03-04 11:29:03 +01:00
|
|
|
if ! locale -a | grep -q -i -E 'utf-?8$' ; then
|
2014-02-05 19:25:49 +01:00
|
|
|
echo
|
|
|
|
echo "You need at least one UTF8 locale to build a toolchain supporting locales"
|
|
|
|
exit 1 ;
|
|
|
|
fi
|
2010-08-11 13:10:54 +02:00
|
|
|
fi
|
2012-12-28 15:07:33 +01:00
|
|
|
|
2014-02-19 16:33:50 +01:00
|
|
|
if grep -q ^BR2_NEEDS_HOST_JAVA=y $BR2_CONFIG ; then
|
2014-05-04 00:45:43 +02:00
|
|
|
check_prog_host "java"
|
2014-08-16 11:44:38 +02:00
|
|
|
JAVA_GCJ=$(java -version 2>&1 | grep gcj)
|
|
|
|
if [ ! -z "$JAVA_GCJ" ] ; then
|
|
|
|
echo
|
|
|
|
echo "$JAVA_GCJ is not sufficient to compile your package selection."
|
|
|
|
echo "Please install an OpenJDK/IcedTea/Oracle Java."
|
|
|
|
exit 1 ;
|
|
|
|
fi
|
2014-02-18 00:37:12 +01:00
|
|
|
fi
|
|
|
|
|
2014-02-04 16:18:52 +01:00
|
|
|
if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $BR2_CONFIG ; then
|
2014-02-05 19:25:49 +01:00
|
|
|
if test ! -f /lib/ld-linux.so.2 ; then
|
|
|
|
echo
|
|
|
|
echo "Your Buildroot configuration uses pre-built tools for the x86 architecture,"
|
|
|
|
echo "but your build machine uses the x86-64 architecture without the 32 bits compatibility"
|
|
|
|
echo "library."
|
2015-05-08 04:42:29 +02:00
|
|
|
echo "If you're running a Debian/Ubuntu distribution, install the libc6-i386,"
|
2014-07-19 17:15:16 +02:00
|
|
|
echo "lib32stdc++6, and lib32z1 packages (or alternatively libc6:i386,"
|
2014-07-10 12:36:57 +02:00
|
|
|
echo "libstdc++6:i386, and zlib1g:i386)."
|
2018-07-02 14:38:20 +02:00
|
|
|
echo "If you're running a RedHat/Fedora distribution, install the glibc.i686 and"
|
|
|
|
echo "zlib.i686 packages."
|
2019-05-10 07:42:33 +02:00
|
|
|
echo "If you're running an ArchLinux distribution, install lib32-glibc."
|
2014-02-05 19:25:49 +01:00
|
|
|
echo "For other distributions, refer to the documentation on how to install the 32 bits"
|
|
|
|
echo "compatibility libraries."
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-12-29 07:14:49 +01:00
|
|
|
fi
|
2013-03-23 23:26:45 +01:00
|
|
|
|
2014-02-04 16:18:52 +01:00
|
|
|
if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then
|
2014-11-12 14:31:45 +01:00
|
|
|
if ! echo "int main(void) {}" | gcc -m32 -x c - -o /dev/null 2>/dev/null; then
|
2014-02-05 19:25:49 +01:00
|
|
|
echo
|
|
|
|
echo "Your Buildroot configuration needs a compiler capable of building 32 bits binaries."
|
|
|
|
echo "If you're running a Debian/Ubuntu distribution, install the gcc-multilib package."
|
|
|
|
echo "For other distributions, refer to their documentation."
|
2018-02-05 22:57:08 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! echo "int main(void) {}" | g++ -m32 -x c++ - -o /dev/null 2>/dev/null; then
|
|
|
|
echo
|
|
|
|
echo "Your Buildroot configuration needs a compiler capable of building 32 bits binaries."
|
|
|
|
echo "If you're running a Debian/Ubuntu distribution, install the g++-multilib package."
|
|
|
|
echo "For other distributions, refer to their documentation."
|
2014-02-05 19:25:49 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2013-11-11 17:47:25 +01:00
|
|
|
fi
|
|
|
|
|
2023-02-07 18:21:05 +01:00
|
|
|
if grep -q ^BR2_NEEDS_HOST_GCC_PLUGIN_SUPPORT=y $BR2_CONFIG ; then
|
2020-07-06 17:30:35 +02:00
|
|
|
if ! echo "#include <gcc-plugin.h>" | $HOSTCXX_NOCCACHE -I$($HOSTCXX_NOCCACHE -print-file-name=plugin)/include -x c++ -c - -o /dev/null ; then
|
|
|
|
echo
|
|
|
|
echo "Your Buildroot configuration needs a host compiler capable of building gcc plugins."
|
|
|
|
echo "If you're running a Debian/Ubuntu distribution, install gcc-X-plugin-dev package."
|
|
|
|
echo "For other distributions, refer to their documentation."
|
|
|
|
exit 1 ;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-09-29 10:47:02 +02:00
|
|
|
# Check that the Perl installation is complete enough for Buildroot.
|
|
|
|
required_perl_modules="Data::Dumper" # Needed to build host-autoconf
|
2023-02-07 09:34:34 +01:00
|
|
|
required_perl_modules="$required_perl_modules English" # Used by host-libxml-parser-perl
|
2016-07-07 00:43:31 +02:00
|
|
|
required_perl_modules="$required_perl_modules ExtUtils::MakeMaker" # Used by host-libxml-parser-perl
|
2015-09-29 10:47:02 +02:00
|
|
|
required_perl_modules="$required_perl_modules Thread::Queue" # Used by host-automake
|
2023-02-06 22:32:30 +01:00
|
|
|
required_perl_modules="$required_perl_modules FindBin" # Used by (host-)libopenssl
|
2023-07-16 09:28:33 +02:00
|
|
|
required_perl_modules="$required_perl_modules IPC::Cmd" # Used by (host-)libopenssl
|
2015-09-29 10:47:02 +02:00
|
|
|
|
2024-01-06 12:23:43 +01:00
|
|
|
if grep -q ^BR2_PACKAGE_LIBOPENSSL=y $BR2_CONFIG && grep -q ^BR2_s390x=y $BR2_CONFIG ; then
|
2024-03-03 11:50:34 +01:00
|
|
|
required_perl_modules="$required_perl_modules bigint"
|
2024-01-06 12:23:43 +01:00
|
|
|
fi
|
|
|
|
|
2023-02-10 16:04:56 +01:00
|
|
|
if grep -q ^BR2_PACKAGE_MOSH=y $BR2_CONFIG ; then
|
|
|
|
required_perl_modules="$required_perl_modules diagnostics"
|
|
|
|
fi
|
|
|
|
|
2016-07-07 00:43:32 +02:00
|
|
|
if grep -q ^BR2_PACKAGE_MPV=y $BR2_CONFIG ; then
|
|
|
|
required_perl_modules="$required_perl_modules Math::BigInt"
|
|
|
|
required_perl_modules="$required_perl_modules Math::BigRat"
|
|
|
|
fi
|
|
|
|
|
2023-02-23 23:59:42 +01:00
|
|
|
if grep -q ^BR2_PACKAGE_NETSURF=y $BR2_CONFIG ; then
|
|
|
|
required_perl_modules="$required_perl_modules Digest::MD5"
|
|
|
|
fi
|
|
|
|
|
2018-06-05 20:13:47 +02:00
|
|
|
if grep -q ^BR2_PACKAGE_WHOIS=y $BR2_CONFIG ; then
|
|
|
|
required_perl_modules="$required_perl_modules autodie"
|
|
|
|
fi
|
|
|
|
|
2019-09-16 00:57:43 +02:00
|
|
|
if grep -q -E '^BR2_PACKAGE_(WEBKITGTK|WPEWEBKIT)=y' $BR2_CONFIG ; then
|
|
|
|
required_perl_modules="${required_perl_modules} JSON::PP"
|
|
|
|
fi
|
|
|
|
|
2023-02-21 14:36:08 +01:00
|
|
|
if grep -q -E '^BR2_(PACKAGE_ACE|TARGET_SYSLINUX)=y' $BR2_CONFIG ; then
|
2023-02-20 11:03:09 +01:00
|
|
|
required_perl_modules="$required_perl_modules FileHandle"
|
|
|
|
fi
|
|
|
|
|
2015-09-29 10:47:02 +02:00
|
|
|
# This variable will keep the modules that are missing in your system.
|
|
|
|
missing_perl_modules=""
|
|
|
|
|
2023-02-07 12:32:00 +01:00
|
|
|
if grep -q ^BR2_PACKAGE_LIBXCRYPT=y $BR2_CONFIG ; then
|
|
|
|
# open cannot be used with require
|
|
|
|
if ! perl -e "use open ':std'" > /dev/null 2>&1 ; then
|
|
|
|
missing_perl_modules="$missing_perl_modules open"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-09-29 10:47:02 +02:00
|
|
|
for pm in $required_perl_modules ; do
|
|
|
|
if ! perl -e "require $pm" > /dev/null 2>&1 ; then
|
|
|
|
missing_perl_modules="$missing_perl_modules $pm"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$missing_perl_modules" ] ; then
|
|
|
|
echo "Your Perl installation is not complete enough; at least the following"
|
|
|
|
echo "modules are missing:"
|
|
|
|
echo
|
|
|
|
for pm in $missing_perl_modules ; do
|
|
|
|
printf "\t $pm\n"
|
|
|
|
done
|
|
|
|
echo
|
2014-02-05 19:25:49 +01:00
|
|
|
exit 1
|
2013-03-23 23:26:45 +01:00
|
|
|
fi
|