howto make define seen in all files?
Subsystems (5)
Hi, I want to provide a general defined macro like __MY__TIME__ (for determinictic build) and that symbol should be seen as #define or -D... to gcc in all files;
Value of __MY_TIME__ is determined once, at start of build.
I was using file scripts/mkcompile_h as in the attached .diff patch, worked in 3.2.48 but in 3.2.50 files do not see the value _MY_BUILD__TIME__
arch/x86/math-emu/errors.c +1 -1
@@ -332,7 +332,7 @@ asmlinkage void FPU_exception(int n)if ((~control_word & n & CW_Exceptions) || (n ==EX_INTERNAL )) {#ifdef PRINT_MESSAGES /* My message from the sponsor */ -printk (FPU_VERSION " " __DATE__" (C) W. Metzenthen.\n" ); +printk (FPU_VERSION " " _MY_BUILD__DATE__" (C) W. Metzenthen.\n" );#endif /* PRINT_MESSAGES */ /* Get a name string for error reporting */
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +1 -1
@@ -43,7 +43,7 @@ int brcmf_msg_level;#ifdef BCMDBG static const char brcmf_version[] ="Dongle Host Driver, version " BRCMF_VERSION_STR "\nCompiled on " - __DATE__" at " __TIME__; + _MY_BUILD__TIME__" at " _MY_BUILD__DATE__;#else static const char brcmf_version[] ="Dongle Host Driver, version " BRCMF_VERSION_STR ;
drivers/staging/rts5139/rts51x_scsi.c +1 -1
@@ -2067,7 +2067,7 @@ int proc_info(struct Scsi_Host *host, chSPRINTF (" Vendor: Realtek Corp.\n" );SPRINTF (" Product: RTS51xx USB Card Reader\n" );SPRINTF (" Version: %s\n" ,DRIVER_VERSION ); -SPRINTF (" Build: %s\n" , __TIME__); +SPRINTF (" Build: %s\n" , _MY_BUILD__TIME__);/* * Calculate start of next buffer, and return value.
drivers/staging/wlags49_h2/wl_version.h +1 -1
@@ -130,7 +130,7 @@ err: define bus type;#endif /* BUS_XXX */ #ifdef DBG -#define MODULE_DATE __DATE__ " " __TIME__ +#define MODULE_DATE _MY_BUILD__DATE__ " " _MY_BUILD__TIME__#else #define MODULE_DATE "07/18/2004 13:30:00"#endif // DBG
fs/ubifs/super.c +1 -1
@@ -1435,7 +1435,7 @@ static int mount_ubifs(struct ubifs_infoubifs_msg ("reserved for root: %llu bytes (%llu KiB)" , c->report_rp_size, c->report_rp_size >>10 ); -dbg_msg ("compiled on: " __DATE__" at " __TIME__); +dbg_msg ("compiled on: " _MY_BUILD__DATE__" at " _MY_BUILD__TIME__);dbg_msg ("min. I/O unit size: %d bytes" , c->min_io_size);dbg_msg ("max. write size: %d bytes" , c->max_write_size); dbg_msg("LEB size: %d bytes (%d KiB)",
scripts/mkcompile_h +5 -0
@@ -42,6 +42,11 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; the else TIMESTAMP=$KBUILD_BUILD_TIMESTAMP fi + +# create _MY_BUILD__TIME__ instead __TIME__ (and DATE) deterministic build +_MY_BUILD__TIME__=`date -d "$TIMESTAMP" "+%H:%M:%S"` +_MY_BUILD__DATE__=`date -d "$TIMESTAMP" "+%b %d %Y"` + if test -z "$KBUILD_BUILD_USER"; then LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') else
Dne 18.8.2013 05:56, [email protected] napsal(a):
Quoted 8 lines
Hi, I want to provide a general defined macro like
__MY__TIME__(for determinictic build) and that symbol should be seen as #define or -D... to gcc in all files;Value of
__MY_TIME__is determined once, at start of build.I was using file
scripts/mkcompile_has in the attached .diff patch, worked in 3.2.48 but in 3.2.50 files do not see the value _MY_BUILD__TIME__
Just drop the remaining occurrences of __TIME__ and __DATA__, it's not worth the hassle to define new macros.
Michal