* README: Mention gdbserver/README.
[deliverable/binutils-gdb.git] / gdb / configure.ac
index c451781022f4b444c9b04e8bda514dd1ba1f5686..39246aab8250a36501c351604e7eaf19c89f3cbb 100644 (file)
@@ -91,6 +91,25 @@ esac
 
 AC_CONFIG_SUBDIRS(doc testsuite)
 
+# Check whether to support alternative target configurations
+AC_ARG_ENABLE(targets,
+[  --enable-targets        alternative target configurations],
+[case "${enableval}" in
+  yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
+            ;;
+  no)       enable_targets= ;;
+  *)        enable_targets=$enableval ;;
+esac])
+
+# Check whether to enable 64-bit support on 32-bit hosts
+AC_ARG_ENABLE(64-bit-bfd,
+[  --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)],
+[case "${enableval}" in
+  yes)  want64=true  ;;
+  no)   want64=false ;;
+  *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
+esac],[want64=false])dnl
+
 # Provide defaults for some variables set by the per-host and per-target
 # configuration.
 gdb_host_obs=posix-hdep.o
@@ -103,7 +122,74 @@ fi
 
 . $srcdir/configure.host
 
-. $srcdir/configure.tgt
+# Accumulate some settings from configure.tgt over all enabled targets
+
+TARGET_OBS=
+all_targets=
+
+for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
+do
+  if test "$targ_alias" = "all"; then
+    all_targets=true
+  else
+    # Canonicalize the secondary target names.
+    result=`$ac_config_sub $targ_alias 2>/dev/null`
+    if test -n "$result"; then
+        targ=$result
+    else
+        targ=$targ_alias
+    fi
+
+    . ${srcdir}/configure.tgt
+
+    # Target-specific object files
+    for i in ${gdb_target_obs}; do
+        case " $TARGET_OBS " in
+        *" ${i} "*) ;;
+        *)
+          TARGET_OBS="$TARGET_OBS ${i}"
+          ;;
+        esac
+    done
+
+    # Check whether this target needs 64-bit CORE_ADDR
+    if test x${want64} = xfalse; then
+      . ${srcdir}/../bfd/config.bfd
+    fi
+  fi
+done
+
+if test x${all_targets} = xtrue; then
+
+  # We want all 64-bit targets if we either:
+  #  - run on a 64-bit host  or
+  #  - already require 64-bit support for some other target  or
+  #  - the --enable-64-bit-bfd option was supplied
+  # Otherwise we only support all 32-bit targets.
+  #
+  # NOTE: This test must be in sync with the corresponding
+  #       tests in BFD!
+
+  if test x${want64} = xfalse; then
+    AC_CHECK_SIZEOF(long)
+    if test "x${ac_cv_sizeof_long}" = "x8"; then
+      want64=true
+    fi
+  fi
+  if test x${want64} = xtrue; then
+    TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
+  else
+    TARGET_OBS='$(ALL_TARGET_OBS)'
+  fi
+fi
+
+AC_SUBST(TARGET_OBS)
+
+# For other settings, only the main target counts.
+gdb_sim=
+gdb_osabi=
+build_gdbserver=
+targ=$target; . ${srcdir}/configure.tgt
 
 # Fetch the default architecture and default target vector from BFD.
 targ=$target; . $srcdir/../bfd/config.bfd
@@ -554,7 +640,7 @@ AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret,
 AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [
 for gdb_arg1 in 'int' 'long'; do
  for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long'; do
+  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
    for gdb_arg4 in 'int' 'long'; do
      AC_TRY_COMPILE($gdb_ptrace_headers, [
 extern $gdb_cv_func_ptrace_ret
@@ -742,7 +828,7 @@ if test "${target}" = "${host}"; then
       [Define if you want to use new multi-fd /proc interface
        (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
       ;;
-  *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]])
+  *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]]*)
       AC_DEFINE(NEW_PROC_API, 1,
       [Define if you want to use new multi-fd /proc interface
        (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
@@ -1557,14 +1643,7 @@ else
   host_makefile_frag=/dev/null
 fi
 
-target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
-if test ! -f ${target_makefile_frag}; then
-  AC_MSG_ERROR("*** Gdb does not support target ${target}")
-fi
-frags="$frags $target_makefile_frag"
-
 AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(frags)
 
 changequote(,)dnl
@@ -1661,7 +1740,6 @@ esac
 ],
 [
 gdb_host_cpu=$gdb_host_cpu
-gdb_target_cpu=$gdb_target_cpu
 nativefile=$nativefile
 ])
 
This page took 0.024992 seconds and 4 git commands to generate.