From c4d6884cd82fddbbdce015750e574fd02af36a94 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sat, 26 Aug 2017 12:22:51 -0700 Subject: build: source files sorted in a FS independent manner to be more compatible with reproducible builds. patch inspired by @bmwiedemann --- doc/lz4_manual.html | 6 ++++-- lib/Makefile | 5 +++-- programs/Makefile | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/lz4_manual.html b/doc/lz4_manual.html index 9ab1984..df8128b 100644 --- a/doc/lz4_manual.html +++ b/doc/lz4_manual.html @@ -301,9 +301,11 @@ union LZ4_streamDecode_u { # define LZ4_DEPRECATED(message) /* disable deprecation warnings */ #else # define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) -# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ +# if defined(__clang__) /* clang doesn't handle mixed C++11 and CNU attributes */ +# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) +# elif defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ # define LZ4_DEPRECATED(message) [[deprecated(message)]] -# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__) +# elif (LZ4_GCC_VERSION >= 405) # define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) # elif (LZ4_GCC_VERSION >= 301) # define LZ4_DEPRECATED(message) __attribute__((deprecated)) diff --git a/lib/Makefile b/lib/Makefile index 9abb699..ed546dd 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -47,11 +47,12 @@ BUILD_STATIC:=yes CPPFLAGS+= -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 DEBUGFLAGS:= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ - -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \ - -Wpointer-arith -Wstrict-aliasing=1 + -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wundef -Wpointer-arith -Wstrict-aliasing=1 CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +SRCFILES := $(sort $(wildcard *.c)) # OS X linker doesn't support -soname, and use different extension diff --git a/programs/Makefile b/programs/Makefile index 29408f1..a551b01 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -41,15 +41,15 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) -SRCFILES := $(wildcard $(LZ4DIR)/*.c) $(wildcard *.c) +SRCFILES := $(sort $(wildcard $(LZ4DIR)/*.c) $(wildcard *.c)) #OBJFILES := $(patsubst %.c,%.o,$(SRCFILES)) OBJFILES := $(SRCFILES:.c=.o) CPPFLAGS += -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 DEBUGFLAGS:=-Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow \ - -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \ - -Wpointer-arith -Wstrict-aliasing=1 + -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wpointer-arith -Wstrict-aliasing=1 CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -- cgit v0.12