4 # Shell script to do machine-dependent things in
5 # preparation for compiling gdb.
7 # Usage: config.gdb machine [operating-system]
9 # If config.gdb succeeds, it leaves its status in config.status.
10 # If config.gdb fails after disturbing the status quo,
11 # config.status is removed.
13 # Note: if making something gives errors like "unable to make target
14 # 1-dep.c", this means that the compiler has put in a builtin define
15 # and there is a "-U" missing from makedefine in this file.
30 echo "Usage: $progname machine [operating-system]"
31 echo "Available machine types:"
32 echo m-
*.h |
sed 's/m-//g' |
sed 's/\.h//g'
33 if [ -r config.status
]
41 # cannonicalize the machine name.
74 # Arguably, the default should be sun3os4, but in that case we'd want
75 # to change the list of machine types given by "config.gdb" so it
76 # doesn't list "sun3 sun3os4".
89 # Arguably, the default should be sun4os4, but in that case we'd want
90 # to change the list of machine types given by "config.gdb" so it
91 # doesn't list "sun4 sun4os4".
97 # GCC accepts sequent-i386 or symmetry, so be consistent.
104 paramfile
=m-
${machine}${os}.h
105 pinsnfile
=${machine}${os}-pinsn.c
106 opcodefile
=${machine}${os}-opcode.h
107 # Set up a define for purposes of editing the makefile.
109 if [ -r ${machine}${os}-dep.c
]
111 depfile
=${machine}${os}-dep.c
113 depfile
=default-dep.c
118 # If a file is not needed, set the file name to something.
119 # It must be linked to something, or else make will try to make it.
120 # /dev/null will not work because on systems without symbolic links,
121 # it will complain that /dev/null is on a different file system.
125 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
126 pinsnfile
=m68k-pinsn.c
127 opcodefile
=m68k-opcode.h
130 echo "Use of the coff encapsulation features require the GNU binutils utilities"
131 echo "To be ahead of their System V counterparts in your path."
132 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
133 pinsnfile
=m68k-pinsn.c
135 opcodefile
=m68k-opcode.h
139 echo "Note that GDB on Pyramids only works with GCC."
144 # The following types of /bin/cc failures have been observed:
145 # 1. Something in readline.c which I have never seen
146 # 2. ``"values.c", line 816: compiler error: schain botch''
147 echo "/bin/cc has been known to fail on VAXen running BSD4.3"
148 echo "If this occurs, use gcc "
149 echo " (but see comments in Makefile.dist about compiling with gcc)."
151 pinsnfile
=vax-pinsn.c
152 opcodefile
=vax-opcode.h
155 # The headers in the directory hp-include override system headers
156 # and tell GDB to use BSD executable file format (hence -Ihp-include)
157 makedefine
="-DM_SYSV -DM_BSD_NM -DM_REGEX=regex.o
158 -DM_ALLOCA=alloca.o -DM_CFLAGS=-Ihp-include"
159 # The following is true because gcc uses a different .o file format
160 # than the native HPUX compiler
162 echo "If you compile GDB with GCC on HPUX, you must make sure"
163 echo "that the \`nm' used in \`munch' is GNU nm"
165 pinsnfile
=m68k-pinsn.c
166 opcodefile
=m68k-opcode.h
169 pinsnfile
=m68k-pinsn.c
170 opcodefile
=m68k-opcode.h
174 pinsnfile
=m68k-pinsn.c
175 opcodefile
=m68k-opcode.h
178 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
179 # The following is a lie, but a necessary one. See comment at beginning
180 # of this file about unneeded files.
184 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
186 echo "Use of the coff encapsulation features requires the GNU binary utilities"
187 echo "to be ahead of their System V counterparts in your path."
189 pinsnfile
=i386-pinsn.c
191 # The following is a lie, but a necessary one. See comment at beginning
192 # of this file about unneeded files.
195 # These names are short and cryptic due to the @#$#!@#$@! System V
196 # 14 character file name limit.
198 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
199 pinsnfile
=i386-pinsn.c
201 # The following is a lie, but a necessary one. See comment at beginning
202 # of this file about unneeded files.
206 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
208 echo "Use of the coff encapsulation features requires the GNU binary utilities"
209 echo "to be ahead of their System V counterparts in your path."
211 pinsnfile
=i386-pinsn.c
213 # The following is a lie, but a necessary one. See comment at beginning
214 # of this file about unneeded files.
219 echo "To install GDB on this machine you must copy /bin/sh"
220 echo "to /usr/local/lib/gdb-sh, and make it world readable"
221 echo "and writeable. For example:"
222 echo " cp /bin/sh /usr/local/lib/gdb-sh"
223 echo " chmod ogu+rw /usr/local/lib/gdb-sh"
224 echo "If you want to put it somewhere other than /usr/local/lib,"
225 echo "edit the definition of SHELL_FILE in m-merlin.h"
227 pinsnfile
=ns32k-pinsn.c
228 opcodefile
=ns32k-opcode.h
231 pinsnfile
=m68k-pinsn.c
232 opcodefile
=m68k-opcode.h
235 pinsnfile
=m68k-pinsn.c
236 opcodefile
=m68k-opcode.h
240 pinsnfile
=gld-pinsn.c
243 pinsnfile
=gld-pinsn.c
247 pinsnfile
=m68k-pinsn.c
248 opcodefile
=m68k-opcode.h
251 depfile
=default-dep.c
253 pinsnfile
=m68k-pinsn.c
254 opcodefile
=m68k-opcode.h
257 # Compile GDB without shared libraries so that it can be run on itself.
258 # -Bstatic is the right flag for cc.
259 # For gcc, -Bstatic is (probably) a no-op, and -g (which is specified by
260 # Makefile.dist prevents use of shared libraries).
261 makedefine
=-DM_CFLAGS=-Bstatic
263 echo "Make sure to compile any program on which you want to run gdb"
264 echo " without shared libraries (cc -Bstatic)"
266 paramfile
=m-sun2os4.h
268 pinsnfile
=m68k-pinsn.c
269 opcodefile
=m68k-opcode.h
274 pinsnfile
=m68k-pinsn.c
275 opcodefile
=m68k-opcode.h
278 # Compile GDB without shared libraries so that it can be run on itself.
279 makedefine
=-DM_CFLAGS=-Bstatic
281 echo "Make sure to compile any program on which you want to run gdb"
282 echo " without shared libraries (cc -Bstatic)"
284 paramfile
=m-sun3os4.h
285 pinsnfile
=m68k-pinsn.c
286 opcodefile
=m68k-opcode.h
290 # Compile GDB without shared libraries so that it can be run on itself.
291 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
292 makedefine
="-DM_CFLAGS=-Bstatic -Usparc"
294 echo "Make sure to compile any program on which you want to run gdb"
295 echo " without shared libraries (cc -Bstatic)"
297 paramfile
=m-sun4os4.h
298 pinsnfile
=sparc-pinsn.c
299 opcodefile
=sparc-opcode.h
303 paramfile
=m-symmetry.h
304 depfile
=symmetry-dep.c
305 pinsnfile
=i386-pinsn.c
306 # The following is a lie, but a necessary one. See comment at beginning
307 # of this file about unneeded files.
311 pinsnfile
=ns32k-pinsn.c
312 opcodefile
=ns32k-opcode.h
314 sparc|sun4|sun4os3|sun4-os3
)
316 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
318 pinsnfile
=sparc-pinsn.c
319 opcodefile
=sparc-opcode.h
330 echo "Unknown machine type: \`$machine'"
331 echo "Available types:"
332 echo m-
*.h |
sed 's/m-//g' |
sed 's/\.h//g'
337 files
="$paramfile $pinsnfile $opcodefile $depfile"
338 links
="param.h pinsn.c opcode.h dep.c"
341 while [ -n "$files" ]
343 # set file to car of files, files to cdr of files
344 set $files; file=$1; shift; files
=$
*
345 set $links; link
=$1; shift; links
=$
*
347 if [ "$file" != skip
]
351 echo "$progname: cannot create a link \`$link',"
352 echo "since the file \`$file' does not exist."
356 echo "Linking \`$link' to \`$file'."
358 # Make a symlink if possible, otherwise try a hard link
359 ln -s $file $link 2>/dev
/null ||
ln $file $link
363 echo "$progname: unable to link \`$link' to \`$file'."
370 echo "Editing Makefile"
371 cp Makefile.dist tmp.c
372 cc
-E >Makefile tmp.c
$makedefine -DM_MAKEDEFINE="$makedefine"
375 echo "GDB is now set up for use with a $machine." \