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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
Description: Make the build reproducible
Author: Chris Lamb <lamby@debian.org>
Last-Update: 2020-01-20
--- a/src/bin/vmrelease.sh
+++ b/src/bin/vmrelease.sh
@@ -22,14 +22,21 @@
#define ${PROGRAM}RELEASE_H
ENDOFRELEASEPRE
-date +"#define ${PROGRAM}COMPILEDATE \"%Y-%m-%d %H:%M:%S\""
+date +"#define ${PROGRAM}COMPILEDATE \"%Y-%m-%d %H:%M:%S\"" --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"
shift # get rid of first argument
-echo "#define ${PROGRAM}CFLAGS \"$*\""
+echo "#define ${PROGRAM}CFLAGS \"(reproducible build)\""
+
+if [ -n "${SOURCE_DATE_EPOCH}" ]
+then
+ HOSTNAME="(reproducible build)"
+else
+ HOSTNAME="`hostname`"
+fi
cat << ENDOFRELEASEPOST
#define ${PROGRAM}RELEASEDATE "2007-Aug-27"
#define ${PROGRAM}VERSION "`cat ${WORKVSTREESRC}/VERSION`"
-#define ${PROGRAM}COMPILEHOST "`hostname`"
+#define ${PROGRAM}COMPILEHOST "${HOSTNAME}"
#endif
ENDOFRELEASEPOST
--- a/src/Vmatch/SELECT/makefile
+++ b/src/Vmatch/SELECT/makefile
@@ -1,11 +1,11 @@
# makefile to compile shared objects using the gnu C compiler
# Stefan Kurtz, October 2000
-CC=gcc
+#CC=gcc
# in 64-bit mode add -m64
-CFLAGS=-Wall -Werror -O3 -g
+CFLAGS+=-Wall -Werror -O3 -g
ifneq ($(SYSTEM),Windows)
CFLAGS+=-fPIC
@@ -43,15 +43,15 @@
# on most platforms the shared objects have a suffix .so
%.so:%.c Shareddef
- ${CC} ${CFLAGS} ${CPPFLAGS} ${SHARED} $< -o $@
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${SHARED} $< -o $@ ${LDFLAGS}
mergematches-dbg.so:mergematches.c Shareddef
- ${CC} ${CFLAGS} ${CPPFLAGS} -DDEBUG ${SHARED} $< -o $@
+ ${CC} ${CFLAGS} ${CPPFLAGS} -DDEBUG ${SHARED} $< -o $@ ${LDFLAGS}
# on HP-UX the shared objects have a suffix .sl
%.sl:%.c Shareddef
- @${CC} ${CFLAGS} ${CPPFLAGS} ${SHARED} $< -o $@
+ @${CC} ${CFLAGS} ${CPPFLAGS} ${SHARED} $< -o $@ ${LDFLAGS}
# the following goal generates the output of the C-preprocessor
# applied to the given C-file.
--- a/src/Vmatch/SELECT/mstat.c
+++ b/src/Vmatch/SELECT/mstat.c
@@ -87,20 +87,20 @@
and \(iend\). The following function reports such section.
*/
-static void showsection(ArrayMstatvalue *mstat,Uint istart,Uint iend)
+static void showsection(ArrayMstatvalue *mmstat,Uint istart,Uint iend)
{
Uint i;
Mstatvalue *mstatptr;
- printf("%lu:\n",(Showuint) mstat->spaceMstatvalue[istart].seqnum1);
+ printf("%lu:\n",(Showuint) mmstat->spaceMstatvalue[istart].seqnum1);
for(i=istart; i<=iend; i++)
{
- mstatptr = mstat->spaceMstatvalue + i;
- if(mstatptr->seqnum1 != mstat->spaceMstatvalue[istart].seqnum1)
+ mstatptr = mmstat->spaceMstatvalue + i;
+ if(mstatptr->seqnum1 != mmstat->spaceMstatvalue[istart].seqnum1)
{
fprintf(stderr,"seqnum1 =%lu != %lu\n",
(Showuint) mstatptr->seqnum1,
- (Showuint) mstat->spaceMstatvalue[istart].seqnum1);
+ (Showuint) mmstat->spaceMstatvalue[istart].seqnum1);
exit(EXIT_FAILURE);
}
printf(" %lu %lu %lu %lu\n",
@@ -117,27 +117,27 @@
function \texttt{showsection} is applied.
*/
-static void splitMstatvalues(ArrayMstatvalue *mstat)
+static void splitMstatvalues(ArrayMstatvalue *mmstat)
{
Uint i, lastseqnum, istart;
- if(mstat->nextfreeMstatvalue == 0)
+ if(mmstat->nextfreeMstatvalue == 0)
{
fprintf(stderr,"no matches available\n");
exit(EXIT_FAILURE);
}
- lastseqnum = mstat->spaceMstatvalue[0].seqnum1;
+ lastseqnum = mmstat->spaceMstatvalue[0].seqnum1;
istart = 0;
- for(i=1; i<mstat->nextfreeMstatvalue; i++)
+ for(i=1; i<mmstat->nextfreeMstatvalue; i++)
{
- if(lastseqnum < mstat->spaceMstatvalue[i].seqnum1)
+ if(lastseqnum < mmstat->spaceMstatvalue[i].seqnum1)
{
- showsection(mstat,istart,i-1);
- lastseqnum = mstat->spaceMstatvalue[i].seqnum1;
+ showsection(mmstat,istart,i-1);
+ lastseqnum = mmstat->spaceMstatvalue[i].seqnum1;
istart = i;
}
}
- showsection(mstat,istart,i-1);
+ showsection(mmstat,istart,i-1);
}
/*
--- a/src/Vmatch/SELECT/cgvizout.c
+++ b/src/Vmatch/SELECT/cgvizout.c
@@ -99,7 +99,7 @@
static ArrayConnectdata *edges;
/*Sorting and grouping of matches. Returns number of generated groups*/
-static Uint multmatchesCountingSort ()
+static Uint multmatchesCountingSort (void)
{
Uint maxmatchlen = 0,
nof_matches,
|