1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/sh
# When SOURCE_DATE_EPOCH is defined in the environment,
# and the date it contains is older than an Ada source,
# gcc (>= 7.1.0-9) writes SOURCE_DATE_EPOCH in the .ali file
# instead of the actual source file timestamp.
# gprbuild/2017 detects the mismatch and insists on recompiling.
set -C -e -f -u
cd "$ADTTMP"
cat > a.adb <<EOF
procedure A is
begin
null;
end A;
EOF
cat > p.gpr <<EOF
project P is
for Main use ("a.adb");
end P;
EOF
export SOURCE_DATE_EPOCH=100
gprbuild -v p.gpr
! (gprbuild -vh p.gpr | grep "different time stamp for a\.adb")
|