| 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-2013 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 | 25 |
| 26 AM_MAINTAINER_MODE | 26 AM_MAINTAINER_MODE |
| 27 | 27 |
| 28 AC_PROG_CC | 28 AC_PROG_CC |
| 29 AC_GNU_SOURCE | 29 AC_GNU_SOURCE |
| 30 AC_SYS_LARGEFILE |
| 30 | 31 |
| 31 AC_CANONICAL_SYSTEM | 32 AC_CANONICAL_SYSTEM |
| 32 | 33 |
| 33 AC_PROG_INSTALL | 34 AC_PROG_INSTALL |
| 34 AC_PROG_RANLIB | 35 AC_PROG_RANLIB |
| 35 | 36 |
| 36 AC_ARG_PROGRAM | 37 AC_ARG_PROGRAM |
| 37 | 38 |
| 38 AC_HEADER_STDC | 39 AC_HEADER_STDC |
| 39 AC_HEADER_DIRENT | |
| 40 | 40 |
| 41 AC_FUNC_ALLOCA | 41 AC_FUNC_ALLOCA |
| 42 | 42 |
| 43 # Set the 'development' global. |
| 44 . $srcdir/../development.sh |
| 45 |
| 46 # Enable -lmcheck by default (it provides cheap-enough memory |
| 47 # mangling), but turn it off for releases. |
| 48 if $development; then |
| 49 libmcheck_default=yes |
| 50 else |
| 51 libmcheck_default=no |
| 52 fi |
| 53 GDB_AC_LIBMCHECK(${libmcheck_default}) |
| 54 |
| 55 ACX_NONCANONICAL_TARGET |
| 56 ACX_NONCANONICAL_HOST |
| 57 |
| 58 # Dependency checking. |
| 59 ZW_CREATE_DEPDIR |
| 60 ZW_PROG_COMPILER_DEPENDENCIES([CC]) |
| 61 |
| 43 # Check for the 'make' the user wants to use. | 62 # Check for the 'make' the user wants to use. |
| 44 AC_CHECK_PROGS(MAKE, make) | 63 AC_CHECK_PROGS(MAKE, make) |
| 64 MAKE_IS_GNU= |
| 65 case "`$MAKE --version 2>&1 | sed 1q`" in |
| 66 *GNU*) |
| 67 MAKE_IS_GNU=yes |
| 68 ;; |
| 69 esac |
| 70 AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes) |
| 71 AC_PROG_MAKE_SET |
| 45 | 72 |
| 46 # Configure gnulib. We can't use AC_CONFIG_SUBDIRS as that'd expect | 73 # 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 | 74 # to find the the source subdir to be configured directly under |
| 48 # gdbserver/. We need to build gnulib under some other directory not | 75 # gdbserver/. We need to build gnulib under some other directory not |
| 49 # "gnulib", to avoid the problem of both GDB and GDBserver wanting to | 76 # "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. | 77 # build it in the same directory, when building in the source dir. |
| 51 ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"]) | 78 ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"]) |
| 52 | 79 |
| 53 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl | 80 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl |
| 54 » » proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl | 81 » » proc_service.h sys/procfs.h linux/elf.h dnl |
| 55 » » stdlib.h unistd.h dnl | |
| 56 errno.h fcntl.h signal.h sys/file.h malloc.h dnl | 82 errno.h fcntl.h signal.h sys/file.h malloc.h dnl |
| 57 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl | 83 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl |
| 58 » » netinet/tcp.h arpa/inet.h sys/wait.h sys/un.h) | 84 » » netinet/tcp.h arpa/inet.h) |
| 59 AC_CHECK_FUNCS(pread pwrite pread64 readlink) | 85 AC_CHECK_FUNCS(pread pwrite pread64 readlink) |
| 60 AC_REPLACE_FUNCS(vasprintf vsnprintf) | 86 AC_REPLACE_FUNCS(vasprintf vsnprintf) |
| 61 | 87 |
| 88 GDB_AC_COMMON |
| 89 |
| 62 # Check for UST | 90 # Check for UST |
| 63 ustlibs="" | 91 ustlibs="" |
| 64 ustinc="" | 92 ustinc="" |
| 65 | 93 |
| 66 AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the insta
lled UST package | 94 AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the insta
lled UST package |
| 67 Equivalent to --with-ust-include=PATH/include | 95 Equivalent to --with-ust-include=PATH/include |
| 68 plus --with-ust-lib=PATH/lib]) | 96 plus --with-ust-lib=PATH/lib]) |
| 69 AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for instal
led UST include files]) | 97 AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for instal
led UST include files]) |
| 70 AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the inst
alled UST library]) | 98 AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the inst
alled UST library]) |
| 71 | 99 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then | 147 if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then |
| 120 ERROR_ON_WARNING=yes | 148 ERROR_ON_WARNING=yes |
| 121 fi | 149 fi |
| 122 | 150 |
| 123 WERROR_CFLAGS="" | 151 WERROR_CFLAGS="" |
| 124 if test "${ERROR_ON_WARNING}" = yes ; then | 152 if test "${ERROR_ON_WARNING}" = yes ; then |
| 125 WERROR_CFLAGS="-Werror" | 153 WERROR_CFLAGS="-Werror" |
| 126 fi | 154 fi |
| 127 | 155 |
| 128 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ | 156 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ |
| 129 -Wformat-nonliteral -Wno-char-subscripts" | 157 -Wformat-nonliteral -Wno-char-subscripts -Wempty-body" |
| 130 | 158 |
| 131 WARN_CFLAGS="" | 159 WARN_CFLAGS="" |
| 132 if test "x$GCC" = xyes | 160 if test "x$GCC" = xyes |
| 133 then | 161 then |
| 134 AC_MSG_CHECKING(compiler warning flags) | 162 AC_MSG_CHECKING(compiler warning flags) |
| 135 # Separate out the -Werror flag as some files just cannot be | 163 # Separate out the -Werror flag as some files just cannot be |
| 136 # compiled with it enabled. | 164 # compiled with it enabled. |
| 137 for w in ${build_warnings}; do | 165 for w in ${build_warnings}; do |
| 138 case $w in | 166 case $w in |
| 139 -Werr*) WERROR_CFLAGS=-Werror ;; | 167 -Werr*) WERROR_CFLAGS=-Werror ;; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 151 | 179 |
| 152 dnl dladdr is glibc-specific. It is used by thread-db.c but only for | 180 dnl dladdr is glibc-specific. It is used by thread-db.c but only for |
| 153 dnl debugging messages. It lives in -ldl which is handled below so we don't | 181 dnl debugging messages. It lives in -ldl which is handled below so we don't |
| 154 dnl use AC_CHECK_LIB (or AC_SEARCH_LIBS) here. Instead we just temporarily | 182 dnl use AC_CHECK_LIB (or AC_SEARCH_LIBS) here. Instead we just temporarily |
| 155 dnl augment LIBS. | 183 dnl augment LIBS. |
| 156 old_LIBS="$LIBS" | 184 old_LIBS="$LIBS" |
| 157 LIBS="$LIBS -ldl" | 185 LIBS="$LIBS -ldl" |
| 158 AC_CHECK_FUNCS(dladdr) | 186 AC_CHECK_FUNCS(dladdr) |
| 159 LIBS="$old_LIBS" | 187 LIBS="$old_LIBS" |
| 160 | 188 |
| 161 have_errno=no | |
| 162 AC_MSG_CHECKING(for errno) | |
| 163 AC_TRY_LINK([ | |
| 164 #if HAVE_ERRNO_H | |
| 165 #include <errno.h> | |
| 166 #endif], [static int x; x = errno;], | |
| 167 [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is
available]) have_errno=yes]) | |
| 168 if test $have_errno = no; then | |
| 169 AC_TRY_LINK([ | |
| 170 #if HAVE_ERRNO_H | |
| 171 #include <errno.h> | |
| 172 #endif], [extern int errno; static int x; x = errno;], | |
| 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
])], | |
| 174 [AC_MSG_RESULT(no)]) | |
| 175 fi | |
| 176 | |
| 177 AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf]) | 189 AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf]) |
| 178 | 190 |
| 179 AC_CHECK_TYPES(socklen_t, [], [], | 191 AC_CHECK_TYPES(socklen_t, [], [], |
| 180 [#include <sys/types.h> | 192 [#include <sys/types.h> |
| 181 #include <sys/socket.h> | 193 #include <sys/socket.h> |
| 182 ]) | 194 ]) |
| 183 | 195 |
| 184 AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], | 196 AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], |
| 185 #include <elf.h> | 197 #include <elf.h> |
| 186 ) | 198 ) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 [gdbsrv_cv_have_ptrace_getfpxregs=yes], | 283 [gdbsrv_cv_have_ptrace_getfpxregs=yes], |
| 272 [gdbsrv_cv_have_ptrace_getfpxregs=no])]) | 284 [gdbsrv_cv_have_ptrace_getfpxregs=no])]) |
| 273 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) | 285 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) |
| 274 if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then | 286 if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then |
| 275 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, | 287 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, |
| 276 [Define if the target supports PTRACE_GETFPXREGS for extended ] | 288 [Define if the target supports PTRACE_GETFPXREGS for extended ] |
| 277 [register access.]) | 289 [register access.]) |
| 278 fi | 290 fi |
| 279 fi | 291 fi |
| 280 | 292 |
| 293 if test "${srv_linux_btrace}" = "yes"; then |
| 294 AC_DEFINE(HAVE_LINUX_BTRACE, 1, |
| 295 [Define if the target supports branch tracing.]) |
| 296 fi |
| 297 |
| 281 if test "$ac_cv_header_sys_procfs_h" = yes; then | 298 if test "$ac_cv_header_sys_procfs_h" = yes; then |
| 282 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) | 299 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) |
| 283 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) | 300 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) |
| 284 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) | 301 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) |
| 285 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) | 302 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) |
| 286 fi | 303 fi |
| 287 | 304 |
| 288 dnl Some systems (e.g., Android) have lwpid_t defined in libthread_db.h. | 305 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 | 306 if test "$bfd_cv_have_sys_procfs_type_lwpid_t" != yes; then |
| 290 GDBSERVER_HAVE_THREAD_DB_TYPE(lwpid_t) | 307 GDBSERVER_HAVE_THREAD_DB_TYPE(lwpid_t) |
| 291 fi | 308 fi |
| 292 | 309 |
| 293 dnl Some systems (e.g., Android) have psaddr_t defined in libthread_db.h. | 310 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 | 311 if test "$bfd_cv_have_sys_procfs_type_psaddr_t" != yes; then |
| 295 GDBSERVER_HAVE_THREAD_DB_TYPE(psaddr_t) | 312 GDBSERVER_HAVE_THREAD_DB_TYPE(psaddr_t) |
| 296 fi | 313 fi |
| 297 | 314 |
| 298 dnl Check for libdl, but do not add it to LIBS as only gdbserver | 315 dnl Check for libdl, but do not add it to LIBS as only gdbserver |
| 299 dnl needs it (and gdbreplay doesn't). | 316 dnl needs it (and gdbreplay doesn't). |
| 300 old_LIBS="$LIBS" | 317 old_LIBS="$LIBS" |
| 301 AC_CHECK_LIB(dl, dlopen) | 318 AC_CHECK_LIB(dl, dlopen) |
| 302 LIBS="$old_LIBS" | 319 LIBS="$old_LIBS" |
| 303 | 320 |
| 304 srv_thread_depfiles= | 321 srv_thread_depfiles= |
| 305 srv_libs= | 322 srv_libs= |
| 306 USE_THREAD_DB= | |
| 307 | 323 |
| 308 if test "$srv_linux_thread_db" = "yes"; then | 324 if test "$srv_linux_thread_db" = "yes"; then |
| 309 if test "$ac_cv_lib_dl_dlopen" = "yes"; then | 325 if test "$ac_cv_lib_dl_dlopen" = "yes"; then |
| 310 srv_libs="-ldl" | 326 srv_libs="-ldl" |
| 311 AC_MSG_CHECKING(for the dynamic export flag) | 327 AC_MSG_CHECKING(for the dynamic export flag) |
| 312 old_LDFLAGS="$LDFLAGS" | 328 old_LDFLAGS="$LDFLAGS" |
| 313 # Older GNU ld supports --export-dynamic but --dynamic-list may not be | 329 # Older GNU ld supports --export-dynamic but --dynamic-list may not be |
| 314 # supported there. | 330 # supported there. |
| 315 RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" | 331 RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" |
| 316 LDFLAGS="$LDFLAGS $RDYNAMIC" | 332 LDFLAGS="$LDFLAGS $RDYNAMIC" |
| 317 AC_TRY_LINK([], [], | 333 AC_TRY_LINK([], [], |
| 318 [found="-Wl,--dynamic-list" | 334 [found="-Wl,--dynamic-list" |
| 319 RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'], | 335 RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'], |
| 320 [RDYNAMIC="-rdynamic" | 336 [RDYNAMIC="-rdynamic" |
| 321 LDFLAGS="$old_LDFLAGS $RDYNAMIC" | 337 LDFLAGS="$old_LDFLAGS $RDYNAMIC" |
| 322 AC_TRY_LINK([], [], | 338 AC_TRY_LINK([], [], |
| 323 [found="-rdynamic"], | 339 [found="-rdynamic"], |
| 324 [found="no" | 340 [found="no" |
| 325 RDYNAMIC=""])]) | 341 RDYNAMIC=""])]) |
| 326 AC_SUBST(RDYNAMIC) | 342 AC_SUBST(RDYNAMIC) |
| 327 LDFLAGS="$old_LDFLAGS" | 343 LDFLAGS="$old_LDFLAGS" |
| 328 AC_MSG_RESULT($found) | 344 AC_MSG_RESULT($found) |
| 329 else | 345 else |
| 330 srv_libs="-lthread_db" | 346 srv_libs="-lthread_db" |
| 331 fi | 347 fi |
| 332 | 348 |
| 333 srv_thread_depfiles="thread-db.o proc-service.o" | 349 srv_thread_depfiles="thread-db.o proc-service.o" |
| 334 USE_THREAD_DB="-DUSE_THREAD_DB" | 350 AC_DEFINE(USE_THREAD_DB, 1, [Define if we should use libthread_db.]) |
| 335 AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, | 351 AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, |
| 336 [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;], | 352 [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;], |
| 337 [gdbsrv_cv_have_td_version=yes], | 353 [gdbsrv_cv_have_td_version=yes], |
| 338 [gdbsrv_cv_have_td_version=no])]) | 354 [gdbsrv_cv_have_td_version=no])]) |
| 339 if test $gdbsrv_cv_have_td_version = yes; then | 355 if test $gdbsrv_cv_have_td_version = yes; then |
| 340 AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.]) | 356 AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.]) |
| 341 fi | 357 fi |
| 342 fi | 358 fi |
| 343 | 359 |
| 344 AC_ARG_WITH(libthread-db, | 360 AC_ARG_WITH(libthread-db, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 if $have_ipa ; then | 449 if $have_ipa ; then |
| 434 IPA_DEPFILES="$ipa_obj" | 450 IPA_DEPFILES="$ipa_obj" |
| 435 extra_libraries="$extra_libraries libinproctrace.so" | 451 extra_libraries="$extra_libraries libinproctrace.so" |
| 436 else | 452 else |
| 437 AC_MSG_ERROR([inprocess agent not supported for this target]) | 453 AC_MSG_ERROR([inprocess agent not supported for this target]) |
| 438 fi | 454 fi |
| 439 fi | 455 fi |
| 440 | 456 |
| 441 AC_SUBST(GDBSERVER_DEPFILES) | 457 AC_SUBST(GDBSERVER_DEPFILES) |
| 442 AC_SUBST(GDBSERVER_LIBS) | 458 AC_SUBST(GDBSERVER_LIBS) |
| 443 AC_SUBST(USE_THREAD_DB) | |
| 444 AC_SUBST(srv_xmlbuiltin) | 459 AC_SUBST(srv_xmlbuiltin) |
| 445 AC_SUBST(srv_xmlfiles) | 460 AC_SUBST(srv_xmlfiles) |
| 446 AC_SUBST(IPA_DEPFILES) | 461 AC_SUBST(IPA_DEPFILES) |
| 447 AC_SUBST(extra_libraries) | 462 AC_SUBST(extra_libraries) |
| 448 | 463 |
| 449 GNULIB=build-gnulib-gdbserver/import | 464 GNULIB=build-gnulib-gdbserver/import |
| 450 | 465 |
| 451 GNULIB_STDINT_H= | 466 GNULIB_STDINT_H= |
| 452 if test x"$STDINT_H" != x; then | 467 if test x"$STDINT_H" != x; then |
| 453 GNULIB_STDINT_H=$GNULIB/$STDINT_H | 468 GNULIB_STDINT_H=$GNULIB/$STDINT_H |
| 454 fi | 469 fi |
| 455 AC_SUBST(GNULIB_STDINT_H) | 470 AC_SUBST(GNULIB_STDINT_H) |
| 456 | 471 |
| 457 AC_OUTPUT(Makefile, | 472 AC_OUTPUT(Makefile, |
| 458 [case x$CONFIG_HEADERS in | 473 [case x$CONFIG_HEADERS in |
| 459 xconfig.h:config.in) | 474 xconfig.h:config.in) |
| 460 echo > stamp-h ;; | 475 echo > stamp-h ;; |
| 461 esac | 476 esac |
| 462 ]) | 477 ]) |
| OLD | NEW |