summaryrefslogtreecommitdiff
path: root/scripts/prereq.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/prereq.sh')
-rwxr-xr-xscripts/prereq.sh108
1 files changed, 79 insertions, 29 deletions
diff --git a/scripts/prereq.sh b/scripts/prereq.sh
index 0245d6e9d..717ddf15c 100755
--- a/scripts/prereq.sh
+++ b/scripts/prereq.sh
@@ -54,7 +54,7 @@ for tool in $tools; do
FETCHCMD="$(which $tool) --progress-bar -L -k -f -o "
;;
wget)
- FETCHCMD="$(which $tool) --no-check-certificate -O "
+ FETCHCMD="$(which $tool) -t2 --no-check-certificate -O "
;;
esac
break
@@ -232,8 +232,8 @@ done
printf " ---> checking if bash is installed.. "
if which bash >/dev/null; then
printf "found\n"
- printf " ---> checking if it is bash 4.x or 5.x"
- LC_ALL=C bash --version 2>/dev/null| grep -i "version \(4\|5\)" >/dev/null
+ printf " ---> checking if it is bash 4.x or 5.x.. "
+ LC_ALL=C bash --version 2>/dev/null| egrep -i 'version 4|5' >/dev/null
if [ $? -eq 0 ]; then
printf "yes\n"
else
@@ -304,6 +304,16 @@ if ! which git >/dev/null 2>&1; then
fi
printf "found\n"
+printf " ---> checking if ncurses is installed.. "
+check_lxdialog=${topdir}/adk/config/lxdialog/check-lxdialog.sh
+CURSES_CFLAGS=$(/bin/sh ${check_lxdialog} -ccflags | tr '\n' ' ')
+CURSES_LIBS=$(/bin/sh ${check_lxdialog} -ldflags ${CC})
+if [ $? -eq 0 ]; then
+ printf "found\n"
+else
+ printf "not found\n"
+ out=1
+fi
# creating prereq.mk
echo "ADK_TOPDIR:=$(readlink -nf . 2>/dev/null || pwd -P)" > $topdir/prereq.mk
@@ -327,6 +337,8 @@ echo "ARCH_FOR_BUILD:=$(${CC} -dumpmachine | sed \
-e 's/mipsel-.*/mipsel/' \
-e 's/i[3-9]86/x86/' \
)" >>prereq.mk
+echo "CURSES_LIBS:=${CURSES_LIBS}" >> $topdir/prereq.mk
+echo "CURSES_CFLAGS:=${CURSES_CFLAGS}" >> $topdir/prereq.mk
if [ "$CC" = "clang" ]; then
echo "HOST_CC:=${CC} -fbracket-depth=1024" >> $topdir/prereq.mk
@@ -339,8 +351,8 @@ else
echo "HOST_CXX:=${CXX}" >> $topdir/prereq.mk
fi
-echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk
-echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk
+echo "HOST_CFLAGS:=-O0 -g0 -fcommon" >> $topdir/prereq.mk
+echo "HOST_CXXFLAGS:=-O0 -g0 -fcommon" >> $topdir/prereq.mk
echo 'LANGUAGE:=C' >> $topdir/prereq.mk
echo 'LC_ALL:=C' >> $topdir/prereq.mk
echo "_PATH:=$PATH" >> $topdir/prereq.mk
@@ -411,7 +423,7 @@ EOF
$MAKE --no-print-directory LDADD=-lz ADK_TOPDIR=$topdir -f Makefile.tmp >/dev/null 2>&1
X=$(echo YES | gzip | ./test 2>/dev/null)
if [ X$X != XYES ]; then
- echo Cannot compile a libz test programm.
+ echo Cannot compile a libz test program.
echo You must install the zlib development package,
echo usually called libz-dev, and the run-time library.
echo
@@ -423,17 +435,6 @@ fi
rm test.c test 2>/dev/null
rm Makefile.tmp 2>/dev/null
-# for make kernelconfig pkg-config is required to find ncurses
-if [ $os = "Darwin" ]; then
- printf " ---> checking if pkg-config is installed.. "
- if ! which pkg-config >/dev/null 2>&1; then
- printf "not found\n"
- out=1
- else
- printf "found\n"
- fi
-fi
-
# error out on any required prerequisite
if [ $out -ne 0 ]; then
exit
@@ -521,6 +522,15 @@ else
printf "found\n"
fi
+printf " ---> checking if rsync is installed.. "
+host_build_rsync=0
+if ! which rsync >/dev/null 2>&1; then
+ printf "not found\n"
+ host_build_rsync=1
+else
+ printf "found\n"
+fi
+
host_build_tar=0
if which tar >/dev/null 2>&1; then
if ! tar --version 2>/dev/null|grep GNU >/dev/null;then
@@ -608,15 +618,6 @@ else
host_build_cpio=1
fi
-printf " ---> checking if xz is installed.. "
-host_build_xz=0
-if ! which xz >/dev/null 2>&1; then
- printf "not found\n"
- host_build_xz=1
-else
- printf "found\n"
-fi
-
# optional
host_build_cdrtools=0
if ! which mkisofs >/dev/null 2>&1; then
@@ -633,6 +634,11 @@ if ! which lzma >/dev/null 2>&1; then
host_build_lzma=1
fi
+host_build_zstd=0
+if ! which zstd >/dev/null 2>&1; then
+ host_build_zstd=1
+fi
+
host_build_lz4=0
if ! which lz4c >/dev/null 2>&1; then
host_build_lz4=1
@@ -692,6 +698,9 @@ fi
if [ $host_build_patch -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_PATCH" >> $topdir/target/config/Config.in.prereq
fi
+if [ $host_build_rsync -eq 1 ]; then
+ printf "\t%s\n" "select ADK_HOST_BUILD_RSYNC" >> $topdir/target/config/Config.in.prereq
+fi
if [ $host_build_findutils -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_FINDUTILS" >> $topdir/target/config/Config.in.prereq
fi
@@ -707,9 +716,6 @@ fi
if [ $host_build_cpio -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_CPIO" >> $topdir/target/config/Config.in.prereq
fi
-if [ $host_build_xz -eq 1 ]; then
- printf "\t%s\n" "select ADK_HOST_BUILD_XZ" >> $topdir/target/config/Config.in.prereq
-fi
# optional
if [ $host_build_cdrtools -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_CDRTOOLS if ADK_HOST_NEED_CDRTOOLS" >> $topdir/target/config/Config.in.prereq
@@ -720,6 +726,9 @@ fi
if [ $host_build_lzma -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_LZMA if ADK_HOST_NEED_LZMA" >> $topdir/target/config/Config.in.prereq
fi
+if [ $host_build_zstd -eq 1 ]; then
+ printf "\t%s\n" "select ADK_HOST_BUILD_ZSTD if ADK_HOST_NEED_ZSTD" >> $topdir/target/config/Config.in.prereq
+fi
if [ $host_build_lz4 -eq 1 ]; then
printf "\t%s\n" "select ADK_HOST_BUILD_LZ4 if ADK_HOST_NEED_LZ4" >> $topdir/target/config/Config.in.prereq
fi
@@ -781,6 +790,19 @@ if [ ! -f $topdir/.config ]; then
else
# scan host-tool prerequisites of certain packages before building.
. $topdir/.config
+
+ if [ -n "$ADK_PACKAGE_FIREFOX" ]; then
+ NEED_RUST="$NEED_RUST firefox"
+ fi
+ if [ -n "$ADK_PACKAGE_FIREFOX" ]; then
+ NEED_CARGO="$NEED_CARGO firefox"
+ fi
+ if [ -n "$ADK_PACKAGE_FIREFOX" ]; then
+ NEED_CLANG="$NEED_CLANG firefox"
+ fi
+ if [ -n "$ADK_PACKAGE_FIREFOX" ]; then
+ NEED_CBINDGEN="$NEED_CBINDGEN firefox"
+ fi
if [ -n "$ADK_PACKAGE_KODI" ]; then
NEED_JAVA="$NEED_JAVA kodi"
fi
@@ -877,6 +899,34 @@ else
fi
fi
+ if [ -n "$NEED_RUST" ]; then
+ if ! which rustc >/dev/null 2>&1; then
+ printf "You need rustc to build $NEED_RUST \n"
+ out=1
+ fi
+ fi
+
+ if [ -n "$NEED_CARGO" ]; then
+ if ! which cargo >/dev/null 2>&1; then
+ printf "You need cargo to build $NEED_CARGO \n"
+ out=1
+ fi
+ fi
+
+ if [ -n "$NEED_CLANG" ]; then
+ if ! which clang-13 >/dev/null 2>&1; then
+ printf "You need clang-13 to build $NEED_CLANG \n"
+ out=1
+ fi
+ fi
+
+ if [ -n "$NEED_CBINDGEN" ]; then
+ if ! which cbindgen >/dev/null 2>&1; then
+ printf "You need cbindgen to build $NEED_CBINDGEN \n"
+ out=1
+ fi
+ fi
+
if [ -n "$NEED_STATIC_LIBSTDCXX" ]; then
cat >test.c <<-'EOF'
#include <stdio.h>