[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: STABS
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2007-11-29 12:19:24
Message-ID: 474EAE4C.9070807 () ludd ! ltu ! se
[Download RAW message or body]

Gregory McGarry wrote:
> Currently the pre-processor macro STABS is defined as part of the 
> target OS, and doesn't work well for cross-compiling.
>
> Is the variable meant to signal the target OS supports stabs, or that 
> the host OS has <stab.h>, or just a general option to remove the 
> feature from the compiler?
The only thinking was to be able to debug the compiled binaries :-)  I 
assume that another format is
preferred in the long term for most targets, stabs is just a hack.

But you're right in that it should not be dependent of this header file 
in the host system.  I think the
best is to include the stab defines into the stabs.c file to avoid the 
use of stab.h.  There aren't too many
of them needed. 

-- Ragge

> The following fragment adds --disable-stabs.  The default is to always 
> define STABS, unless <stab.h> doesn't exist.
>
>
> +# Whether the host has <stab.h> and whether the user wants it disabled.
> +AC_ARG_ENABLE(stabs,
> +       AC_HELP_STRING([--disable-stabs],
> +               [Disable stabs debugging information.]),
> +       enable_stabs = $enableval,
> +       enable_stabs = yes)
> +AC_CHECK_HEADERS([stab.h],have_stabs=yes,have_stabs=no)
> +if test "X$enable_stabs" == "Xyes"; then
> +       if test "X$have_stabs" != "Xyes"; then
> +               AC_MSG_ERROR([Cannot find <stab.h>. \
> +                       Try using --disable-stabs])
> +       else
> +               AC_DEFINE(STABS, [], [Define to 1 if you want stabs \
> +                       debugging information])
> +       fi
> +fi
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic