| 1 | # ; -*- mode: sh ; -*- |
| 2 | # Copyright (C) 2013-2020 Free Software Foundation, Inc. |
| 3 | # |
| 4 | # This file is part of GDB. |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | # Variables defined here: |
| 20 | # |
| 21 | # NAT_FILE - The header file with definitions for this native target. |
| 22 | # |
| 23 | # NATDEPFILES - Source files required for native debugging on this |
| 24 | # native target. |
| 25 | # |
| 26 | # NAT_CDEPS - Dynamic symbols to be exported for libthread_db. |
| 27 | # |
| 28 | # LOADLIBES - Libraries against which GDB will be linked for this |
| 29 | # native target. |
| 30 | # |
| 31 | # MH_CFLAGS - Additional CFLAGS for this host. |
| 32 | # |
| 33 | # XM_CLIBS - Host-dependent libraries against which GDB will be linked |
| 34 | # for this native target. |
| 35 | # |
| 36 | # HAVE_NATIVE_GCORE_HOST - Whether gcore should be installed on this |
| 37 | # native target. |
| 38 | # |
| 39 | # nat_makefile_frag - Name of the (optional) Makefile fragment file |
| 40 | # required to build the native target. The |
| 41 | # fragment is incorporated into the Makefile that |
| 42 | # configure constructs from Makefile.in. |
| 43 | # |
| 44 | # Notes: |
| 45 | # |
| 46 | # - To avoid shell expansion of variables, declare them with single |
| 47 | # quotes. |
| 48 | # |
| 49 | # - nat_makefile_frag must contain the full path of the file. |
| 50 | |
| 51 | |
| 52 | # This first case is useful for filling default values for each |
| 53 | # gdb_host. |
| 54 | case ${gdb_host} in |
| 55 | *linux*) |
| 56 | NAT_FILE='config/nm-linux.h' |
| 57 | NATDEPFILES='inf-ptrace.o fork-child.o nat/fork-inferior.o \ |
| 58 | proc-service.o \ |
| 59 | linux-thread-db.o linux-nat.o nat/linux-osdata.o linux-fork.o \ |
| 60 | nat/linux-procfs.o nat/linux-ptrace.o nat/linux-waitpid.o \ |
| 61 | nat/linux-personality.o nat/linux-namespaces.o' |
| 62 | NAT_CDEPS='$(srcdir)/proc-service.list' |
| 63 | LOADLIBES='-ldl $(RDYNAMIC)' |
| 64 | ;; |
| 65 | fbsd*) |
| 66 | NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o fbsd-nat.o' |
| 67 | HAVE_NATIVE_GCORE_HOST=1 |
| 68 | LOADLIBES='-lkvm' |
| 69 | ;; |
| 70 | nbsd*) |
| 71 | NATDEPFILES='fork-child.o nat/fork-inferior.o nat/netbsd-nat.o inf-ptrace.o' |
| 72 | HAVE_NATIVE_GCORE_HOST=1 |
| 73 | ;; |
| 74 | obsd*) |
| 75 | NATDEPFILES='fork-child.o nat/fork-inferior.o inf-ptrace.o' |
| 76 | ;; |
| 77 | cygwin*) |
| 78 | NATDEPFILES='x86-nat.o nat/x86-dregs.o windows-nat.o nat/windows-nat.o' |
| 79 | ;; |
| 80 | mingw*) |
| 81 | NATDEPFILES='x86-nat.o nat/x86-dregs.o windows-nat.o nat/windows-nat.o' |
| 82 | ;; |
| 83 | aix) |
| 84 | NATDEPFILES='nat/fork-inferior.o fork-child.o inf-ptrace.o' |
| 85 | ;; |
| 86 | darwin) |
| 87 | NATDEPFILES='fork-child.o nat/fork-inferior.o darwin-nat.o \ |
| 88 | darwin-nat-info.o' |
| 89 | ;; |
| 90 | sol2) |
| 91 | NATDEPFILES='fork-child.o nat/fork-inferior.o \ |
| 92 | procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o \ |
| 93 | sol-thread.o' |
| 94 | HAVE_NATIVE_GCORE_HOST=1 |
| 95 | ;; |
| 96 | esac |
| 97 | |
| 98 | # This is where we actually filter by host and host CPU. |
| 99 | case ${gdb_host} in |
| 100 | aix) |
| 101 | case ${gdb_host_cpu} in |
| 102 | powerpc) |
| 103 | # Host: IBM PowerPC running AIX aix-thread.o is not |
| 104 | # listed in NATDEPFILES as it is pulled in by |
| 105 | # configure. |
| 106 | NATDEPFILES="${NATDEPFILES} rs6000-nat.o" |
| 107 | |
| 108 | # When compiled with cc, for debugging, this argument |
| 109 | # should be passed. We have no idea who our current |
| 110 | # compiler is though, so we skip it. |
| 111 | # MH_CFLAGS='-bnodelcsect' |
| 112 | ;; |
| 113 | esac |
| 114 | ;; |
| 115 | alpha-linux) |
| 116 | case ${gdb_host_cpu} in |
| 117 | alpha) |
| 118 | # Host: Little-endian Alpha running Linux |
| 119 | NATDEPFILES="${NATDEPFILES} linux-nat-trad.o alpha-linux-nat.o" |
| 120 | # doublest.c currently assumes some properties of FP arithmetic |
| 121 | # on the host which require this. |
| 122 | MH_CFLAGS='-mieee' |
| 123 | ;; |
| 124 | esac |
| 125 | ;; |
| 126 | cygwin) |
| 127 | case ${gdb_host_cpu} in |
| 128 | i386) |
| 129 | # Native config information for GDB on i386 |
| 130 | # systems running Cygwin. |
| 131 | NATDEPFILES="${NATDEPFILES} i386-windows-nat.o" |
| 132 | ;; |
| 133 | esac |
| 134 | ;; |
| 135 | cygwin64) |
| 136 | case ${gdb_host_cpu} in |
| 137 | i386) |
| 138 | # Native config information for GDB on amd64 |
| 139 | # systems running Cygwin. |
| 140 | NATDEPFILES="${NATDEPFILES} i386-windows-nat.o amd64-windows-nat.o" |
| 141 | ;; |
| 142 | esac |
| 143 | ;; |
| 144 | darwin) |
| 145 | case ${gdb_host_cpu} in |
| 146 | i386) |
| 147 | # Host: IA86 running Darwin |
| 148 | NATDEPFILES="${NATDEPFILES} i386-darwin-nat.o x86-nat.o \ |
| 149 | nat/x86-dregs.o amd64-nat.o" |
| 150 | ;; |
| 151 | esac |
| 152 | ;; |
| 153 | fbsd) |
| 154 | case ${gdb_host_cpu} in |
| 155 | aarch64) |
| 156 | # Host: FreeBSD/aarch64 |
| 157 | NATDEPFILES="${NATDEPFILES} aarch64-fbsd-nat.o" |
| 158 | LOADLIBES= |
| 159 | ;; |
| 160 | arm) |
| 161 | # Host: FreeBSD/arm |
| 162 | NATDEPFILES="${NATDEPFILES} arm-fbsd-nat.o" |
| 163 | LOADLIBES= |
| 164 | ;; |
| 165 | i386) |
| 166 | # Host: FreeBSD/i386 |
| 167 | NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \ |
| 168 | x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o" |
| 169 | ;; |
| 170 | mips) |
| 171 | # Host: FreeBSD/mips |
| 172 | NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o" |
| 173 | LOADLIBES= |
| 174 | ;; |
| 175 | powerpc) |
| 176 | # Native config information for GDB on PowerPC |
| 177 | # systems running FreeBSD. |
| 178 | NATDEPFILES="${NATDEPFILES} ppc-fbsd-nat.o bsd-kvm.o" |
| 179 | ;; |
| 180 | riscv*) |
| 181 | # Host: FreeBSD/riscv |
| 182 | NATDEPFILES="${NATDEPFILES} riscv-fbsd-nat.o" |
| 183 | ;; |
| 184 | sparc) |
| 185 | # Host: FreeBSD/sparc64 |
| 186 | NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \ |
| 187 | sparc64-fbsd-nat.o bsd-kvm.o" |
| 188 | ;; |
| 189 | esac |
| 190 | ;; |
| 191 | fbsd64) |
| 192 | case ${gdb_host_cpu} in |
| 193 | i386) |
| 194 | # Host: FreeBSD/amd64 |
| 195 | NATDEPFILES="${NATDEPFILES} amd64-nat.o amd64-bsd-nat.o \ |
| 196 | amd64-fbsd-nat.o bsd-kvm.o x86-nat.o nat/x86-dregs.o \ |
| 197 | x86-bsd-nat.o" |
| 198 | ;; |
| 199 | esac |
| 200 | ;; |
| 201 | go32) |
| 202 | case ${gdb_host_cpu} in |
| 203 | i386) |
| 204 | # Host: Intel x86 running DJGPP |
| 205 | # We include several header files from config/djgpp |
| 206 | MH_CFLAGS='-I$(srcdir)/config/djgpp' |
| 207 | NATDEPFILES='go32-nat.o x86-nat.o nat/x86-dregs.o' |
| 208 | XM_CLIBS='-ldbg' |
| 209 | ;; |
| 210 | esac |
| 211 | ;; |
| 212 | i386gnu) |
| 213 | case ${gdb_host_cpu} in |
| 214 | i386) |
| 215 | # Host: Intel 386 running the GNU Hurd |
| 216 | NATDEPFILES='i386-gnu-nat.o gnu-nat.o \ |
| 217 | x86-nat.o nat/x86-dregs.o fork-child.o \ |
| 218 | nat/fork-inferior.o \ |
| 219 | notify_S.o process_reply_S.o msg_reply_S.o \ |
| 220 | msg_U.o exc_request_U.o exc_request_S.o' |
| 221 | HAVE_NATIVE_GCORE_HOST=1 |
| 222 | |
| 223 | NAT_FILE='nm-i386gnu.h' |
| 224 | MH_CFLAGS='-D_GNU_SOURCE' |
| 225 | |
| 226 | XM_CLIBS='-lshouldbeinlibc' |
| 227 | |
| 228 | nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn" |
| 229 | ;; |
| 230 | esac |
| 231 | ;; |
| 232 | linux) |
| 233 | case ${gdb_host_cpu} in |
| 234 | aarch64) |
| 235 | # Host: AArch64 based machine running GNU/Linux |
| 236 | NATDEPFILES="${NATDEPFILES} aarch64-linux-nat.o \ |
| 237 | aarch32-linux-nat.o nat/aarch64-linux-hw-point.o \ |
| 238 | nat/aarch64-linux.o \ |
| 239 | nat/aarch64-sve-linux-ptrace.o" |
| 240 | ;; |
| 241 | arc) |
| 242 | # Host: ARC based machine running GNU/Linux |
| 243 | NATDEPFILES="${NATDEPFILES} arc-linux-nat.o" |
| 244 | ;; |
| 245 | arm) |
| 246 | # Host: ARM based machine running GNU/Linux |
| 247 | NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \ |
| 248 | aarch32-linux-nat.o" |
| 249 | ;; |
| 250 | i386) |
| 251 | # Host: Intel 386 running GNU/Linux. |
| 252 | NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \ |
| 253 | i386-linux-nat.o x86-linux-nat.o nat/linux-btrace.o \ |
| 254 | nat/x86-linux.o nat/x86-linux-dregs.o" |
| 255 | ;; |
| 256 | ia64) |
| 257 | # Host: Intel IA-64 running GNU/Linux |
| 258 | NATDEPFILES="${NATDEPFILES} ia64-linux-nat.o" |
| 259 | ;; |
| 260 | m32r) |
| 261 | # Host: M32R based machine running GNU/Linux |
| 262 | NATDEPFILES="${NATDEPFILES} m32r-linux-nat.o" |
| 263 | ;; |
| 264 | m68k) |
| 265 | # Host: Motorola m68k running GNU/Linux. |
| 266 | NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o" |
| 267 | ;; |
| 268 | mips) |
| 269 | # Host: Linux/MIPS |
| 270 | NATDEPFILES="${NATDEPFILES} linux-nat-trad.o \ |
| 271 | mips-linux-nat.o nat/mips-linux-watch.o" |
| 272 | ;; |
| 273 | pa) |
| 274 | # Host: Hewlett-Packard PA-RISC machine, running Linux |
| 275 | NATDEPFILES="${NATDEPFILES} hppa-linux-nat.o" |
| 276 | ;; |
| 277 | powerpc) |
| 278 | # Host: PowerPC, running Linux |
| 279 | NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o nat/ppc-linux.o" |
| 280 | ;; |
| 281 | riscv*) |
| 282 | # Host: RISC-V, running Linux |
| 283 | NATDEPFILES="${NATDEPFILES} riscv-linux-nat.o \ |
| 284 | nat/riscv-linux-tdesc.o" |
| 285 | ;; |
| 286 | s390) |
| 287 | # Host: S390, running Linux |
| 288 | NATDEPFILES="${NATDEPFILES} s390-linux-nat.o" |
| 289 | ;; |
| 290 | sparc) |
| 291 | # Host: GNU/Linux SPARC |
| 292 | NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-linux-nat.o" |
| 293 | ;; |
| 294 | tilegx) |
| 295 | # Host: Tilera TILE-Gx running GNU/Linux. |
| 296 | NATDEPFILES="${NATDEPFILES} tilegx-linux-nat.o" |
| 297 | NAT_CDEPS= |
| 298 | ;; |
| 299 | xtensa) |
| 300 | # Host: Xtensa, running GNU/Linux. |
| 301 | NATDEPFILES="${NATDEPFILES} xtensa-linux-nat.o" |
| 302 | ;; |
| 303 | esac |
| 304 | ;; |
| 305 | linux64) |
| 306 | case ${gdb_host_cpu} in |
| 307 | i386) |
| 308 | # Host: GNU/Linux x86-64 |
| 309 | NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \ |
| 310 | amd64-nat.o amd64-linux-nat.o x86-linux-nat.o \ |
| 311 | nat/linux-btrace.o \ |
| 312 | nat/x86-linux.o nat/x86-linux-dregs.o \ |
| 313 | nat/amd64-linux-siginfo.o" |
| 314 | ;; |
| 315 | sparc) |
| 316 | # Host: GNU/Linux UltraSPARC |
| 317 | NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \ |
| 318 | sparc64-linux-nat.o" |
| 319 | ;; |
| 320 | esac |
| 321 | ;; |
| 322 | mingw) |
| 323 | case ${gdb_host_cpu} in |
| 324 | i386) |
| 325 | NATDEPFILES="${NATDEPFILES} i386-windows-nat.o" |
| 326 | ;; |
| 327 | esac |
| 328 | ;; |
| 329 | mingw64) |
| 330 | case ${gdb_host_cpu} in |
| 331 | i386) |
| 332 | NATDEPFILES="${NATDEPFILES} i386-windows-nat.o amd64-windows-nat.o" |
| 333 | ;; |
| 334 | esac |
| 335 | ;; |
| 336 | nbsd) |
| 337 | case ${gdb_host_cpu} in |
| 338 | alpha) |
| 339 | # Host: NetBSD/alpha |
| 340 | NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o" |
| 341 | LOADLIBES='-lkvm' |
| 342 | ;; |
| 343 | mips) |
| 344 | # Host: NetBSD/mips |
| 345 | NATDEPFILES="${NATDEPFILES} mips-netbsd-nat.o" |
| 346 | ;; |
| 347 | pa) |
| 348 | # Host: NetBSD/hppa |
| 349 | NATDEPFILES="${NATDEPFILES} netbsd-nat.o hppa-netbsd-nat.o" |
| 350 | ;; |
| 351 | powerpc) |
| 352 | # Host: NetBSD/powerpc |
| 353 | NATDEPFILES="${NATDEPFILES} ppc-netbsd-nat.o bsd-kvm.o" |
| 354 | LOADLIBES='-lkvm' |
| 355 | ;; |
| 356 | sh) |
| 357 | # Host: NetBSD/sh |
| 358 | NATDEPFILES="${NATDEPFILES} sh-netbsd-nat.o" |
| 359 | ;; |
| 360 | |
| 361 | esac |
| 362 | ;; |
| 363 | nbsd64) |
| 364 | case ${gdb_host_cpu} in |
| 365 | i386) |
| 366 | # Host: NetBSD/amd64 |
| 367 | NATDEPFILES="${NATDEPFILES} netbsd-nat.o amd64-nat.o x86-nat.o \ |
| 368 | nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-netbsd-nat.o" |
| 369 | ;; |
| 370 | sparc) |
| 371 | # Host: NetBSD/sparc64 |
| 372 | NATDEPFILES="${NATDEPFILES} sparc64-netbsd-nat.o sparc-nat.o \ |
| 373 | bsd-kvm.o" |
| 374 | LOADLIBES='-lkvm' |
| 375 | ;; |
| 376 | |
| 377 | esac |
| 378 | ;; |
| 379 | nbsdelf) |
| 380 | case ${gdb_host_cpu} in |
| 381 | arm) |
| 382 | # Host: NetBSD/arm |
| 383 | NATDEPFILES="${NATDEPFILES} arm-netbsd-nat.o" |
| 384 | ;; |
| 385 | i386) |
| 386 | # Host: NetBSD/i386 ELF |
| 387 | NATDEPFILES="${NATDEPFILES} netbsd-nat.o x86-nat.o \ |
| 388 | nat/x86-dregs.o \ |
| 389 | x86-bsd-nat.o i386-bsd-nat.o i386-netbsd-nat.o bsd-kvm.o" |
| 390 | LOADLIBES='-lkvm' |
| 391 | ;; |
| 392 | m68k) |
| 393 | # Host: NetBSD/m68k ELF |
| 394 | NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o" |
| 395 | LOADLIBES='-lkvm' |
| 396 | ;; |
| 397 | sparc) |
| 398 | # Host: NetBSD/sparc ELF |
| 399 | NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-netbsd-nat.o \ |
| 400 | bsd-kvm.o" |
| 401 | LOADLIBES='-lkvm' |
| 402 | ;; |
| 403 | vax) |
| 404 | # Host: NetBSD/vax ELF |
| 405 | NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o" |
| 406 | LOADLIBES='-lkvm' |
| 407 | ;; |
| 408 | |
| 409 | esac |
| 410 | ;; |
| 411 | nto) |
| 412 | case ${gdb_host_cpu} in |
| 413 | i386) |
| 414 | # Host: Intel 386 running QNX. |
| 415 | NATDEPFILES='nto-procfs.o' |
| 416 | NAT_FILE='config/nm-nto.h' |
| 417 | ;; |
| 418 | esac |
| 419 | ;; |
| 420 | obsd) |
| 421 | case ${gdb_host_cpu} in |
| 422 | i386) |
| 423 | # Host: OpenBSD/i386 ELF |
| 424 | NATDEPFILES="${NATDEPFILES} obsd-nat.o x86-bsd-nat.o \ |
| 425 | i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o" |
| 426 | LOADLIBES='-lkvm' |
| 427 | ;; |
| 428 | m68k) |
| 429 | # Host: OpenBSD/m68k |
| 430 | NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o" |
| 431 | LOADLIBES='-lkvm' |
| 432 | ;; |
| 433 | pa) |
| 434 | # Host: OpenBSD/hppa |
| 435 | NATDEPFILES="${NATDEPFILES} obsd-nat.o hppa-obsd-nat.o" |
| 436 | ;; |
| 437 | powerpc) |
| 438 | # Host: OpenBSD/powerpc |
| 439 | NATDEPFILES="${NATDEPFILES} obsd-nat.o ppc-obsd-nat.o bsd-kvm.o" |
| 440 | LOADLIBES='-lkvm' |
| 441 | ;; |
| 442 | vax) |
| 443 | # Host: OpenBSD/vax |
| 444 | NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o" |
| 445 | LOADLIBES='-lkvm' |
| 446 | ;; |
| 447 | esac |
| 448 | ;; |
| 449 | obsd64) |
| 450 | case ${gdb_host_cpu} in |
| 451 | i386) |
| 452 | # Host: OpenBSD/amd64 |
| 453 | NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o x86-nat.o \ |
| 454 | x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o \ |
| 455 | nat/x86-dregs.o" |
| 456 | LOADLIBES='-lkvm' |
| 457 | ;; |
| 458 | mips) |
| 459 | # Host: OpenBSD/mips64 |
| 460 | NATDEPFILES="${NATDEPFILES} obsd-nat.o mips64-obsd-nat.o" |
| 461 | ;; |
| 462 | sparc) |
| 463 | # Host: OpenBSD/sparc64 |
| 464 | NATDEPFILES="${NATDEPFILES} obsd-nat.o sparc64-obsd-nat.o \ |
| 465 | sparc-nat.o bsd-kvm.o" |
| 466 | LOADLIBES='-lkvm' |
| 467 | ;; |
| 468 | esac |
| 469 | ;; |
| 470 | ppc64-linux) |
| 471 | case ${gdb_host_cpu} in |
| 472 | powerpc) |
| 473 | # Host: PowerPC64, running Linux |
| 474 | XM_CLIBS= |
| 475 | NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o nat/ppc-linux.o" |
| 476 | ;; |
| 477 | esac |
| 478 | ;; |
| 479 | sol2) |
| 480 | case ${gdb_host_cpu} in |
| 481 | i386) |
| 482 | # Host: Solaris x86_64 |
| 483 | NATDEPFILES="${NATDEPFILES} \ |
| 484 | amd64-nat.o i386-sol2-nat.o" |
| 485 | ;; |
| 486 | sparc) |
| 487 | # Host: Solaris SPARC & UltraSPARC |
| 488 | NAT_FILE='nm-sol2.h' |
| 489 | NATDEPFILES="${NATDEPFILES} sparc-sol2-nat.o" |
| 490 | ;; |
| 491 | esac |
| 492 | ;; |
| 493 | esac |