scummvm random work
[patches.git] / BuildToolChain-scrub.patch
1 Index: BuildToolChain
2 ===================================================================
3 --- BuildToolChain (revision 1371)
4 +++ BuildToolChain (working copy)
5 @@ -199,15 +199,9 @@
6 HOST_TARGET="--host=$OPTARG"
7 ;;
8 k)
9 - if [ -d $OPTARG/uClibc ] ; then
10 - UCLINUX_ROOT=$OPTARG
11 - KERNEL_SOURCE=$OPTARG/linux-2.6.x
12 - if [ ! -d $KERNEL_SOURCE/arch/blackfin ] ; then
13 - echo "Can't find $KERNEL_SOURCE/arch/blackfin"
14 - exit 1
15 - fi
16 - else
17 - echo "Invalid Kernel path : $OPTARG"
18 + KERNEL_SOURCE=$OPTARG
19 + if [ ! -d $KERNEL_SOURCE/arch/blackfin ] ; then
20 + echo "Can't find $KERNEL_SOURCE/arch/blackfin"
21 exit 1
22 fi
23 ;;
24 @@ -811,8 +805,7 @@
25 #
26 build_uClibc()
27 {
28 - #ARGS="CROSS=bfin-elf- PREFIX=$2 DEVEL_PREFIX=\"/\" RUNTIME_PREFIX=/runtime/ KERNEL_SOURCE=$KERNEL_SOURCE ROOTDIR=$UCLINUX_ROOT"
29 - ARGS="CROSS=bfin-elf- PREFIX=$2 DEVEL_PREFIX=\"/\" RUNTIME_PREFIX=/runtime/ KERNEL_SOURCE=$DIR_KBUILD_OUTPUT/usr ROOTDIR=$UCLINUX_ROOT"
30 + ARGS="CROSS=bfin-elf- PREFIX=$2 DEVEL_PREFIX=\"/\" RUNTIME_PREFIX=/runtime/ KERNEL_SOURCE=$DIR_KBUILD_OUTPUT/usr"
31 echo -n "*** Cleaning uClibc " ; date
32 RUN="$MAKE clean $ARGS"
33 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
34 @@ -869,11 +862,6 @@
35 echo "uClibc $1 did not install properly : Missing $RUN"
36 echo "Please report an error to http://blackfin.uclinux.org"
37 tail -10 $ACTUAL_LOGFILE
38 - mv saved-config-toplevel .config 2>/dev/null
39 - mv saved-config-linux linux-2.6.x/.config 2>/dev/null
40 - mv saved-config-uClibc uClibc/.config 2>/dev/null
41 - mv saved-config-user config/.config 2>/dev/null
42 - mv saved-config-arch config.arch 2>/dev/null
43 exit 1
44 fi
45 done
46 @@ -1102,26 +1090,11 @@
47
48 if [ $KERNEL_SOURCE ] ; then
49 echo -n "*** Configuring uClinux " ; date
50 - cd $UCLINUX_ROOT
51
52 - # Save the previous configuration
53 - cp .config saved-config-toplevel 2>/dev/null
54 - cp linux-2.6.x/.config saved-config-linux 2>/dev/null
55 - cp config/.config saved-config-user 2>/dev/null
56 - cp -a config.arch saved-config-arch 2>/dev/null
57 -
58 - # Make sure the kernel is in a safe state
59 - RUN="$MAKE AnalogDevices/BF537-STAMP_config"
60 + cd $KERNEL_SOURCE
61 + RUN="$MAKE -j1 CROSS_COMPILE=bfin-elf- headers_check headers_install INSTALL_HDR_PATH=$DIR_KBUILD_OUTPUT/usr KBUILD_OUTPUT=$DIR_KBUILD_OUTPUT"
62 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
63 - (echo $RUN $LOGFILE ; ) | sh
64 -
65 - cd linux-2.6.x
66 - RUN="$MAKE CROSS_COMPILE=bfin-elf- prepare"
67 - (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
68 (echo $RUN $LOGFILE ; ) | sh || die_with_log
69 - RUN="$MAKE CROSS_COMPILE=bfin-elf- headers_install INSTALL_HDR_PATH=$DIR_KBUILD_OUTPUT/usr KBUILD_OUTPUT=$DIR_KBUILD_OUTPUT"
70 - (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
71 - (echo $RUN $LOGFILE ; ) | sh || die_with_log
72 cd ..
73
74 ####################### Step 3 - build uClibc ################
75 @@ -1144,7 +1117,7 @@
76 echo '# UCLIBC_FORMAT_SHARED_FLAT is not set' >>.config
77 echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >>.config
78 echo "KERNEL_HEADERS=\"$DIR_KBUILD_OUTPUT/usr/include\"" >>.config
79 - RUN="$MAKE oldconfig CROSS=bfin-elf- ROOTDIR=$UCLINUX_ROOT"
80 + RUN="$MAKE oldconfig CROSS=bfin-elf-"
81 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
82 (echo $RUN $LOGFILE ; ) | sh
83
84 @@ -1162,7 +1135,7 @@
85 echo '# UCLIBC_FORMAT_FLAT is not set' >>.config
86 echo 'MULTILIB="msep-data"' >>.config
87
88 - RUN="$MAKE oldconfig CROSS=bfin-elf- ROOTDIR=$UCLINUX_ROOT"
89 + RUN="$MAKE oldconfig CROSS=bfin-elf-"
90 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
91 (echo $RUN $LOGFILE ; ) | sh
92
93 @@ -1180,7 +1153,7 @@
94 echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >>.config
95 echo 'MULTILIB="mid-shared-library"' >>.config
96
97 - RUN="$MAKE oldconfig CROSS=bfin-elf- ROOTDIR=$UCLINUX_ROOT"
98 + RUN="$MAKE oldconfig CROSS=bfin-elf-"
99 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
100 (echo $RUN $LOGFILE ; ) | sh
101
102 @@ -1206,7 +1179,7 @@
103 echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >>.config
104 echo "KERNEL_HEADERS=\"$DIR_KBUILD_OUTPUT/usr/include\"" >>.config
105
106 - RUN="$MAKE oldconfig CROSS=bfin-elf- ROOTDIR=$UCLINUX_ROOT"
107 + RUN="$MAKE oldconfig CROSS=bfin-elf-"
108 (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
109 (echo $RUN $LOGFILE ; ) | sh
110
111 @@ -1225,11 +1198,8 @@
112
113 ######################### Done with uClibc ###########################
114
115 - echo -n "*** Cleaning uClinux " ; date
116 - cd $UCLINUX_ROOT
117 - RUN="$MAKE distclean"
118 - (echo "echo -e '###\n$RUN\n' $LOGFILE" ) | sh
119 - (echo $RUN $LOGFILE ; ) | sh
120 + echo -n "*** Cleaning kernel " ; date
121 + rm -rf "$DIR_KBUILD_OUTPUT"
122
123 echo -n "*** Cleaning uClibc " ; date
124 cd $UCLIBC_SOURCE
125 @@ -1243,12 +1213,6 @@
126 mkdir -p $DIR_LINUX_OUTPUT/bfin-linux-uclibc/runtime/usr/include
127 (cd $DIR_uC_OUTPUT/bfin-uclinux/ ; tar cf - include) | (cd $DIR_LINUX_OUTPUT/bfin-linux-uclibc/runtime/usr ; tar xf - )
128
129 - cd $UCLINUX_ROOT
130 - mv saved-config-toplevel .config 2>/dev/null
131 - mv saved-config-linux linux-2.6.x/.config 2>/dev/null
132 - mv saved-config-user config/.config 2>/dev/null
133 - mv saved-config-arch config.arch 2>/dev/null
134 -
135 ####################### Done Step 3 #########################
136
137 ####################### Step 4 - build bfin-uclinux ################