Move GDB_MULTI_ARCH selection to configure*. Makes tm.h optional.

This commit is contained in:
Andrew Cagney 2000-07-27 04:01:24 +00:00
parent d6e83f5f72
commit 6166d547d8
9 changed files with 285 additions and 179 deletions

View file

@ -1,3 +1,19 @@
Wed Jul 26 17:22:53 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (GDB_MULTI_ARCH): Define from configure.tgt
or makefile fragment.
* acconfig.h (GDB_MULTI_ARCH): Add.
* config.in, configure: Regenerate.
* gdbarch.sh (GDB_MULTI_ARCH): Delete definition, moved to
configure.in and defs.h. Use GDB_MULTI_ARCH_TM,
GDB_MULTI_ARCH_PARTIAL and GDB_MULTI_ARCH_PURE in tests.
* gdbarch.h, gdbarch.c: Regenerate.
* defs.h (GDB_MULTI_ARCH_PARTIAL, GDB_MULTI_ARCH_TM, ,
GDB_MULTI_ARCH_PURE): Define. Only include "tm.h" when the target
is less than pure multi-arch.
2000-07-26 Jimmy Guo <guo@cup.hp.com>
* config/convex/tm-convex.h: Remove stray control characters.

View file

@ -121,3 +121,7 @@
/* BFD's default target vector. */
#undef DEFAULT_BFD_VEC
/* Multi-arch enabled. */
#undef GDB_MULTI_ARCH

View file

@ -141,6 +141,9 @@
/* BFD's default target vector. */
#undef DEFAULT_BFD_VEC
/* Multi-arch enabled. */
#undef GDB_MULTI_ARCH
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT

52
gdb/configure vendored
View file

@ -7482,6 +7482,10 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
GDB_MULTI_ARCH=`sed -n '
s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
' ${target_makefile_frag}`
# these really aren't orthogonal true/false values of the same condition,
# but shells are slow enough that I like to reuse the test conditions
# whenever possible
@ -7495,6 +7499,36 @@ s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
fi
# New targets should just set gdb_multi_arch=yes in configure.tgt.
# Old targets being converted can either do that or set GDB_MULTI_ARCH
# in the target specific makefile frag. Eventually gdb_multi_arch=yes
# will be the default.
if test x"${GDB_MULTI_ARCH}" = x ; then
case "${gdb_multi_arch}" in
yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
no ) GDB_MULTI_ARCH=0 ;;
0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
esac
fi
if test x"${GDB_MULTI_ARCH}" != x ; then
cat >> confdefs.h <<EOF
#define GDB_MULTI_ARCH ${GDB_MULTI_ARCH}
EOF
fi
# Warn the user when they use an old pratice
case "${GDB_MULTI_ARCH}" in
"" ) ;;
0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
echo "configure: warning: "GDB: Target is not pure multi-arch"" 1>&2 ;;
GDB_MULTI_ARCH_PURE )
if test x"${targetfile}" != x ; then
echo "configure: warning: "GDB: Ingoring TM_FILE in ${target_makefile_frag}"" 1>&2
fi ;;
*) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };;
esac
SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
@ -7530,7 +7564,7 @@ files="${files} config/nm-empty.h"
links="${links} nm.h"
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:7534: checking whether ln -s works" >&5
echo "configure:7568: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7554,12 +7588,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:7558: checking for Cygwin environment" >&5
echo "configure:7592: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7563 "configure"
#line 7597 "configure"
#include "confdefs.h"
int main() {
@ -7570,7 +7604,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:7574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:7608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@ -7587,19 +7621,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:7591: checking for mingw32 environment" >&5
echo "configure:7625: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7596 "configure"
#line 7630 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:7603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:7637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@ -7618,7 +7652,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:7622: checking for executable suffix" >&5
echo "configure:7656: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -7628,7 +7662,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
if { (eval echo configure:7632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:7666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;

View file

@ -1003,6 +1003,10 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
GDB_MULTI_ARCH=`sed -n '
s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
' ${target_makefile_frag}`
# these really aren't orthogonal true/false values of the same condition,
# but shells are slow enough that I like to reuse the test conditions
# whenever possible
@ -1016,6 +1020,33 @@ s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
fi
changequote([,])
# New targets should just set gdb_multi_arch=yes in configure.tgt.
# Old targets being converted can either do that or set GDB_MULTI_ARCH
# in the target specific makefile frag. Eventually gdb_multi_arch=yes
# will be the default.
if test x"${GDB_MULTI_ARCH}" = x ; then
case "${gdb_multi_arch}" in
yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
no ) GDB_MULTI_ARCH=0 ;;
0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
esac
fi
if test x"${GDB_MULTI_ARCH}" != x ; then
AC_DEFINE_UNQUOTED(GDB_MULTI_ARCH, ${GDB_MULTI_ARCH})
fi
# Warn the user when they use an old pratice
case "${GDB_MULTI_ARCH}" in
"" ) ;;
0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
AC_MSG_WARN("GDB: Target is not pure multi-arch") ;;
GDB_MULTI_ARCH_PURE )
if test x"${targetfile}" != x ; then
AC_MSG_WARN("GDB: Ingoring TM_FILE in ${target_makefile_frag}")
fi ;;
*) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
esac
SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"

