view sources/sections/busybox.build @ 1507:1261b8fd1ec9

Teach busybox.build to switch off toybox-supplied functionality when TOYBOX=toybox, and move one more config symbol after toybox marker.
author Rob Landley <rob@landley.net>
date Fri, 16 Mar 2012 07:00:09 -0500
parents 1e494ad5c7fd
children e2f722cc97a6
line wrap: on
line source

# Build busybox statically by default, but don't statically link against
# glibc (during host_tools) build because glibc is buggy and can't combine
# --static with --gc-sections.

# Build busybox

if [ "$TOYBOX" == busybox_defconfig ]
then
  make defconfig &&
  # breaks on ubuntu 11.10
  sed -i -e 's/^\(CONFIG_UBI.*\)=y/# \1 is not set/' .config &&
  cp .config "$WORK"/config-busybox || dienow
else
  if [ "$TOYBOX" == toybox ]
  then
    getconfig busybox | sed '/toybox/q' > "$WORK/config-busybox" || dienow
  else
    getconfig busybox > "$WORK/config-busybox" || dienow
  fi
  make allnoconfig KCONFIG_ALLCONFIG="$WORK/config-busybox" || dienow
fi

LDFLAGS="$LDFLAGS $STATIC_FLAGS" make -j $CPUS $VERBOSITY $DO_CROSS &&
make busybox.links || dienow

[ -d "$STAGE_DIR/bin" ] && INSTDIR="$STAGE_DIR/bin" || INSTDIR="$STAGE_DIR"

cp busybox${SKIP_STRIP:+_unstripped} "$INSTDIR/busybox" || dienow

for i in $(sed 's@.*/@@' busybox.links)
do
  # busybox mke2fs/tune2fs don't support -j
  if [ "$i" == mke2fs ] || [ "$i" == tune2fs ]
  then
    continue
  fi
  [ ! -f "$INSTDIR/$i" ] && (ln -sf busybox "$INSTDIR/$i" || dienow)
done

# Reset error condition, the last file already existing is not an error

true