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]

[Ada] Support for recording bind time environment info


This change adds support for recording a set of key=value pairs
at the time an application is built (or more precisely at bind time),
and making this information available at run time. Typical use case
is to record a build timestamp:

$ gnatmake record_build_time -bargs -VBUILD_TIME="`LANG=C date`"
gcc -c record_build_time.adb
gnatbind -VBUILD_TIME=Tue Oct 20 05:51:21 EDT 2015 -x record_build_time.ali
gnatlink record_build_time.ali

$ ./record_build_time 
BT=<<Tue Oct 20 05:51:21 EDT 2015>>

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-10-20  Thomas Quinot  <quinot@adacore.com>

	* Makefile.rtl: add the following...
	* g-binenv.ads, g-binenv.adb: New unit providing runtime access
	to bind time captured values ("bind environment")
	* init.c, s-init.ads: declare new global variable
	__gl_bind_env_addr.
	* bindgen.ads, bindgen.adb (Set_Bind_Env): record a bind
	environment key=value pair.
	(Gen_Bind_Env_String): helper to produce the bind environment data
	called  in the binder generated file.
	(Gen_Output_File_Ada): Call the above (Gen_Adainit): Set
	__gl_bind_env_addr accordingly.
	* switch-b.adb: Support for command line switch -V (user interface
	to set a build environment key=value pair)
	* bindusg.adb: Document the above

Attachment: difs
Description: Text document


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