Robert Cragie wrote:
I did try:
CFLAGS_FOR_TARGET += -mopt1 -mopt2
in the t-default Makefile segment
I really meaned customizing the main '$BUILD/Makefile', not customizing
the '$BUILD/gcc/Makefile' !
The latter controls only what happens in the 'gcc' subdirectory when
building there, meanwhile the main
one should control all the stuff produced for the $target. The
CFLAGS_FOR_TARGET would be
expected to go into the '$BUILD/gcc/Makefile' and all those
'$BUILD/gcc/libgcc/...' Makefiles, so every
'libgcc.a' and everything being built into the '$BUILD/$target/...'
would be compiled with these options.
Putting this into environment during configure could work, but if not
then manually editing this into the
(by configure) produced main 'Makefile', is the sure way... Things like
'AR_FOR_TARGET' sometimes
went from environment to the Makefile but maybe not any more :(
Hmmm, the '$SRC/config' may be looked for $host and $target specific
'custom' options during 'configure',
the 'mt-$target' files there could be taken into those Makefiles but not
automatically... If looking at the
main 'configure' script, there are select cases like :
----------------- clip ------------------------------
case "${target}" in
i[3456789]86-*-netware*)
target_makefile_frag="config/mt-netware"
;;
powerpc-*-netware*)
target_makefile_frag="config/mt-netware"
;;
*-*-linux*)
target_makefile_frag="config/mt-linux"
;;
*-*-aix4.[3456789]* | *-*-aix[56789].*)
# nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
# commands to handle both 32-bit and 64-bit objects. These flags are
# harmless if we're using GNU nm or ar.
extra_arflags_for_target=" -X32_64"
extra_nmflags_for_target=" -B -X32_64"
;;
*-*-darwin*)
----------------- clip ------------------------------
So putting things into some "target specific Makefile-fragment" and
adding this
target "case" among the existing in the main 'configure' could be one
way more
to do the job...