Mailinglist Archive: opensuse-buildservice (327 mails)

< Previous Next >
Re: [opensuse-buildservice] Feature request: redefine __DATE__ and __TIME__ macros
  • From: Adam Mizerski <adam@xxxxxxxxxxx>
  • Date: Tue, 05 Apr 2011 09:47:02 +0200
  • Message-id: <1301989622.2725.2.camel@etam-laptop.rodzinka>
Dnia 2011-04-05, wto o godzinie 09:35 +0200, Cristian Morales Vega
2011/4/5 Michal Vyskocil <mvyskocil@xxxxxxx>:

during a build of openjdk I got the following error

java-1_6_0-openjdk.x86_64: W: file-contains-date-and-time
Your file uses __DATE and __TIME__ this causes the package to rebuild
not needed

I assume the correct fix would be redefine them by the actual commit
date and time. Maybe Build Service should define __commit_date
and __commit_time macros, which would be used in CFLAGS. And in ideal
case both can be redefined in default %optflags, like this

'%{?__commit_date:-D__DATE__=%__commit_date}' \

What do you think?

It actually works? Can these macros be redefined?
But yeah, makes sense.

It works.

$ gcc test.c -o test -D__TIME__=\"bla\"
<command-line>:0:0: warning: "__TIME__" redefined
$ ./test

Adam Mizerski
< Previous Next >