This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Use tm_defines to configure default scheduling model on PA


> I don't think it's the same as what you've done, but I'd really like
> to see some way of defining a gcc-build-time macro in config.gcc for 
> an arbitrary port.  So many of the port-specific files exist solely
> to redefine FOO that it would be nicer to get rid of the extra files
> (and therefore complexity) and instead have, say,
> 
> <in file common.h>
> #ifdef SOME_CONFIG_GCC_MACRO_FOR_TARGET_A
> # define FOO TARGET_A_FOO
> #else
> # define FOO OTHER_TARGETS_FOO
> #endif

I think effectively what I have done allows the above.  For example,
in the particular case I am trying to deal with, you get the following
additional code in config.h, hconfig.h and tconfig.h

#ifndef TARGET_SCHED_DEFAULT
# define TARGET_SCHED_DEFAULT "7100LC"
#endif

This selects a particular default in pa.c.

These defines are right at the beginning of the config files, before
the inclusion of any of the target machine headers.  The problem with
the xm_defines is that they come after the target mchine headers.  Thus,
the configure process can be used to define or not define
SOME_CONFIG_GCC_MACRO_FOR_TARGET_A, and thereby control defines in
other headers and code.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]