Commit | Line | Data |
---|---|---|
d6e9fb05 | 1 | dnl Autoconf configure script for GDB server. |
0b302171 | 2 | dnl Copyright (C) 2000, 2002-2012 Free Software Foundation, Inc. |
d6e9fb05 JK |
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 | |
5a0e3bd0 | 8 | dnl the Free Software Foundation; either version 3 of the License, or |
d6e9fb05 JK |
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 | |
5a0e3bd0 | 17 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. |
d6e9fb05 JK |
18 | |
19 | dnl Process this file with autoconf to produce a configure script. | |
20 | ||
bec39cab AC |
21 | AC_PREREQ(2.59)dnl |
22 | ||
d6e9fb05 | 23 | AC_INIT(server.c) |
84563040 | 24 | AC_CONFIG_HEADER(config.h:config.in) |
c9a1864a YQ |
25 | |
26 | AM_MAINTAINER_MODE | |
84563040 DJ |
27 | |
28 | AC_PROG_CC | |
fd462a61 | 29 | AC_GNU_SOURCE |
d6e9fb05 JK |
30 | |
31 | AC_CANONICAL_SYSTEM | |
84563040 | 32 | |
d6e9fb05 | 33 | AC_PROG_INSTALL |
c971b7fa | 34 | AC_PROG_RANLIB |
c906108c | 35 | |
dcdb98d2 DJ |
36 | AC_ARG_PROGRAM |
37 | ||
ee6e2b82 | 38 | AC_HEADER_STDC |
d26e3629 | 39 | AC_HEADER_DIRENT |
84563040 | 40 | |
a1723c35 | 41 | AC_FUNC_ALLOCA |
c9a1864a YQ |
42 | |
43 | # Check for the 'make' the user wants to use. | |
44 | AC_CHECK_PROGS(MAKE, make) | |
45 | ||
c971b7fa PA |
46 | # Configure gnulib. We can't use AC_CONFIG_SUBDIRS as that'd expect |
47 | # to find the the source subdir to be configured directly under | |
48 | # gdbserver/. We need to build gnulib under some other directory not | |
49 | # "gnulib", to avoid the problem of both GDB and GDBserver wanting to | |
50 | # build it in the same directory, when building in the source dir. | |
51 | ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"]) | |
52 | ||
0d62e5e8 | 53 | AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl |
94e10508 | 54 | proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl |
b80864fb | 55 | stdlib.h unistd.h dnl |
1b3f6016 | 56 | errno.h fcntl.h signal.h sys/file.h malloc.h dnl |
61ff6e04 | 57 | sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl |
945bf713 MM |
58 | netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h dnl |
59 | linux/perf_event.h) | |
f8255c2a | 60 | AC_CHECK_FUNCS(pread pwrite pread64 readlink) |
c9a1864a | 61 | AC_REPLACE_FUNCS(vasprintf vsnprintf) |
84563040 | 62 | |
0fb4aa4b PA |
63 | # Check for UST |
64 | ustlibs="" | |
65 | ustinc="" | |
66 | ||
67 | AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the installed UST package | |
68 | Equivalent to --with-ust-include=PATH/include | |
69 | plus --with-ust-lib=PATH/lib]) | |
70 | AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for installed UST include files]) | |
71 | AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the installed UST library]) | |
72 | ||
73 | case $with_ust in | |
74 | no) | |
75 | ustlibs= | |
76 | ustinc= | |
77 | ;; | |
78 | "" | yes) | |
79 | ustlibs=" -lust " | |
80 | ustinc="" | |
81 | ;; | |
82 | *) | |
83 | ustlibs="-L$with_ust/lib -lust" | |
84 | ustinc="-I$with_ust/include " | |
85 | ;; | |
86 | esac | |
87 | if test "x$with_ust_include" != x; then | |
88 | ustinc="-I$with_ust_include " | |
89 | fi | |
90 | if test "x$with_ust_lib" != x; then | |
91 | ustlibs="-L$with_ust_lib -lust" | |
92 | fi | |
93 | ||
94 | if test "x$with_ust" != "xno"; then | |
95 | saved_CFLAGS="$CFLAGS" | |
96 | CFLAGS="$CFLAGS $ustinc" | |
97 | AC_MSG_CHECKING([for ust]) | |
98 | AC_TRY_COMPILE([ | |
99 | #define CONFIG_UST_GDB_INTEGRATION | |
100 | #include <ust/ust.h> | |
101 | ],[], | |
102 | [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_UST, 1, [Define if UST is available])], | |
103 | [AC_MSG_RESULT([no]); ustlibs= ; ustinc= ]) | |
104 | CFLAGS="$saved_CFLAGS" | |
105 | fi | |
106 | ||
107 | # Flags needed for UST | |
108 | AC_SUBST(ustlibs) | |
109 | AC_SUBST(ustinc) | |
110 | ||
d4596a3d PA |
111 | AC_ARG_ENABLE(werror, |
112 | AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]), | |
113 | [case "${enableval}" in | |
114 | yes | y) ERROR_ON_WARNING="yes" ;; | |
115 | no | n) ERROR_ON_WARNING="no" ;; | |
116 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; | |
117 | esac]) | |
118 | ||
119 | # Enable -Werror by default when using gcc | |
120 | if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then | |
121 | ERROR_ON_WARNING=yes | |
122 | fi | |
123 | ||
124 | WERROR_CFLAGS="" | |
125 | if test "${ERROR_ON_WARNING}" = yes ; then | |
126 | WERROR_CFLAGS="-Werror" | |
127 | fi | |
128 | ||
129 | build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ | |
8c29b58e | 130 | -Wformat-nonliteral -Wno-char-subscripts -Wempty-body" |
d4596a3d PA |
131 | |
132 | WARN_CFLAGS="" | |
133 | if test "x$GCC" = xyes | |
134 | then | |
135 | AC_MSG_CHECKING(compiler warning flags) | |
136 | # Separate out the -Werror flag as some files just cannot be | |
137 | # compiled with it enabled. | |
138 | for w in ${build_warnings}; do | |
139 | case $w in | |
140 | -Werr*) WERROR_CFLAGS=-Werror ;; | |
141 | *) # Check that GCC accepts it | |
142 | saved_CFLAGS="$CFLAGS" | |
143 | CFLAGS="$CFLAGS $w" | |
144 | AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",) | |
145 | CFLAGS="$saved_CFLAGS" | |
146 | esac | |
147 | done | |
148 | AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS}) | |
149 | fi | |
150 | AC_SUBST(WARN_CFLAGS) | |
151 | AC_SUBST(WERROR_CFLAGS) | |
152 | ||
10e86dd7 DE |
153 | dnl dladdr is glibc-specific. It is used by thread-db.c but only for |
154 | dnl debugging messages. It lives in -ldl which is handled below so we don't | |
155 | dnl use AC_CHECK_LIB (or AC_SEARCH_LIBS) here. Instead we just temporarily | |
156 | dnl augment LIBS. | |
157 | old_LIBS="$LIBS" | |
158 | LIBS="$LIBS -ldl" | |
159 | AC_CHECK_FUNCS(dladdr) | |
160 | LIBS="$old_LIBS" | |
161 | ||
68070c10 PA |
162 | have_errno=no |
163 | AC_MSG_CHECKING(for errno) | |
164 | AC_TRY_LINK([ | |
165 | #if HAVE_ERRNO_H | |
166 | #include <errno.h> | |
167 | #endif], [static int x; x = errno;], | |
168 | [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is available]) have_errno=yes]) | |
169 | if test $have_errno = no; then | |
170 | AC_TRY_LINK([ | |
171 | #if HAVE_ERRNO_H | |
172 | #include <errno.h> | |
173 | #endif], [extern int errno; static int x; x = errno;], | |
174 | [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is available]) AC_DEFINE(MUST_DEFINE_ERRNO, 1, [Checking if errno must be defined])], | |
175 | [AC_MSG_RESULT(no)]) | |
176 | fi | |
177 | ||
e6712ff1 | 178 | AC_CHECK_DECLS([strerror, strstr, perror, vasprintf, vsnprintf]) |
43d5792c | 179 | |
ccbd4912 MK |
180 | AC_CHECK_TYPES(socklen_t, [], [], |
181 | [#include <sys/types.h> | |
182 | #include <sys/socket.h> | |
183 | ]) | |
fb1e4ffc | 184 | |
8365dcf5 TJB |
185 | AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], |
186 | #include <elf.h> | |
187 | ) | |
188 | ||
c16158bc JM |
189 | ACX_PKGVERSION([GDB]) |
190 | ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) | |
191 | AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description]) | |
192 | AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address]) | |
193 | ||
8838b45e NS |
194 | # Check for various supplementary target information (beyond the |
195 | # triplet) which might affect the choices in configure.srv. | |
196 | case "${target}" in | |
197 | changequote(,)dnl | |
198 | i[34567]86-*-linux*) | |
199 | changequote([,])dnl | |
200 | AC_CACHE_CHECK([if building for x86-64], [gdb_cv_i386_is_x86_64], | |
201 | [save_CPPFLAGS="$CPPFLAGS" | |
202 | CPPFLAGS="$CPPFLAGS $CFLAGS" | |
203 | AC_EGREP_CPP([got it], [ | |
204 | #if __x86_64__ | |
205 | got it | |
206 | #endif | |
207 | ], [gdb_cv_i386_is_x86_64=yes], | |
208 | [gdb_cv_i386_is_x86_64=no]) | |
209 | CPPFLAGS="$save_CPPFLAGS"]) | |
210 | ;; | |
9ac544ce MK |
211 | m68k-*-*) |
212 | AC_CACHE_CHECK([if building for Coldfire], [gdb_cv_m68k_is_coldfire], | |
213 | [save_CPPFLAGS="$CPPFLAGS" | |
214 | CPPFLAGS="$CPPFLAGS $CFLAGS" | |
215 | AC_EGREP_CPP([got it], [ | |
216 | #ifdef __mcoldfire__ | |
217 | got it | |
218 | #endif | |
219 | ], [gdb_cv_m68k_is_coldfire=yes], | |
220 | [gdb_cv_m68k_is_coldfire=no]) | |
221 | CPPFLAGS="$save_CPPFLAGS"]) | |
222 | ;; | |
8838b45e NS |
223 | esac |
224 | ||
7ea81414 | 225 | . ${srcdir}/configure.srv |
c906108c | 226 | |
68070c10 PA |
227 | if test "${srv_mingwce}" = "yes"; then |
228 | LIBS="$LIBS -lws2" | |
229 | elif test "${srv_mingw}" = "yes"; then | |
12ea4b69 | 230 | LIBS="$LIBS -lws2_32" |
ac8c974e AR |
231 | elif test "${srv_qnx}" = "yes"; then |
232 | LIBS="$LIBS -lsocket" | |
8ed54b31 JB |
233 | elif test "${srv_lynxos}" = "yes"; then |
234 | LIBS="$LIBS -lnetinet" | |
68070c10 PA |
235 | fi |
236 | ||
237 | if test "${srv_mingw}" = "yes"; then | |
b80864fb DJ |
238 | AC_DEFINE(USE_WIN32API, 1, |
239 | [Define if we should use the Windows API, instead of the | |
240 | POSIX API. On Windows, we use the Windows API when | |
241 | building for MinGW, but the POSIX API when building | |
242 | for Cygwin.]) | |
243 | fi | |
244 | ||
58caa3dc | 245 | if test "${srv_linux_usrregs}" = "yes"; then |
f450004a DJ |
246 | AC_DEFINE(HAVE_LINUX_USRREGS, 1, |
247 | [Define if the target supports PTRACE_PEEKUSR for register ] | |
248 | [access.]) | |
58caa3dc DJ |
249 | fi |
250 | ||
251 | if test "${srv_linux_regsets}" = "yes"; then | |
e9d25b98 DJ |
252 | AC_DEFINE(HAVE_LINUX_REGSETS, 1, |
253 | [Define if the target supports register sets.]) | |
254 | ||
58caa3dc DJ |
255 | AC_MSG_CHECKING(for PTRACE_GETREGS) |
256 | AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs, | |
257 | [AC_TRY_COMPILE([#include <sys/ptrace.h>], | |
258 | [PTRACE_GETREGS;], | |
259 | [gdbsrv_cv_have_ptrace_getregs=yes], | |
260 | [gdbsrv_cv_have_ptrace_getregs=no])]) | |
261 | AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs) | |
262 | if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then | |
e9d25b98 | 263 | AC_DEFINE(HAVE_PTRACE_GETREGS, 1, |
f450004a DJ |
264 | [Define if the target supports PTRACE_GETREGS for register ] |
265 | [access.]) | |
58caa3dc DJ |
266 | fi |
267 | ||
268 | AC_MSG_CHECKING(for PTRACE_GETFPXREGS) | |
269 | AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs, | |
270 | [AC_TRY_COMPILE([#include <sys/ptrace.h>], | |
271 | [PTRACE_GETFPXREGS;], | |
272 | [gdbsrv_cv_have_ptrace_getfpxregs=yes], | |
273 | [gdbsrv_cv_have_ptrace_getfpxregs=no])]) | |
274 | AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) | |
275 | if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then | |
f450004a DJ |
276 | AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, |
277 | [Define if the target supports PTRACE_GETFPXREGS for extended ] | |
278 | [register access.]) | |
58caa3dc DJ |
279 | fi |
280 | fi | |
281 | ||
0d62e5e8 DJ |
282 | if test "$ac_cv_header_sys_procfs_h" = yes; then |
283 | BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) | |
284 | BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) | |
285 | BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) | |
0d62e5e8 DJ |
286 | BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) |
287 | fi | |
288 | ||
18f5fd81 TJB |
289 | dnl Some systems (e.g., Android) have lwpid_t defined in libthread_db.h. |
290 | if test "$bfd_cv_have_sys_procfs_type_lwpid_t" != yes; then | |
291 | GDBSERVER_HAVE_THREAD_DB_TYPE(lwpid_t) | |
292 | fi | |
293 | ||
294 | dnl Some systems (e.g., Android) have psaddr_t defined in libthread_db.h. | |
295 | if test "$bfd_cv_have_sys_procfs_type_psaddr_t" != yes; then | |
296 | GDBSERVER_HAVE_THREAD_DB_TYPE(psaddr_t) | |
297 | fi | |
298 | ||
193f13e6 MK |
299 | dnl Check for libdl, but do not add it to LIBS as only gdbserver |
300 | dnl needs it (and gdbreplay doesn't). | |
301 | old_LIBS="$LIBS" | |
302 | AC_CHECK_LIB(dl, dlopen) | |
303 | LIBS="$old_LIBS" | |
304 | ||
0d62e5e8 DJ |
305 | srv_thread_depfiles= |
306 | srv_libs= | |
307 | USE_THREAD_DB= | |
308 | ||
309 | if test "$srv_linux_thread_db" = "yes"; then | |
193f13e6 MK |
310 | if test "$ac_cv_lib_dl_dlopen" = "yes"; then |
311 | srv_libs="-ldl" | |
f6528abd | 312 | AC_MSG_CHECKING(for the dynamic export flag) |
193f13e6 | 313 | old_LDFLAGS="$LDFLAGS" |
f6528abd JK |
314 | # Older GNU ld supports --export-dynamic but --dynamic-list may not be |
315 | # supported there. | |
316 | RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" | |
317 | LDFLAGS="$LDFLAGS $RDYNAMIC" | |
318 | AC_TRY_LINK([], [], | |
319 | [found="-Wl,--dynamic-list" | |
320 | RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'], | |
321 | [RDYNAMIC="-rdynamic" | |
322 | LDFLAGS="$old_LDFLAGS $RDYNAMIC" | |
323 | AC_TRY_LINK([], [], | |
324 | [found="-rdynamic"], | |
325 | [found="no" | |
326 | RDYNAMIC=""])]) | |
193f13e6 MK |
327 | AC_SUBST(RDYNAMIC) |
328 | LDFLAGS="$old_LDFLAGS" | |
f6528abd | 329 | AC_MSG_RESULT($found) |
193f13e6 MK |
330 | else |
331 | srv_libs="-lthread_db" | |
332 | fi | |
0d62e5e8 | 333 | |
0d62e5e8 DJ |
334 | srv_thread_depfiles="thread-db.o proc-service.o" |
335 | USE_THREAD_DB="-DUSE_THREAD_DB" | |
3db0444b DJ |
336 | AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, |
337 | [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;], | |
1b3f6016 PA |
338 | [gdbsrv_cv_have_td_version=yes], |
339 | [gdbsrv_cv_have_td_version=no])]) | |
3db0444b DJ |
340 | if test $gdbsrv_cv_have_td_version = yes; then |
341 | AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.]) | |
342 | fi | |
0d62e5e8 DJ |
343 | fi |
344 | ||
96f15937 PP |
345 | AC_ARG_WITH(libthread-db, |
346 | AS_HELP_STRING([--with-libthread-db=PATH], [use given libthread_db directly]), | |
347 | [srv_libthread_db_path="${withval}" | |
96f15937 PP |
348 | srv_libs="$srv_libthread_db_path" |
349 | ]) | |
350 | ||
193f13e6 MK |
351 | if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then |
352 | AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.]) | |
353 | fi | |
354 | ||
9b4b61c8 | 355 | if test "$srv_xmlfiles" != ""; then |
fb1e4ffc DJ |
356 | srv_xmlbuiltin="xml-builtin.o" |
357 | AC_DEFINE(USE_XML, 1, [Define if an XML target description is available.]) | |
358 | ||
359 | tmp_xmlfiles=$srv_xmlfiles | |
9b4b61c8 | 360 | srv_xmlfiles="" |
fb1e4ffc DJ |
361 | for f in $tmp_xmlfiles; do |
362 | srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f" | |
363 | done | |
364 | fi | |
365 | ||
59a016f0 | 366 | GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" |
0d62e5e8 | 367 | GDBSERVER_LIBS="$srv_libs" |
c906108c | 368 | |
fa593d66 PA |
369 | dnl Check whether the target supports __sync_*_compare_and_swap. |
370 | AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap], | |
371 | gdbsrv_cv_have_sync_builtins, [ | |
372 | AC_TRY_LINK([], [int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);], | |
373 | gdbsrv_cv_have_sync_builtins=yes, | |
374 | gdbsrv_cv_have_sync_builtins=no)]) | |
375 | if test $gdbsrv_cv_have_sync_builtins = yes; then | |
376 | AC_DEFINE(HAVE_SYNC_BUILTINS, 1, | |
377 | [Define to 1 if the target supports __sync_*_compare_and_swap]) | |
378 | fi | |
379 | ||
380 | dnl Check for -fvisibility=hidden support in the compiler. | |
381 | saved_cflags="$CFLAGS" | |
382 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
383 | AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), | |
384 | [gdbsrv_cv_have_visibility_hidden=yes], | |
385 | [gdbsrv_cv_have_visibility_hidden=no]) | |
386 | CFLAGS="$saved_cflags" | |
387 | ||
03583c20 UW |
388 | dnl Check if we can disable the virtual address space randomization. |
389 | dnl The functionality of setarch -R. | |
390 | AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>]) | |
391 | define([PERSONALITY_TEST], [AC_LANG_PROGRAM([#include <sys/personality.h>], [ | |
392 | # if !HAVE_DECL_ADDR_NO_RANDOMIZE | |
393 | # define ADDR_NO_RANDOMIZE 0x0040000 | |
394 | # endif | |
395 | /* Test the flag could be set and stays set. */ | |
396 | personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); | |
397 | if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) | |
398 | return 1])]) | |
399 | AC_RUN_IFELSE([PERSONALITY_TEST], | |
400 | [gdbsrv_cv_have_personality=true], | |
401 | [gdbsrv_cv_have_personality=false], | |
402 | [AC_LINK_IFELSE([PERSONALITY_TEST], | |
403 | [gdbsrv_cv_have_personality=true], | |
404 | [gdbsrv_cv_have_personality=false])]) | |
405 | if $gdbsrv_cv_have_personality | |
406 | then | |
407 | AC_DEFINE([HAVE_PERSONALITY], 1, | |
408 | [Define if you support the personality syscall.]) | |
409 | fi | |
410 | ||
c2a66c29 | 411 | |
fa593d66 | 412 | IPA_DEPFILES="" |
c2a66c29 | 413 | extra_libraries="" |
fa593d66 | 414 | |
c2a66c29 | 415 | # check whether to enable the inprocess agent |
fa593d66 PA |
416 | if test "$ipa_obj" != "" \ |
417 | -a "$gdbsrv_cv_have_sync_builtins" = yes \ | |
418 | -a "$gdbsrv_cv_have_visibility_hidden" = yes; then | |
c2a66c29 NS |
419 | have_ipa=true |
420 | else | |
421 | have_ipa=false | |
422 | fi | |
423 | ||
424 | AC_ARG_ENABLE(inprocess-agent, | |
425 | AS_HELP_STRING([--enable-inprocess-agent], [inprocess agent]), | |
426 | [case "$enableval" in | |
427 | yes) want_ipa=true ;; | |
428 | no) want_ipa=false ;; | |
429 | *) AC_MSG_ERROR([bad value $enableval for inprocess-agent]) ;; | |
430 | esac], | |
431 | [want_ipa=$have_ipa]) | |
432 | ||
433 | if $want_ipa ; then | |
434 | if $have_ipa ; then | |
435 | IPA_DEPFILES="$ipa_obj" | |
436 | extra_libraries="$extra_libraries libinproctrace.so" | |
437 | else | |
438 | AC_MSG_ERROR([inprocess agent not supported for this target]) | |
439 | fi | |
fa593d66 PA |
440 | fi |
441 | ||
7ea81414 | 442 | AC_SUBST(GDBSERVER_DEPFILES) |
0d62e5e8 DJ |
443 | AC_SUBST(GDBSERVER_LIBS) |
444 | AC_SUBST(USE_THREAD_DB) | |
fb1e4ffc DJ |
445 | AC_SUBST(srv_xmlbuiltin) |
446 | AC_SUBST(srv_xmlfiles) | |
fa593d66 PA |
447 | AC_SUBST(IPA_DEPFILES) |
448 | AC_SUBST(extra_libraries) | |
c906108c | 449 | |
c971b7fa | 450 | GNULIB=build-gnulib-gdbserver/import |
c9a1864a YQ |
451 | |
452 | GNULIB_STDINT_H= | |
453 | if test x"$STDINT_H" != x; then | |
c971b7fa | 454 | GNULIB_STDINT_H=$GNULIB/$STDINT_H |
c9a1864a YQ |
455 | fi |
456 | AC_SUBST(GNULIB_STDINT_H) | |
457 | ||
c971b7fa | 458 | AC_OUTPUT(Makefile, |
c3a3ccc7 DJ |
459 | [case x$CONFIG_HEADERS in |
460 | xconfig.h:config.in) | |
461 | echo > stamp-h ;; | |
462 | esac | |
463 | ]) |