aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-07-20 21:57:11 +0000
committerEric Andersen <andersen@codepoet.org>2000-07-20 21:57:11 +0000
commit51154bacbe34d160f089c4ab4bbb51766030233d (patch)
treed4cc96083ccdfb95c031f92aacfb1b3f8c08dc97
parent3950596e1e13d3593d06ab3cf1e48a07d5bd80c9 (diff)
downloadbusybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.tar.gz
busybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.tar.bz2
busybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.zip
Adjusted install.sh to use relative symlinks, and to optionally
create hardlinks. Added a makefile target to create hardlinks. -Erik
-rw-r--r--Makefile9
-rwxr-xr-xapplets/install.sh44
-rwxr-xr-xinstall.sh44
3 files changed, 80 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index f4df9c702..a17225c0f 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,9 @@ VERSION := 0.46
23BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z") 23BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
24export VERSION 24export VERSION
25 25
26# If you want a static binary, turn this on.
27DOSTATIC = false
28
26# Set the following to `true' to make a debuggable build. 29# Set the following to `true' to make a debuggable build.
27# Leave this set to `false' for production use. 30# Leave this set to `false' for production use.
28# eg: `make DODEBUG=true tests' 31# eg: `make DODEBUG=true tests'
@@ -37,9 +40,6 @@ DODEBUG = false
37# Do not enable this for production builds... 40# Do not enable this for production builds...
38DODMALLOC = false 41DODMALLOC = false
39 42
40# If you want a static binary, turn this on.
41DOSTATIC = false
42
43# If you are running a cross compiler, you may want to set this 43# If you are running a cross compiler, you may want to set this
44# to something more interesting... 44# to something more interesting...
45CROSS = 45CROSS =
@@ -182,6 +182,9 @@ distclean: clean
182install: busybox busybox.links 182install: busybox busybox.links
183 ./install.sh $(PREFIX) 183 ./install.sh $(PREFIX)
184 184
185install-hardlinks: busybox busybox.links
186 ./install.sh $(PREFIX) --hardlinks
187
185dist release: distclean doc 188dist release: distclean doc
186 cd ..; \ 189 cd ..; \
187 rm -rf busybox-$(VERSION); \ 190 rm -rf busybox-$(VERSION); \
diff --git a/applets/install.sh b/applets/install.sh
index 65190f59d..236f62a56 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -1,21 +1,51 @@
1#!/bin/sh 1#!/bin/sh
2 2
3set -e 3set -e
4 4set -x
5if [ "$1" = "" ]; then 5if [ "$1" = "" ]; then
6 echo "No installation directory, aborting." 6 echo "No installation directory, aborting."
7 exit 1; 7 exit 1;
8fi 8fi
9 9if [ "$2" = "--hardlinks" ]; then
10 linkopts="-f"
11else
12 linkopts="-fs"
13fi
14prefix=$1
10h=`sort busybox.links | uniq` 15h=`sort busybox.links | uniq`
11 16
12for i in $h ; do 17
13 echo " $1$i -> /bin/busybox"
14 mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' `
15 ln -fs /bin/busybox $1$i
16done
17rm -f $1/bin/busybox 18rm -f $1/bin/busybox
18mkdir -p $1/bin 19mkdir -p $1/bin
19install -m 755 busybox $1/bin/busybox 20install -m 755 busybox $1/bin/busybox
20 21
22for i in $h ; do
23 appdir=`dirname $i`
24 mkdir -p $prefix/$appdir
25 if [ "$2" = "--hardlinks" ]; then
26 bb_path="$prefix/bin/busybox"
27 else
28 case "$appdir" in
29 /)
30 bb_path="bin/busybox"
31 ;;
32 /bin)
33 bb_path="busybox"
34 ;;
35 /sbin)
36 bb_path="../bin/busybox"
37 ;;
38 /usr/bin|/usr/sbin)
39 bb_path="../../bin/busybox"
40 ;;
41 *)
42 echo "Unknown installation directory: $appdir"
43 exit 1
44 ;;
45 esac
46 fi
47 echo " $prefix$i -> /bin/busybox"
48 ln $linkopts $bb_path $prefix$i
49done
50
21exit 0 51exit 0
diff --git a/install.sh b/install.sh
index 65190f59d..236f62a56 100755
--- a/install.sh
+++ b/install.sh
@@ -1,21 +1,51 @@
1#!/bin/sh 1#!/bin/sh
2 2
3set -e 3set -e
4 4set -x
5if [ "$1" = "" ]; then 5if [ "$1" = "" ]; then
6 echo "No installation directory, aborting." 6 echo "No installation directory, aborting."
7 exit 1; 7 exit 1;
8fi 8fi
9 9if [ "$2" = "--hardlinks" ]; then
10 linkopts="-f"
11else
12 linkopts="-fs"
13fi
14prefix=$1
10h=`sort busybox.links | uniq` 15h=`sort busybox.links | uniq`
11 16
12for i in $h ; do 17
13 echo " $1$i -> /bin/busybox"
14 mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' `
15 ln -fs /bin/busybox $1$i
16done
17rm -f $1/bin/busybox 18rm -f $1/bin/busybox
18mkdir -p $1/bin 19mkdir -p $1/bin
19install -m 755 busybox $1/bin/busybox 20install -m 755 busybox $1/bin/busybox
20 21
22for i in $h ; do
23 appdir=`dirname $i`
24 mkdir -p $prefix/$appdir
25 if [ "$2" = "--hardlinks" ]; then
26 bb_path="$prefix/bin/busybox"
27 else
28 case "$appdir" in
29 /)
30 bb_path="bin/busybox"
31 ;;
32 /bin)
33 bb_path="busybox"
34 ;;
35 /sbin)
36 bb_path="../bin/busybox"
37 ;;
38 /usr/bin|/usr/sbin)
39 bb_path="../../bin/busybox"
40 ;;
41 *)
42 echo "Unknown installation directory: $appdir"
43 exit 1
44 ;;
45 esac
46 fi
47 echo " $prefix$i -> /bin/busybox"
48 ln $linkopts $bb_path $prefix$i
49done
50
21exit 0 51exit 0