URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [gdb/] [gdbserver/] [configure.ac] - Rev 840
Compare with Previous | Blame | View Log
dnl Autoconf configure script for GDB server.dnl Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006dnl Free Software Foundation, Inc.dnldnl This file is part of GDB.dnldnl This program is free software; you can redistribute it and/or modifydnl it under the terms of the GNU General Public License as published bydnl the Free Software Foundation; either version 3 of the License, ordnl (at your option) any later version.dnldnl This program is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See thednl GNU General Public License for more details.dnldnl You should have received a copy of the GNU General Public Licensednl along with this program. If not, see <http://www.gnu.org/licenses/>.dnl Process this file with autoconf to produce a configure script.AC_PREREQ(2.59)dnlAC_INIT(server.c)AC_CONFIG_HEADER(config.h:config.in)AC_PROG_CCAC_GNU_SOURCEAC_CANONICAL_SYSTEMAC_PROG_INSTALLAC_ARG_PROGRAMAC_HEADER_STDCAC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnlproc_service.h sys/procfs.h thread_db.h linux/elf.h dnlstdlib.h unistd.h dnlerrno.h fcntl.h signal.h sys/file.h malloc.h dnlsys/ioctl.h netinet/in.h sys/socket.h netdb.h dnlnetinet/tcp.h arpa/inet.h sys/wait.h)AC_CHECK_FUNCS(pread pwrite pread64)have_errno=noAC_MSG_CHECKING(for errno)AC_TRY_LINK([#if HAVE_ERRNO_H#include <errno.h>#endif], [static int x; x = errno;],[AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is available]) have_errno=yes])if test $have_errno = no; thenAC_TRY_LINK([#if HAVE_ERRNO_H#include <errno.h>#endif], [extern int errno; static int x; x = errno;],[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])],[AC_MSG_RESULT(no)])fiAC_CHECK_DECLS([strerror, perror])AC_CHECK_TYPES(socklen_t, [], [],[#include <sys/types.h>#include <sys/socket.h>])# Check for various supplementary target information (beyond the# triplet) which might affect the choices in configure.srv.case "${target}" inarm*-*-linux*)AC_CACHE_CHECK([if iWMMXt is selected], [gdb_cv_arm_iwmmxt],[save_CPPFLAGS="$CPPFLAGS"CPPFLAGS="$CPPFLAGS $CFLAGS"AC_EGREP_CPP([got it], [#ifdef __IWMMXT__got it#endif], [gdb_cv_arm_iwmmxt=yes],[gdb_cv_arm_iwmmxt=no])CPPFLAGS="$save_CPPFLAGS"]);;powerpc*-*-*)AC_CACHE_CHECK([if Altivec is selected], [gdb_cv_ppc_altivec],[save_CPPFLAGS="$CPPFLAGS"CPPFLAGS="$CPPFLAGS $CFLAGS"AC_EGREP_CPP([got it], [#ifdef __ALTIVEC__got it#endif], [gdb_cv_ppc_altivec=yes],[gdb_cv_ppc_altivec=no])CPPFLAGS="$save_CPPFLAGS"])AC_CACHE_CHECK([if SPE is selected], [gdb_cv_ppc_spe],[save_CPPFLAGS="$CPPFLAGS"CPPFLAGS="$CPPFLAGS $CFLAGS"AC_EGREP_CPP([got it], [#ifdef __SPE__got it#endif], [gdb_cv_ppc_spe=yes],[gdb_cv_ppc_spe=no])CPPFLAGS="$save_CPPFLAGS"]);;esac. ${srcdir}/configure.srvif test "${srv_mingwce}" = "yes"; thenLIBS="$LIBS -lws2"elif test "${srv_mingw}" = "yes"; thenLIBS="$LIBS -lwsock32"fiif test "${srv_mingw}" = "yes"; thenAC_DEFINE(USE_WIN32API, 1,[Define if we should use the Windows API, instead of thePOSIX API. On Windows, we use the Windows API whenbuilding for MinGW, but the POSIX API when buildingfor Cygwin.])fiif test "${srv_linux_usrregs}" = "yes"; thenAC_DEFINE(HAVE_LINUX_USRREGS, 1,[Define if the target supports PTRACE_PEEKUSR for register ][access.])fiif test "${srv_linux_regsets}" = "yes"; thenAC_DEFINE(HAVE_LINUX_REGSETS, 1,[Define if the target supports register sets.])AC_MSG_CHECKING(for PTRACE_GETREGS)AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,[AC_TRY_COMPILE([#include <sys/ptrace.h>],[PTRACE_GETREGS;],[gdbsrv_cv_have_ptrace_getregs=yes],[gdbsrv_cv_have_ptrace_getregs=no])])AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; thenAC_DEFINE(HAVE_PTRACE_GETREGS, 1,[Define if the target supports PTRACE_GETREGS for register ][access.])fiAC_MSG_CHECKING(for PTRACE_GETFPXREGS)AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,[AC_TRY_COMPILE([#include <sys/ptrace.h>],[PTRACE_GETFPXREGS;],[gdbsrv_cv_have_ptrace_getfpxregs=yes],[gdbsrv_cv_have_ptrace_getfpxregs=no])])AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; thenAC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,[Define if the target supports PTRACE_GETFPXREGS for extended ][register access.])fifiif test "$ac_cv_header_sys_procfs_h" = yes; thenBFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)fisrv_thread_depfiles=srv_libs=USE_THREAD_DB=if test "$srv_linux_thread_db" = "yes"; thenSRV_CHECK_THREAD_DBif test "$srv_cv_thread_db" = no; thenAC_WARN([Could not find libthread_db.])AC_WARN([Disabling thread support in gdbserver.])srv_linux_thread_db=noelsesrv_libs="$srv_cv_thread_db"SRV_CHECK_TLS_GET_ADDRfiold_LDFLAGS="$LDFLAGS"LDFLAGS="$LDFLAGS -rdynamic"AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])AC_SUBST(RDYNAMIC)LDFLAGS="$old_LDFLAGS"fiif test "$srv_linux_thread_db" = "yes"; thensrv_thread_depfiles="thread-db.o proc-service.o"USE_THREAD_DB="-DUSE_THREAD_DB"AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,[AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],[gdbsrv_cv_have_td_version=yes],[gdbsrv_cv_have_td_version=no])])if test $gdbsrv_cv_have_td_version = yes; thenAC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])fiif test "$srv_cv_tls_get_addr" = yes; thenAC_DEFINE(HAVE_TD_THR_TLS_GET_ADDR, 1, [Define if td_thr_tls_get_addr is available.])fifiif test "$srv_xmltarget" != ""; thensrv_xmltarget="\$(XML_DIR)/$srv_xmltarget"srv_xmlbuiltin="xml-builtin.o"AC_DEFINE(USE_XML, 1, [Define if an XML target description is available.])tmp_xmlfiles=$srv_xmlfilessrv_xmlfiles="target.xml"for f in $tmp_xmlfiles; dosrv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f"donefiGDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"GDBSERVER_LIBS="$srv_libs"AC_SUBST(GDBSERVER_DEPFILES)AC_SUBST(GDBSERVER_LIBS)AC_SUBST(USE_THREAD_DB)AC_SUBST(srv_xmlbuiltin)AC_SUBST(srv_xmlfiles)AC_SUBST(srv_xmltarget)AC_OUTPUT(Makefile,[case x$CONFIG_HEADERS inxconfig.h:config.in)echo > stamp-h ;;esac])
