Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # To compile BusyBox without touching the original sources |
| 4 | # (as might be interesting for multi-target builds), create |
| 5 | # an empty directory, cd into it, and run this program by |
| 6 | # giving its explicit path (kind of like how you would run |
| 7 | # configure, if BusyBox had one). Then you should be ready |
| 8 | # to "make". Files in the build tree, in particular Config.h, |
| 9 | # will override those in the pristine source tree. |
| 10 | # |
Eric Andersen | 966b3a6 | 2001-02-17 15:56:52 +0000 | [diff] [blame^] | 11 | # If you use a ? in your path name, you lose, see sed command below. |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 12 | |
Eric Andersen | 966b3a6 | 2001-02-17 15:56:52 +0000 | [diff] [blame^] | 13 | DIR=${0%%/pristine_setup.sh} |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 14 | if [ ! -d $DIR ]; then |
| 15 | echo "unexpected problem: $DIR is not a directory. Aborting pristine setup" |
| 16 | exit |
| 17 | fi |
| 18 | |
| 19 | echo " " |
| 20 | |
| 21 | if [ -e ./Config.h ]; then |
Eric Andersen | 966b3a6 | 2001-02-17 15:56:52 +0000 | [diff] [blame^] | 22 | echo "./Config.h already exists: not overwriting" |
| 23 | exit |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 24 | fi |
| 25 | |
| 26 | if [ -e ./Makefile ]; then |
| 27 | echo "./Makefile already exists: not overwriting" |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 28 | fi |
| 29 | |
Eric Andersen | 966b3a6 | 2001-02-17 15:56:52 +0000 | [diff] [blame^] | 30 | sed -e "s?BB_SRC_DIR =.*?BB_SRC_DIR = $DIR?" <$DIR/Makefile >Makefile || exit |
| 31 | cp $DIR/Config.h Config.h || exit |
| 32 | #mkdir -p pwd_grp |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 33 | |
| 34 | echo " " |
| 35 | echo "You may now type 'make' to build busybox in this directory" |
| 36 | echo "($PWD) using the pristine sources in $DIR" |
| 37 | echo " " |
| 38 | |