summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <nerdboy@gentoo.org>2009-08-01 20:00:23 +0000
committerSteve Arnold <nerdboy@gentoo.org>2009-08-01 20:00:23 +0000
commit1a1f95660e42c584d95f623c4b18cb60bbb47e49 (patch)
treed8da44ce1b6478f0f3c1b1e2a8af44561ebe53de /dev-util/duma
parentddrescue bump (diff)
downloadgentoo-2-1a1f95660e42c584d95f623c4b18cb60bbb47e49.tar.gz
gentoo-2-1a1f95660e42c584d95f623c4b18cb60bbb47e49.tar.bz2
gentoo-2-1a1f95660e42c584d95f623c4b18cb60bbb47e49.zip
Updated to latest version using new ebuild (closes bug #275011).
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/duma')
-rw-r--r--dev-util/duma/ChangeLog9
-rw-r--r--dev-util/duma/duma-2.5.15.ebuild90
-rw-r--r--dev-util/duma/files/duma-2.5.15-GNUmakefile.patch1159
3 files changed, 1257 insertions, 1 deletions
diff --git a/dev-util/duma/ChangeLog b/dev-util/duma/ChangeLog
index 38a5cc8b4f3e..3af946259f05 100644
--- a/dev-util/duma/ChangeLog
+++ b/dev-util/duma/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-util/duma
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/duma/ChangeLog,v 1.9 2009/04/01 00:47:27 nerdboy Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/duma/ChangeLog,v 1.10 2009/08/01 20:00:23 nerdboy Exp $
+
+*duma-2.5.15 (01 Aug 2009)
+
+ 01 Aug 2009; Steve Arnold <nerdboy@gentoo.org> +duma-2.5.15.ebuild,
+ +files/duma-2.5.15-GNUmakefile.patch:
+ Updated to latest version using ebuild and patch contributed by
+ ssuominen with one or two minor enhancements. Closes bug #275011.
*duma-2.5.14-r1 (01 Apr 2009)
diff --git a/dev-util/duma/duma-2.5.15.ebuild b/dev-util/duma/duma-2.5.15.ebuild
new file mode 100644
index 000000000000..074a40c31983
--- /dev/null
+++ b/dev-util/duma/duma-2.5.15.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/duma/duma-2.5.15.ebuild,v 1.1 2009/08/01 20:00:23 nerdboy Exp $
+
+EAPI=2
+inherit eutils flag-o-matic multilib toolchain-funcs versionator
+
+MY_P=${PN}_$(replace_all_version_separators '_')
+
+DESCRIPTION="DUMA (Detect Unintended Memory Access) is a memory debugging library"
+HOMEPAGE="http://duma.sourceforge.net"
+SRC_URI="mirror://sourceforge/duma/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="examples"
+
+RDEPEND="app-shells/bash"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-GNUmakefile.patch
+}
+
+src_compile() {
+ # strip-flags
+ replace-flags O? O0
+ append-flags -Wall -Wextra -U_FORTIFY_SOURCE
+ tc-export AR CC CXX LD RANLIB
+
+ case "${CHOST}" in
+ *-linux-gnu)
+ OS=linux;;
+ *-solaris*)
+ OS=solaris;;
+ *-darwin*)
+ OS=osx;;
+ *-freebsd*)
+ OS=freebsd;;
+ *-netbsd*)
+ OS=netbsd;;
+ *-cygwin*)
+ OS=cygwin;;
+ **-irix**)
+ OS=irix;;
+ esac
+ export OS="${OS}"
+ elog "Detected OS is: ${OS}"
+
+ if use amd64 && ! [ -n "${DUMA_ALIGNMENT}" ]; then
+ export DUMA_ALIGNMENT=16
+ elog "Exported DUMA_ALIGNMENT=${DUMA_ALIGNMENT} for x86_64,"
+ fi
+
+ make reconfig || die "make config failed"
+ # The above must be run first if distcc is enabled, otherwise
+ # the real build breaks on parallel makes.
+ emake || die "emake failed"
+}
+
+src_test() {
+ emake test || die "emake test failed"
+
+ elog "Please, see the output above to verify all tests have passed."
+ elog "Both static and dynamic confidence tests should say PASSED."
+}
+
+src_install(){
+ emake prefix="${D}/usr" libdir="${D}/usr/$(get_libdir)" \
+ docdir="${D}/usr/share/doc/${PF}" install || die "emake install failed"
+
+ dodoc CHANGELOG TODO GNUmakefile
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins example[1-6].cpp example_makes/ex6/Makefile || die "doins failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "See the GNUmakefile which will be also installed at"
+ elog "/usr/share/doc/${PF} for more options. You can now export"
+ elog "varibles to the build system easily, e.g.:"
+ elog "# export CPPFLAGS=\"-DFLAG\" (or by using append-cppflags)"
+ elog "# export DUMA_ALIGNMENT=${DUMA_ALIGNMENT} (Default is 16 for x86_64)"
+ elog "See more information about DUMA_ALIGNMENT from Readme.txt"
+}
diff --git a/dev-util/duma/files/duma-2.5.15-GNUmakefile.patch b/dev-util/duma/files/duma-2.5.15-GNUmakefile.patch
new file mode 100644
index 000000000000..59c2570ea586
--- /dev/null
+++ b/dev-util/duma/files/duma-2.5.15-GNUmakefile.patch
@@ -0,0 +1,1159 @@
+Rename CPPFLAGS to CXXFLAGS and DUMA_OPTIONS to CPPFLAGS as that's intended for the preprocessor AFAIK. Respect users AR, LD, CC, CXX, CXXFLAGS, CFLAGS, LDFLAGSand RANLIB. Fix building with GLIBC 2.10+ by working around the souce fortifying.
+
+diff -ur duma_2_5_15.orig/comparisons/ex11/Makefile duma_2_5_15/comparisons/ex11/Makefile
+--- duma_2_5_15.orig/comparisons/ex11/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex11/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong1
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex12/Makefile duma_2_5_15/comparisons/ex12/Makefile
+--- duma_2_5_15.orig/comparisons/ex12/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex12/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong3
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex13/Makefile duma_2_5_15/comparisons/ex13/Makefile
+--- duma_2_5_15.orig/comparisons/ex13/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex13/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong6
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex14/Makefile duma_2_5_15/comparisons/ex14/Makefile
+--- duma_2_5_15.orig/comparisons/ex14/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex14/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong7
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex15/Makefile duma_2_5_15/comparisons/ex15/Makefile
+--- duma_2_5_15.orig/comparisons/ex15/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex15/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=leak1
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex16/Makefile duma_2_5_15/comparisons/ex16/Makefile
+--- duma_2_5_15.orig/comparisons/ex16/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex16/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=leak2
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex17/Makefile duma_2_5_15/comparisons/ex17/Makefile
+--- duma_2_5_15.orig/comparisons/ex17/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex17/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h
++CFLAGS +=-I$(DUMADIR) -include stdlib.h -include duma.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=ok5
+ OBJ=$(BIN).o
+@@ -21,8 +21,8 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $< -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+diff -ur duma_2_5_15.orig/comparisons/ex21/Makefile duma_2_5_15/comparisons/ex21/Makefile
+--- duma_2_5_15.orig/comparisons/ex21/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex21/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong1
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex22/Makefile duma_2_5_15/comparisons/ex22/Makefile
+--- duma_2_5_15.orig/comparisons/ex22/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex22/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong2
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex23/Makefile duma_2_5_15/comparisons/ex23/Makefile
+--- duma_2_5_15.orig/comparisons/ex23/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex23/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong3
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex24/Makefile duma_2_5_15/comparisons/ex24/Makefile
+--- duma_2_5_15.orig/comparisons/ex24/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex24/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong4
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex25/Makefile duma_2_5_15/comparisons/ex25/Makefile
+--- duma_2_5_15.orig/comparisons/ex25/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex25/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong5
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex26/Makefile duma_2_5_15/comparisons/ex26/Makefile
+--- duma_2_5_15.orig/comparisons/ex26/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex26/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=wrong6
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex27/Makefile duma_2_5_15/comparisons/ex27/Makefile
+--- duma_2_5_15.orig/comparisons/ex27/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex27/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=leak1
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex28/Makefile duma_2_5_15/comparisons/ex28/Makefile
+--- duma_2_5_15.orig/comparisons/ex28/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex28/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=leak2
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/comparisons/ex29/Makefile duma_2_5_15/comparisons/ex29/Makefile
+--- duma_2_5_15.orig/comparisons/ex29/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/comparisons/ex29/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=ok5
+ OBJ=$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cc.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/example_makes/ex1/Makefile duma_2_5_15/example_makes/ex1/Makefile
+--- duma_2_5_15.orig/example_makes/ex1/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex1/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR)
++CXXFLAGS += -I$(DUMADIR)
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example1
+ OBJ=../../$(BIN).o
+@@ -21,5 +21,5 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+diff -ur duma_2_5_15.orig/example_makes/ex2/Makefile duma_2_5_15/example_makes/ex2/Makefile
+--- duma_2_5_15.orig/example_makes/ex2/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex2/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR)
++CXXFLAGS += -I$(DUMADIR)
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example2
+ OBJ=../../$(BIN).o
+@@ -21,5 +21,5 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+diff -ur duma_2_5_15.orig/example_makes/ex3/Makefile duma_2_5_15/example_makes/ex3/Makefile
+--- duma_2_5_15.orig/example_makes/ex3/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex3/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR)
++CXXFLAGS += -I$(DUMADIR)
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example3
+ OBJ=../../$(BIN).o
+@@ -21,5 +21,5 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+diff -ur duma_2_5_15.orig/example_makes/ex4/Makefile duma_2_5_15/example_makes/ex4/Makefile
+--- duma_2_5_15.orig/example_makes/ex4/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex4/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR)
++CXXFLAGS += -I$(DUMADIR)
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example4
+ OBJ=../../$(BIN).o
+@@ -21,5 +21,5 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+diff -ur duma_2_5_15.orig/example_makes/ex5/Makefile duma_2_5_15/example_makes/ex5/Makefile
+--- duma_2_5_15.orig/example_makes/ex5/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex5/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR)
++CXXFLAGS += -I$(DUMADIR)
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example5
+ OBJ=../../$(BIN).o
+@@ -21,5 +21,5 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+diff -ur duma_2_5_15.orig/example_makes/ex6/Makefile duma_2_5_15/example_makes/ex6/Makefile
+--- duma_2_5_15.orig/example_makes/ex6/Makefile 2009-06-22 05:27:53.000000000 +0300
++++ duma_2_5_15/example_makes/ex6/Makefile 2009-06-22 05:35:37.000000000 +0300
+@@ -1,6 +1,6 @@
+
+ DUMADIR=../..
+-CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
++CXXFLAGS += -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h
+ LFLAGS=$(DUMADIR)/libduma.a
+ ifeq ($(OS), Windows_NT)
+ LIBS=
+@@ -8,8 +8,8 @@
+ LIBS=-lpthread
+ endif
+
+-CC=gcc
+-CXX=g++
++CC ?= gcc
++CXX ?= g++
+
+ BIN=example6
+ OBJ=../../$(BIN).o
+@@ -21,7 +21,7 @@
+ - rm -f $(OBJ) $(BIN)
+
+ $(BIN): $(OBJ)
+- $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN)
+
+ .cpp.o:
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) -c $< -o $@
+diff -ur duma_2_5_15.orig/GNUmakefile duma_2_5_15/GNUmakefile
+--- duma_2_5_15.orig/GNUmakefile 2008-08-03 22:22:38.000000000 +0300
++++ duma_2_5_15/GNUmakefile 2009-06-22 05:57:24.000000000 +0300
+@@ -65,38 +65,35 @@
+ #
+ ########################################
+
+-# edit following line
+-DUMA_OPTIONS=
+-
+ # no leak detection on any platform:
+ # use static library for finding leaks - with information memory was allocated
+ # i think leak-checking without further information is quite useless!
+ # additionaly too many platforms/environments are broken.
+-DUMA_OPTIONS += -DDUMA_SO_NO_LEAKDETECTION
++CPPFLAGS += -DDUMA_SO_NO_LEAKDETECTION $(DUMA_OPTIONS)
+
+ # some test cases:
+-#DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
+-#DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
+-#DUMA_OPTIONS += -DDUMA_NO_CPP_SUPPORT
++#CPPFLAGS += -DDUMA_LIB_NO_LEAKDETECTION
++#CPPFLAGS += -DDUMA_NO_THREAD_SAFETY
++#CPPFLAGS += -DDUMA_NO_CPP_SUPPORT
+
+-PIC=-fPIC -DPIC
+-DUMA_SO_OPTIONS=$(PIC) -DDUMA_SO_LIBRARY
++# For shared linking,
++LFLAGS = -fPIC -DPIC -DDUMA_SO_LIBRARY
+
+ # for FreeBSD 5.4
+-# DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
++# CPPFLAGS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
+ #
+ # for FreeBSD 5.4 if DUMA_EXPLICIT_INIT is not set
+-# DUMA_OPTIONS += -DDUMA_NO_LEAKDETECTION
++# CPPFLAGS += -DDUMA_NO_LEAKDETECTION
+ #
+ # for cygwin environment on Windows
+-# DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
++# CPPFLAGS += -DDUMA_EXPLICIT_INIT
+ # also define 'WIN32'
+
+ # some defaults:
+-CC=gcc
+-CXX=g++
+-AR=ar
+-RANLIB=ranlib
++CC?=gcc
++CXX?=g++
++AR?=ar
++RANLIB?=ranlib
+ INSTALL=install
+ RM=rm
+ RMFORCE=rm -f
+@@ -116,7 +113,7 @@
+ # using explicit initialization to avoid leak report
+ # from __w32_sharedptr_initialize() function
+ BSWITCH=101
+- DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
++ CPPFLAGS += -DDUMA_EXPLICIT_INIT
+ RM=del
+ RMFORCE=del /F 2>nul
+ ECHO=echo
+@@ -124,31 +121,25 @@
+ CURPATH=
+ DUMA_DYN_DEPS=
+ DUMASO=
+- CFLAGS=-g -O0
+- CPPFLAGS=-g -O0
+ LIBS=
+ EXEPOSTFIX=.exe
+ endif
+ ifeq ($(OSTYPE), cygwin)
+ # call make OSTYPE=cygwin
+ BSWITCH=102
+- DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
++ CPPFLAGS += -DWIN32 -DDUMA_EXPLICIT_INIT
+ CURPATH=./
+ DUMA_DYN_DEPS=
+ DUMASO=
+- CFLAGS=-g -O0 -DWIN32 -Wall -Wextra
+- CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra
+ LIBS=
+ EXEPOSTFIX=.exe
+ endif
+ ifndef BSWITCH
+ BSWITCH=100
+- DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
++ CPPFLAGS += -DWIN32 -DDUMA_EXPLICIT_INIT
+ CURPATH=./
+ DUMA_DYN_DEPS=
+ DUMASO=
+- CFLAGS=-g -O0 -DWIN32
+- CPPFLAGS=-g -O0 -DWIN32
+ LIBS=
+ EXEPOSTFIX=.exe
+ endif
+@@ -158,29 +149,23 @@
+ # tested on darwin 8.0, which is the base for mac-osx
+ # call: make OS=osx
+ BSWITCH=210
+- DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
+- DUMA_OPTIONS += -DDUMA_SO_PREFER_GETENV
+-# DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
++ CPPFLAGS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS -DDUMA_SO_PREFER_GETENV
++# CPPFLAGS += -DDUMA_LIB_NO_LEAKDETECTION
+ CURPATH=./
+ # DUMA_DYN_DEPS=
+ DUMASO=libduma.dylib
+ DUMASO_LINK1=libduma.dylib
+- CFLAGS=-g -O0
+- CPPFLAGS=-g -O0
+ LIBS=-lpthread
+ EXEPOSTFIX=
+ endif
+
+ ifeq ($(OS), freebsd)
+ BSWITCH=310
+- DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
+- DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
++ CPPFLAGS += -DDUMA_NO_THREAD_SAFETY -DDUMA_EXPLICIT_INIT
+ CURPATH=./
+ DUMA_DYN_DEPS=
+ DUMASO=
+ DUMASO_LINK1=
+- CFLAGS=-g -O0
+- CPPFLAGS=-g -O0
+ LIBS=-lpthread
+ EXEPOSTFIX=
+ endif
+@@ -191,25 +176,19 @@
+ DUMASO=libduma.so.0.0.0
+ DUMASO_LINK1=libduma.so.0
+ DUMASO_LINK2=libduma.so
+- CFLAGS=-g -O0
+- CPPFLAGS=-g -O0
+ LIBS=-lpthread
+ EXEPOSTFIX=
+ endif
+
+ ifeq ($(OS), solaris)
+ BSWITCH=410
+- DUMA_OPTIONS += -DDUMA_NO_STRERROR
++ CPPFLAGS += -DDUMA_NO_STRERROR
+ CURPATH=./
+ DUMA_DYN_DEPS=
+ DUMASO=libduma.so.0.0.0
+ DUMASO_LINK1=libduma.so.0
+ DUMASO_LINK2=libduma.so
+- CFLAGS=-g -O0
+- CPPFLAGS=-g -O0
+- LDFLAGS += -lgcc_s
+- LDOPTIONS += -lgcc_s
+- LIBS=-Wl,-R/opt/sfw/lib -lpthread
++ LIBS=-lgcc_s -Wl,-R/opt/sfw/lib -lpthread
+ EXEPOSTFIX=
+ endif
+
+@@ -220,8 +199,6 @@
+ DUMASO=libduma.so.0.0.0
+ DUMASO_LINK1=libduma.so.0
+ DUMASO_LINK2=libduma.so
+- CFLAGS=-g -O0 -Wall -Wextra
+- CPPFLAGS=-g -O0 -Wall -Wextra
+ LIBS=-lpthread
+ EXEPOSTFIX=
+ endif
+@@ -234,8 +211,6 @@
+ DUMASO=libduma.so.0.0.0
+ DUMASO_LINK1=libduma.so.0
+ DUMASO_LINK2=libduma.so
+- CFLAGS=-g -O0 -Wall -Wextra
+- CPPFLAGS=-g -O0 -Wall -Wextra
+ LIBS=-lpthread
+ EXEPOSTFIX=
+ endif
+@@ -243,9 +218,6 @@
+
+ ############################################################
+
+-MAN_INSTALL_DIR=$(prefix)/share/man/man3
+-DOC_INSTALL_DIR=$(prefix)/share/doc/duma
+-
+ ifndef srcdir
+ srcdir=.
+ $(info using default srcdir [$(srcdir)])
+@@ -271,6 +243,10 @@
+ datadir=$(prefix)/share
+ endif
+
++ifndef mandir
++ mandir=$(datadir)/man
++endif
++
+ # The directory for installing read-only data files that pertain to a single machine--that is to say, files for configuring a host.
+ ifndef sysconfdir
+ sysconfdir=$(prefix)/etc
+@@ -286,6 +262,9 @@
+ includedir=$(prefix)/include
+ endif
+
++ifndef docdir
++ docdir=$(datadir)/doc/duma
++endif
+
+ PACKAGE_SOURCE=README.txt CHANGELOG COPYING-GPL COPYING-LGPL duma.3 Makefile gdbinit.rc \
+ duma.h dumapp.h duma_sem.h paging.h print.h duma_hlp.h noduma.h \
+@@ -344,6 +323,8 @@
+ @echo exec_prefix [$(exec_prefix)]
+ @echo bindir [$(bindir)]
+ @echo datadir [$(datadir)]
++ @echo mandir [$(mandir)]
++ @echo docdir [$(docdir)]
+ @echo sysconfdir [$(sysconfdir)]
+ @echo libdir [$(libdir)]
+ @echo includedir [$(includedir)]
+@@ -352,12 +333,11 @@
+ else
+ @echo oldincludedir empty
+ endif
+- @echo MAN_INSTALL_DIR [$(MAN_INSTALL_DIR)]
+- @echo DOC_INSTALL_DIR [$(DOC_INSTALL_DIR)]
+ @echo MAKE [$(MAKE)]
+ @echo CC [$(CC)]
+ @echo CFLAGS [$(CFLAGS)]
+ @echo CXX [$(CXX)]
++ @echo CXXFLAGS [$(CXXFLAGS)]
+ @echo CPPFLAGS [$(CPPFLAGS)]
+ @echo LD [$(LD)]
+ @echo AR [$(AR)]
+@@ -368,11 +348,9 @@
+ @echo RMFORCE [$(RMFORCE)]
+ @echo ECHO [$(ECHO)]
+ @echo ECHOLF [$(ECHOLF)]
+- @echo PIC [$(PIC)]
++ @echo LFLAGS [$(LFLAGS)]
+ @echo EXEPOSTFIX [$(EXEPOSTFIX)]
+ @echo CURPATH [$(CURPATH)]
+- @echo DUMA_OPTIONS [$(DUMA_OPTIONS)]
+- @echo DUMA_SO_OPTIONS [$(DUMA_SO_OPTIONS)]
+ @echo OBJECTS [$(OBJECTS)]
+ @echo SO_OBJECTS [$(SO_OBJECTS)]
+ @echo DUMASO [$(DUMASO)]
+@@ -386,8 +364,8 @@
+ # commands; copy any auxiliary files that the executable uses into the
+ # directories where it will look for them.
+ install: libduma.a duma.3 $(DUMASO)
+- - mkdir -p $(DOC_INSTALL_DIR)
+- $(INSTALL) -m 644 README.txt $(DOC_INSTALL_DIR)
++ - mkdir -p $(docdir)
++ $(INSTALL) -m 644 README.txt $(docdir)
+ - mkdir -p $(includedir)
+ $(INSTALL) -m 644 noduma.h duma.h dumapp.h duma_sem.h duma_config.h $(includedir)
+ - mkdir -p $(bindir)
+@@ -405,13 +383,13 @@
+ - $(RMFORCE) $(libdir)/$(DUMASO_LINK2)
+ ln -s $(DUMASO) $(libdir)/$(DUMASO_LINK2)
+ endif
+- - mkdir -p $(MAN_INSTALL_DIR)
+- $(INSTALL) -m 644 duma.3 $(MAN_INSTALL_DIR)/duma.3
++ - mkdir -p $(mandir)/man3
++ $(INSTALL) -m 644 duma.3 $(mandir)/man3/duma.3
+
+
+ # Delete all the installed files that the `install' target would create
+ uninstall:
+- - $(RMFORCE) $(DOC_INSTALL_DIR)/README.txt
++ - $(RMFORCE) $(docdir)/README.txt
+ - $(RMFORCE) $(includedir)/noduma.h
+ - $(RMFORCE) $(includedir)/duma.h
+ - $(RMFORCE) $(includedir)/dumapp.h
+@@ -428,7 +406,7 @@
+ ifdef DUMASO_LINK2
+ - $(RMFORCE) $(libdir)/$(DUMASO_LINK2)
+ endif
+- - $(RMFORCE) $(MAN_INSTALL_DIR)/duma.3
++ - $(RMFORCE) $(mandir)/man3/duma.3
+
+
+ # Delete all files that are normally created by running make.
+@@ -471,39 +449,39 @@
+
+ createconf$(EXEPOSTFIX): createconf.o
+ - $(RMFORCE) createconf$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) createconf.o -o createconf$(EXEPOSTFIX)
+
+ tstheap$(EXEPOSTFIX): libduma.a tstheap.o
+ - $(RMFORCE) tstheap$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) tstheap.o libduma.a -o tstheap$(EXEPOSTFIX) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) tstheap.o libduma.a -o tstheap$(EXEPOSTFIX) $(LIBS)
+
+ dumatest$(EXEPOSTFIX): libduma.a dumatest.o
+ - $(RMFORCE) dumatest$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) dumatest.o libduma.a -o dumatest$(EXEPOSTFIX) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) dumatest.o libduma.a -o dumatest$(EXEPOSTFIX) $(LIBS)
+
+ dumatestpp$(EXEPOSTFIX): libduma.a dumatestpp.o duma_sem.h dumapp.h
+ - $(RMFORCE) dumatestpp$(EXEPOSTFIX)
+- $(CXX) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp$(EXEPOSTFIX) $(LIBS)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp$(EXEPOSTFIX) $(LIBS)
+
+ thread-test$(EXEPOSTFIX): libduma.a thread-test.o
+ - $(RMFORCE) thread-test$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) thread-test.o libduma.a -o thread-test$(EXEPOSTFIX) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) thread-test.o libduma.a -o thread-test$(EXEPOSTFIX) $(LIBS)
+
+ testmt$(EXEPOSTFIX): libduma.a testmt.o
+ - $(RMFORCE) testmt$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) testmt.o libduma.a -o testmt$(EXEPOSTFIX) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) testmt.o libduma.a -o testmt$(EXEPOSTFIX) $(LIBS)
+
+ testoperators$(EXEPOSTFIX): libduma.a testoperators.o duma_sem.h dumapp.h
+ - $(RMFORCE) testoperators$(EXEPOSTFIX)
+- $(CXX) $(CPPFLAGS) testoperators.o libduma.a -o testoperators$(EXEPOSTFIX) $(LIBS)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) testoperators.o libduma.a -o testoperators$(EXEPOSTFIX) $(LIBS)
+
+ tstheap_so$(EXEPOSTFIX): tstheap_so.o
+ - $(RMFORCE) tstheap_so$(EXEPOSTFIX)
+- $(CC) $(CFLAGS) tstheap_so.o -o tstheap_so$(EXEPOSTFIX) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) tstheap_so.o -o tstheap_so$(EXEPOSTFIX) $(LIBS)
+
+ dumatestpp_so$(EXEPOSTFIX): dumatestpp_so.o
+ - $(RMFORCE) dumatestpp_so$(EXEPOSTFIX)
+- $(CXX) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so$(EXEPOSTFIX) $(LIBS)
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so$(EXEPOSTFIX) $(LIBS)
+
+
+ $(OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o: duma.h
+@@ -514,14 +492,14 @@
+ ifeq ($(OS), osx)
+
+ $(DUMASO): duma_config.h $(SO_OBJECTS)
+- $(CXX) -g -dynamiclib -Wl -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
+- $(CXX) -g -dynamiclib -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -dynamiclib -Wl -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -dynamiclib -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
+
+ else
+
+ $(DUMASO): duma_config.h $(SO_OBJECTS)
+- $(CXX) -g -shared -Wl,-soname,$(DUMASO) -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
+-# $(CXX) -g -shared -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -shared -Wl,-soname,$(DUMASO) -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
++# $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -shared -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
+
+ endif
+
+@@ -532,7 +510,7 @@
+ # define rules how to build objects for createconf
+ #
+ createconf.o:
+- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c createconf.c -o $@
+
+
+ #
+@@ -540,39 +518,39 @@
+ #
+
+ dumapp_so.o: dumapp.cpp duma.h duma_sem.h dumapp.h
+- $(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumapp.cpp -o $@
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(LFLAGS) -c dumapp.cpp -o $@
+
+ duma_so.o: duma.c duma.h duma_config.h
+- $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c duma.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(LFLAGS) -c duma.c -o $@
+
+ sem_inc_so.o: sem_inc.c duma_sem.h
+- $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c sem_inc.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(LFLAGS) -c sem_inc.c -o $@
+
+ print_so.o: print.c print.h
+- $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c print.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(LFLAGS) -c print.c -o $@
+
+-# DUMA_SO_OPTIONS needed cause duma.h is included explicitly
++# LFLAGS needed cause duma.h is included explicitly
+ tstheap_so.o:
+- $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tstheap.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(LFLAGS) -c tstheap.c -o $@
+
+ dumatestpp_so.o:
+- $(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumatestpp.cpp -o $@
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(LFLAGS) -c dumatestpp.cpp -o $@
+
+ #
+ # define rules how to build objects for static library
+ #
+
+ dumapp.o: dumapp.cpp duma.h duma_sem.h dumapp.h
+- $(CXX) $(CPPFLAGS) -c dumapp.cpp -o $@
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c dumapp.cpp -o $@
+
+ duma.o: duma.c duma.h duma_config.h
+- $(CC) $(CFLAGS) -c duma.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c duma.c -o $@
+
+ sem_inc.o: sem_inc.c duma_sem.h
+- $(CC) $(CFLAGS) -c sem_inc.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c sem_inc.c -o $@
+
+ print.o: print.c print.h
+- $(CC) $(CFLAGS) -c print.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c print.c -o $@
+
+
+ #
+@@ -580,32 +558,32 @@
+ #
+
+ dumatest.o: dumatest.c duma.h duma_config.h
+- $(CC) $(CFLAGS) -c dumatest.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c dumatest.c -o $@
+
+ dumatestpp.o: dumatestpp.cpp duma.h duma_sem.h dumapp.h duma_config.h
+- $(CXX) $(CPPFLAGS) -c dumatestpp.cpp -o $@
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c dumatestpp.cpp -o $@
+
+ tstheap.o: tstheap.c duma.h duma_config.h
+- $(CC) $(CFLAGS) -c tstheap.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c tstheap.c -o $@
+
+ testoperators.o: testoperators.cpp duma.h duma_sem.h dumapp.h duma_config.h
+- $(CXX) $(CPPFLAGS) -c testoperators.cpp -o $@
++ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c testoperators.cpp -o $@
+
+ thread-test.o: thread-test.c duma.h duma_config.h
+- $(CC) $(CFLAGS) -c thread-test.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c thread-test.c -o $@
+
+ testmt.o: testmt.c duma.h duma_config.h
+- $(CC) $(CFLAGS) -c testmt.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c testmt.c -o $@
+
+
+ #
+ # default rules
+ #
+ #.c.o:
+-# $(CC) $(CFLAGS) -c $< -o $@
++# $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ #
+ #.cpp.o:
+-# $(CXX) $(CPPFLAGS) -c $< -o $@
++# $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
+ #
+
+ .PHONY: check test installcheck install uninstall clean distclean realclean clobber dos2unix printvars
+diff -ur duma_2_5_15.orig/README.txt duma_2_5_15/README.txt
+--- duma_2_5_15.orig/README.txt 2009-04-07 01:26:47.000000000 +0300
++++ duma_2_5_15/README.txt 2009-06-22 05:53:14.000000000 +0300
+@@ -377,7 +377,7 @@
+ linenumber of the calling function. The atexit() function checks if each
+ allocated memory block was freed. To disable leak detection add the
+ preprocessor definition 'DUMA_SO_NO_LEAKDETECTION' or
+-'DUMA_LIB_NO_LEAKDETECTION' to DUMA_OPTIONS in Makefile.
++'DUMA_LIB_NO_LEAKDETECTION' to CPPFLAGS in Makefile.
+ If a leak is reported without source filename and line number but is
+ reproducible with the same pointer, set a conditional breakpoint on the
+ function 'void * duma_alloc_return( void * address)'
+@@ -392,7 +392,7 @@
+ same leak detection reports as for malloc and free. 'dumapp.h' needs to be
+ included from your source file(s).
+ For disabling the C++ new/delete/new[] and delete[] operators, add the
+-preprocessor definition 'DUMA_NO_CPP_SUPPORT' to DUMA_OPTIONS in Makefile.
++preprocessor definition 'DUMA_NO_CPP_SUPPORT' to CPPFLAGS in Makefile.
+
+
+ DEFINITION OF OWN MEMBER NEW/DELETE OPERATORS: