[Trunk] patch for GNU-friendly gengtype

Basile Starynkevitch basile@starynkevitch.net
Wed Jun 16 14:14:00 GMT 2010


Hello All

We need to improve gengtype, in particular so that it will (later) be
installed -eg as gcc-gengtype- and be usable in plugin mode without
requiring the entire GCC build or source tree.

See http://gcc.gnu.org/ml/gcc/2009-06/msg00416.html and more.

A first step is to make gengtype more GNU friendly, that is accept
--help & --version program arguments, and change its program
invocation conventions.

The attached patch to trunk revison 160833 seems to work (on
x86-64/Linux).

gcc/Changelog entry:
2010-06-16  Basile Starynkevitch  <basile@starynkevitch.net>

	* Makefile.in (gengtype.o): Pass version information strings as
	-DGENGTYPE_* preprocessor flags.

	* gengtype.c: include getopt.h.
	(do_dump): Added static variable moved from main.
	(inputlist): Ditto.
	(plugin_output_filename): Ditto.
	(gengtype_long_options): New variable.
	(print_usage): Added function.
	(bug_report_url, version_string, pkgversion_string): Added variable.
	(print_version): Added function.
	(parse_program_options): Added new function.
	(main): Changed program invocation convention. Call
	parse_program_options. Removed old argument parsing.

##############

I was not able to add a dependency to version.o for build/gengtype.o
(this caused circularities in make), so I pasted code from version.c
to gengtype.c

Comments are welcome.

Bootstrapped on x86-64/Linux (Ubuntu/Lucid).

Ok for trunk?

Cheers

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-gcctrunk-160833-gengtype.diff
Type: text/x-diff
Size: 8289 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100616/f6ce1d57/attachment.bin>


More information about the Gcc-patches mailing list