# HG changeset patch # User Rob Landley # Date 1271017260 18000 # Node ID 27c38c82401d3a24b3b2dfcaca8be3c420a35e46 # Parent 87b3a69ca71cb6346c3e890bad2465f2d8b935dd Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.) diff -r 87b3a69ca71c -r 27c38c82401d native-compiler.sh --- a/native-compiler.sh Thu Apr 08 23:09:13 2010 -0500 +++ b/native-compiler.sh Sun Apr 11 15:21:00 2010 -0500 @@ -34,15 +34,26 @@ build_section gcc build_section ccwrap -# Tell future packages to link against the libraries in the new root filesystem, -# rather than the ones in the cross compiler directory. +# Tell future packages to link against the libraries in the new compiler, +# rather than the ones in the simple compiler. export "$(echo $ARCH | sed 's/-/_/g')"_CCWRAP_TOPDIR="$STAGE_DIR" build_section uClibc++ +# For a native compiler, build make, bash, and distcc. (Yes, this is an old +# version of Bash. It's intentional.) + +if [ "$FROM_ARCH" == "$ARCH" ] +then + build_section make + build_section bash + build_section distcc +fi + # Delete some unneeded files -[ -z "$SKIP_STRIP" ] && rm -rf "$STAGE_DIR"/{info,man} +[ -z "$SKIP_STRIP" ] && + rm -rf "$STAGE_DIR"/{info,man,libexec/gcc/*/*/install-tools} create_stage_tarball diff -r 87b3a69ca71c -r 27c38c82401d root-filesystem.sh --- a/root-filesystem.sh Thu Apr 08 23:09:13 2010 -0500 +++ b/root-filesystem.sh Sun Apr 11 15:21:00 2010 -0500 @@ -46,14 +46,17 @@ "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -o "$STAGE_DIR/bin/hello-dynamic" && "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -static -o "$STAGE_DIR/bin/hello-static" || dienow -# If no native compiler exists for this target... +# If a native compiler exists for this target, grab it -if [ ! -d "$BUILD/native-compiler-$ARCH" ] +if [ -d "$BUILD/native-compiler-$ARCH" ] then + # Copy native compiler + cp -a "$BUILD/native-compiler-$ARCH/." "$STAGE_DIR/" || dienow +else # Do we need shared libraries? - if [ ! -z "$BUILD_STATIC" ] + if [ ! -z "$BUILD_STATIC" ] && [ "$BUILD_STATIC" != none ] then echo Copying compiler libraries... mkdir -p "$STAGE_DIR/lib" || dienow @@ -65,67 +68,7 @@ # Since we're not installing a compiler, delete the example source code. rm -rf "$STAGE_DIR/src/*.c*" || dienow - -# If a native compiler exists for this target, use it and add supplementary -# development tools - -else - - # Copy native compiler - - cp -a "$BUILD/native-compiler-$ARCH/." "$STAGE_DIR/" || dienow - - # Build and install make - - setupfor make - LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ - --prefix="$STAGE_DIR" --build="${CROSS_HOST}" --host="${CROSS_TARGET}" && - make -j $CPUS && - make -j $CPUS install - - cleanup - - # Build and install bash. (Yes, this is an old version. It's intentional.) - - setupfor bash - # wire around some tests ./configure can't run when cross-compiling. - echo -e "ac_cv_func_setvbuf_reversed=no\nbash_cv_sys_named_pipes=yes\nbash_cv_have_mbstate_t=yes\nbash_cv_getenv_redef=no" > config.cache && - LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" RANLIB="${ARCH}-ranlib" \ - ./configure --prefix="$STAGE_DIR" \ - --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ - --without-bash-malloc --disable-readline && - # note: doesn't work with -j - make && - make install && - # Make bash the default shell. - ln -sf bash "$STAGE_DIR/bin/sh" - - cleanup - - # Build and install distcc - - setupfor distcc - rsync_cv_HAVE_C99_VSNPRINTF=yes \ - LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ - --host="${CROSS_TARGET}" --prefix="$STAGE_DIR" \ - --with-included-popt --disable-Werror && - make -j $CPUS && - make -j $CPUS install && - mkdir -p "$STAGE_DIR/distcc" || dienow - - for i in gcc cc g++ c++ - do - ln -s ../bin/distcc "$STAGE_DIR/distcc/$i" || dienow - done - - cleanup - - # Delete some unneeded files - - [ -z "$SKIP_STRIP" ] && - rm -rf "$STAGE_DIR"/{info,man,libexec/gcc/*/*/install-tools} - -fi # native compiler +fi # This is allowed to fail if there are no configs. diff -r 87b3a69ca71c -r 27c38c82401d sources/sections/bash.build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/sections/bash.build Sun Apr 11 15:21:00 2010 -0500 @@ -0,0 +1,11 @@ +# wire around some tests ./configure can't run when cross-compiling. +echo -e "ac_cv_func_setvbuf_reversed=no\nbash_cv_sys_named_pipes=yes\nbash_cv_have_mbstate_t=yes\nbash_cv_getenv_redef=no" > config.cache && +LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" RANLIB="${ARCH}-ranlib" \ + ./configure --prefix="$STAGE_DIR" \ + --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ + --without-bash-malloc --disable-readline && +# note: doesn't work with -j +make && +make install && +# Make bash the default shell. +ln -sf bash "$STAGE_DIR/bin/sh" diff -r 87b3a69ca71c -r 27c38c82401d sources/sections/distcc.build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/sections/distcc.build Sun Apr 11 15:21:00 2010 -0500 @@ -0,0 +1,12 @@ +rsync_cv_HAVE_C99_VSNPRINTF=yes \ +LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ + --host="${CROSS_TARGET}" --prefix="$STAGE_DIR" \ + --with-included-popt --disable-Werror && +make -j $CPUS && +make -j $CPUS install && +mkdir -p "$STAGE_DIR/distcc" || dienow + +for i in gcc cc g++ c++ +do + ln -s ../bin/distcc "$STAGE_DIR/distcc/$i" || dienow +done diff -r 87b3a69ca71c -r 27c38c82401d sources/sections/make.build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/sections/make.build Sun Apr 11 15:21:00 2010 -0500 @@ -0,0 +1,4 @@ +LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ + --prefix="$STAGE_DIR" --build="${CROSS_HOST}" --host="${CROSS_TARGET}" && +make -j $CPUS && +make -j $CPUS install