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.
83 # GCC accepts sequent-i386 or symmetry, so be consistent.
90 paramfile
=m-
${machine}${os}.h
91 pinsnfile
=${machine}${os}-pinsn.c
92 opcodefile
=${machine}${os}-opcode.h
93 # Set up a define for purposes of editing the makefile.
95 if [ -r ${machine}${os}-dep.c
]
97 depfile
=${machine}${os}-dep.c
104 # If a file is not needed, set the file name to something.
105 # It must be linked to something, or else make will try to make it.
106 # /dev/null will not work because on systems without symbolic links,
107 # it will complain that /dev/null is on a different file system.
111 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
112 pinsnfile
=m68k-pinsn.c
113 opcodefile
=m68k-opcode.h
116 echo "Use of the coff encapsulation features require the GNU binutils utilities"
117 echo "To be ahead of their System V counterparts in your path."
118 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
119 pinsnfile
=m68k-pinsn.c
121 opcodefile
=m68k-opcode.h
125 # The following types of /bin/cc failures have been observed:
126 # 1. Something in readline.c which I have never seen
127 # 2. ``"values.c", line 816: compiler error: schain botch''
128 echo "/bin/cc has been known to fail on VAXen running BSD4.3"
129 echo "If this occurs, use gcc "
130 echo " (but see comments in Makefile.dist about compiling with gcc)."
132 pinsnfile
=vax-pinsn.c
133 opcodefile
=vax-opcode.h
136 # The headers in the directory hp-include override system headers
137 # and tell GDB to use BSD executable file format (hence -Ihp-include)
138 makedefine
="-DM_SYSV -DM_BSD_NM -DM_REGEX=regex.o
139 -DM_ALLOCA=alloca.o -DM_CFLAGS=-Ihp-include"
140 # The following is true because gcc uses a different .o file format
141 # than the native HPUX compiler
143 echo "If you compile GDB with GCC on HPUX, you must make sure"
144 echo "that the \`nm' used in \`munch' is GNU nm"
146 pinsnfile
=m68k-pinsn.c
147 opcodefile
=m68k-opcode.h
150 # Not sure what makefile editing (if any) is necessary for this machine.
151 pinsnfile
=m68k-pinsn.c
152 opcodefile
=m68k-opcode.h
156 pinsnfile
=m68k-pinsn.c
157 opcodefile
=m68k-opcode.h
160 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
161 # The following is a lie, but a necessary one. See comment at beginning
162 # of this file about unneeded files.
166 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
168 echo "Use of the coff encapsulation features requires the GNU binary utilities"
169 echo "to be ahead of their System V counterparts in your path."
171 pinsnfile
=i386-pinsn.c
173 # The following is a lie, but a necessary one. See comment at beginning
174 # of this file about unneeded files.
177 # These names are short and cryptic due to the @#$#!@#$@! System V
178 # 14 character file name limit.
180 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
181 pinsnfile
=i386-pinsn.c
183 # The following is a lie, but a necessary one. See comment at beginning
184 # of this file about unneeded files.
188 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
190 echo "Use of the coff encapsulation features requires the GNU binary utilities"
191 echo "to be ahead of their System V counterparts in your path."
193 pinsnfile
=i386-pinsn.c
195 # The following is a lie, but a necessary one. See comment at beginning
196 # of this file about unneeded files.
200 pinsnfile
=ns32k-pinsn.c
201 opcodefile
=ns32k-opcode.h
204 pinsnfile
=m68k-pinsn.c
205 opcodefile
=m68k-opcode.h
208 pinsnfile
=m68k-pinsn.c
209 opcodefile
=m68k-opcode.h
213 pinsnfile
=gld-pinsn.c
216 pinsnfile
=gld-pinsn.c
220 pinsnfile
=m68k-pinsn.c
221 opcodefile
=m68k-opcode.h
224 depfile
=default-dep.c
226 pinsnfile
=m68k-pinsn.c
227 opcodefile
=m68k-opcode.h
230 # Compile GDB without shared libraries so that it can be run on itself.
231 makedefine
=-DM_CFLAGS=-Bstatic
233 echo "Make sure to compile any program on which you want to run gdb"
234 echo " without shared libraries (cc -Bstatic)"
236 paramfile
=m-sun2os4.h
238 pinsnfile
=m68k-pinsn.c
239 opcodefile
=m68k-opcode.h
244 pinsnfile
=m68k-pinsn.c
245 opcodefile
=m68k-opcode.h
248 # Compile GDB without shared libraries so that it can be run on itself.
249 makedefine
=-DM_CFLAGS=-Bstatic
251 echo "Make sure to compile any program on which you want to run gdb"
252 echo " without shared libraries (cc -Bstatic)"
254 paramfile
=m-sun3os4.h
255 pinsnfile
=m68k-pinsn.c
256 opcodefile
=m68k-opcode.h
260 # Compile GDB without shared libraries so that it can be run on itself.
261 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
262 makedefine
="-DM_CFLAGS=-Bstatic -Usparc"
264 echo "Make sure to compile any program on which you want to run gdb"
265 echo " without shared libraries (cc -Bstatic)"
267 paramfile
=m-sun4os4.h
268 pinsnfile
=sparc-pinsn.c
269 opcodefile
=sparc-opcode.h
273 paramfile
=m-symmetry.h
274 depfile
=symmetry-dep.c
275 pinsnfile
=i386-pinsn.c
276 # The following is a lie, but a necessary one. See comment at beginning
277 # of this file about unneeded files.
281 pinsnfile
=ns32k-pinsn.c
282 opcodefile
=ns32k-opcode.h
284 sparc|sun4|sun4os3|sun4-os3
)
286 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
288 pinsnfile
=sparc-pinsn.c
289 opcodefile
=sparc-opcode.h
300 echo "Unknown machine type: \`$machine'"
301 echo "Available types:"
302 echo m-
*.h |
sed 's/m-//g' |
sed 's/\.h//g'
307 files
="$paramfile $pinsnfile $opcodefile $depfile"
308 links
="param.h pinsn.c opcode.h dep.c"
311 while [ -n "$files" ]
313 # set file to car of files, files to cdr of files
314 set $files; file=$1; shift; files
=$
*
315 set $links; link
=$1; shift; links
=$
*
317 if [ "$file" != skip
]
321 echo "$progname: cannot create a link \`$link',"
322 echo "since the file \`$file' does not exist."
326 echo "Linking \`$link' to \`$file'."
328 # Make a symlink if possible, otherwise try a hard link
329 ln -s $file $link 2>/dev
/null ||
ln $file $link
333 echo "$progname: unable to link \`$link' to \`$file'."
340 echo "Editing Makefile"
341 cp Makefile.dist tmp.c
342 cc
-E >Makefile tmp.c
$makedefine -DM_MAKEDEFINE="$makedefine"
345 echo "GDB is now set up for use with a $machine." \