~ubuntu-branches/ubuntu/jaunty/spim/jaunty

« back to all changes in this revision

Viewing changes to Configure

  • Committer: Bazaar Package Importer
  • Author(s): Fernando Sanchez
  • Date: 2001-01-24 14:05:34 UTC
  • Revision ID: james.westby@ubuntu.com-20010124140534-3le9wmofforjjcd8
Tags: upstream-6.3
ImportĀ upstreamĀ versionĀ 6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Shell script to configure SPIM.
 
4
#
 
5
# Copyright (C) 1992-2000 by James Larus (larus@cs.wisc.edu).
 
6
# ALL RIGHTS RESERVED.
 
7
#
 
8
# SPIM is distributed under the following conditions:
 
9
#
 
10
#   You may make copies of SPIM for your own use and modify those copies.
 
11
#
 
12
#   All copies of SPIM must retain my name and copyright notice.
 
13
#
 
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.
 
16
#
 
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
 
20
# PURPOSE.
 
21
#
 
22
# $Header: /u/l/a/larus/Software/SPIM/RCS/Configure,v 1.13 1997/12/30 21:49:27 larus Exp $
 
23
#
 
24
# Shell script to create proper links to machine-dependent files for SPIM.
 
25
#
 
26
#
 
27
# Usage: Configure
 
28
#
 
29
# (Environment variable CC can be set to name a compiler--besides the
 
30
# default of cc)
 
31
 
 
32
 
 
33
set CC = ${CC:=cc}
 
34
echo $CC
 
35
 
 
36
 
 
37
echo Check if this machine is big-endian or little-endian.
 
38
echo This may take a few minutes.
 
39
rm -f configuration
 
40
$CC endian.c -o endian
 
41
if ./endian; then
 
42
  # Big endian
 
43
  rm -f Tests/tt.s Tests/tt.OK configuration
 
44
  cd Tests
 
45
  ln -s tt.be.s tt.s
 
46
  ln -s tt.be.OK tt.OK
 
47
  cd ..
 
48
  echo "-DBIGENDIAN" > configuration
 
49
  echo I believe this is a big-endian machine.
 
50
else
 
51
  # Little endian
 
52
  rm -f Tests/tt.s Tests/tt.OK configuration
 
53
  cd Tests
 
54
  ln -s tt.le.s tt.s
 
55
  ln -s tt.le.OK tt.OK
 
56
  cd ..
 
57
  echo "-DLITTLEENDIAN" > configuration
 
58
  echo I believe this is a little-endian machine.
 
59
fi;
 
60
rm -f endian
 
61
 
 
62
 
 
63
if [ -f /usr/lib/libc.a ]; then
 
64
  # BSD Universe:
 
65
  echo Looks like a BSD universe exists...
 
66
  echo Scaning libc
 
67
  nm /usr/lib/libc.a > library_contents
 
68
  set flag = -s
 
69
else if [ -f /lib/libc.a ]; then
 
70
  # System V Universe:
 
71
  echo Looks like a System V universe exists...
 
72
  echo Scaning libc
 
73
  nm /lib/libc.a > library_contents
 
74
  set flag = -q
 
75
else if [ -f /usr/lib/libc.so ]; then
 
76
  # System V Universe?
 
77
  echo Looks like a System V universe exists...
 
78
  echo Scaning libc
 
79
  nm /usr/lib/libc.so > library_contents
 
80
  set flag = -q
 
81
fi;
 
82
fi;
 
83
fi;
 
84
 
 
85
 
 
86
echo
 
87
echo Checking if libc on this machine contains:
 
88
 
 
89
 
 
90
if  grep $flag 'vsprintf' library_contents > /dev/null; then
 
91
  echo "  vsprintf: Yes, I think so"
 
92
else
 
93
  echo "-DNEED_VSPRINTF" >> configuration
 
94
  echo "  vsprintf: No, I don't think"
 
95
 
 
96
  if  grep $flag '_doprnt' library_contents > /dev/null; then
 
97
    echo "    _doprnt: Yes, I think, so I will use it instead"
 
98
  else
 
99
    echo "    _doprnt: NO, THIS IS A PROBLEM: NO VSPRINTF AND NO _DOPRNT"
 
100
    echo "SPIM WILL NOT RUN PROPERLY"
 
101
  fi;
 
102
fi;
 
103
 
 
104
 
 
105
if  grep $flag 'vfprintf' library_contents > /dev/null; then
 
106
  echo "  vfprintf: Yes, I think"
 
107
else
 
108
  echo "-DNO_VFPRINTF" >> configuration
 
109
  echo "  vfprintf: No, I don't think"
 
110
 
 
111
  if  grep $flag '_doprnt' library_contents > /dev/null; then
 
112
    echo "    _doprnt: Yes, I think"
 
113
  else
 
114
    echo "    _doprnt: NO, THIS IS A PROBLEM: NO VFPRINTF AND NO _DOPRNT"
 
115
    echo "SPIM WILL NOT RUN PROPERLY"
 
116
  fi;
 
117
fi;
 
118
 
 
119
 
 
120
if grep $flag 'strtoul' library_contents > /dev/null; then
 
121
  echo "  strtoul: Yes, I think"
 
122
else
 
123
  # No strtol
 
124
  echo "-DNEED_STRTOUL" >> configuration
 
125
  echo "  strtoul: No, I don't think"
 
126
fi;
 
127
 
 
128
 
 
129
if grep $flag 'strtol' library_contents > /dev/null; then
 
130
    echo "  strtol: Yes, I think"
 
131
else
 
132
  # No strtol
 
133
  echo "-DNEED_STRTOL" >> configuration
 
134
  echo "  strtol: No, I don't think"
 
135
fi;
 
136
 
 
137
 
 
138
if grep $flag 'memcpy' library_contents > /dev/null; then
 
139
  echo "  memcpy: Yes, I think"
 
140
else
 
141
  # No memcpy
 
142
  echo "-DNO_MEM_FUNCTIONS" >> configuration
 
143
  echo "  memcpy: No, I don't think"
 
144
fi;
 
145
 
 
146
 
 
147
echo
 
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"
 
152
else
 
153
  # No memcpy
 
154
  echo "No, it is not there"
 
155
fi;
 
156
 
 
157
 
 
158
rm -f library_contents