glibc is a wonderful library. Tidy and clean. To keep it that clean it does such useful things as sorting the CFLAGS alphabeticly. Unfortunately this breaks command line arguments that contain parameters such as `-include /foo/bar`. This commit works around this flaw by removing the space and using -include/foo/bar instead.
13 lines
466 B
Bash
13 lines
466 B
Bash
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
|
CFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h"
|
|
CXXFLAGS+=" -Wno-builtin-macro-redefined -include$XBPS_STATEDIR/timestamp-macros.h"
|
|
for i in "DATE,%b %d %Y" "TIME,%H:%M:%S" "DATETIME,%b %d %Y %H:%M:%S"; do
|
|
mcr=${i%%,*}
|
|
val=$(LC_ALL=C date --date "@$SOURCE_DATE_EPOCH" +"${i#*,}")
|
|
cat >> $XBPS_STATEDIR/timestamp-macros.h <<EOF
|
|
#undef __${mcr}__
|
|
#define __${mcr}__ "${val}"
|
|
EOF
|
|
done
|
|
fi
|