blob: 9e638f96e7f1afedb0b031ea4b298e2e6abaf7b2 [file] [log] [blame]
Eric Andersen19f86202001-02-17 00:42:47 +00001#!/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 Andersen966b3a62001-02-17 15:56:52 +000011# If you use a ? in your path name, you lose, see sed command below.
Eric Andersen19f86202001-02-17 00:42:47 +000012
Eric Andersen39eea892001-03-08 21:42:11 +000013export LC_ALL=POSIX
14export LC_CTYPE=POSIX
15
Eric Andersen966b3a62001-02-17 15:56:52 +000016DIR=${0%%/pristine_setup.sh}
Eric Andersen19f86202001-02-17 00:42:47 +000017if [ ! -d $DIR ]; then
18 echo "unexpected problem: $DIR is not a directory. Aborting pristine setup"
19 exit
20fi
21
22echo " "
23
24if [ -e ./Config.h ]; then
Eric Andersen966b3a62001-02-17 15:56:52 +000025 echo "./Config.h already exists: not overwriting"
26 exit
Eric Andersen19f86202001-02-17 00:42:47 +000027fi
28
29if [ -e ./Makefile ]; then
30 echo "./Makefile already exists: not overwriting"
Eric Andersen19f86202001-02-17 00:42:47 +000031fi
32
Eric Andersen966b3a62001-02-17 15:56:52 +000033sed -e "s?BB_SRC_DIR =.*?BB_SRC_DIR = $DIR?" <$DIR/Makefile >Makefile || exit
34cp $DIR/Config.h Config.h || exit
35#mkdir -p pwd_grp
Eric Andersen19f86202001-02-17 00:42:47 +000036
Mark Whitley8b7a0d82001-05-24 21:31:09 +000037if [ ! -r $DIR/sh.c ]; then
38 echo "Warning: no shell selected. You must make the symlink (sh.c to either"
39 echo "lash.c or hush.c) in $DIR, not here."
40fi
41
Eric Andersen19f86202001-02-17 00:42:47 +000042echo " "
43echo "You may now type 'make' to build busybox in this directory"
44echo "($PWD) using the pristine sources in $DIR"
45echo " "
46