OSSP CVS Repository

ossp - Check-in [5630]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5630
Date: 2006-Aug-02 15:11:09 (local)
2006-Aug-02 13:11:09 (UTC)
User:rse
Branch:
Comment: Optional DMALLOC based memory debugging support.
Tickets:
Inspections:
Files:
ossp-pkg/uuid/ChangeLog      1.131 -> 1.132     5 inserted, 1 deleted
ossp-pkg/uuid/aclocal.m4      1.2 -> 1.3     127 inserted, 0 deleted
ossp-pkg/uuid/configure.ac      1.11 -> 1.12     1 inserted, 0 deleted
ossp-pkg/uuid/devtool.conf      1.30 -> 1.31     3 inserted, 0 deleted
ossp-pkg/uuid/uuid.c      1.61 -> 1.62     1 inserted, 1 deleted
ossp-pkg/uuid/uuid_ac.h      1.5 -> 1.6     14 inserted, 1 deleted
ossp-pkg/uuid/uuid_cli.c      1.23 -> 1.24     3 inserted, 1 deleted
ossp-pkg/uuid/uuid_dce.c      1.6 -> 1.7     0 inserted, 1 deleted
ossp-pkg/uuid/uuid_mac.c      1.10 -> 1.11     6 inserted, 3 deleted
ossp-pkg/uuid/uuid_md5.c      1.14 -> 1.15     5 inserted, 1 deleted
ossp-pkg/uuid/uuid_prng.c      1.13 -> 1.14     5 inserted, 1 deleted
ossp-pkg/uuid/uuid_sha1.c      1.4 -> 1.5     5 inserted, 1 deleted
ossp-pkg/uuid/uuid_str.c      1.8 -> 1.9     5 inserted, 1 deleted
ossp-pkg/uuid/uuid_ui128.c      1.2 -> 1.3     5 inserted, 1 deleted
ossp-pkg/uuid/uuid_ui64.c      1.5 -> 1.6     5 inserted, 1 deleted

ossp-pkg/uuid/ChangeLog 1.131 -> 1.132

--- ChangeLog    2006/08/02 11:59:34     1.131
+++ ChangeLog    2006/08/02 13:11:09     1.132
@@ -13,7 +13,11 @@
 
   Changes between 1.5.1 and 1.5.2 (31-Jul-2006 to xx-Aug-2006)
 
-   o Consistently include "config.h" in all source files.
+   o Optional DMALLOC based memory debugging support.
+     [Ralf S. Engelschall]
+
+   o Consistently include "uuid_ac.h" in all source files to have GNU
+     autoconf results and standard system defines available everywhere.
      [Ralf S. Engelschall]
 
   Changes between 1.5.0 and 1.5.1 (28-Jul-2006 to 31-Jul-2006)


ossp-pkg/uuid/aclocal.m4 1.2 -> 1.3

--- aclocal.m4   2006/03/13 09:39:11     1.2
+++ aclocal.m4   2006/08/02 13:11:09     1.3
@@ -223,3 +223,130 @@
   fi
 ])
 
