OLD | NEW |
1 dnl Autoconf configure script for GDB server. | 1 dnl Autoconf configure script for GDB server. |
2 dnl Copyright (C) 2000, 2002-2012 Free Software Foundation, Inc. | 2 dnl Copyright (C) 2000, 2002-2012 Free Software Foundation, Inc. |
3 dnl | 3 dnl |
4 dnl This file is part of GDB. | 4 dnl This file is part of GDB. |
5 dnl | 5 dnl |
6 dnl This program is free software; you can redistribute it and/or modify | 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 | 7 dnl it under the terms of the GNU General Public License as published by |
8 dnl the Free Software Foundation; either version 3 of the License, or | 8 dnl the Free Software Foundation; either version 3 of the License, or |
9 dnl (at your option) any later version. | 9 dnl (at your option) any later version. |
10 dnl | 10 dnl |
11 dnl This program is distributed in the hope that it will be useful, | 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 | 12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 dnl GNU General Public License for more details. | 14 dnl GNU General Public License for more details. |
15 dnl | 15 dnl |
16 dnl You should have received a copy of the GNU General Public License | 16 dnl You should have received a copy of the GNU General Public License |
17 dnl along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 dnl along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
19 dnl Process this file with autoconf to produce a configure script. | 19 dnl Process this file with autoconf to produce a configure script. |
20 | 20 |
21 AC_PREREQ(2.59)dnl | 21 AC_PREREQ(2.59)dnl |
22 | 22 |
23 AC_INIT(server.c) | 23 AC_INIT(server.c) |
24 AC_CONFIG_HEADER(config.h:config.in) | 24 AC_CONFIG_HEADER(config.h:config.in) |
25 AC_CONFIG_LIBOBJ_DIR(../gnulib) | 25 |
| 26 AM_MAINTAINER_MODE |
26 | 27 |
27 AC_PROG_CC | 28 AC_PROG_CC |
28 AC_GNU_SOURCE | 29 AC_GNU_SOURCE |
29 | 30 |
30 AC_CANONICAL_SYSTEM | 31 AC_CANONICAL_SYSTEM |
31 | 32 |
32 AC_PROG_INSTALL | 33 AC_PROG_INSTALL |
| 34 AC_PROG_RANLIB |
33 | 35 |
34 AC_ARG_PROGRAM | 36 AC_ARG_PROGRAM |
35 | 37 |
36 AC_HEADER_STDC | 38 AC_HEADER_STDC |
37 AC_HEADER_DIRENT | 39 AC_HEADER_DIRENT |
38 | 40 |
39 AC_FUNC_ALLOCA | 41 AC_FUNC_ALLOCA |
| 42 |
| 43 # Check for the 'make' the user wants to use. |
| 44 AC_CHECK_PROGS(MAKE, make) |
| 45 |
| 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 |
40 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl | 53 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl |
41 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl | 54 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl |
42 stdlib.h unistd.h dnl | 55 stdlib.h unistd.h dnl |
43 errno.h fcntl.h signal.h sys/file.h malloc.h dnl | 56 errno.h fcntl.h signal.h sys/file.h malloc.h dnl |
44 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl | 57 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl |
45 » » netinet/tcp.h arpa/inet.h sys/wait.h) | 58 » » netinet/tcp.h arpa/inet.h sys/wait.h sys/un.h) |
46 AC_CHECK_FUNCS(pread pwrite pread64) | 59 AC_CHECK_FUNCS(pread pwrite pread64 readlink) |
47 AC_REPLACE_FUNCS(memmem vasprintf vsnprintf) | 60 AC_REPLACE_FUNCS(vasprintf vsnprintf) |
48 | 61 |
49 # Check for UST | 62 # Check for UST |
50 ustlibs="" | 63 ustlibs="" |
51 ustinc="" | 64 ustinc="" |
52 | 65 |
53 AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the insta
lled UST package | 66 AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the insta
lled UST package |
54 Equivalent to --with-ust-include=PATH/include | 67 Equivalent to --with-ust-include=PATH/include |
55 plus --with-ust-lib=PATH/lib]) | 68 plus --with-ust-lib=PATH/lib]) |
56 AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for instal
led UST include files]) | 69 AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for instal
led UST include files]) |
57 AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the inst
alled UST library]) | 70 AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the inst
alled UST library]) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is
available]) have_errno=yes]) | 167 [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is
available]) have_errno=yes]) |
155 if test $have_errno = no; then | 168 if test $have_errno = no; then |
156 AC_TRY_LINK([ | 169 AC_TRY_LINK([ |
157 #if HAVE_ERRNO_H | 170 #if HAVE_ERRNO_H |
158 #include <errno.h> | 171 #include <errno.h> |
159 #endif], [extern int errno; static int x; x = errno;], | 172 #endif], [extern int errno; static int x; x = errno;], |
160 [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno i
s available]) AC_DEFINE(MUST_DEFINE_ERRNO, 1, [Checking if errno must be defined
])], | 173 [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno i
s available]) AC_DEFINE(MUST_DEFINE_ERRNO, 1, [Checking if errno must be defined
])], |
161 [AC_MSG_RESULT(no)]) | 174 [AC_MSG_RESULT(no)]) |
162 fi | 175 fi |
163 | 176 |
164 AC_CHECK_DECLS([strerror, perror, memmem, vasprintf, vsnprintf]) | 177 AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf]) |
165 | 178 |
166 AC_CHECK_TYPES(socklen_t, [], [], | 179 AC_CHECK_TYPES(socklen_t, [], [], |
167 [#include <sys/types.h> | 180 [#include <sys/types.h> |
168 #include <sys/socket.h> | 181 #include <sys/socket.h> |
169 ]) | 182 ]) |
170 | 183 |
| 184 AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], |
| 185 #include <elf.h> |
| 186 ) |
| 187 |
171 ACX_PKGVERSION([GDB]) | 188 ACX_PKGVERSION([GDB]) |
172 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) | 189 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) |
173 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package descriptio
n]) | 190 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package descriptio
n]) |
174 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address
]) | 191 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address
]) |
175 | 192 |
176 # Check for various supplementary target information (beyond the | 193 # Check for various supplementary target information (beyond the |
177 # triplet) which might affect the choices in configure.srv. | 194 # triplet) which might affect the choices in configure.srv. |
178 case "${target}" in | 195 case "${target}" in |
179 changequote(,)dnl | 196 changequote(,)dnl |
180 i[34567]86-*-linux*) | 197 i[34567]86-*-linux*) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 fi | 278 fi |
262 fi | 279 fi |
263 | 280 |
264 if test "$ac_cv_header_sys_procfs_h" = yes; then | 281 if test "$ac_cv_header_sys_procfs_h" = yes; then |
265 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) | 282 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) |
266 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) | 283 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) |
267 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) | 284 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) |
268 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) | 285 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) |
269 fi | 286 fi |
270 | 287 |
| 288 dnl Some systems (e.g., Android) have lwpid_t defined in libthread_db.h. |
| 289 if test "$bfd_cv_have_sys_procfs_type_lwpid_t" != yes; then |
| 290 GDBSERVER_HAVE_THREAD_DB_TYPE(lwpid_t) |
| 291 fi |
| 292 |
| 293 dnl Some systems (e.g., Android) have psaddr_t defined in libthread_db.h. |
| 294 if test "$bfd_cv_have_sys_procfs_type_psaddr_t" != yes; then |
| 295 GDBSERVER_HAVE_THREAD_DB_TYPE(psaddr_t) |
| 296 fi |
| 297 |
271 dnl Check for libdl, but do not add it to LIBS as only gdbserver | 298 dnl Check for libdl, but do not add it to LIBS as only gdbserver |
272 dnl needs it (and gdbreplay doesn't). | 299 dnl needs it (and gdbreplay doesn't). |
273 old_LIBS="$LIBS" | 300 old_LIBS="$LIBS" |
274 AC_CHECK_LIB(dl, dlopen) | 301 AC_CHECK_LIB(dl, dlopen) |
275 LIBS="$old_LIBS" | 302 LIBS="$old_LIBS" |
276 | 303 |
277 srv_thread_depfiles= | 304 srv_thread_depfiles= |
278 srv_libs= | 305 srv_libs= |
279 USE_THREAD_DB= | 306 USE_THREAD_DB= |
280 | 307 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 fi | 439 fi |
413 | 440 |
414 AC_SUBST(GDBSERVER_DEPFILES) | 441 AC_SUBST(GDBSERVER_DEPFILES) |
415 AC_SUBST(GDBSERVER_LIBS) | 442 AC_SUBST(GDBSERVER_LIBS) |
416 AC_SUBST(USE_THREAD_DB) | 443 AC_SUBST(USE_THREAD_DB) |
417 AC_SUBST(srv_xmlbuiltin) | 444 AC_SUBST(srv_xmlbuiltin) |
418 AC_SUBST(srv_xmlfiles) | 445 AC_SUBST(srv_xmlfiles) |
419 AC_SUBST(IPA_DEPFILES) | 446 AC_SUBST(IPA_DEPFILES) |
420 AC_SUBST(extra_libraries) | 447 AC_SUBST(extra_libraries) |
421 | 448 |
| 449 GNULIB=build-gnulib-gdbserver/import |
| 450 |
| 451 GNULIB_STDINT_H= |
| 452 if test x"$STDINT_H" != x; then |
| 453 GNULIB_STDINT_H=$GNULIB/$STDINT_H |
| 454 fi |
| 455 AC_SUBST(GNULIB_STDINT_H) |
| 456 |
422 AC_OUTPUT(Makefile, | 457 AC_OUTPUT(Makefile, |
423 [case x$CONFIG_HEADERS in | 458 [case x$CONFIG_HEADERS in |
424 xconfig.h:config.in) | 459 xconfig.h:config.in) |
425 echo > stamp-h ;; | 460 echo > stamp-h ;; |
426 esac | 461 esac |
427 ]) | 462 ]) |
OLD | NEW |