From 54298f49d71347616df19b8d2f59c907374e07b3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 1 Mar 2014 22:27:11 +0100 Subject: move defines for version to macros.h also adds namespaced attributes for good usage Git-Dch: Ignore --- buildlib/libversion.mak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'buildlib') diff --git a/buildlib/libversion.mak b/buildlib/libversion.mak index 796c956e7..deb3da377 100644 --- a/buildlib/libversion.mak +++ b/buildlib/libversion.mak @@ -2,9 +2,9 @@ # Version number of libapt-pkg. # Please increase MAJOR with each ABI break, # with each non-ABI break to the lib, please increase RELEASE. -# The versionnumber is extracted from apt-pkg/init.h - see also there. -LIBAPTPKG_MAJOR=$(shell awk -v ORS='.' '/^\#define APT_PKG_M/ {print $$3}' $(BASE)/apt-pkg/init.h | sed 's/\.$$//') -LIBAPTPKG_RELEASE=$(shell grep -E '^\#define APT_PKG_RELEASE' $(BASE)/apt-pkg/init.h | cut -d ' ' -f 3) +# The versionnumber is extracted from apt-pkg/macros.h - see also there. +LIBAPTPKG_MAJOR=$(shell awk -v ORS='.' '/^\#define APT_PKG_M/ {print $$3}' $(BASE)/apt-pkg/contrib/macros.h | sed 's/\.$$//') +LIBAPTPKG_RELEASE=$(shell grep -E '^\#define APT_PKG_RELEASE' $(BASE)/apt-pkg/contrib/macros.h | cut -d ' ' -f 3) # Version number of libapt-inst # Please increase MAJOR with each ABI break, -- cgit v1.2.3 From 453b82a388013e522b3a1b9fcd6ed0810dab1f4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Mar 2014 22:11:25 +0100 Subject: cleanup headers and especially #includes everywhere Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use) --- buildlib/apti18n.h.in | 3 ++- buildlib/config.h.in | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'buildlib') diff --git a/buildlib/apti18n.h.in b/buildlib/apti18n.h.in index a9d48dd97..2202c5b19 100644 --- a/buildlib/apti18n.h.in +++ b/buildlib/apti18n.h.in @@ -8,7 +8,8 @@ #ifdef USE_NLS // apt will use the gettext implementation of the C library -# include +#include +#include # ifdef APT_DOMAIN # define _(x) dgettext(APT_DOMAIN,x) # define P_(msg,plural,n) dngettext(APT_DOMAIN,msg,plural,n) diff --git a/buildlib/config.h.in b/buildlib/config.h.in index bd43a40b9..6779e07bc 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -42,3 +42,4 @@ #define APT_8_CLEANER_HEADERS #define APT_9_CLEANER_HEADERS +#define APT_10_CLEANER_HEADERS -- cgit v1.2.3 From 9d9d5e810751954594c793383b07ca526c647350 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 Mar 2014 02:36:48 +0100 Subject: enable various compiler warnings Now that the last few commits resolved the issues we can finally enable a bunch of compiler warnings by default. Git-Dch: ignore --- buildlib/environment.mak.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'buildlib') diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index fc859951e..9cc449573 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -7,9 +7,13 @@ PACKAGE_MAIL = @PACKAGE_MAIL@ # C++ compiler options CC = @CC@ -CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -Wall +CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2 CXX = @CXX@ -CXXFLAGS+= @CXXFLAGS@ +CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra +CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations +CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +# a bit too pedantic to be run by default +#CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros NUM_PROCS = @NUM_PROCS@ # Linker stuff @@ -68,4 +72,3 @@ else # Do not know how to create shared libraries here. ONLYSTATICLIBS = yes endif - -- cgit v1.2.3 From 7f350a377e0c65a656b9b5437e27d037fd742901 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Mar 2014 14:39:18 +0100 Subject: use liblzma-dev to provide xz/lzma support We have xz/lzma support for a while, but only via an external binary provided by xz-utils. Now that the Debian archive provides xz by default and dpkg pre-depends on the library provided by liblzma-dev we can switch now to use this library as well to avoid requiring an external binary. For now the binary is in a prio:required package, but this might change in the future. API wise it is quiet similar to bz2 code expect that it doesn't provide file I/O methods, so we piece this together on our own. --- buildlib/config.h.in | 3 +++ buildlib/environment.mak.in | 1 + 2 files changed, 4 insertions(+) (limited to 'buildlib') diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 6779e07bc..6b72fb393 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -11,6 +11,9 @@ /* Define if we have the bz2 library for bzip2 */ #undef HAVE_BZ2 +/* Define if we have the lzma library for lzma/xz */ +#undef HAVE_LZMA + /* These two are used by the statvfs shim for glibc2.0 and bsd */ /* Define if we have sys/vfs.h */ #undef HAVE_VFS_H diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index 9cc449573..c1bf29672 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -61,6 +61,7 @@ INTLLIBS = @INTLLIBS@ HAVE_STATVFS = @HAVE_STATVFS@ HAVE_ZLIB = @HAVE_ZLIB@ HAVE_BZ2 = @HAVE_BZ2@ +HAVE_LZMA = @HAVE_LZMA@ NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@ # Shared library things -- cgit v1.2.3 From cbc9ec23b0fb551f20f4fd8ca46d98f59b5666bc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 13 Apr 2014 21:40:35 +0200 Subject: compile with absolute paths to allow lcov use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instructing gcc (or clang) to prepare for capturing coverage data is easy: Just build with: CXXFLAGS=--coverage The hard part is that our buildsystem uses relative paths and so confuses the hell out of lcov as it assumes this way that all our *.cc files are in the same directory… by changing to absolute paths in the compile rules we solve this problem. Still not perfect as it refers to build/include files for most headers and our forking/threading code isn't properly captured, but good enough to see red reports for now: CXXFLAGS=--coverage make make test ./test/integration/run-tests -q lcov --no-external --directory . --capture --output-file apt.info genhtml --output-directory ./coverage/ apt.info Git-Dch: Ignore --- buildlib/library.mak | 2 +- buildlib/program.mak | 2 +- buildlib/python.mak | 2 +- buildlib/staticlibrary.mak | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'buildlib') diff --git a/buildlib/library.mak b/buildlib/library.mak index ef1306b66..cc0286d7e 100644 --- a/buildlib/library.mak +++ b/buildlib/library.mak @@ -63,7 +63,7 @@ $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) vpath %.cc $(SUBDIRS) $(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) echo Compiling $< to $@ - $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $< + $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $(abspath $<) $(DoDep) # Include the dependencies that are available diff --git a/buildlib/program.mak b/buildlib/program.mak index da538f5eb..71c265f39 100644 --- a/buildlib/program.mak +++ b/buildlib/program.mak @@ -50,7 +50,7 @@ $($(LOCAL)-BIN): $($(LOCAL)-OBJS) $($(LOCAL)-MKS) vpath %.cc $(SUBDIRS) $(OBJ)/%.o: %.cc echo Compiling $< to $@ - $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< + $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) -o $@ $(abspath $<) $(DoDep) # Include the dependencies that are available diff --git a/buildlib/python.mak b/buildlib/python.mak index 02345c2d2..f08ab5563 100644 --- a/buildlib/python.mak +++ b/buildlib/python.mak @@ -58,7 +58,7 @@ endif # ifdef PYTHONLIB vpath %.cc $(SUBDIRS) $(OBJ)/%.opic: %.cc echo Compiling $< to $@ - $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $< + $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $(abspath $<) $(DoDep) # Include the dependencies that are available diff --git a/buildlib/staticlibrary.mak b/buildlib/staticlibrary.mak index ce9259dc0..86908700f 100644 --- a/buildlib/staticlibrary.mak +++ b/buildlib/staticlibrary.mak @@ -50,7 +50,7 @@ endif vpath %.cc $(SUBDIRS) $(OBJ)/%.o: %.cc echo Compiling $< to $@ - $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< + $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) -o $@ $(abspath $<) $(DoDep) # Include the dependencies that are available -- cgit v1.2.3