fix partial updates to libgray.a when using Nix
When building the static library the Nixpkgs stdenv `ar` defaults to not writing timestamps for the members file. This imply make will always try to add all members to the archive, which defeats the purpose of the file-level granularity.
This commit is contained in:
parent
95d398d503
commit
c889c754f7
9
Makefile
9
Makefile
@ -69,6 +69,13 @@ LD = gfortran
|
||||
FFLAGS += -J$(OBJDIR) -I$(INCDIR) -ffree-line-length-none -fPIC
|
||||
CPPFLAGS += -DREVISION=\"$(GIT_REV)$(GIT_DIRTY)\" -DPREFIX=\"$(PREFIX)\"
|
||||
|
||||
ifndef DETERMINISTIC
|
||||
ifdef AR_DEFAULT_DETERMINISTIC
|
||||
# Write timestamps to allow partial updates
|
||||
ARFLAGS = crU
|
||||
endif
|
||||
endif
|
||||
|
||||
# Static build options
|
||||
ifdef STATIC
|
||||
LIBRARIES := $(LIBRARIES:so=a)
|
||||
@ -109,7 +116,7 @@ install: $(BINARIES) $(LIBRARIES) $(SHAREDIR)/doc $(SHAREDIR)/gray.1
|
||||
$(OBJDIR)/%.o: $(OBJDIR)/%.d
|
||||
|
||||
# GRAY binary
|
||||
$(GRAY): $(shell ./depend $(OBJDIR)/main.o) | $(BINDIR)
|
||||
$(GRAY): $(OBJDIR)/main.o $(LIBGRAY).a | $(BINDIR)
|
||||
$(LD) $(LDFLAGS) -o '$@' $^
|
||||
|
||||
# GRAY shared library
|
||||
|
7
configure
vendored
7
configure
vendored
@ -15,6 +15,7 @@ Options:
|
||||
--prefix=PREFIX install files in PREFIX [/usr/local]
|
||||
--enable-static statically link programs and libraries [no]
|
||||
--disable-static dynamically link programs and libraries [yes]
|
||||
--enable-deterministic try to make a bit-for-bit deterministic build [no]
|
||||
--with-katex=PATH specify path to the KaTeX library [automatically downloaded]
|
||||
EOF
|
||||
}
|
||||
@ -40,6 +41,7 @@ for arg in "$@"; do
|
||||
;;
|
||||
--enable-static) printf 'STATIC=1\n' >> configure.mk ;;
|
||||
--disable-static) ;;
|
||||
--enable-deterministic) printf 'DETERMINISTIC=1\n' >> configure.mk ;;
|
||||
--with-katex=*) printf 'KATEX_URL==file://%s/\n' "${arg#*=}" >> configure.mk ;;
|
||||
*=*)
|
||||
printf '%s\n' "${arg?}" >> configure.mk
|
||||
@ -79,3 +81,8 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
printf 'using %s as Fortran compiler\n' "$FC"
|
||||
printf '%s=%s\n' FC "$FC" >> configure.mk
|
||||
|
||||
# Check whether ar is deterministic by default
|
||||
if ar h | grep -q '\[D\].*(default)' 2>/dev/null; then
|
||||
printf 'AR_DEFAULT_DETERMINISTIC=1\n' >> configure.mk
|
||||
fi
|
||||
|
@ -59,6 +59,7 @@ in
|
||||
configureFlags = [
|
||||
(lib.enableFeature static "static")
|
||||
"--with-katex=${katex}"
|
||||
"--enable-deterministic"
|
||||
"GIT_REV=${version}"
|
||||
"GIT_DIRTY="
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user