From 3d0c1d108f4f997cb40e3e415feef361b55f71d0 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sun, 26 May 2013 14:16:58 +0200 Subject: [PATCH] Cleanup possible due to abstracting compression code. Now that the compression code is mostly in the shared library we no longer need to include zlib headers etc all over the place as all code accessing any compression specific interface is abstracted now we can cleanup the header files and the Makefiles. This way we also don't leak to many global stuff into our namespace which will never be used anyway. --- src/filed/compression.c | 4 ++++ src/filed/filed.h | 5 ----- src/stored/Makefile.in | 6 ------ src/stored/bextract.c | 9 --------- src/stored/stored.h | 5 ----- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/filed/compression.c b/src/filed/compression.c index 7e3cb90a50c..adc587d0bc0 100644 --- a/src/filed/compression.c +++ b/src/filed/compression.c @@ -31,6 +31,10 @@ #if defined(HAVE_LZO) || defined(HAVE_LIBZ) || defined(HAVE_FASTLZ) +#if defined(HAVE_LIBZ) +#include +#endif + #if defined(HAVE_LZO) #include #include diff --git a/src/filed/filed.h b/src/filed/filed.h index 10706415937..b5a2f3d7f0b 100644 --- a/src/filed/filed.h +++ b/src/filed/filed.h @@ -32,11 +32,6 @@ #include "lib/htable.h" #include "lib/runscript.h" #include "findlib/find.h" -#ifdef HAVE_LIBZ -#include /* compression headers */ -#else -#define uLongf uint32_t -#endif #include "ch.h" #include "backup.h" #include "restore.h" diff --git a/src/stored/Makefile.in b/src/stored/Makefile.in index 11c2d705891..46406682006 100644 --- a/src/stored/Makefile.in +++ b/src/stored/Makefile.in @@ -68,8 +68,6 @@ COPYSRCS = acquire.c ansi_label.c autochanger.c bcopy.c block.c bsr.c \ spool.c stored_conf.c vol_mgr.c vtape.c wait.c COPYOBJS = $(COPYSRCS:.c=.o) -COMPRESS_CPPFLAGS += @ZLIB_INC@ @LZO_INC@ @FASTLZ_INC@ - SD_LIBS += @CAP_LIBS@ BEXTRACT_LIBS += @ZLIB_LIBS_NONSHARED@ BEXTRACT_LIBS += @LZO_LIBS_NONSHARED@ @@ -130,10 +128,6 @@ bls: Makefile $(BLSOBJS) ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) ../lib/ $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \ -lbareosfind -lbareoscfg -lbareos -lm $(LIBS) $(GETTEXT_LIBS) -bextract.o: bextract.c - @echo "Compiling $<" - $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(COMPRESS_CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $< - bextract: Makefile $(BEXTOBJS) ../findlib/libbareosfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbareoscfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbareos$(DEFAULT_ARCHIVE_TYPE) @echo "Compiling $<" $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) \ diff --git a/src/stored/bextract.c b/src/stored/bextract.c index 048864e1f05..d6873c7551d 100644 --- a/src/stored/bextract.c +++ b/src/stored/bextract.c @@ -32,15 +32,6 @@ #include "lib/crypto_cache.h" #include "findlib/find.h" -#ifdef HAVE_LZO -#include -#include -#endif - -#ifdef HAVE_FASTLZ -#include -#endif - extern bool parse_sd_config(CONFIG *config, const char *configfile, int exit_code); static void do_extract(char *devname); diff --git a/src/stored/stored.h b/src/stored/stored.h index 53012db4990..c1543481079 100644 --- a/src/stored/stored.h +++ b/src/stored/stored.h @@ -59,11 +59,6 @@ const int sd_dbglvl = 300; #include "vol_mgr.h" #include "reserve.h" #include "protos.h" -#ifdef HAVE_LIBZ -#include /* compression headers */ -#else -#define uLongf uint32_t -#endif #ifdef HAVE_FNMATCH #include #else