+dnl ##
+dnl ##  Check for an external/extension library.
+dnl ##  - is aware of <libname>-config style scripts
+dnl ##  - searches under standard paths include, lib, etc.
+dnl ##  - searches under subareas like .libs, etc.
+dnl ##
+dnl ##  configure.in:
+dnl ##      AC_CHECK_EXTLIB(<realname>, <libname>, <func>, <header>,
+dnl ##                      [<success-action> [, <fail-action>]])
+dnl ##  Makefile.in:
+dnl ##      CFLAGS  = @CFLAGS@
+dnl ##      LDFLAGS = @LDFLAGS@
+dnl ##      LIBS    = @LIBS@
+dnl ##  shell:
+dnl ##      $ ./configure --with-<libname>[=DIR]
+dnl ##
+
+AC_DEFUN(AC_CHECK_EXTLIB,[dnl
+AC_ARG_WITH($2, [dnl
+[  --with-]m4_substr([$2[[=DIR]]                     ], 0, 19)[build with external $1 library (default=no)]], [dnl
+    if test ".$with_$2" = .yes; then
+        #   via config script in PATH
+        $2_version=`($2-config --version) 2>/dev/null`
+        if test ".$$2_version" != .; then
+            CPPFLAGS="$CPPFLAGS `$2-config --cflags`"
+            CFLAGS="$CFLAGS `$2-config --cflags`"
+            LDFLAGS="$LDFLAGS `$2-config --ldflags`"
+        fi
+    else
+        if test -d "$with_$2"; then
+            found=0
+            #   via config script
+            for dir in $with_$2/bin $with_$2; do
+                if test -f "$dir/$2-config" && test ! -f "$dir/$2-config.in"; then
+                    $2_version=`($dir/$2-config --version) 2>/dev/null`
+                    if test ".$$2_version" != .; then
+                        CPPFLAGS="$CPPFLAGS `$dir/$2-config --cflags`"
+                        CFLAGS="$CFLAGS `$dir/$2-config --cflags`"
+                        LDFLAGS="$LDFLAGS `$dir/$2-config --ldflags`"
+                        found=1
+                        break
+                    fi
+                fi
+            done
+            #   in standard sub-areas
+            if test ".$found" = .0; then
+                for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
+                    if test -f "$dir/$4"; then
+                        CPPFLAGS="$CPPFLAGS -I$dir"
+                        CFLAGS="$CFLAGS -I$dir"
+                        found=1
+                        break
+                    fi
+                done
+                for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do
+                    if test -f "$dir/lib$2.la" && test -d "$dir/.libs"; then
+                        LDFLAGS="$LDFLAGS -L$dir -L$dir/.libs"
+                        found=1
+                        break
+                    elif test -f "$dir/lib$2.a" || test -f "$dir/lib$2.so"; then
+                        LDFLAGS="$LDFLAGS -L$dir"
+                        found=1
+                        break
+                    fi
+                done
+            fi
+            #   in any sub-area
+            if test ".$found" = .0; then
+changequote(, )dnl
+                for file in x `find $with_$2 -name "$4" -type f -print`; do
+                    test .$file = .x && continue
+                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
+                    CPPFLAGS="$CPPFLAGS -I$dir"
+                    CFLAGS="$CFLAGS -I$dir"
+                done
+                for file in x `find $with_$2 -name "lib$2.[aso]" -type f -print`; do
+                    test .$file = .x && continue
+                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
+                    LDFLAGS="$LDFLAGS -L$dir"
+                done
+changequote([, ])dnl
+            fi
+        fi
+    fi
+    AC_HAVE_HEADERS($4)
+    AC_CHECK_LIB($2, $3)
+    with_$2=yes
+    ac_var="ac_cv_header_`echo $4 | sed 'y%./+-%__p_%'`"
+    eval "ac_val=\$$ac_var"
+    if test ".$ac_val" != .yes; then
+        with_$2=no
+    fi
+    if test ".$ac_cv_lib_$2_$3" != .yes; then
+        with_$2=no
+    fi
+    if test ".$with_$2" = .no; then
+        AC_ERROR([Unable to find $1 library])
+    fi
+    ], [dnl
+if test ".$with_$2" = .; then
+    with_$2=no
+fi
+    ])dnl
+AC_MSG_CHECKING(whether to build against external $1 library)
+if test ".$with_$2" = .yes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+AC_MSG_RESULT([$with_$2])
+])dnl
+
+dnl ##
+dnl ##  Check whether to activate Dmalloc
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_DMALLOC
+dnl ##
+
+AC_DEFUN(AC_CHECK_DMALLOC,[dnl
+AC_CHECK_EXTLIB(Dmalloc, dmalloc, dmalloc_debug, dmalloc.h,
+                AC_DEFINE(WITH_DMALLOC, 1, [define if building with Dmalloc]))
+if test ".$with_dmalloc" = .yes; then
+    CFLAGS=`echo "X$CFLAGS" | sed -e 's;^X;;' -e 's; -Wredundant-decls;;'`
+fi
+])dnl
+


ossp-pkg/uuid/configure.ac 1.11 -> 1.12

--- configure.ac 2006/01/13 06:44:30     1.11
+++ configure.ac 2006/08/02 13:11:09     1.12
@@ -41,6 +41,7 @@
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_CHECK_DEBUGGING
+AC_CHECK_DMALLOC
 
 with_tags=""
 sinclude(libtool.m4)


ossp-pkg/uuid/devtool.conf 1.30 -> 1.31

--- devtool.conf 2006/07/31 12:02:57     1.30
+++ devtool.conf 2006/08/02 13:11:09     1.31
@@ -13,10 +13,13 @@
     @autoclean autoconf
 
 %configure
+    CPPFLAGS="-I/usr/opkg/include" \
+    LDFLAGS="-L/usr/opkg/lib" \
     ./configure \
         --prefix=/tmp/uuid \
         --disable-shared \
         --enable-debug \
+        --with-dmalloc \
         --with-dce \
         --with-cxx \
         --with-perl \


ossp-pkg/uuid/uuid.c 1.61 -> 1.62

--- uuid.c       2006/07/28 19:04:32     1.61
+++ uuid.c       2006/08/02 13:11:09     1.62
@@ -28,8 +28,8 @@
 */
 
 /* own headers (part 1/2) */
-#include "config.h"
 #include "uuid.h"
+#include "uuid_ac.h"
 
 /* system headers */
 #include <stdio.h>


ossp-pkg/uuid/uuid_ac.h 1.5 -> 1.6

--- uuid_ac.h    2006/01/13 06:44:30     1.5
+++ uuid_ac.h    2006/08/02 13:11:09     1.6
@@ -30,7 +30,20 @@
 #ifndef __UUID_AC_H__
 #define __UUID_AC_H__
 
