Commit | Line | Data |
---|---|---|
d6e9fb05 JK |
1 | dnl Autoconf configure script for GDB server. |
2 | dnl Copyright 2000 Free Software Foundation, Inc. | |
3 | dnl | |
4 | dnl This file is part of GDB. | |
5 | dnl | |
6 | dnl This program is free software; you can redistribute it and/or modify | |
7 | dnl it under the terms of the GNU General Public License as published by | |
8 | dnl the Free Software Foundation; either version 2 of the License, or | |
9 | dnl (at your option) any later version. | |
10 | dnl | |
11 | dnl This program is distributed in the hope that it will be useful, | |
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | dnl GNU General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU General Public License | |
17 | dnl along with this program; if not, write to the Free Software | |
18 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
19 | ||
20 | dnl Process this file with autoconf to produce a configure script. | |
21 | ||
22 | AC_INIT(server.c) | |
23 | ||
24 | AC_CANONICAL_SYSTEM | |
25 | AC_PROG_INSTALL | |
c906108c SS |
26 | |
27 | . ${srcdir}/../configure.host | |
28 | ||
c906108c SS |
29 | . ${srcdir}/../configure.tgt |
30 | ||
d6e9fb05 JK |
31 | frags= |
32 | host_makefile_frag=${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh | |
33 | if test ! -f ${host_makefile_frag}; then | |
34 | AC_MSG_ERROR("*** GDB remote does not support host ${host}") | |
c906108c | 35 | fi |
d6e9fb05 | 36 | frags="$frags $host_makefile_frag" |
c906108c | 37 | |
d6e9fb05 JK |
38 | target_makefile_frag=${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt |
39 | if test ! -f ${target_makefile_frag}; then | |
40 | AC_MSG_ERROR("*** GDB remote does not support target ${target}") | |
c906108c | 41 | fi |
d6e9fb05 | 42 | frags="$frags $target_makefile_frag" |
c906108c | 43 | |
d6e9fb05 JK |
44 | AC_SUBST_FILE(host_makefile_frag) |
45 | AC_SUBST_FILE(target_makefile_frag) | |
46 | AC_SUBST(frags) | |
c906108c | 47 | |
d6e9fb05 JK |
48 | changequote(,)dnl |
49 | hostfile=`sed -n ' | |
50 | s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p | |
51 | ' ${host_makefile_frag}` | |
c906108c | 52 | |
d6e9fb05 JK |
53 | targetfile=`sed -n ' |
54 | s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p | |
55 | ' ${target_makefile_frag}` | |
56 | ||
57 | if test "${target}" = "${host}"; then | |
58 | nativefile=`sed -n ' | |
59 | s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p | |
60 | ' ${host_makefile_frag}` | |
61 | fi | |
62 | changequote([,])dnl | |
c906108c SS |
63 | |
64 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile | |
65 | # (NAT_FILE) is not set in the ?config/* file, we don't make the | |
66 | # corresponding links. But we have to remove the xm.h files and tm.h | |
67 | # files anyway, e.g. when switching from "configure host" to | |
68 | # "configure none". | |
69 | ||
70 | files= | |
71 | links= | |
72 | rm -f xm.h | |
73 | rm -f ser-hardwire.c | |
d6e9fb05 JK |
74 | if test "${hostfile}" != ""; then |
75 | files="${files} ../config/${gdb_host_cpu}/${hostfile}" | |
c906108c | 76 | links="${links} xm.h" |
c906108c SS |
77 | fi |
78 | rm -f tm.h | |
d6e9fb05 JK |
79 | if test "${targetfile}" != ""; then |
80 | files="${files} ../config/${gdb_target_cpu}/${targetfile}" | |
c906108c SS |
81 | links="${links} tm.h" |
82 | fi | |
83 | rm -f nm.h | |
d6e9fb05 JK |
84 | if test "${nativefile}" != ""; then |
85 | files="${files} ../config/${gdb_host_cpu}/${nativefile}" | |
c906108c | 86 | links="${links} nm.h" |
c906108c | 87 | fi |
d6e9fb05 | 88 | AC_LINK_FILES($files, $links) |
c906108c | 89 | |
d6e9fb05 | 90 | AC_OUTPUT(Makefile) |