View file

@ -65,6 +65,26 @@
/* For BFD64 and bfd_vma. */
#include "bfd.h"
/* The target is partially multi-arched. Both "tm.h" and the
multi-arch vector provide definitions. "tm.h" normally overrides
the multi-arch vector (but there are a few exceptions). */
#define GDB_MULTI_ARCH_PARTIAL 1
/* The target is multi-arched. The MULTI-ARCH vector provides all
definitions. "tm.h" is included and may provide definitions of
non- multi-arch macros.. */
#define GDB_MULTI_ARCH_TM 2
/* The target is pure multi-arch. The MULTI-ARCH vector provides all
definitions. "tm.h" is NOT included. */
#define GDB_MULTI_ARCH_PURE 3
/* An address in the program being debugged. Host byte order. Rather
than duplicate all the logic in BFD which figures out what type
this is (long, long long, etc.) and whether it needs to be 64
@ -703,7 +723,21 @@ enum val_prettyprint
/* Target machine definition. This will be a symlink to one of the
tm-*.h files, built by the `configure' script. */
#if (GDB_MULTI_ARCH < GDB_MULTI_ARCH_PURE)
#include "tm.h"
#endif
/* GDB_MULTI_ARCH is normally set by configure.in using information
from configure.tgt or the config/%/%.mt Makefile fragment. Since
some targets have defined it in their tm.h file, don't provide a
default until after "tm.h" has been included. (In the above #if,
GDB_MULTI_ARCH will be interpreted as zero if it is not
defined). */
#ifndef GDB_MULTI_ARCH
#define GDB_MULTI_ARCH 0
#endif
/* If the xm.h file did not define the mode string used to open the
files, assume that binary files are opened the same way as text

View file

@ -430,7 +430,7 @@ static void
verify_gdbarch (struct gdbarch *gdbarch)
{
/* Only perform sanity checks on a multi-arch target. */
if (GDB_MULTI_ARCH <= 0)
if (!GDB_MULTI_ARCH)
return;
/* fundamental */
if (gdbarch->byte_order == 0)

File diff suppressed because it is too large Load diff

View file

@ -498,17 +498,9 @@ struct frame_info;
struct value;
#ifndef GDB_MULTI_ARCH
#define GDB_MULTI_ARCH 0
#endif
extern struct gdbarch *current_gdbarch;
/* See gdb/doc/gdbint.texi for a discussion of the GDB_MULTI_ARCH
macro */
/* If any of the following are defined, the target wasn't correctly
converted. */
@ -537,7 +529,7 @@ do
echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);"
echo "/* set_gdbarch_${function}() - not applicable - pre-initialized. */"
echo "#if GDB_MULTI_ARCH"
echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
echo "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})"
echo "#define ${macro} (gdbarch_${function} (current_gdbarch))"
echo "#endif"
echo "#endif"
@ -555,17 +547,17 @@ do
echo ""
echo "#if defined (${macro})"
echo "/* Legacy for systems yet to multi-arch ${macro} */"
# echo "#if (GDB_MULTI_ARCH <= 2) && defined (${macro})"
# echo "#if (GDB_MULTI_ARCH <= GDB_MULTI_ARCH_PARTIAL) && defined (${macro})"
echo "#define ${macro}_P() (1)"
echo "#endif"
echo ""
echo "/* Default predicate for non- multi-arch targets. */"
echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro}_P)"
echo "#if (!GDB_MULTI_ARCH) && !defined (${macro}_P)"
echo "#define ${macro}_P() (0)"
echo "#endif"
echo ""
echo "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);"
echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro}_P)"
echo "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro}_P)"
echo "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))"
echo "#endif"
fi
@ -575,7 +567,7 @@ do
then
echo ""
echo "/* Default (value) for non- multi-arch platforms. */"
echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})"
echo "#if (!GDB_MULTI_ARCH) && !defined (${macro})"
echo "#define ${macro} (${fallbackdefault})" \
| sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g'
echo "#endif"
@ -584,7 +576,7 @@ do
echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);"
echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});"
echo "#if GDB_MULTI_ARCH"
echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
echo "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})"
echo "#define ${macro} (gdbarch_${function} (current_gdbarch))"
echo "#endif"
echo "#endif"
@ -595,7 +587,7 @@ do
then
echo ""
echo "/* Default (function) for non- multi-arch platforms. */"
echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})"
echo "#if (!GDB_MULTI_ARCH) && !defined (${macro})"
if [ "${fallbackdefault}" = "0" ]
then
echo "#define ${macro}(${actual}) (internal_error (\"${macro}\"), 0)"
@ -616,7 +608,7 @@ do
fi
echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});"
echo "#if GDB_MULTI_ARCH"
echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
echo "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})"
if [ "${actual}" = "" ]
then
echo "#define ${macro}() (gdbarch_${function} (current_gdbarch))"
@ -1171,7 +1163,7 @@ static void
verify_gdbarch (struct gdbarch *gdbarch)
{
/* Only perform sanity checks on a multi-arch target. */
if (GDB_MULTI_ARCH <= 0)
if (!GDB_MULTI_ARCH)
return;
/* fundamental */
if (gdbarch->byte_order == 0)