7 if [ -z "$prefix" ]; then
8 echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks]"
11 h=`sort busybox.links | uniq`
13 --hardlinks) linkopts="-f";;
14 --symlinks) linkopts="-fs";;
16 *) echo "Unknown install option: $2"; exit 1;;
19 if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
20 # get the target dir for the libs
21 # assume it starts with lib
22 libdir=$($CC -print-file-name=libc.so | \
23 sed -n 's%^.*\(/lib[^\/]*\)/libc.so%\1%p')
24 if test -z "$libdir"; then
28 mkdir -p $prefix/$libdir || exit 1
29 for i in $DO_INSTALL_LIBS; do
30 rm -f $prefix/$libdir/$i || exit 1
32 cp -a $i $prefix/$libdir/ || exit 1
33 chmod 0644 $prefix/$libdir/$i || exit 1
37 rm -f $prefix/bin/busybox || exit 1
38 mkdir -p $prefix/bin || exit 1
39 install -m 755 busybox $prefix/bin/busybox || exit 1
43 mkdir -p $prefix/$appdir || exit 1
44 if [ "$2" = "--hardlinks" ]; then
45 bb_path="$prefix/bin/busybox"
55 bb_path="../bin/busybox"
58 bb_path="../../bin/busybox"
61 echo "Unknown installation directory: $appdir"
66 echo " $prefix$i -> $bb_path"
67 ln $linkopts $bb_path $prefix$i || exit 1