diff options
Diffstat (limited to 'tools/rockboxdev.sh')
-rwxr-xr-x | tools/rockboxdev.sh | 111 |
1 files changed, 66 insertions, 45 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh index 540ede75e2..f8e9ab2140 100755 --- a/tools/rockboxdev.sh +++ b/tools/rockboxdev.sh | |||
@@ -378,8 +378,14 @@ buildtool() { | |||
378 | $config_opt | 378 | $config_opt |
379 | elif [ "$config_opt" != "NO_CONFIGURE" ]; then | 379 | elif [ "$config_opt" != "NO_CONFIGURE" ]; then |
380 | echo "ROCKBOXDEV: $toolname/configure" | 380 | echo "ROCKBOXDEV: $toolname/configure" |
381 | cflags='-U_FORTIFY_SOURCE -fgnu89-inline -O2' | ||
382 | if [ "$tool" == "glib" ]; then | ||
383 | run_cmd "$logfile" sed -i -e 's/m4_copy/m4_copy_force/g' "$cfg_dir/m4macros/glib-gettext.m4" | ||
384 | run_cmd "$logfile" autoreconf -fiv "$cfg_dir" | ||
385 | cflags="$cflags -Wno-format-nonliteral -Wno-format-overflow" | ||
386 | fi | ||
381 | # NOTE glibc requires to be compiled with optimization | 387 | # NOTE glibc requires to be compiled with optimization |
382 | CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -O2' CXXFLAGS="$CXXFLAGS" run_cmd "$logfile" \ | 388 | CFLAGS="$cflags" CXXFLAGS="$CXXFLAGS" run_cmd "$logfile" \ |
383 | "$cfg_dir/configure" "--prefix=$prefix" \ | 389 | "$cfg_dir/configure" "--prefix=$prefix" \ |
384 | --disable-docs $config_opt | 390 | --disable-docs $config_opt |
385 | fi | 391 | fi |
@@ -458,30 +464,30 @@ build() { | |||
458 | cd "$toolname-$version" | 464 | cd "$toolname-$version" |
459 | if (echo $needs_libs | grep -q gmp && test ! -d gmp); then | 465 | if (echo $needs_libs | grep -q gmp && test ! -d gmp); then |
460 | echo "ROCKBOXDEV: Getting GMP" | 466 | echo "ROCKBOXDEV: Getting GMP" |
461 | getfile "gmp-6.2.1.tar.bz2" "$GNU_MIRROR/gmp" | 467 | getfile "gmp-4.3.2.tar.bz2" "$GNU_MIRROR/gmp" |
462 | tar xjf $dlwhere/gmp-6.2.1.tar.bz2 | 468 | tar xjf $dlwhere/gmp-4.3.2.tar.bz2 |
463 | ln -s gmp-6.2.1 gmp | 469 | ln -s gmp-4.3.2 gmp |
464 | fi | 470 | fi |
465 | 471 | ||
466 | if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then | 472 | if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then |
467 | echo "ROCKBOXDEV: Getting MPFR" | 473 | echo "ROCKBOXDEV: Getting MPFR" |
468 | getfile "mpfr-4.1.0.tar.bz2" "$GNU_MIRROR/mpfr" | 474 | getfile "mpfr-3.1.0.tar.bz2" "$GNU_MIRROR/mpfr" |
469 | tar xjf $dlwhere/mpfr-4.1.0.tar.bz2 | 475 | tar xjf $dlwhere/mpfr-3.1.0.tar.bz2 |
470 | ln -s mpfr-4.1.0 mpfr | 476 | ln -s mpfr-3.1.0 mpfr |
471 | fi | 477 | fi |
472 | 478 | ||
473 | if (echo $needs_libs | grep -q mpc && test ! -d mpc); then | 479 | if (echo $needs_libs | grep -q mpc && test ! -d mpc); then |
474 | echo "ROCKBOXDEV: Getting MPC" | 480 | echo "ROCKBOXDEV: Getting MPC" |
475 | getfile "mpc-1.2.1.tar.gz" "http://www.multiprecision.org/downloads" | 481 | getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads" |
476 | tar xzf $dlwhere/mpc-1.2.1.tar.gz | 482 | tar xzf $dlwhere/mpc-1.0.1.tar.gz |
477 | ln -s mpc-1.2.1 mpc | 483 | ln -s mpc-1.0.1 mpc |
478 | fi | 484 | fi |
479 | 485 | ||
480 | if (echo $needs_libs | grep -q isl && test ! -d isl); then | 486 | if (echo $needs_libs | grep -q isl && test ! -d isl); then |
481 | echo "ROCKBOXDEV: Getting ISL" | 487 | echo "ROCKBOXDEV: Getting ISL" |
482 | getfile "isl-0.18.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure" | 488 | getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure" |
483 | tar xjf $dlwhere/isl-0.18.tar.bz2 | 489 | tar xjf $dlwhere/isl-0.15.tar.bz2 |
484 | ln -s isl-0.18 isl | 490 | ln -s isl-0.15 isl |
485 | fi | 491 | fi |
486 | cd $builddir | 492 | cd $builddir |
487 | fi | 493 | fi |
@@ -541,9 +547,9 @@ build_linux_toolchain () { | |||
541 | 547 | ||
542 | # check libraries: | 548 | # check libraries: |
543 | # contrary to other toolchains that rely on a hack to avoid installing | 549 | # contrary to other toolchains that rely on a hack to avoid installing |
544 | # gmp, mpc, and mpfr, we simply require that they are installed on | 550 | # gmp, mpc and mpfr, we simply require that they are installed on the system |
545 | # the system this is not a huge requirement since virtually all systems | 551 | # this is not a huge requirement since virtually all systems these days |
546 | # these days provide dev packages for them | 552 | # provide dev packages for them |
547 | # FIXME: maybe add an option to download and install them automatically | 553 | # FIXME: maybe add an option to download and install them automatically |
548 | checklib "mpc" "gmp" "mpfr" | 554 | checklib "mpc" "gmp" "mpfr" |
549 | 555 | ||
@@ -764,26 +770,26 @@ do | |||
764 | echo "" | 770 | echo "" |
765 | case $arch in | 771 | case $arch in |
766 | [Ii]) | 772 | [Ii]) |
767 | build "binutils" "mipsel-elf" "2.37" "" "--disable-werror" "gmp isl" | 773 | build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" "isl" |
768 | build "gcc" "mipsel-elf" "8.5.0" "" "" "gmp mpfr mpc isl" | 774 | build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl" |
769 | ;; | 775 | ;; |
770 | 776 | ||
771 | [Mm]) | 777 | [Mm]) |
772 | build "binutils" "m68k-elf" "2.37" "" "--disable-werror" "gmp isl" | 778 | build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "isl" |
773 | build "gcc" "m68k-elf" "8.5.0" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl" | 779 | build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl" |
774 | ;; | 780 | ;; |
775 | 781 | ||
776 | [Aa]) | 782 | [Aa]) |
777 | binopts="" | 783 | binopts="" |
778 | gccopts="--with-multilib-list=rmprofile" | 784 | gccopts="" |
779 | case $system in | 785 | case $system in |
780 | Darwin) | 786 | Darwin) |
781 | binopts="--disable-nls" | 787 | binopts="--disable-nls" |
782 | gccopts="--disable-nls" | 788 | gccopts="--disable-nls" |
783 | ;; | 789 | ;; |
784 | esac | 790 | esac |
785 | build "binutils" "arm-elf-eabi" "2.37" "" "$binopts --disable-werror" "gmp isl" | 791 | build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "isl" |
786 | build "gcc" "arm-elf-eabi" "8.5.0" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl" | 792 | build "gcc" "arm-elf-eabi" "4.9.4" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl" |
787 | ;; | 793 | ;; |
788 | [Xx]) | 794 | [Xx]) |
789 | # IMPORTANT NOTE | 795 | # IMPORTANT NOTE |
@@ -792,19 +798,30 @@ do | |||
792 | # | 798 | # |
793 | # Samsung YP-R0/R1: | 799 | # Samsung YP-R0/R1: |
794 | # ARM1176JZF-S, softfp EABI | 800 | # ARM1176JZF-S, softfp EABI |
795 | # kernel: device runs 2.6.24, but oem toolchain is built against 2.6.27.59 | 801 | # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that |
796 | # glibc: device runs 2.4.2 | 802 | # compiles with GCC >6 |
797 | # | 803 | # kernel: 2.6.27.59 is the same 2.6.x stable kernel as used by the |
804 | # original ct-ng toolchain, the device runs kernel 2.6.24 | ||
805 | # glibc: 2.19 is the latest version that supports kernel 2.6.24 which | ||
806 | # is used on the device, but we need to support ABI 2.4 because | ||
807 | # the device uses glibc 2.4.2 | ||
808 | # | ||
798 | # Sony NWZ: | 809 | # Sony NWZ: |
799 | # kernel: Varies from device to device; 2.6.23, 2.6.35, and 3.x seen. | 810 | # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that |
800 | # glibc: device runs 2.7 | 811 | # compiles with GCC >6 |
812 | # kernel: 2.6.32.68 is the latest 2.6.x stable kernel, the device | ||
813 | # runs kernel 2.6.23 or 2.6.35 or 3.x for the most recent | ||
814 | # glibc: 2.19 is the latest version that supports kernel 2.6.23 which | ||
815 | # is used on many Sony players, but we need to support ABI 2.7 | ||
816 | # because the device uses glibc 2.7 | ||
801 | # | 817 | # |
802 | # Thus the lowest common denominator is to target 2.6.23 and glibc 2.4 | 818 | # Thus the lowest common denominator is to use the latest 2.6.x stable |
803 | # Use a recent 2.6.32 LTS kernel, but glibc 2.20 targeting 2.6.23 and API 2.4 | 819 | # kernel but compile glibc to support kernel 2.6.23 and glibc 2.4. |
804 | # | 820 | # We use a recent 2.26.1 binutils to avoid any build problems and |
821 | # avoid patches/bugs. | ||
805 | glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4" | 822 | glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4" |
806 | build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.37" "" "8.5.0" \ | 823 | build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.26.1" "" "4.9.4" \ |
807 | "$gccopts" "2.6.32.71" "2.20" "$glibcopts" "glibc-220-make44.patch" | 824 | "$gccopts" "2.6.32.68" "2.19" "$glibcopts" "glibc-220-make44.patch" |
808 | # build alsa-lib | 825 | # build alsa-lib |
809 | # we need to set the prefix to how it is on device (/usr) and then | 826 | # we need to set the prefix to how it is on device (/usr) and then |
810 | # tweak install dir at make install step | 827 | # tweak install dir at make install step |
@@ -819,22 +836,28 @@ do | |||
819 | # This toolchain must support several targets and thus must support | 836 | # This toolchain must support several targets and thus must support |
820 | # the oldest possible configuration. | 837 | # the oldest possible configuration. |
821 | # | 838 | # |
822 | # AGPTek Rocker (and other HibyOS players): | 839 | # AGPTek Rocker: |
840 | # XBurst release 1 (something inbetween mips32r1 and mips32r2) | ||
841 | # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that | ||
842 | # compiles with GCC >6 | ||
823 | # kernel: 3.10.14 | 843 | # kernel: 3.10.14 |
824 | # glibc: 2.16 | 844 | # glibc: 2.16 |
825 | # alsa: 1.0.29 | 845 | # alsa: 1.0.29 |
826 | # | 846 | # |
827 | # FiiO M3K Linux (Based on Ingenic SDK): | 847 | # FiiO M3K Linux: |
828 | # kernel: 3.10.14 | 848 | # kernel: 3.10.14 |
829 | # glibc: 2.16 | 849 | # glibc: 2.16 |
830 | # alsa: 1.0.26 | 850 | # alsa: 1.0.26 |
831 | # | 851 | # |
832 | # Use a recent 3.10 LTS kernel, but glibc 2.27 targeting 3.2.x and API 2.16 | 852 | # To maximize compatibility, we use kernel 3.2.85 which is the lastest |
833 | # | 853 | # longterm 3.2 kernel and is supported by the latest glibc, and we |
854 | # require support for up to glibc 2.16 | ||
855 | # We use a recent 2.26.1 binutils to avoid any build problems and | ||
856 | # avoid patches/bugs. | ||
834 | glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16" | 857 | glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16" |
835 | # FIXME: maybe add -mhard-float? | 858 | # FIXME: maybe add -mhard-float |
836 | build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.37" "" "8.5.0" \ | 859 | build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \ |
837 | "$gccopts" "3.10.108" "2.27" "$glibcopts" "glibc-227-make44.patch" | 860 | "$gccopts" "3.2.85" "2.25" "$glibcopts" "glibc-225-make44.patch" |
838 | # build alsa-lib | 861 | # build alsa-lib |
839 | # we need to set the prefix to how it is on device (/usr) and then | 862 | # we need to set the prefix to how it is on device (/usr) and then |
840 | # tweak install dir at make install step | 863 | # tweak install dir at make install step |
@@ -842,10 +865,7 @@ do | |||
842 | gettool "alsa-lib" "$alsalib_ver" | 865 | gettool "alsa-lib" "$alsalib_ver" |
843 | extract "alsa-lib-$alsalib_ver" | 866 | extract "alsa-lib-$alsalib_ver" |
844 | prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \ | 867 | prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \ |
845 | "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot" | 868 | "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot" |
846 | |||
847 | ### Everything below here is needed only for bluetooth support | ||
848 | |||
849 | # build libffi | 869 | # build libffi |
850 | libffi_ver="3.2.1" | 870 | libffi_ver="3.2.1" |
851 | gettool "libffi" "$libffi_ver" | 871 | gettool "libffi" "$libffi_ver" |
@@ -866,7 +886,7 @@ do | |||
866 | gettool "glib" "$glib_ver" | 886 | gettool "glib" "$glib_ver" |
867 | extract "glib-$glib_ver" | 887 | extract "glib-$glib_ver" |
868 | prefix="/usr" buildtool "glib" "$glib_ver" \ | 888 | prefix="/usr" buildtool "glib" "$glib_ver" \ |
869 | "--host=$target --with-sysroot=$prefix/$target/sysroot --disable-libelf glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes CFLAGS=-Wno-error=format-nonliteral" "" "install DESTDIR=$prefix/$target/sysroot" | 889 | "--host=$target --with-sysroot=$prefix/$target/sysroot --disable-libelf glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes" "" "install DESTDIR=$prefix/$target/sysroot" |
870 | 890 | ||
871 | # build expat | 891 | # build expat |
872 | expat_ver="2.1.0" | 892 | expat_ver="2.1.0" |
@@ -882,6 +902,7 @@ do | |||
882 | prefix="/usr" buildtool "dbus" "$dbus_ver" \ | 902 | prefix="/usr" buildtool "dbus" "$dbus_ver" \ |
883 | "--host=$target --with-sysroot=$prefix/$target/sysroot --includedir=/usr/include --enable-abstract-sockets ac_cv_lib_expat_XML_ParserCreate_MM=yes --disable-systemd --disable-launchd --enable-x11-autolaunch=no --with-x=no -disable-selinux --disable-apparmor --disable-doxygen-docs " "" "install DESTDIR=$prefix/$target/sysroot " | 903 | "--host=$target --with-sysroot=$prefix/$target/sysroot --includedir=/usr/include --enable-abstract-sockets ac_cv_lib_expat_XML_ParserCreate_MM=yes --disable-systemd --disable-launchd --enable-x11-autolaunch=no --with-x=no -disable-selinux --disable-apparmor --disable-doxygen-docs " "" "install DESTDIR=$prefix/$target/sysroot " |
884 | 904 | ||
905 | |||
885 | ;; | 906 | ;; |
886 | *) | 907 | *) |
887 | echo "ROCKBOXDEV: Unsupported architecture option: $arch" | 908 | echo "ROCKBOXDEV: Unsupported architecture option: $arch" |