Skip to content

Commit cceb1b2

Browse files
committed
Automatic OS detection and additional reformatting.
Added best-guess automatic OS detection to GNUmakefile. Made a few minor textual changes and typo corrections, and additional adjustments newline and whitespace fixes.
1 parent 19a1f49 commit cceb1b2

20 files changed

+31
-38
lines changed

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
CHANGELOG:
32
==========
43

@@ -702,3 +701,4 @@ CHANGELOG:
702701

703702
2.0.5 20-January-1995
704703
Port to Linux.
704+

COPYING-LGPL

-2
Original file line numberDiff line numberDiff line change
@@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names:
500500
Ty Coon, President of Vice
501501

502502
That's all there is to it!
503-
504-

GNUmakefile

+18-4
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ AR=ar
102102
RANLIB=ranlib
103103
INSTALL=install
104104

105+
ifndef $(OS)
106+
OS=$(shell uname -s 2>/dev/null | tr '[:upper:]' '[:lower:]' 2>/dev/null || true)
107+
endif
108+
105109
# dynamic dependencies
106110
DUMA_DYN_DEPS=$(DUMASO) tstheap_so$(EXEPOSTFIX) dumatestpp_so$(EXEPOSTFIX)
107111

108-
# some OS specific:
109-
112+
# some OS specifics:
110113
ifeq ($(OS), Windows_NT)
111114
ifeq ($(OSTYPE), msys)
115+
$(info using settings for OS=Windows_NT, OSTYPE=msys)
112116
# call mingw32-make OSTYPE=msys
113117
# from Windows command prompt
114118
# having added the PATH for MINGW/bin
@@ -129,6 +133,7 @@ ifeq ($(OS), Windows_NT)
129133
EXEPOSTFIX=.exe
130134
endif
131135
ifeq ($(OSTYPE), msys-sh)
136+
$(info using settings for OS=Windows_NT, OSTYPE=msys-sh)
132137
# call mingw32-make OSTYPE=msyssh
133138
# from MSYS shell
134139
# having added the PATH for MINGW/bin
@@ -151,6 +156,7 @@ ifeq ($(OS), Windows_NT)
151156
EXEPOSTFIX=.exe
152157
endif
153158
ifeq ($(OSTYPE), cygwin)
159+
$(info using settings for OS=Windows_NT, OSTYPE=cygwin)
154160
# call make OSTYPE=cygwin
155161
BSWITCH=103
156162
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
@@ -163,6 +169,7 @@ ifeq ($(OS), Windows_NT)
163169
EXEPOSTFIX=.exe
164170
endif
165171
ifndef BSWITCH
172+
$(info using settings for OS=Windows_NT)
166173
BSWITCH=100
167174
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
168175
CURPATH=./
@@ -176,6 +183,7 @@ ifeq ($(OS), Windows_NT)
176183
endif
177184

178185
ifeq ($(OS), osx)
186+
$(info using settings for OS=osx)
179187
# tested on darwin 8.0, which is the base for mac-osx
180188
# call: make OS=osx
181189
BSWITCH=210
@@ -193,6 +201,7 @@ ifeq ($(OS), osx)
193201
endif
194202

195203
ifeq ($(OS), freebsd)
204+
$(info using settings for OS=freebsd)
196205
BSWITCH=310
197206
DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
198207
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
@@ -206,7 +215,8 @@ ifeq ($(OS), freebsd)
206215
EXEPOSTFIX=
207216
endif
208217

209-
ifeq ($(OS), netbsd)
218+
ifeq ($(OS), netbsd)
219+
$(info using settings for OS=netbsd)
210220
BSWITCH=320
211221
CURPATH=./
212222
DUMASO=libduma.so.0.0.0
@@ -219,6 +229,7 @@ ifeq ($(OS), netbsd)
219229
endif
220230

221231
ifeq ($(OS), solaris)
232+
$(info using settings for OS=solaris)
222233
BSWITCH=410
223234
DUMA_OPTIONS += -DDUMA_NO_STRERROR
224235
CURPATH=./
@@ -235,6 +246,7 @@ ifeq ($(OS), solaris)
235246
endif
236247

237248
ifeq ($(OS), linux)
249+
$(info using settings for OS=linux)
238250
# Linux with GNU compiler and tools.
239251
CC=gcc
240252
CXX=g++
@@ -356,6 +368,8 @@ endif
356368
@ $(ECHOLF)
357369
@ $(ECHO) "DUMA dynamic confidence test PASSED."
358370
@ $(ECHOLF)
371+
@ $(ECHO) "You may now run make install and then installcheck"
372+
@ $(ECHOLF)
359373
endif
360374

