* sparc64-tdep.h (sparc64_regnum): Fix comment.
[deliverable/binutils-gdb.git] / gdb / configure.in
index 4b3c995747c58699784de635ea45c1627701e645..89940deb31ac8beff7695a3ba24bd1073f4c0c9b 100644 (file)
@@ -26,6 +26,7 @@ AC_CONFIG_HEADER(config.h:config.in)
 AM_MAINTAINER_MODE
 
 AC_PROG_CC
+AC_GNU_SOURCE
 AC_AIX
 AC_ISC_POSIX
 AM_PROG_CC_STDC
@@ -37,7 +38,7 @@ AC_CANONICAL_SYSTEM
 # doesn't support cross-compilation, but the one from Autoconf 2.5x
 # does.  Override RANLIB here (i.e. before running AC_PROG_RANLIB) to
 # deal with the lossage.  Note that CY_GNU_GETTEXT currently calls
-# AC_PROG_RANLIB.  This can be removed when we switch to Autoconf
+# AC_PROG_RANLIB.  This can be removed when we switch to Autoconf
 # 2.5x.
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
@@ -46,6 +47,15 @@ ALL_LINGUAS=
 CY_GNU_GETTEXT
 AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
 
+debugdir=${libdir}/debug
+        
+AC_ARG_WITH(separate-debug-dir,
+[  --with-separate-debug-dir=path   Look for global separate debug info in this path [LIBDIR/debug]],
+[debugdir="${withval}"])
+       
+AC_DEFINE_DIR(DEBUGDIR, debugdir,
+              [Global directory for separate debug files. ])
+#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
 
 dnl List of object files added by configure.
 
@@ -161,6 +171,68 @@ if test x"$enable_tui" = xyes; then
   fi
 fi
 
+# Enable gdbtk.
+AC_ARG_ENABLE(gdbtk,
+[  --enable-gdbtk          enable gdbtk graphical user interface (GUI)],
+  [case $enableval in
+    yes | no)
+      ;;
+    *)
+      AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
+  esac],
+  [if test -d $srcdir/gdbtk; then
+    enable_gdbtk=yes
+  else
+    enable_gdbtk=no
+  fi])
+# We unconditionally disable gdbtk tests on selected platforms.
+case $host_os in
+  go32* | windows*)
+    AC_MSG_WARN([gdbtk isn't supported on $host; disabling])
+    enable_gdbtk=no ;;
+esac
+
+# Profiling support.
+AC_ARG_ENABLE(profiling,
+[  --enable-profiling      enable profiling of GDB],
+  [case $enableval in
+    yes | no)
+      ;;
+    *)
+      AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
+  esac],
+ [enable_profiling=no])
+
+AC_CHECK_FUNCS(monstartup _mcleanup)
+AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
+[AC_TRY_LINK(
+[#include <stdlib.h>
+extern char _etext;
+],
+[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
+if test $ac_cv_var__etext = yes; then
+  AC_DEFINE(HAVE__ETEXT, 1,
+            [Define to 1 if your system has the _etext variable. ])
+fi
+if test "$enable_profiling" = yes ; then
+  if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
+    AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
+  fi
+  PROFILE_CFLAGS=-pg
+  OLD_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $PROFILE_CFLAGS"
+
+  AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
+    [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
+     ac_cv_cc_supports_pg=no)])
+
+  if test $ac_cv_cc_supports_pg = no; then
+    AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
+  fi
+
+  CFLAGS="$OLD_CFLAGS"
+fi
+
 # --------------------- #
 # Checks for programs.  #
 # --------------------- #
@@ -285,6 +357,12 @@ AC_CHECK_HEADERS(curses.h ncurses.h term.h)
 # unconditionally, so what's the point in checking these?
 AC_CHECK_HEADERS(ctype.h time.h)
 
+# ------------------------- #
+# Checks for declarations.  #
+# ------------------------- #
+
+gcc_AC_CHECK_DECLS(getopt)
+
 # ------------------ #
 # Checks for types.  #
 # ------------------ #
@@ -307,10 +385,12 @@ AC_FUNC_MMAP
 AC_FUNC_VFORK
 AC_CHECK_FUNCS(canonicalize_file_name realpath)
 AC_CHECK_FUNCS(poll)
+AC_CHECK_FUNCS(pread64)
 AC_CHECK_FUNCS(sbrk)
 AC_CHECK_FUNCS(setpgid setpgrp)
 AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
 AC_CHECK_FUNCS(socketpair)
+AC_CHECK_FUNCS(syscall)
 
 dnl AC_FUNC_SETPGRP does not work when cross compiling
 dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
@@ -438,6 +518,18 @@ if test $gdb_cv_have_pt_getxmmregs = yes; then
   AC_DEFINE(HAVE_PT_GETXMMREGS)
 fi
 
+# See if stdint.h provides the uintptr_t type.
+# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
+AC_CACHE_CHECK([for uintptr_t in stdint.h], gdb_cv_have_uintptr_t,
+  [AC_TRY_COMPILE(
+    [#include <stdint.h>],
+    [uintptr_t foo = 0;],
+    gdb_cv_have_uintptr_t=yes,
+    gdb_cv_have_uintptr_t=no)])
+AC_MSG_RESULT($gdb_cv_have_uintptr_t)
+if test $gdb_cv_have_uintptr_t = yes; then
+  AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.])
+fi
 
 BFD_NEED_DECLARATION(malloc)
 BFD_NEED_DECLARATION(realloc)