-#include "config.h"
+/* include GNU autoconf results */
+#include "config.h"           /* HAVE_xxx */
+
+/* include standard system headers */
+#include <stdio.h>            /* NULL, etc. */
+#include <stdlib.h>           /* malloc, NULL, etc. */
+#include <stdarg.h>           /* va_list, etc. */
+#include <string.h>           /* size_t, strlen, etc. */
+#include <unistd.h>           /* dmalloc pre-loading */
+
+/* enable optional "dmalloc" support */
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>          /* malloc override, etc */
+#endif
 
 /* define boolean values */
 #define UUID_FALSE 0


ossp-pkg/uuid/uuid_cli.c 1.23 -> 1.24

--- uuid_cli.c   2006/08/02 11:59:08     1.23
+++ uuid_cli.c   2006/08/02 13:11:09     1.24
@@ -27,9 +27,11 @@
 **  uuid_cli.c: command line tool
 */
 
-#include "config.h"
+/* own headers */
 #include "uuid.h"
+#include "uuid_ac.h"
 
+/* system headers */
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>


ossp-pkg/uuid/uuid_dce.c 1.6 -> 1.7

--- uuid_dce.c   2006/08/02 11:59:08     1.6
+++ uuid_dce.c   2006/08/02 13:11:09     1.7
@@ -41,7 +41,6 @@
 #undef uuid_hash
 
 /* include regular API */
-#include "config.h"
 #include "uuid.h"
 
 /* helper macro */


ossp-pkg/uuid/uuid_mac.c 1.10 -> 1.11

--- uuid_mac.c   2006/07/28 19:04:32     1.10
+++ uuid_mac.c   2006/08/02 13:11:09     1.11
@@ -27,16 +27,16 @@
 **  uuid_mac.c: Media Access Control (MAC) resolver implementation
 */
 
-#include "config.h"
-#include "uuid_mac.h"
+/* own headers (part (1/2) */
+#include "uuid_ac.h"
 
+/* system headers */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <time.h>
-
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
@@ -77,6 +77,9 @@
 #include <ifaddrs.h>
 #endif
 
+/* own headers (part (1/2) */
+#include "uuid_mac.h"
+
 #ifndef FALSE
 #define FALSE 0
 #endif


ossp-pkg/uuid/uuid_md5.c 1.14 -> 1.15

--- uuid_md5.c   2006/07/28 19:16:03     1.14
+++ uuid_md5.c   2006/08/02 13:11:09     1.15
@@ -27,10 +27,14 @@
 **  uuid_md5.c: MD5 API implementation
 */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <stdlib.h>
 #include <string.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_md5.h"
 
 /*


ossp-pkg/uuid/uuid_prng.c 1.13 -> 1.14

--- uuid_prng.c  2006/08/02 11:59:08     1.13
+++ uuid_prng.c  2006/08/02 13:11:09     1.14
@@ -27,6 +27,10 @@
 **  uuid_prng.c: PRNG API implementation
 */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -34,7 +38,7 @@
 #include <sys/time.h>
 #include <fcntl.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_prng.h"
 #include "uuid_md5.h"
 


ossp-pkg/uuid/uuid_sha1.c 1.4 -> 1.5

--- uuid_sha1.c  2006/07/28 19:16:05     1.4
+++ uuid_sha1.c  2006/08/02 13:11:10     1.5
@@ -27,10 +27,14 @@
 **  uuid_sha1.c: SHA-1 API implementation
 */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <stdlib.h>
 #include <string.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_sha1.h"
 
 /*


ossp-pkg/uuid/uuid_str.c 1.8 -> 1.9

--- uuid_str.c   2006/03/17 07:10:10     1.8
+++ uuid_str.c   2006/08/02 13:11:10     1.9
@@ -48,12 +48,16 @@
  * o Ralf S. Engelschall <rse@engelschall.com> (1999, for OSSP)
  */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <ctype.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_str.h"
 
 #if HAVE_LONG_LONG


ossp-pkg/uuid/uuid_ui128.c 1.2 -> 1.3

--- uuid_ui128.c 2006/08/02 11:59:08     1.2
+++ uuid_ui128.c 2006/08/02 13:11:10     1.3
@@ -27,10 +27,14 @@
 **  ui128.c: implementation of 128-bit unsigned integer arithmetic
 */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <string.h>
 #include <ctype.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_ui128.h"
 
 #define UI128_BASE   256 /* 2^8 */


ossp-pkg/uuid/uuid_ui64.c 1.5 -> 1.6

--- uuid_ui64.c  2006/08/02 11:59:08     1.5
+++ uuid_ui64.c  2006/08/02 13:11:10     1.6
@@ -27,10 +27,14 @@
 **  ui64.c: implementation of 64-bit unsigned integer arithmetic
 */
 
+/* own headers (part 1/2) */
+#include "uuid_ac.h"
+
+/* system headers */
 #include <string.h>
 #include <ctype.h>
 
-#include "config.h"
+/* own headers (part 2/2) */
 #include "uuid_ui64.h"
 
 #define UI64_BASE   256 /* 2^8 */

CVSTrac 2.0.1