diff options
-rwxr-xr-x | tools/rockboxdev.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh index a5dfcc3f94..c45ed0b615 100755 --- a/tools/rockboxdev.sh +++ b/tools/rockboxdev.sh | |||
@@ -354,6 +354,14 @@ buildtool() { | |||
354 | ;; | 354 | ;; |
355 | esac | 355 | esac |
356 | 356 | ||
357 | if [ "$RESTART_STEP" == "gcc-stage1" ] ; then | ||
358 | CXXFLAGS="-std=gnu++03" | ||
359 | elif [ "$RESTART_STEP" == "gcc-stage2" ] ; then | ||
360 | CXXFLAGS="-std=gnu++11" | ||
361 | else | ||
362 | CXXFLAGS="" | ||
363 | fi | ||
364 | |||
357 | if [ "$tool" == "zlib" ]; then | 365 | if [ "$tool" == "zlib" ]; then |
358 | echo "ROCKBOXDEV: $toolname/configure" | 366 | echo "ROCKBOXDEV: $toolname/configure" |
359 | # NOTE glibc requires to be compiled with optimization | 367 | # NOTE glibc requires to be compiled with optimization |
@@ -363,7 +371,7 @@ buildtool() { | |||
363 | elif [ "$config_opt" != "NO_CONFIGURE" ]; then | 371 | elif [ "$config_opt" != "NO_CONFIGURE" ]; then |
364 | echo "ROCKBOXDEV: $toolname/configure" | 372 | echo "ROCKBOXDEV: $toolname/configure" |
365 | # NOTE glibc requires to be compiled with optimization | 373 | # NOTE glibc requires to be compiled with optimization |
366 | CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -O2' CXXFLAGS='-std=c++03' run_cmd "$logfile" \ | 374 | CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -O2' CXXFLAGS="$CXXFLAGS" run_cmd "$logfile" \ |
367 | "$cfg_dir/configure" "--prefix=$prefix" \ | 375 | "$cfg_dir/configure" "--prefix=$prefix" \ |
368 | --disable-docs $config_opt | 376 | --disable-docs $config_opt |
369 | fi | 377 | fi |
@@ -473,7 +481,7 @@ build() { | |||
473 | ./configure --prefix=$prefix $configure_params | 481 | ./configure --prefix=$prefix $configure_params |
474 | ;; | 482 | ;; |
475 | *) | 483 | *) |
476 | CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -fcommon' CXXFLAGS='-std=c++03' ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params | 484 | CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -fcommon' CXXFLAGS='-std=gnu++03' ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params |
477 | ;; | 485 | ;; |
478 | esac | 486 | esac |
479 | 487 | ||
@@ -634,11 +642,13 @@ build_linux_toolchain () { | |||
634 | # build glibc using the first stage cross compiler | 642 | # build glibc using the first stage cross compiler |
635 | # we need to set the prefix to /usr because the glibc runs on the actual | 643 | # we need to set the prefix to /usr because the glibc runs on the actual |
636 | # target and is indeed installed in /usr | 644 | # target and is indeed installed in /usr |
645 | RESTART_STEP="glibc" \ | ||
637 | prefix="/usr" \ | 646 | prefix="/usr" \ |
638 | buildtool "glibc" "$glibc_ver" "--target=$target --host=$target --build=$MACHTYPE \ | 647 | buildtool "glibc" "$glibc_ver" "--target=$target --host=$target --build=$MACHTYPE \ |
639 | --with-__thread --with-headers=$sysroot/usr/include $glibc_opts" \ | 648 | --with-__thread --with-headers=$sysroot/usr/include $glibc_opts" \ |
640 | "" "install install_root=$sysroot" | 649 | "" "install install_root=$sysroot" |
641 | # build stage 2 compiler | 650 | # build stage 2 compiler |
651 | RESTART_STEP="gcc-stage2" \ | ||
642 | buildtool "gcc" "$gcc_ver" "$gcc_opts --enable-languages=c,c++ --target=$target \ | 652 | buildtool "gcc" "$gcc_ver" "$gcc_opts --enable-languages=c,c++ --target=$target \ |
643 | --with-sysroot=$sysroot" "" "" | 653 | --with-sysroot=$sysroot" "" "" |
644 | } | 654 | } |