28 |
make="make" |
make="make" |
29 |
strip="strip" |
strip="strip" |
30 |
target_cpu="x86" |
target_cpu="x86" |
31 |
|
target_bigendian="default" |
32 |
cpu=`uname -m` |
cpu=`uname -m` |
33 |
case "$cpu" in |
case "$cpu" in |
34 |
i386|i486|i586|i686|i86pc|BePC) |
i386|i486|i586|i686|i86pc|BePC) |
104 |
;; |
;; |
105 |
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
106 |
;; |
;; |
107 |
|
--target-cpu=*) target_cpu=`echo $opt | cut -d '=' -f 2` |
108 |
|
;; |
109 |
|
--target-big-endian) target_bigendian="yes" |
110 |
|
;; |
111 |
|
--target-little-endian) target_bigendian="no" |
112 |
|
;; |
113 |
--enable-gprof) gprof="yes" |
--enable-gprof) gprof="yes" |
114 |
;; |
;; |
115 |
--static) static="yes" |
--static) static="yes" |
169 |
gcc_major="3" |
gcc_major="3" |
170 |
fi |
fi |
171 |
|
|
172 |
|
if test "$target_bigendian" = "default" ; then |
173 |
|
if test "$target_cpu" = "x86" ; then |
174 |
|
target_bigendian="no" |
175 |
|
elif test "$target_cpu" = "arm" ; then |
176 |
|
target_bigendian="no" |
177 |
|
else |
178 |
|
target_bigendian="no" |
179 |
|
fi |
180 |
|
fi |
181 |
|
|
182 |
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
183 |
cat << EOF |
cat << EOF |
184 |
|
|
190 |
echo " --help print this message" |
echo " --help print this message" |
191 |
echo " --prefix=PREFIX install in PREFIX [$prefix]" |
echo " --prefix=PREFIX install in PREFIX [$prefix]" |
192 |
echo " --interp-prefix=PREFIX where to find shared libraries, etc. [$interp_prefix]" |
echo " --interp-prefix=PREFIX where to find shared libraries, etc. [$interp_prefix]" |
193 |
|
echo " --target_cpu=CPU set target cpu (x86 or arm) [$target_cpu]" |
194 |
echo "" |
echo "" |
195 |
echo "Advanced options (experts only):" |
echo "Advanced options (experts only):" |
196 |
echo " --source-path=PATH path of source code [$source_path]" |
echo " --source-path=PATH path of source code [$source_path]" |
209 |
echo "C compiler $cc" |
echo "C compiler $cc" |
210 |
echo "make $make" |
echo "make $make" |
211 |
echo "host CPU $cpu" |
echo "host CPU $cpu" |
212 |
echo "Big Endian $bigendian" |
echo "host big endian $bigendian" |
213 |
echo "target CPU $target_cpu" |
echo "target CPU $target_cpu" |
214 |
|
echo "target big endian $target_bigendian" |
215 |
echo "gprof enabled $gprof" |
echo "gprof enabled $gprof" |
216 |
echo "static build $static" |
echo "static build $static" |
217 |
|
|
265 |
echo "WORDS_BIGENDIAN=yes" >> config.mak |
echo "WORDS_BIGENDIAN=yes" >> config.mak |
266 |
echo "#define WORDS_BIGENDIAN 1" >> $TMPH |
echo "#define WORDS_BIGENDIAN 1" >> $TMPH |
267 |
fi |
fi |
268 |
|
|
269 |
|
if test "$target_cpu" = "x86" ; then |
270 |
|
echo "TARGET_ARCH=i386" >> config.mak |
271 |
|
echo "#define TARGET_ARCH \"i386\"" >> $TMPH |
272 |
|
echo "#define TARGET_I386 1" >> $TMPH |
273 |
|
elif test "$target_cpu" = "arm" ; then |
274 |
|
echo "TARGET_ARCH=arm" >> config.mak |
275 |
|
echo "#define TARGET_ARCH \"arm\"" >> $TMPH |
276 |
|
echo "#define TARGET_ARM 1" >> $TMPH |
277 |
|
else |
278 |
|
echo "Unsupported target CPU" |
279 |
|
exit 1 |
280 |
|
fi |
281 |
|
if test "$target_bigendian" = "yes" ; then |
282 |
|
echo "TARGET_WORDS_BIGENDIAN=yes" >> config.mak |
283 |
|
echo "#define TARGET_WORDS_BIGENDIAN 1" >> $TMPH |
284 |
|
fi |
285 |
|
|
286 |
if test "$gprof" = "yes" ; then |
if test "$gprof" = "yes" ; then |
287 |
echo "TARGET_GPROF=yes" >> config.mak |
echo "TARGET_GPROF=yes" >> config.mak |
288 |
echo "#define HAVE_GPROF 1" >> $TMPH |
echo "#define HAVE_GPROF 1" >> $TMPH |