Skip to content

Commit

Permalink
Remove libb2 (BLAKE2) support
Browse files Browse the repository at this point in the history
  • Loading branch information
erijo committed Feb 13, 2020
1 parent 27efbb1 commit 3d71d3d
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 91 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ configure
dev.mk
dev_mode_disabled
doc/ccache.1
libb2-*.tar.gz
perfdir.*
src/third_party/libb2
src/third_party/zstd
src/version.cpp
testdir.*
Expand Down
4 changes: 2 additions & 2 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
make clean
make travis CC=gcc CXX=g++
make travis CC=clang CXX=clang++
make travis CC=gcc CFLAGS="-m32 -g -O2" CXX=g++ CXXFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet --with-libb2-from-internet"
make travis CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet --with-libb2-from-internet" TEST="unittest/run.exe"
make travis CC=gcc CFLAGS="-m32 -g -O2" CXX=g++ CXXFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet"
make travis CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe"
make travis CC=clang CXX=clang++ CFLAGS="-fsanitize=undefined" LDFLAGS="-fsanitize=undefined" ASAN_OPTIONS="detect_leaks=0"
make travis CC=clang CXX=clang++ CFLAGS="-fsanitize=address -g" LDFLAGS="-fsanitize=address" ASAN_OPTIONS="detect_leaks=0"
make travis CC=/usr/bin/clang CXX=/usr/bin/clang++ TEST=analyze
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ matrix:
packages:
- elfutils
- libzstd1-dev
- libb2-dev

# Job 2: Linux native Clang
- os: linux
Expand All @@ -31,17 +30,16 @@ matrix:
packages:
- elfutils
- libzstd1-dev
- libb2-dev

# Job 3: Mac OS X native Clang
- os: osx
compiler: clang
env: V=1 CONFIGURE="--with-libzstd-from-internet --with-libb2-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1
env: V=1 CONFIGURE="--with-libzstd-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1

# Job 4: Linux 32-bit native
- os: linux
compiler: gcc
env: V=1 CFLAGS="-m32 -g -O2" CXXFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet --with-libb2-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1
env: V=1 CFLAGS="-m32 -g -O2" CXXFLAGS="-m32 -g -O2" LDFLAGS="-m32" CONFIGURE="--host=i386-linux-gnu --with-libzstd-from-internet" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
Expand All @@ -51,7 +49,7 @@ matrix:
# Job 5: Linux cross-compiled 32-bit MinGW
- os: linux
compiler: i686-w64-mingw32-g++-posix
env: V=1 CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet --with-libb2-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
env: V=1 CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=i686-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
Expand All @@ -60,7 +58,7 @@ matrix:
# Job 6: Linux cross-compiled 64-bit MinGW
- os: linux
compiler: x86_64-w64-mingw32-g++
env: V=1 CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=x86_64-w64-mingw32 --with-libzstd-from-internet --with-libb2-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
env: V=1 CC=i686-w64-mingw32-gcc-posix CXX=i686-w64-mingw32-g++-posix CONFIGURE="--host=x86_64-w64-mingw32 --with-libzstd-from-internet" TEST="unittest/run.exe" ENABLE_CACHE_CLEANUP_TESTS=1
addons:
apt:
packages:
Expand All @@ -75,7 +73,6 @@ matrix:
packages:
- elfutils
- libzstd1-dev
- libb2-dev

# Job 8: Clang's address sanitizer
- os: linux
Expand All @@ -86,7 +83,6 @@ matrix:
packages:
- elfutils
- libzstd1-dev
- libb2-dev

# Job 9: Clang static analyzer
- os: linux
Expand All @@ -96,7 +92,6 @@ matrix:
apt:
packages:
- libzstd1-dev
- libb2-dev

# Job 10: Linux GCC with CUDA compiler
- os: linux
Expand All @@ -108,6 +103,5 @@ matrix:
packages:
- elfutils
- libzstd1-dev
- libb2-dev
before_install:
- source ./.travis/install_cuda.sh
1 change: 0 additions & 1 deletion .travis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ RUN apt-get -qq update && apt-get install -y --no-install-recommends \
RUN apt-get -qq update && apt-get install -y --no-install-recommends \
elfutils \
libzstd1-dev \
libb2-dev \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
19 changes: 0 additions & 19 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ install: ccache$(EXEEXT) @disable_man@ccache.1
clean:
rm -rf $(files_to_clean)
[ ! -f src/third_party/zstd/Makefile ] || $(MAKE) -C src/third_party/zstd/lib clean
[ ! -f src/third_party/libb2/Makefile ] || $(MAKE) -C src/third_party/libb2 clean

$(non_third_party_objs) $(test_objs): CFLAGS += @extra_warnings@
$(non_third_party_objs) $(test_objs): CXXFLAGS += @extra_warnings@
Expand All @@ -161,24 +160,6 @@ libzstd_options = \
src/third_party/zstd/lib/libzstd.a:
$(MAKE) -C src/third_party/zstd/lib libzstd.a $(libzstd_options) CC="$(CC)"

libb2_options = \
--disable-shared \
--enable-static

