import gdb-2000-01-17 snapshot
[deliverable/binutils-gdb.git] / gdb / configure.in
index d65811837928ebd939a129b83778a78c1a61fe8f..e8d6c3bcc8cce08e4dbee911d7e08b40278b43a4 100644 (file)
@@ -44,6 +44,19 @@ CONFIG_SRCS=
 
 configdirs="doc testsuite"
 
+AC_ARG_ENABLE(multi-ice,
+[  --enable-multi-ice            Build the multi-ice-gdb-server],
+[case "${enableval}" in
+    yes ) enable_multi_ice="yes" ;;
+    no)  enable_multi_ice="no" ;;
+    *) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
+  esac
+])
+
+if test "${enable_multi_ice}" = "yes"; then
+  configdirs="${configdirs} multi-ice"
+fi
+
 dnl
 changequote(,)dnl
 
@@ -54,6 +67,7 @@ changequote(,)dnl
 dnl
 changequote([,])dnl
 
+AC_PROG_AWK
 AC_PROG_INSTALL
 AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
@@ -65,23 +79,47 @@ AC_TYPE_SIGNAL
 
 AC_HEADER_STDC
 
-AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h \
+AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h thread_db.h proc_service.h \
        memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
-       string.h sys/procfs.h sys/ptrace.h sys/reg.h \
+       string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
        term.h termio.h termios.h unistd.h wait.h sys/wait.h \
-       wchar.h wctype.h asm/debugreg.h sys/debugreg.h)
+       wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
+       time.h sys/ioctl.h)
 AC_HEADER_STAT
 
 AC_C_CONST
 
-AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
+AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
 AC_FUNC_ALLOCA
 
+dnl See if ptrace.h provides the PTRACE_GETXFPREGS request.
+dnl PTRACE_GETXFPREGS is a Cygnus invention, since we wrote our own
+dnl Linux kernel patch for SSE support.  That patch may or may not
+dnl actually make it into the official distribution.  If you find that
+dnl years have gone by since this configure test was added, and Linux
+dnl isn't using PTRACE_GETXFPREGS, that means that our patch didn't
+dnl make it, and you can delete this code.
+AC_MSG_CHECKING(for PTRACE_GETXFPREGS)
+AC_CACHE_VAL(gdb_cv_have_ptrace_getxfpregs,
+[AC_TRY_COMPILE([#include <sys/ptrace.h>],
+               [PTRACE_GETXFPREGS;],
+               [gdb_cv_have_ptrace_getxfpregs=yes],
+               [gdb_cv_have_ptrace_getxfpregs=no])])
+AC_MSG_RESULT($gdb_cv_have_ptrace_getxfpregs)
+if test $gdb_cv_have_ptrace_getxfpregs = yes; then
+  AC_DEFINE(HAVE_PTRACE_GETXFPREGS)
+fi
+
+AC_CHECK_LIB(socket, socketpair)
+AC_CHECK_FUNCS(socketpair)
+
+
 BFD_NEED_DECLARATION(malloc)
 BFD_NEED_DECLARATION(realloc)
 BFD_NEED_DECLARATION(free)
 BFD_NEED_DECLARATION(strerror)
 BFD_NEED_DECLARATION(strdup)
+BFD_NEED_DECLARATION(strstr)
 
 
 # The following save_state_t checkery is only necessary for HPUX 
@@ -106,7 +144,7 @@ AC_MSG_RESULT($gdb_cv_hpux_sswide)
 
 # If we are configured native on GNU/Linux, work around problems with
 # sys/procfs.h
-# Also detect which type of /proc is in use, such as for Unixware.
+# Also detect which type of /proc is in use, such as for Unixware or Solaris.
 
 if test "${target}" = "${host}"; then
   case "${host}" in
@@ -114,21 +152,16 @@ if test "${target}" = "${host}"; then
        AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
        AC_DEFINE(sys_quotactl)
        ;;
+  *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+      AC_DEFINE(NEW_PROC_API)
+      ;;
+  # FIXME: we would like to define NEW_PROC_API for all versions of
+  # Solaris from 2.6 on... but it isn't quite working yet.  Seems
+  # to work on sparc 2.6, so let's try it out there.
+  sparc-sun-solaris2.6)
+      AC_DEFINE(NEW_PROC_API)
+      ;;
   esac
-  AC_MSG_CHECKING(for directory proc entries)
-# The [gdb_host != sun4sol2] hack is because Solaris does provide the
-# multiple procfs files as of Solaris 2.6, but GDB can't use it right now.
-  if test "$ac_cv_header_sys_procfs_h" = yes -a "$gdb_host" != sun4sol2 \
-  -a -d /proc/$$ \
-  -a -f /proc/$$/ctl \
-  -a -f /proc/$$/as \
-  -a -f /proc/$$/map \
-  -a -f /proc/$$/status; then
-    AC_MSG_RESULT(yes)
-    AC_DEFINE(HAVE_MULTIPLE_PROC_FDS)
-  else
-    AC_MSG_RESULT(no)
-  fi
 fi
 
 if test "$ac_cv_header_sys_procfs_h" = yes; then
