diff --git a/fix-lib-build.patch b/fix-lib-build.patch new file mode 100644 index 0000000..3c0059f --- /dev/null +++ b/fix-lib-build.patch @@ -0,0 +1,37 @@ +From 39a32f40c91c306898d771962aab5bd22235554f Mon Sep 17 00:00:00 2001 +From: Yann Collet +Date: Mon, 25 May 2020 06:50:45 -0700 +Subject: [PATCH] fixed default rule for lib/Makefile + +default rule is `lib-release` + +`lib-release` wasn't working : it was just skipped. + +Removing `lib-release` from the list of .PHONY targets fixes it. + +Same for `lib-mt`. +--- + lib/Makefile | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/Makefile b/lib/Makefile +index e6213ac86..c4305d6f8 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -220,13 +220,14 @@ libzstd : $(LIBZSTD) + .PHONY: lib + lib : libzstd.a libzstd + +-.PHONY: lib-mt ++# note : do not define lib-mt or lib-release as .PHONY ++# make does not consider implicit pattern rule for .PHONY target ++ + %-mt : CPPFLAGS += -DZSTD_MULTITHREAD + %-mt : LDFLAGS += -pthread + %-mt : % + @echo multi-threading build completed + +-.PHONY: lib-release + %-release : DEBUGFLAGS := + %-release : % + @echo release build completed diff --git a/zstd.changes b/zstd.changes index 9fe0f64..41bac34 100644 --- a/zstd.changes +++ b/zstd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 8 17:47:50 UTC 2020 - Martin Liška + +- Use %make_build macro. +- Add upstream patch fix-lib-build.patch which fixes lib-mt target. + ------------------------------------------------------------------- Fri May 22 08:05:28 UTC 2020 - Ismail Dönmez diff --git a/zstd.spec b/zstd.spec index d9acf81..ba7d1ed 100644 --- a/zstd.spec +++ b/zstd.spec @@ -28,6 +28,7 @@ URL: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source99: baselibs.conf Patch1: pzstd.1.patch +Patch2: fix-lib-build.patch BuildRequires: gcc # C++ is needed for pzstd only BuildRequires: gcc-c++ @@ -84,23 +85,28 @@ Needed for compiling programs that link with the library. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags} -std=c++11" -for dir in lib programs contrib/pzstd; do - make %{?_smp_mflags} -C "$dir" +# lib-mt is alias for multi-threaded library support +%make_build -C lib lib-mt +for dir in programs contrib/pzstd; do + %make_build -C "$dir" done %check export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags} -std=c++11" -make %{?_smp_mflags} -C tests test-zstd +%make_build -C tests test-zstd #make %{?_smp_mflags} -C contrib/pzstd test-pzstd %install -%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags} -std=c++11" +%make_install V=1 VERBOSE=1 PREFIX=%{_prefix} LIBDIR=%{_libdir} install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1