@disable_cross@# cross compilation
@disable_cross@libb2_options += \
@disable_cross@ --build=@build_alias@ \
@disable_cross@ --host=@host_alias@ \
@disable_cross@ --target=@target_alias@ \
@disable_cross@ --disable-openmp \
@disable_cross@ --disable-fat \
@disable_cross@ --disable-native

src/third_party/libb2/src/.libs/libb2.a:
cd src/third_party/libb2 && ./configure ${libb2_options} CC="$(CC)"
$(MAKE) -C src/third_party/libb2 CC="$(CC)" \
@disable_cross@ CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"

.PHONY: performance
performance: ccache$(EXEEXT)
$(srcdir)/misc/performance --ccache ccache$(EXEEXT) $(CXX) $(all_cppflags) $(all_cxxflags) $(srcdir)/src/ccache.cpp
Expand Down
46 changes: 0 additions & 46 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ case $host in
esac

AC_SUBST(blake3_defines)
AC_SUBST(disable_cross)
AC_SUBST(disable_man)
AC_SUBST(extra_libs)
AC_SUBST(extra_sources)
Expand Down Expand Up @@ -197,51 +196,6 @@ else
extra_libs="src/third_party/zstd/lib/libzstd.a"
fi

dnl Check for libb2
libb2_version=0.98.1
libb2_url=https://github.com/BLAKE2/libb2/releases/download/v${libb2_version}/libb2-${libb2_version}.tar.gz

AC_ARG_WITH(libb2-from-internet,
[AS_HELP_STRING([--with-libb2-from-internet],
[download and use libb2 from the Internet instead of using the system's default libb2])])
if test x${with_libb2_from_internet} = x; then
AC_CHECK_LIB([b2],[blake2b], [found_libb2=yes])
if test x${found_libb2} = x; then
AC_MSG_ERROR(please install libb2 or use --with-libb2-from-internet)
fi
LIBS="$LIBS -lb2"
else
libb2_archive=`basename ${libb2_url}`
if ! test -f ${libb2_archive}; then
AC_CHECK_TOOL(WGET, wget)
if test -n "$WGET"; then
AC_MSG_NOTICE(downloading libb2 from $libb2_url)
wget -q ${libb2_url}
else
AC_CHECK_TOOL(CURL, curl)
if test -n "$CURL"; then
AC_MSG_NOTICE(downloading libb2 from $libb2_url)
curl -sLOJ ${libb2_url}
else
AC_MSG_ERROR(please install wget or curl)
fi
fi
fi
(cd src/third_party && tar -xzf ../../${libb2_archive})
rm -rf src/third_party/libb2
mv src/third_party/libb2-${libb2_version} src/third_party/libb2
# try to make clang happy by changing the header guard macros
sed -i -e 's/__BLAKE2_H__/BLAKE2_H/' src/third_party/libb2/src/blake2.h
CPPFLAGS="$CPPFLAGS -I$PWD/src/third_party/libb2/src"
extra_libs="$extra_libs src/third_party/libb2/src/.libs/libb2.a"
fi

if test "$cross_compiling" != no -o "$host_cpu" != 'x86_64'; then
disable_cross=''
else
disable_cross='#'
fi

AC_ARG_ENABLE(man,
[AS_HELP_STRING([--disable-man],
[disable installing man pages])])
Expand Down
2 changes: 1 addition & 1 deletion dev.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ endef
.PHONY: distcheck
distcheck: $(firstword $(dist_archives))
$(call do_distcheck, CFLAGS=-Werror CXXFLAGS=-Werror)
$(call do_distcheck, --with-libzstd-from-internet --with-libb2-from-internet)
$(call do_distcheck, --with-libzstd-from-internet)
$(call do_distcheck, CC=clang CXX=clang++)

.PHONY: docs
Expand Down
5 changes: 0 additions & 5 deletions doc/INSTALL-from-release-archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ To build ccache from a

- A C++11 compiler.
- A C89 compiler.
- [libb2](https://github.com/BLAKE2/libb2). If you don't have libb2 installed
and can't or don't want to install it on your system, you can pass
`--with-libb2-from-internet` to the configure script, which will make the
script download libb2 from the Internet and unpack it in the local source
tree. ccache will then be linked statically to the locally built libb2.
- [libzstd](https://www.zstd.net). If you don't have libzstd installed and
can't or don't want to install it on your system, you can pass
`--with-libzstd-from-internet` to the configure script, which will make the
Expand Down
5 changes: 0 additions & 5 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ To build ccache from a source repository, you need:
- [xsltproc](http://xmlsoft.org/XSLT/xsltproc2.html) to build the man page.
- [Autoconf](https://www.gnu.org/software/autoconf/) to generate the configure
script and related files.
- [libb2](https://github.com/BLAKE2/libb2). If you don't have libb2 installed
and can't or don't want to install it on your system, you can pass
`--with-libb2-from-internet` to the configure script, which will make the
script download libb2 from the Internet and unpack it in the local source
tree. ccache will then be linked statically to the locally built libb2.
- [libzstd](https://www.zstd.net). If you don't have libzstd installed and
can't or don't want to install it on your system, you can pass
`--with-libzstd-from-internet` to the configure script, which will make the
Expand Down

0 comments on commit 3d71d3d

Please sign in to comment.