This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Separate target and host config files
#ifdef TARGET_LIBRARIES
...
#endif
around the things in auto-host.h that we want on the target. That
would also make the subset explicit but it might be hard to do make
that play nice with autoheader.
I know of no way to achieve that with autoheader-generated config.in.
There is new spiffy stuff in 2.5x I haven't looked at, though.
Something like this (untested) would do:
in acinclude.m4:
# GCC_TARGET_TEMPLATE(KEY)
# ------------------------
# Define KEY as a valid configure key on the target machine.
m4_define([GCC_TARGET_TEMPLATE]
[m4_define([GCC_TARGET_TEMPLATE($1)], [])])
# AH_TEMPLATE(KEY, DESCRIPTION)
# -----------------------------
# Issue an autoheader template for KEY, i.e., a comment composed of
# DESCRIPTION (properly wrapped), and then #undef KEY. Redefinition
# of the macro in autoheader.m4, to support definition of only a few
# keys while compiling target libraries.
m4_define([AH_TEMPLATE],
[AH_VERBATIM([$1],
m4_text_wrap([$2 */], [ ], [/* ])[
]m4_ifdef([GCC_TARGET_TEMPLATE($1)], [], [#ifndef TARGET_LIBRARIES])[
#undef $1
]m4_ifdef([GCC_TARGET_TEMPLATE($1)], [], [#endif]))])
in configure.ac:
GCC_TARGET_TEMPLATE([ENABLE_RUNTIME_CHECKING])
GCC_TARGET_TEMPLATE([HAVE_GAS_HIDDEN])
GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR])
Paolo