@@ -826,31 +918,65 @@ if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
             [Define if <thread_db.h> has the TD_NOTALLOC error code.])
 fi
 
-dnl linux-proc.c wants to use pread64, which may require special CFLAGS
-dnl -D_BSD_SOURCE is normally assumed but we have to specify it because of
-dnl -D_XOPEN_SOURCE=500.
-if test $host = $target; then
-  case $target in
-    *-linux*)
-      save_CFLAGS=$CFLAGS
-      CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
-      AC_TRY_LINK([#include <unistd.h>],
-                 [pread64 (0, NULL, 0, 0);],
-                 [ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
-                  AC_DEFINE(HAVE_PREAD64)], [])
-      CFLAGS=$save_CFLAGS
-      ;;
-  esac
+dnl See if we have a sys/syscall header file that has __NR_tkill.
+if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
+   AC_CACHE_CHECK([whether <sys/syscall.h> has __NR_tkill],
+                  gdb_cv_sys_syscall_h_has_tkill,
+     AC_TRY_COMPILE(
+       [#include <sys/syscall.h>],
+       [int i = __NR_tkill;],
+       gdb_cv_sys_syscall_h_has_tkill=yes,
+       gdb_cv_sys_syscall_h_has_tkill=no
+     )
+   )
+fi
+dnl See if we can issue tkill syscall.
+if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then
+  AC_DEFINE(HAVE_TKILL_SYSCALL, 1,
+            [Define if we can use the tkill syscall.])
 fi
 
 dnl Handle optional features that can be enabled.
 
+AC_ARG_WITH(sysroot,
+[  --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+
+ if test "x$exec_prefix" = xNONE; then
+  if test "x$prefix" = xNONE; then
+   test_prefix=/usr/local
+  else
+   test_prefix=$prefix
+  fi
+ else
+  test_prefix=$exec_prefix
+ fi
+ case ${TARGET_SYSTEM_ROOT} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+   t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
+   TARGET_SYSTEM_ROOT_DEFINE="$t"
+   ;;
+ esac
+], [
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
+])
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
 # NOTE: Don't add -Wall or -Wunused, they both include
 # -Wunused-parameter which reports bogus warnings.
 # NOTE: If you add to this list, remember to update
 # gdb/doc/gdbint.texinfo.
 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
+-Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral"
 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
 # -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
 # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
@@ -959,38 +1085,6 @@ GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
 AC_SUBST(LIBGUI)
 AC_SUBST(GUI_CFLAGS_X)
 
-AC_ARG_ENABLE(gdbtk,
-[  --enable-gdbtk          Enable GDBTK GUI front end],
-[case "${enableval}" in
-    yes)
-       case "$host" in
-       *go32*)
-           AC_MSG_WARN([GDB does not support GDBtk on host ${host}.  GDBtk will be disabled.])
-           enable_gdbtk=no ;;
-       *windows*)
-           AC_MSG_WARN([GDB does not support GDBtk on host ${host}.  GDBtk will be disabled.])
-           enable_gdbtk=no ;;
-       *)
-           enable_gdbtk=yes ;;
-       esac ;;
-    no)
-       enable_gdbtk=no  ;;
-    *)
-       AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
-esac],
-[
-# Default is on for everything but go32 and Cygwin
-case "$host" in
-    *go32* | *windows*)
-       ;;
-    *)
-       if test -d "${srcdir}/gdbtk" ; then
-            enable_gdbtk=yes
-       fi
-       ;;
-esac
-])
-
 WIN32LDAPP=
 AC_SUBST(WIN32LIBS)
 AC_SUBST(WIN32LDAPP)
