| 1 | configdirs="doc testsuite" |
| 2 | srcname="GDB" |
| 3 | srctrigger=main.c |
| 4 | |
| 5 | # per-host: |
| 6 | |
| 7 | # Map host cpu into the config cpu subdirectory name. |
| 8 | # The default is $host_cpu. |
| 9 | |
| 10 | case "${host_cpu}" in |
| 11 | |
| 12 | c[12]) gdb_host_cpu=convex ;; |
| 13 | hppa*) gdb_host_cpu=pa ;; |
| 14 | i[34]86) gdb_host_cpu=i386 ;; |
| 15 | m68*) gdb_host_cpu=m68k ;; |
| 16 | np1) gdb_host_cpu=gould ;; |
| 17 | pyramid) gdb_host_cpu=pyr ;; |
| 18 | *) gdb_host_cpu=$host_cpu ;; |
| 19 | |
| 20 | esac |
| 21 | |
| 22 | # map host info into gdb names. |
| 23 | |
| 24 | case "${host}" in |
| 25 | |
| 26 | a29k-*-*) gdb_host=ultra3 ;; |
| 27 | |
| 28 | alpha-*-osf*) gdb_host=alpha-osf1 ;; |
| 29 | |
| 30 | arm-*-*) gdb_host=arm ;; |
| 31 | |
| 32 | c[12]-*-*) gdb_host=convex ;; |
| 33 | |
| 34 | hppa*-*-bsd*) gdb_host=hppabsd ;; |
| 35 | hppa*-*-hpux*) gdb_host=hppahpux ;; |
| 36 | hppa*-*-hiux*) gdb_host=hppahpux ;; |
| 37 | |
| 38 | i[34]86-ncr-*) gdb_host=ncr3000 ;; |
| 39 | i[34]86-sequent-bsd*) gdb_host=symmetry ;; #dynix |
| 40 | i[34]86-sequent-sysv*) gdb_host=ptx ;; |
| 41 | |
| 42 | i[34]86-*-aix*) gdb_host=i386aix ;; |
| 43 | i[34]86-*-bsd*) gdb_host=i386bsd ;; |
| 44 | i[34]86-*-netbsd*) gdb_host=i386bsd ;; |
| 45 | i[34]86-*-go32) gdb_host=go32 ;; |
| 46 | i[34]86-*-linux) gdb_host=linux ;; |
| 47 | i[34]86-*-lynx*) gdb_host=i386lynx ;; |
| 48 | i[34]86-*-mach) gdb_host=i386mach ;; |
| 49 | i[34]86-*-sco3.2v4*) gdb_host=i386sco4 ;; |
| 50 | i[34]86-*-sco*) gdb_host=i386sco ;; |
| 51 | i[34]86-*-solaris*) gdb_host=i386sol2 ;; |
| 52 | i[34]86-*-sunos*) gdb_host=sun386 ;; |
| 53 | i[34]86-*-sysv3.2) gdb_host=i386v32 ;; |
| 54 | i[34]86-*-sysv4*) gdb_host=i386v4 ;; |
| 55 | i[34]86-*-sysv*) gdb_host=i386v ;; |
| 56 | i[34]86-*-isc*) gdb_host=i386v32 ;; |
| 57 | |
| 58 | m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;; |
| 59 | m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;; |
| 60 | m68030-sony-*) gdb_host=news1000 ;; |
| 61 | |
| 62 | m68*-altos-*) gdb_host=altos ;; |
| 63 | m68*-apollo*-sysv*) gdb_host=apollo68v ;; |
| 64 | m68*-apollo*-bsd*) gdb_host=apollo68b ;; |
| 65 | m68*-att-*) gdb_host=3b1 ;; |
| 66 | m68*-bull*-sysv*) gdb_host=dpx2 ;; |
| 67 | m68*-cbm-sysv4*) gdb_host=amix ;; |
| 68 | m68*-hp-bsd*) gdb_host=hp300bsd ;; |
| 69 | m68*-hp-hpux*) gdb_host=hp300hpux ;; |
| 70 | m68*-isi-*) gdb_host=isi ;; |
| 71 | m68*-motorola-*) gdb_host=delta68 ;; |
| 72 | m68*-sony-*) gdb_host=news ;; |
| 73 | m68*-sun-sunos3*) gdb_host=sun3os3 ;; |
| 74 | m68*-sun-sunos4*) gdb_host=sun3os4 ;; |
| 75 | m68*-sun-*) gdb_host=sun3os4 ;; |
| 76 | |
| 77 | m88*-motorola-sysv4*) gdb_host=delta88v4 ;; |
| 78 | m88*-motorola-sysv*) gdb_host=delta88 ;; |
| 79 | # I suspect this is just used for DGUX |
| 80 | m88*-*-*) gdb_host=m88k ;; |
| 81 | |
| 82 | mips-dec-*) gdb_host=decstation ;; |
| 83 | mips-little-*) gdb_host=littlemips ;; |
| 84 | mips-sgi-irix3) gdb_host=irix3 ;; |
| 85 | mips-sgi-irix4*) gdb_host=irix4 ;; |
| 86 | mips-sony-*) gdb_host=news-mips ;; |
| 87 | mips-*-sysv*) gdb_host=riscos ;; |
| 88 | mips-*-riscos*) gdb_host=riscos ;; |
| 89 | |
| 90 | none-*-*) gdb_host=none ;; |
| 91 | |
| 92 | np1-*-*) gdb_host=np1 ;; |
| 93 | |
| 94 | ns32k-umax-*) gdb_host=umax ;; |
| 95 | ns32k-utek-sysv) gdb_host=merlin ;; |
| 96 | |
| 97 | pn-*-*) gdb_host=pn ;; |
| 98 | |
| 99 | pyramid-*-*) gdb_host=pyramid ;; |
| 100 | |
| 101 | romp-*-*) gdb_host=rtbsd ;; |
| 102 | |
| 103 | rs6000-*-*) gdb_host=rs6000 ;; |
| 104 | |
| 105 | sparc-*-solaris2*) gdb_host=sun4sol2 ;; |
| 106 | sparc-*-sunos4*) gdb_host=sun4os4 ;; |
| 107 | sparc-*-*) gdb_host=sun4os4 ;; |
| 108 | |
| 109 | tahoe-*-*) gdb_host=tahoe ;; |
| 110 | |
| 111 | vax-*-bsd*) gdb_host=vaxbsd ;; |
| 112 | vax-*-ultrix2*) gdb_host=vaxult2 ;; |
| 113 | vax-*-ultrix*) gdb_host=vaxult ;; |
| 114 | |
| 115 | esac |
| 116 | |
| 117 | |
| 118 | if [ ! -f ${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh ]; then |
| 119 | echo '***' "Gdb does not support host ${host}" 1>&2 |
| 120 | exit 1 |
| 121 | fi |
| 122 | |
| 123 | # We really shouldn't depend on there being a space after XM_FILE= ... |
| 124 | hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh` |
| 125 | |
| 126 | # per-target: |
| 127 | |
| 128 | # Map target cpu into the config cpu subdirectory name. |
| 129 | # The default is $target_cpu. |
| 130 | |
| 131 | case "${target_cpu}" in |
| 132 | |
| 133 | alpha) gdb_target_cpu=alpha ;; |
| 134 | c[12]) gdb_target_cpu=convex ;; |
| 135 | hppa*) gdb_target_cpu=pa ;; |
| 136 | i[34]86) gdb_target_cpu=i386 ;; |
| 137 | m68*) gdb_target_cpu=m68k ;; |
| 138 | m8*) gdb_target_cpu=m88k ;; |
| 139 | np1) gdb_target_cpu=gould ;; |
| 140 | pn) gdb_target_cpu=gould ;; |
| 141 | pyramid) gdb_target_cpu=pyr ;; |
| 142 | sparclite) gdb_target_cpu=sparc |
| 143 | configdirs="${configdirs} sparclite" |
| 144 | ;; |
| 145 | sparc*) gdb_target_cpu=sparc ;; |
| 146 | *) gdb_target_cpu=$target_cpu ;; |
| 147 | |
| 148 | esac |
| 149 | |
| 150 | # map target info into gdb names. |
| 151 | |
| 152 | case "${target}" in |
| 153 | |
| 154 | a29k-*-aout) gdb_target=a29k ;; |
| 155 | a29k-*-coff) gdb_target=a29k ;; |
| 156 | a29k-*-elf) gdb_target=a29k ;; |
| 157 | a29k-*-ebmon) gdb_target=a29k ;; |
| 158 | a29k-*-kern) gdb_target=a29k-kern ;; |
| 159 | a29k-*-none) gdb_target=a29k ;; |
| 160 | a29k-*-sym1) gdb_target=ultra3 ;; |
| 161 | a29k-*-udi) gdb_target=a29k-udi ;; |
| 162 | |
| 163 | alpha-*-osf*) gdb_target=alpha-osf1 ;; |
| 164 | |
| 165 | arm-*-*) gdb_target=arm ;; |
| 166 | |
| 167 | c1-*-*) gdb_target=convex ;; |
| 168 | c2-*-*) gdb_target=convex ;; |
| 169 | |
| 170 | h8300-*-*) gdb_target=h8300hms ;; |
| 171 | h8300h-*-*) gdb_target=h8300hms gdb_target_cpu=h8300 ;; |
| 172 | h8500-*-*) gdb_target=h8500hms ;; |
| 173 | |
| 174 | sh-*-*) gdb_target=sh ;; |
| 175 | |
| 176 | hppa*-*-bsd*) gdb_target=hppabsd ;; |
| 177 | hppa*-*-hpux*) gdb_target=hppahpux ;; |
| 178 | hppa*-*-hiux*) gdb_target=hppahiux ;; |
| 179 | |
| 180 | i[34]86-sequent-*) gdb_target=symmetry ;; |
| 181 | i[34]86-ncr-*) gdb_target=ncr3000 ;; |
| 182 | |
| 183 | i[34]86-*-aout) gdb_target=i386aout ;; |
| 184 | i[34]86-*-coff) gdb_target=i386v ;; |
| 185 | i[34]86-*-elf) gdb_target=i386v ;; |
| 186 | |
| 187 | i[34]86-*-aix*) gdb_target=i386aix ;; |
| 188 | i[34]86-*-bsd*) gdb_target=i386bsd ;; |
| 189 | i[34]86-*-netbsd*) gdb_target=i386bsd ;; |
| 190 | i[34]86-*-go32) gdb_target=i386aout ;; |
| 191 | i[34]86-*-lynx*) gdb_target=i386lynx |
| 192 | configdirs="${configdirs} gdbserver" |
| 193 | ;; |
| 194 | i[34]86-*-solaris*) gdb_target=i386sol2 ;; |
| 195 | i[34]86-*-sunos*) gdb_target=sun386 ;; |
| 196 | i[34]86-*-sysv4*) gdb_target=i386v4 ;; |
| 197 | i[34]86-*-sco*) gdb_target=i386v ;; |
| 198 | i[34]86-*-sysv*) gdb_target=i386v ;; |
| 199 | i[34]86-*-linux*) gdb_target=linux ;; |
| 200 | i[34]86-*-isc*) gdb_target=i386v ;; |
| 201 | i[34]86-*-netware*) gdb_target=i386nw ;; |
| 202 | |
| 203 | i960-*-bout) gdb_target=vxworks960 ;; |
| 204 | i960-*-coff) gdb_target=nindy960 ;; |
| 205 | i960-*-elf) gdb_target=nindy960 ;; |
| 206 | |
| 207 | i960-*-nindy) gdb_target=nindy960 ;; |
| 208 | i960-*-vxworks) gdb_target=vxworks960 ;; |
| 209 | |
| 210 | m68000-*-sunos3*) gdb_target=sun2os3 ;; |
| 211 | m68000-*-sunos4*) gdb_target=sun2os4 ;; |
| 212 | |
| 213 | m68*-cbm-sysv4*) gdb_target=amix ;; |
| 214 | m68*-bull-sysv*) gdb_target=dpx2 ;; |
| 215 | m68*-hp-bsd*) gdb_target=hp300bsd ;; |
| 216 | m68*-hp-hpux*) gdb_target=hp300hpux ;; |
| 217 | |
| 218 | m68*-altos-*) gdb_target=altos ;; |
| 219 | m68*-att-*) gdb_target=3b1 ;; |
| 220 | m68*-ericsson-*) gdb_target=es1800 ;; |
| 221 | m68*-isi-*) gdb_target=isi ;; |
| 222 | m68*-motorola-*) gdb_target=delta68 ;; |
| 223 | m68*-netx-*) gdb_target=vxworks68 ;; |
| 224 | m68*-sony-*) gdb_target=news ;; |
| 225 | m68*-tandem-*) gdb_target=st2000 ;; |
| 226 | |
| 227 | m68*-rom68k-*) gdb_target=monitor ;; |
| 228 | m68*-*bug-*) gdb_target=monitor ;; |
| 229 | m68*-monitor-*) gdb_target=monitor ;; |
| 230 | |
| 231 | m68*-*-aout) gdb_target=m68k-em ;; |
| 232 | m68*-*-coff) gdb_target=m68k-em ;; |
| 233 | m68*-*-elf) gdb_target=m68k-em ;; |
| 234 | m68*-*-os68k) gdb_target=os68k ;; |
| 235 | m68*-*-sunos3*) gdb_target=sun3os3 ;; |
| 236 | m68*-*-sunos4*) gdb_target=sun3os4 ;; |
| 237 | m68*-*-vxworks*) gdb_target=vxworks68 ;; |
| 238 | |
| 239 | m88*-motorola-sysv4*) gdb_target=delta88v4 ;; |
| 240 | m88*-motorola-*) gdb_target=delta88 ;; |
| 241 | m88*-*-*) gdb_target=m88k ;; |
| 242 | |
| 243 | mips-big-*) gdb_target=bigmips ;; |
| 244 | mips-dec-*) gdb_target=decstation ;; |
| 245 | mips-idt-ecoffl*) gdb_target=idtl ;; |
| 246 | mips-idt-ecoff*) gdb_target=idt ;; |
| 247 | mips-little-*) gdb_target=littlemips ;; |
| 248 | mips-sgi-*) gdb_target=irix3 ;; |
| 249 | mips-sony-*) gdb_target=bigmips ;; |
| 250 | mips-*-sysv*) gdb_target=bigmips ;; |
| 251 | mips-*-riscos*) gdb_target=bigmips ;; |
| 252 | |
| 253 | none-*-*) gdb_target=none ;; |
| 254 | |
| 255 | np1-*-*) gdb_target=np1 ;; |
| 256 | |
| 257 | ns32k-utek-sysv) gdb_target=merlin ;; |
| 258 | ns32k-utek-*) gdb_target=umax ;; |
| 259 | |
| 260 | pn-*-*) gdb_target=pn ;; |
| 261 | |
| 262 | pyramid-*-*) gdb_target=pyramid ;; |
| 263 | |
| 264 | rs6000-*-*) gdb_target=rs6000 ;; |
| 265 | |
| 266 | sparc-*-aout) gdb_target=sparc-em ;; |
| 267 | sparc-*-coff) gdb_target=sparc-em ;; |
| 268 | sparc-*-elf) gdb_target=sparc-em ;; |
| 269 | sparc-*-solaris2*) gdb_target=sun4sol2 ;; |
| 270 | sparc-*-sunos4*) gdb_target=sun4os4 ;; |
| 271 | sparc-*-vxworks*) gdb_target=vxsparc ;; |
| 272 | sparc-*-*) gdb_target=sun4os4 ;; |
| 273 | sparclite*-*-*) gdb_target=sparclite ;; |
| 274 | # start-sanitize-v9 |
| 275 | sparc64-*-*) gdb_target_cpu=sparc gdb_target=sp64 ;; |
| 276 | # end-sanitize-v9 |
| 277 | |
| 278 | tahoe-*-*) gdb_target=tahoe ;; |
| 279 | vax-*-*) gdb_target=vax ;; |
| 280 | |
| 281 | z8k-*-sim | z8k-*-coff) gdb_target=z8ksim ;; |
| 282 | esac |
| 283 | |
| 284 | if [ ! -f ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt ]; then |
| 285 | echo '***' "Gdb does not support target ${target}" 1>&2 |
| 286 | exit 1 |
| 287 | fi |
| 288 | |
| 289 | if [ -z "${removing}" ] ; then |
| 290 | cat ${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt | awk '$1 == "#msg" { |
| 291 | print substr($0,6)}' |
| 292 | fi |
| 293 | |
| 294 | # We really shouldn't depend on there being a space after TM_FILE= ... |
| 295 | targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt` |
| 296 | |
| 297 | if [ "${target}" = "${host}" ] ; then |
| 298 | nativefile=`awk '$1 == "NAT_FILE=" { print $2 }' <${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh` |
| 299 | fi |
| 300 | |
| 301 | host_makefile_frag=config/${gdb_host_cpu}/${gdb_host}.mh |
| 302 | target_makefile_frag=config/${gdb_target_cpu}/${gdb_target}.mt |
| 303 | |
| 304 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile |
| 305 | # (NAT_FILE) is not set in the ?config/* file, we don't make the |
| 306 | # corresponding links. But we have to remove the xm.h files and tm.h |
| 307 | # files anyway, e.g. when switching from "configure host" to |
| 308 | # "configure none". |
| 309 | |
| 310 | files= |
| 311 | links= |
| 312 | rm -f xm.h |
| 313 | if [ "${hostfile}" != "" ]; then |
| 314 | if [ -f ${srcdir}/config/${hostfile} ]; then |
| 315 | files="${files} config/${hostfile}" |
| 316 | else |
| 317 | files="${files} config/${gdb_host_cpu}/${hostfile}" |
| 318 | fi |
| 319 | links="${links} xm.h" |
| 320 | fi |
| 321 | rm -f tm.h |
| 322 | if [ "${targetfile}" != "" ]; then |
| 323 | if [ -f ${srcdir}/config/${targetfile} ]; then |
| 324 | files="${files} config/${targetfile}" |
| 325 | else |
| 326 | files="${files} config/${gdb_target_cpu}/${targetfile}" |
| 327 | fi |
| 328 | links="${links} tm.h" |
| 329 | fi |
| 330 | rm -f nm.h |
| 331 | if [ "${nativefile}" != "" ]; then |
| 332 | if [ -f ${srcdir}/config/${nativefile} ]; then |
| 333 | files="${files} config/${nativefile}" |
| 334 | else |
| 335 | files="${files} config/${gdb_host_cpu}/${nativefile}" |
| 336 | fi |
| 337 | links="${links} nm.h" |
| 338 | # temporary scaffolding until all hosts have the host/target/native |
| 339 | # split in place. |
| 340 | else |
| 341 | files="${files} config/nm-trash.h" |
| 342 | links="${links} nm.h" |
| 343 | fi |
| 344 | |
| 345 | # post-target: |
| 346 | |
| 347 | case ${srcdir} in |
| 348 | .) |
| 349 | ;; |
| 350 | *) |
| 351 | grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \ |
| 352 | echo "source ${srcdir}/.gdbinit" >> .gdbinit |
| 353 | esac |
| 354 | |
| 355 | if [ "${nativefile}" = "" ] ; then |
| 356 | sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \ |
| 357 | < Makefile > Makefile.tem |
| 358 | mv -f Makefile.tem Makefile |
| 359 | fi |