diff options
Diffstat (limited to 'scripts/prereq.sh')
-rwxr-xr-x | scripts/prereq.sh | 183 |
1 files changed, 91 insertions, 92 deletions
diff --git a/scripts/prereq.sh b/scripts/prereq.sh index 0245d6e9d..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 @@ -54,7 +41,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 @@ -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 @@ -232,8 +213,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| grep -E -i 'version 4|5' >/dev/null if [ $? -eq 0 ]; then printf "yes\n" else @@ -304,6 +285,25 @@ if ! which git >/dev/null 2>&1; then fi printf "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 + printf "not found\n" +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 +327,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 +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 @@ -411,7 +413,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 +425,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 +512,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 +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 @@ -633,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 @@ -692,6 +688,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 +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 @@ -720,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 @@ -737,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 @@ -781,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 @@ -789,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 @@ -863,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_JAVA" ]; then - if ! which java >/dev/null 2>&1; then - printf "You need java to build $NEED_JAVA \n" + 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-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 |