@@ -375,15 +408,26 @@ case "${enableval}" in
   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
         build_warnings="${t} ${build_warnings}";;
   *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac],[build_warnings=""])dnl
-
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting warning flags = $build_warnings" 6>&1
+fi
+WARN_CFLAGS=""
+WERROR_CFLAGS=""
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
 then
-   WARN_CFLAGS="${build_warnings}"
-else
-   WARN_CFLAGS=""
-fi
+  # Separate out the -Werror flag as some files just cannot be
+  # compiled with it enabled.
+  for w in ${build_warnings}; do
+    case $w in
+    -Werr*) WERROR_CFLAGS=-Werror ;;
+    *) WARN_CFLAGS="${WARN_CFLAGS} $w"
+    esac
+  done
+fi],[build_warnings=""])dnl
+
 AC_SUBST(WARN_CFLAGS)
+AC_SUBST(WERROR_CFLAGS)
 
 MMALLOC_CFLAGS=
 MMALLOC=
@@ -405,7 +449,23 @@ if test x$want_mmalloc = xtrue; then
    MMALLOC='../mmalloc/libmmalloc.a'
 fi
 
+
+# In the Cygwin environment, we need some additional flags.
+AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
+[AC_EGREP_CPP(lose, [
+#if defined (__CYGWIN__) || defined (__CYGWIN32__)
+lose
+#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
+
+DLLTOOL=${DLLTOOL-dlltool}
+WINDRES=${WINDRES-windres}
+AC_SUBST(DLLTOOL)
+AC_SUBST(WINDRES)
+
 dnl Figure out which term library to use.
+if test x$gdb_host = xgo32; then
+  TERM_LIB=
+else
 if test x$gdb_cv_os_cygwin = xyes; then
   TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
 else
@@ -422,11 +482,57 @@ else
     AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
   fi
 fi
+fi
 AC_SUBST(TERM_LIB)
 
+# libreadline needs libuser32.a in a cygwin environment
+WIN32LIBS=
+if test x$gdb_cv_os_cygwin = xyes; then
+    WIN32LIBS="-luser32"
+    case "${target}" in
+       *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
+       ;;
+    esac
+fi
+AC_SUBST(WIN32LIBS)
+
 
 AC_PATH_X
 
+# Unlike the sim directory, whether a simulator is linked is controlled by 
+# presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.  
+# This code just checks for a few cases where we'd like to ignore those
+# definitions, even when they're present in the '.mt' file.  These cases
+# are when --disable-sim is specified, or if the simulator directory is
+# not part of the soruce tree.
+#
+AC_ARG_ENABLE(sim,
+[  --enable-sim            Link gdb with simulator],
+[echo "enable_sim = $enable_sim";
+ echo "enableval = ${enableval}";
+ case "${enableval}" in
+  yes) ignore_sim=false ;;
+  no)  ignore_sim=true ;;
+  *)   ignore_sim=false ;;
+ esac],
+[ignore_sim=false])
+
+if test ! -d "${srcdir}/../sim"; then
+  ignore_sim=true
+fi
+
+if test "${ignore_sim}" = "true"; then
+    IGNORE_SIM="SIM="
+    IGNORE_SIM_OBS="SIM_OBS="
+else
+    IGNORE_SIM=""
+    IGNORE_SIM_OBS=""
+    AC_DEFINE(WITH_SIM)
+fi
+AC_SUBST(IGNORE_SIM)
+AC_SUBST(IGNORE_SIM_OBS)
+
 AC_SUBST(ENABLE_CFLAGS)
 
 AC_SUBST(CONFIG_OBS)
@@ -540,6 +646,13 @@ s/NAT_FILE[        ]*=[    ]*\([^  ]*\)/\1/p
 fi
 changequote([,])
 
+SUBDIRS="doc testsuite nlm"
+if test "${enable_multi_ice}" = "yes"; then
+  SUBDIRS="${SUBDIRS} multi-ice"
+fi
+
+AC_SUBST(SUBDIRS)
+
 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
 # corresponding links.  But we have to remove the xm.h files and tm.h
@@ -592,6 +705,7 @@ sed -e '/^TM_FILE[  ]*=/s,^TM_FILE[         ]*=[    ]*,&config/'"${gdb_target_cpu}"'/,
 mv -f Makefile.tmp Makefile
 changequote([,])dnl
 
+
 case x$CONFIG_HEADERS in
 xconfig.h:config.in)
 echo > stamp-h ;;
This page took 0.02891 seconds and 4 git commands to generate.