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.
85 paramfile
=m-
${machine}${os}.h
86 pinsnfile
=${machine}${os}-pinsn.c
87 opcodefile
=${machine}${os}-opcode.h
88 # Set up a define for purposes of editing the makefile.
90 if [ -r ${machine}${os}-dep.c
]
92 depfile
=${machine}${os}-dep.c
99 # If a file is not needed, set the file name to something.
100 # It must be linked to something, or else make will try to make it.
101 # /dev/null will not work because on systems without symbolic links,
102 # it will complain that /dev/null is on a different file system.
106 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
107 pinsnfile
=m68k-pinsn.c
108 opcodefile
=m68k-opcode.h
111 echo "Use of the coff encapsulation features require the GNU binutils utilities"
112 echo "To be ahead of their System V counterparts in your path."
113 makedefine
="-DM_REGEX=regex.o -DM_SYSV -DM_BSD_NM"
114 pinsnfile
=m68k-pinsn.c
116 opcodefile
=m68k-opcode.h
120 echo "/bin/cc has been known to fail on readline.c on VAXen running BSD4.3"
121 echo "If this occurs, use gcc "
122 echo " (but see comments in Makefile.dist about compiling with gcc)."
124 pinsnfile
=vax-pinsn.c
125 opcodefile
=vax-opcode.h
128 # The headers in the directory hp-include override system headers
129 # and tell GDB to use BSD executable file format (hence -Ihp-include)
130 makedefine
="-DM_SYSV -DM_BSD_NM -DM_REGEX=regex.o
131 -DM_ALLOCA=alloca.o -DM_CFLAGS=-Ihp-include"
132 # The following is true because gcc uses a different .o file format
133 # than the native HPUX compiler
135 echo "If you compile GDB with GCC on HPUX, you must make sure"
136 echo "that the \`nm' used in \`munch' is GNU nm"
138 pinsnfile
=m68k-pinsn.c
139 opcodefile
=m68k-opcode.h
142 # Not sure what makefile editing (if any) is necessary for this machine.
143 pinsnfile
=m68k-pinsn.c
144 opcodefile
=m68k-opcode.h
148 pinsnfile
=m68k-pinsn.c
149 opcodefile
=m68k-opcode.h
152 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
153 # The following is a lie, but a necessary one. See comment at beginning
154 # of this file about unneeded files.
158 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
160 echo "Use of the coff encapsulation features requires the GNU binary utilities"
161 echo "to be ahead of their System V counterparts in your path."
163 pinsnfile
=i386-pinsn.c
165 # The following is a lie, but a necessary one. See comment at beginning
166 # of this file about unneeded files.
170 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
171 pinsnfile
=i386-pinsn.c
176 makedefine
="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
178 echo "Use of the coff encapsulation features requires the GNU binary utilities"
179 echo "to be ahead of their System V counterparts in your path."
181 pinsnfile
=i386-pinsn.c
186 pinsnfile
=ns32k-pinsn.c
187 opcodefile
=ns32k-opcode.h
190 pinsnfile
=m68k-pinsn.c
191 opcodefile
=m68k-opcode.h
194 pinsnfile
=m68k-pinsn.c
195 opcodefile
=m68k-opcode.h
199 pinsnfile
=gld-pinsn.c
202 pinsnfile
=gld-pinsn.c
206 pinsnfile
=m68k-pinsn.c
207 opcodefile
=m68k-opcode.h
210 depfile
=default-dep.c
212 pinsnfile
=m68k-pinsn.c
213 opcodefile
=m68k-opcode.h
216 # Compile GDB without shared libraries so that it can be run on itself.
217 makedefine
=-DM_CFLAGS=-Bstatic
219 echo "Make sure to compile any program on which you want to run gdb"
220 echo " without shared libraries (cc -Bstatic)"
222 paramfile
=m-sun2os4.h
224 pinsnfile
=m68k-pinsn.c
225 opcodefile
=m68k-opcode.h
230 pinsnfile
=m68k-pinsn.c
231 opcodefile
=m68k-opcode.h
234 # Compile GDB without shared libraries so that it can be run on itself.
235 makedefine
=-DM_CFLAGS=-Bstatic
237 echo "Make sure to compile any program on which you want to run gdb"
238 echo " without shared libraries (cc -Bstatic)"
240 paramfile
=m-sun3os4.h
241 pinsnfile
=m68k-pinsn.c
242 opcodefile
=m68k-opcode.h
246 # Compile GDB without shared libraries so that it can be run on itself.
247 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
248 makedefine
="-DM_CFLAGS=-Bstatic -Usparc"
250 echo "Make sure to compile any program on which you want to run gdb"
251 echo " without shared libraries (cc -Bstatic)"
253 paramfile
=m-sun4os4.h
254 pinsnfile
=sparc-pinsn.c
255 opcodefile
=sparc-opcode.h
259 pinsnfile
=i386-pinsn.c
260 # Need *some* opcode file to keep make from trying to make opcode.h
264 pinsnfile
=ns32k-pinsn.c
265 opcodefile
=ns32k-opcode.h
267 sparc|sun4|sun4os3|sun4-os3
)
269 # Undefine sparc to avoid changing sparc-dep.c to 1-dep.c
271 pinsnfile
=sparc-pinsn.c
272 opcodefile
=sparc-opcode.h
283 echo "Unknown machine type: \`$machine'"
284 echo "Available types:"
285 echo m-
*.h |
sed 's/m-//g' |
sed 's/\.h//g'
290 files
="$paramfile $pinsnfile $opcodefile $depfile"
291 links
="param.h pinsn.c opcode.h dep.c"
294 while [ -n "$files" ]
296 # set file to car of files, files to cdr of files
297 set $files; file=$1; shift; files
=$
*
298 set $links; link
=$1; shift; links
=$
*
300 if [ "$file" != skip
]
304 echo "$progname: cannot create a link \`$link',"
305 echo "since the file \`$file' does not exist."
309 echo "Linking \`$link' to \`$file'."
311 # Make a symlink if possible, otherwise try a hard link
312 ln -s $file $link 2>/dev
/null ||
ln $file $link
316 echo "$progname: unable to link \`$link' to \`$file'."
323 echo "Editing Makefile"
324 cp Makefile.dist tmp.c
325 cc
-E >Makefile tmp.c
$makedefine -DM_MAKEDEFINE="$makedefine"
328 echo "GDB is now set up for use with a $machine." \