Improve handling of SOURCE_DATE_EPOCH
PR #755 (
be1ed774) made it so that the value of SOURCE_DATE_EPOCH is
ignored if time_macros sloppiness is set. A downside of this is
naturally that the user has to set sloppiness if SOURCE_DATE_EPOCH is
set in the environment.
Insight: SOURCE_DATE_EPOCH actually only ever changes the result if the
source code contains __DATE__. __TIME__ is not an issue since ccache
disables the direct mode if __TIME__is present and the preprocessor mode
will then see the actual expansion regardless of any SOURCE_DATE_EPOCH
value. Finally, the __TIMESTAMP__ case is not applicable at all since
it’s not affected by SOURCE_DATE_EPOCH.
Therefore, make sure to only hash SOURCE_DATE_EPOCH if we find __DATE__.
The user then does not have to set sloppiness to get direct mode hits
for files that don’t contain __DATE__.