361375
# Perform installation tests (if any).
@@ -502,7 +516,7 @@ libduma.a: duma_config.h verinfo.h $(OBJECTS)
502516

503517
verinfo.h: FORCE
504518
- $(CURPATH)make_git_source_version.sh > $(CURPATH)verinfo.h
505-
$(shell touch verinfo.h)
519+
$(shell touch verinfo.h || true)
506520

507521
duma_config.h:
508522
$(MAKE) reconfig

INSTALL

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
This documents describes if and how the library is installed on your system.
32

43
I. Linux/Unix environments (including Cygwin and MinGW):
@@ -18,15 +17,16 @@ I. Linux/Unix environments (including Cygwin and MinGW):
1817
Add option 'OS=freebsd' when calling make for FreeBSD.
1918
Add option 'OS=netbsd' when calling make for NetBSD.
2019
Add option 'OS=solaris' when calling make for Solaris.
20+
Add option 'OS=linux' when calling make for Linux.
2121

22-
Get system user with 'su', if you are going to install into
23-
system directories
22+
Get system user with 'su' or 'sudo', if you are going
23+
to install into system directories
2424

25-
Call 'gmake install' for installation in system directories.
25+
Call 'make' or 'gmake install' to install into system directories.
2626

2727
Note: You need not install DUMA. Setting system PATH for duma.sh
2828
or INCLUDE/LIBS variables after compilation may suffice, too.
29-
The (outdated) manual page needs installation.
29+
The (outdated) manual page should be installed as well.
3030

3131

3232
II. Windows 2000/XP, Visual Studio Environments:

LICENSE

-2
Original file line numberDiff line numberDiff line change
@@ -842,5 +842,3 @@ necessary. Here is a sample; alter the names:
842842
Ty Coon, President of Vice
843843

844844
That's all there is to it!
845-
846-

README.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Title: README
32

43
D.U.M.A. - Detect Unintended Memory Access - A Red-Zone memory allocator:
@@ -7,9 +6,11 @@ D.U.M.A. - Detect Unintended Memory Access - A Red-Zone memory allocator:
76
DESCRIPTION:
87

98

10-
DUMA helps you detect two common programming bugs:
11-
software that overruns the boundaries of a malloc() memory allocation, and
12-
software that touches a memory allocation that has been released by free().
9+
DUMA helps you detect two of the most common programming errors:
10+
11+
1. software that overruns the boundaries of a malloc() memory allocation,
12+
2. software that touches memory allocations already released by free().
13+
1314
Unlike other malloc() debuggers, DUMA will detect read accesses as well as
1415
writes, and it will pinpoint the exact instruction that causes an error.
1516
It has been in use at Pixar since 1987, and at many other sites for years.

TODO

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
TODO items (listed by general priority):
32
========================================
43

WIN32_DETOURS_HOWTO.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Title: Win32 Detours Howto
32

43
It is now possible to use detours with duma on already compiled binaries.

createconf.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
*

createconf_new.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
*

duma.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2006 Michael Eddington <[email protected]>

duma.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2006 Michael Eddington <[email protected]>
@@ -350,6 +349,4 @@
350349
#define CA_REF(NAME,INDEX) \
351350
NAME[ DUMA_ASSERT( (NAME ## _checkedidx = (INDEX)) < NAME ## _checkedsize ), NAME ## _checkedidx ]
352351

353-
354-
355-
#endif /* end ifdef DUMA_NO_DUMA */
352+
#endif /* end ifdef DUMA_NO_DUMA */

duma_hlp.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH

duma_sem.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2005 Hayati Ayguen <[email protected]>, Procitec GmbH

dumapp.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH

dumapp.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2008 Hayati Ayguen <[email protected]>, Procitec GmbH
@@ -214,5 +213,4 @@
214213

215214
#endif /* end ifdef DUMA_NO_CPP_SUPPORT */
216215

217-
218-
#include "duma.h"
216+
#include "duma.h"

paging.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Title: paging.h */
32

43
/*
@@ -403,5 +402,4 @@ Page_Size(void)
403402
#endif
404403
}
405404

406-
407405
#endif /* DUMA_PAGING_H */

print.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2006 Michael Eddington <[email protected]>

print.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2008 Hayati Ayguen <[email protected]>, Procitec GmbH

sem_inc.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* DUMA - Red-Zone memory allocator.
43
* Copyright (C) 2002-2008 Hayati Ayguen <[email protected]>, Procitec GmbH

0 commit comments

Comments
 (0)