summaryrefslogtreecommitdiff
path: root/scripts/prereq.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/prereq.sh')
-rwxr-xr-xscripts/prereq.sh144
1 files changed, 61 insertions, 83 deletions
diff --git a/scripts/prereq.sh b/scripts/prereq.sh
index bd0b525d8..7faee35ae 100755
--- a/scripts/prereq.sh
+++ b/scripts/prereq.sh
@@ -25,19 +25,6 @@ rm -f foo
echo >FOO
if [ -e foo ]; then
printf "ERROR: OpenADK cannot be built in a case-insensitive file system.\n"
- case $os in
- CYG*)
- printf "Building OpenADK on $os needs a small registry change.\n"
- printf "http://cygwin.com/cygwin-ug-net/using-specialnames.html\n"
- ;;
- Darwin*)
- printf "Building OpenADK on $os needs a case-sensitive disk partition.\n"
- printf "For Snow Leopard and above you can use diskutil to resize your existing disk.\n"
- printf "Example: sudo diskutil resizeVolume disk0s2 90G 1 jhfsx adk 30G\n"
- printf "For older versions you might consider to use a disk image:\n"
- printf "hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 30g ~/openadk.dmg\n"
- ;;
- esac
rm -f FOO
exit 1
fi
@@ -110,11 +97,8 @@ if [ ! -d $topdir/dl ]; then
fi
# check for c compiler
-if [ $os = "Darwin" ]; then
- compilerbins="clang cc gcc"
-else
- compilerbins="cc gcc clang"
-fi
+compilerbins="cc gcc clang"
+
for compilerbin in $compilerbins; do
printf " ---> checking if $compilerbin is installed.. "
if which $compilerbin >/dev/null; then
@@ -133,11 +117,8 @@ if [ -z "$CCFOUND" ]; then
fi
# check for c++ compiler
-if [ $os = "Darwin" ]; then
- compilerbins="clang++ c++ g++"
-else
- compilerbins="c++ g++ clang++"
-fi
+compilerbins="c++ g++ clang++"
+
for compilerbin in $compilerbins; do
printf " ---> checking if $compilerbin is installed.. "
if which $compilerbin >/dev/null; then
@@ -233,7 +214,7 @@ 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
+ LC_ALL=C bash --version 2>/dev/null| grep -E -i 'version 4|5' >/dev/null
if [ $? -eq 0 ]; then
printf "yes\n"
else
@@ -304,13 +285,14 @@ if ! which git >/dev/null 2>&1; then
fi
printf "found\n"
-printf " ---> checking if pkg-config is installed.. "
-if ! which pkg-config >/dev/null 2>&1; then
- printf "not found\n"
+printf " ---> checking if xz is installed.. "
+if ! which xz >/dev/null 2>&1; then
+ echo You must install xz to continue.
+ echo
out=1
-else
- printf "found\n"
+ printf "not found\n"
fi
+printf "found\n"
printf " ---> checking if ncurses is installed.. "
check_lxdialog=${topdir}/adk/config/lxdialog/check-lxdialog.sh
@@ -359,8 +341,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
@@ -626,15 +608,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
@@ -651,6 +624,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
@@ -728,9 +706,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
@@ -741,6 +716,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
@@ -758,36 +736,6 @@ case $os in
printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
;;
- Darwin)
- printf "\nconfig ADK_HOST_DARWIN\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
- OpenBSD)
- printf "\nconfig ADK_HOST_OPENBSD\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
- FreeBSD)
- printf "\nconfig ADK_HOST_FREEBSD\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
- NetBSD)
- printf "\nconfig ADK_HOST_NETBSD\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
- MirBSD)
- printf "\nconfig ADK_HOST_MIRBSD\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
- Cygwin*)
- printf "\nconfig ADK_HOST_CYGWIN\n" >> $topdir/target/config/Config.in.prereq
- printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
- printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
- ;;
esac
if [ "$target" = "defconfig" ]; then
@@ -802,6 +750,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
@@ -810,10 +771,6 @@ else
NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
fi
- if [ -n "$ADK_PACKAGE_XKEYBOARD_CONFIG" ]; then
- NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
- fi
-
if [ -n "$ADK_PACKAGE_FONT_BH_100DPI" ]; then
NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-100dpi"
fi
@@ -884,16 +841,37 @@ else
fi
fi
- if [ -n "$NEED_XKBCOMP" ]; then
- if ! which xkbcomp >/dev/null 2>&1; then
- printf "You need xkbcomp to build $NEED_XKBCOMP \n"
+ if [ -n "$NEED_JAVA" ]; then
+ if ! which java >/dev/null 2>&1; then
+ printf "You need java to build $NEED_JAVA \n"
+ out=1
+ 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_JAVA" ]; then
- if ! which java >/dev/null 2>&1; then
- printf "You need java to build $NEED_JAVA \n"
+ 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-18 >/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