@@ -1158,6 +1252,7 @@ AC_SUBST(IGNORE_SIM)
 AC_SUBST(IGNORE_SIM_OBS)
 
 AC_SUBST(ENABLE_CFLAGS)
+AC_SUBST(PROFILE_CFLAGS)
 
 AC_SUBST(CONFIG_OBS)
 AC_SUBST(CONFIG_LIB_OBS)
@@ -1169,67 +1264,6 @@ AC_SUBST(CONFIG_CLEAN)
 AC_SUBST(CONFIG_INSTALL)
 AC_SUBST(CONFIG_UNINSTALL)
 
-# Begin stuff to support --enable-shared
-AC_ARG_ENABLE(shared,
-[  --enable-shared         Use shared libraries],
-[case "${enableval}" in
-  yes) shared=true ;;
-  no)  shared=false ;;
-  *) shared=true ;;
-esac])dnl
-
-HLDFLAGS=
-HLDENV=
-# If we have shared libraries, try to set rpath reasonably.
-if test "${shared}" = "true"; then
-  case "${host}" in
-  *-*-hpux*)
-    HLDFLAGS='-Wl,+s,+b,$(libdir)'
-    ;;
-  *-*-irix5* | *-*-irix6*)
-    HLDFLAGS='-Wl,-rpath,$(libdir)'
-    ;;
-  *-*-linux*aout*)
-    ;;
-  *-*-linux* | *-pc-linux-gnu*)
-    HLDFLAGS='-Wl,-rpath,$(libdir)'
-    ;;
-  *-*-solaris*)
-    HLDFLAGS='-R $(libdir)'
-    ;;
-  *-*-sysv4*)
-    HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
-    ;;
-  esac
-fi
-
-# On SunOS, if the linker supports the -rpath option, use it to
-# prevent ../bfd and ../opcodes from being included in the run time
-# search path.
-case "${host}" in
-  *-*-sunos*)
-    echo 'main () { }' > conftest.c
-    ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
-    if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
-      :
-    elif grep 'No such file' conftest.t >/dev/null 2>&1; then
-      :
-    elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
-      :
-    elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
-      :
-    elif test "${shared}" = "true"; then
-      HLDFLAGS='-Wl,-rpath=$(libdir)'
-    else
-      HLDFLAGS='-Wl,-rpath='
-    fi
-    rm -f conftest.t conftest.c conftest
-    ;;
-esac
-AC_SUBST(HLDFLAGS)
-AC_SUBST(HLDENV)
-# End stuff to support --enable-shared
-
 # target_subdir is used by the testsuite to find the target libraries.
 target_subdir=
 if test "${host}" != "${target}"; then
@@ -1310,6 +1344,11 @@ case "${GDB_MULTI_ARCH}" in
     *)  AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
 esac
 
+if test x"${gdb_osabi}" != x ; then
+    AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
+                      [Define to the default OS ABI for this configuration.])
+fi
+
 # Enable multi-ice-gdb-server.
 AC_ARG_ENABLE(multi-ice,
 [  --enable-multi-ice      build the multi-ice-gdb-server],
@@ -1334,8 +1373,6 @@ if test "x$target" = "x$host"; then
 fi
 
 AC_CONFIG_SUBDIRS($configdirs)
-SUBDIRS=$subdirs
-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 link to an empty
This page took 0.038095 seconds and 4 git commands to generate.