3
# Shell script to configure SPIM.
5
# Copyright (C) 1992-2000 by James Larus (larus@cs.wisc.edu).
8
# SPIM is distributed under the following conditions:
10
# You may make copies of SPIM for your own use and modify those copies.
12
# All copies of SPIM must retain my name and copyright notice.
14
# You may not sell SPIM or distributed SPIM in conjunction with a commerical
15
# product or service without the expressed written consent of James Larus.
17
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22
# $Header: /u/l/a/larus/Software/SPIM/RCS/Configure,v 1.13 1997/12/30 21:49:27 larus Exp $
24
# Shell script to create proper links to machine-dependent files for SPIM.
29
# (Environment variable CC can be set to name a compiler--besides the
37
echo Check if this machine is big-endian or little-endian.
38
echo This may take a few minutes.
40
$CC endian.c -o endian
43
rm -f Tests/tt.s Tests/tt.OK configuration
48
echo "-DBIGENDIAN" > configuration
49
echo I believe this is a big-endian machine.
52
rm -f Tests/tt.s Tests/tt.OK configuration
57
echo "-DLITTLEENDIAN" > configuration
58
echo I believe this is a little-endian machine.
63
if [ -f /usr/lib/libc.a ]; then
65
echo Looks like a BSD universe exists...
67
nm /usr/lib/libc.a > library_contents
69
else if [ -f /lib/libc.a ]; then
71
echo Looks like a System V universe exists...
73
nm /lib/libc.a > library_contents
75
else if [ -f /usr/lib/libc.so ]; then
77
echo Looks like a System V universe exists...
79
nm /usr/lib/libc.so > library_contents
87
echo Checking if libc on this machine contains:
90
if grep $flag 'vsprintf' library_contents > /dev/null; then
91
echo " vsprintf: Yes, I think so"
93
echo "-DNEED_VSPRINTF" >> configuration
94
echo " vsprintf: No, I don't think"
96
if grep $flag '_doprnt' library_contents > /dev/null; then
97
echo " _doprnt: Yes, I think, so I will use it instead"
99
echo " _doprnt: NO, THIS IS A PROBLEM: NO VSPRINTF AND NO _DOPRNT"
100
echo "SPIM WILL NOT RUN PROPERLY"
105
if grep $flag 'vfprintf' library_contents > /dev/null; then
106
echo " vfprintf: Yes, I think"
108
echo "-DNO_VFPRINTF" >> configuration
109
echo " vfprintf: No, I don't think"
111
if grep $flag '_doprnt' library_contents > /dev/null; then
112
echo " _doprnt: Yes, I think"
114
echo " _doprnt: NO, THIS IS A PROBLEM: NO VFPRINTF AND NO _DOPRNT"
115
echo "SPIM WILL NOT RUN PROPERLY"
120
if grep $flag 'strtoul' library_contents > /dev/null; then
121
echo " strtoul: Yes, I think"
124
echo "-DNEED_STRTOUL" >> configuration
125
echo " strtoul: No, I don't think"
129
if grep $flag 'strtol' library_contents > /dev/null; then
130
echo " strtol: Yes, I think"
133
echo "-DNEED_STRTOL" >> configuration
134
echo " strtol: No, I don't think"
138
if grep $flag 'memcpy' library_contents > /dev/null; then
139
echo " memcpy: Yes, I think"
142
echo "-DNO_MEM_FUNCTIONS" >> configuration
143
echo " memcpy: No, I don't think"
148
echo Checking for /usr/include/termio.h
149
if [ -f /usr/include/termio.h ]; then
150
echo "-DUSE_TERMIO" >> configuration
151
echo "Yes, it is there"
154
echo "No, it is not there"
158
rm -f library_contents