This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch] Allow options.[ch] to be possibly regenerated after reconfigure--enable-languages=xxx
- From: Kelley Cook <kcook34 at ford dot com>
- To: gcc-patches at gcc dot gnu dot org, Neil Booth <neil at daikokuya dot co dot uk>
- Date: Tue, 08 Jul 2003 15:01:21 -0400
- Subject: [Patch] Allow options.[ch] to be possibly regenerated after reconfigure--enable-languages=xxx
- Hop-count: 1
- Reply-to: Kelley Cook <KelleyCook at wideopenwest dot com>
Neil et al.,
When testing GCC, I occasionally, for time purposes, will only bootstrap
with --enable-languages=c until I'm sure the modifications will work and
then afterwards reconfigure with --enable-languages={whatever} && make
to get the rest of the languages and libraries built.
This possibilty stopped working with your option consolidation, since
options.[ch] will not get rebuilt if the number of front-ends it is
depending on is modified. f77/top.c, for example, will crash since none
of the FOPTS will be in options.h
The small attached patch adds that support back in.
Two notes:
a) I put options.[ch] into a move-if-change form, so options.o will only
be rebuilt if the reconfigure changes the enabled-languages.
b) Because of a) I ended up hardcoding "options.h" in the generated
"options.c" otherwise it was being created with '#include
"tmp-options.h"' This may not be palatable to you in which case I am
open to other suggestions (or you can, of course, modify the patch
yourself).
Tested under i686-pc-cygwin by
configure --enable-languages=c ...
make bootstrap
configure --enable-languages=c,c++,objc,f77,java ...
make
which works as expected.
For good measure I then reran the last two steps and the build process,
as designed, does not update the timestamps of options.[cho].
FWIW, I don't yet have CVSWrite access, though its in process..
Kelley Cook
2003-07-08 Kelley Cook <kelleycook@wideopenwest.com>
* Makefile.in (options.h): Add in timestamped file s-optssh.
* opts.sh: Hardcode "options.h" in generated options.c.
*** gcc/Makefile.in.orig Tue Jul 8 11:44:38 2003
--- gcc/Makefile.in Tue Jul 8 11:54:31 2003
***************
*** 1416,1424 ****
options.c: $(lang_opt_files) $(srcdir)/opts.sh options.h
! options.h: $(lang_opt_files) $(srcdir)/opts.sh
! AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh options.c options.h \
$(lang_opt_files)
dumpvers: dumpvers.c
--- 1416,1428 ----
options.c: $(lang_opt_files) $(srcdir)/opts.sh options.h
! options.h: s-optssh
! s-optssh: $(lang_opt_files) $(srcdir)/opts.sh Makefile
! AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh tmp-options.c tmp-options.h \
$(lang_opt_files)
+ $(SHELL) $(srcdir)/move-if-change tmp-options.h options.h
+ $(SHELL) $(srcdir)/move-if-change tmp-options.c options.c
+ $(STAMP) s-optssh
dumpvers: dumpvers.c
*** gcc/opts.sh.orig Tue Jul 8 12:03:40 2003
--- gcc/opts.sh Tue Jul 8 12:06:12 2003
***************
*** 86,92 ****
comma = ","
print "/* This file is auto-generated by opts.sh. */\n" > c_file
! print "#include \"" h_file "\"" >> c_file
print "#include \"opts.h\"\n" >> c_file
print "const char * const lang_names[] =\n{" >> c_file
--- 86,92 ----
comma = ","
print "/* This file is auto-generated by opts.sh. */\n" > c_file
! print "#include \"options.h\"" >> c_file
print "#include \"opts.h\"\n" >> c_file
print "const char * const lang_names[] =\n{" >> c_file