OSSP CVS Repository

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

Check-in Number: 930
Date: 2001-Sep-11 12:37:04 (local)
2001-Sep-11 10:37:04 (UTC)
User:thl
Branch:
Comment: add Dmalloc support to L2
Tickets:
Inspections:
Files:
ossp-pkg/l2/acconfig.h      added-> 1.1
ossp-pkg/l2/aclocal.m4      1.3 -> 1.4     135 inserted, 0 deleted
ossp-pkg/l2/configure.ac      1.5 -> 1.6     2 inserted, 0 deleted
ossp-pkg/l2/l2_ch_socket.c      1.23 -> 1.24     1 inserted, 1 deleted
ossp-pkg/l2/l2_p.h      1.14 -> 1.15     6 inserted, 0 deleted
ossp-pkg/l2/l2_ut_sa.c      1.5 -> 1.6     1 inserted, 1 deleted

ossp-pkg/l2/acconfig.h -> 1.1

*** /dev/null    Fri Apr 26 16:15:37 2024
--- -    Fri Apr 26 16:15:49 2024
***************
*** 0 ****
--- 1,4 ----
+ 
+ /* optional Dmalloc support */
+ #undef WITH_DMALLOC
+ 


ossp-pkg/l2/aclocal.m4 1.3 -> 1.4

--- aclocal.m4   2001/08/15 10:36:03     1.3
+++ aclocal.m4   2001/09/11 10:37:04     1.4
@@ -186,3 +186,138 @@
     AC_PROG_LIBTOOL
 ])
 
+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-]$2[[=DIR]        build with external $1 library (default=no)]], [dnl
+    if test ".$with_$2" = .yes; then
+        #   via config script
+        $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"; 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
+            #   via standard paths
+            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.a" -o -f "$dir/lib$2.so"; then
+                        LDFLAGS="$LDFLAGS -L$dir"
+                        found=1
+                        break
+                    fi
+                done
+            fi
+            #   in any subarea
+            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)
+    AC_IFALLYES(header:$4 lib:$2_$3, with_$2=yes, with_$2=no)
+    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
+
+define(AC_IFALLYES,[dnl
+ac_rc=yes
+for ac_spec in $1; do
+    ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
+    ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
+    case $ac_type in
+        header [)]
+            ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+            ac_var="ac_cv_header_$ac_item"
+            ;;
+        file [)]
+            ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+            ac_var="ac_cv_file_$ac_item"
+            ;;
+        func    [)] ac_var="ac_cv_func_$ac_item"   ;;
+        lib     [)] ac_var="ac_cv_lib_$ac_item"    ;;
+        define  [)] ac_var="ac_cv_define_$ac_item" ;;
+        typedef [)] ac_var="ac_cv_typedef_$ac_item" ;;
+        custom  [)] ac_var="$ac_item" ;;
+    esac
+    eval "ac_val=\$$ac_var"
+    if test ".$ac_val" != .yes; then
+        ac_rc=no
+        break
+    fi
+done
+if test ".$ac_rc" = .yes; then
+    :
+    $2
+else
+    :
+    $3
+fi
+])
+


ossp-pkg/l2/configure.ac 1.5 -> 1.6

--- configure.ac 2001/09/10 09:48:48     1.5
+++ configure.ac 2001/09/11 10:37:04     1.6
@@ -77,6 +77,8 @@
 AC_CONFIGURE_LIBTOOL
 AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop snprintf vsnprintf)
 
+AC_CHECK_EXTLIB([Dmalloc], dmalloc, dmalloc_debug, dmalloc.h, AC_DEFINE(WITH_DMALLOC))
+
 AC_OUTPUT(dnl
 Makefile dnl
 l2.h dnl


ossp-pkg/l2/l2_ch_socket.c 1.23 -> 1.24

--- l2_ch_socket.c       2001/09/10 14:32:57     1.23
+++ l2_ch_socket.c       2001/09/11 10:37:04     1.24
@@ -36,7 +36,7 @@
 #include <arpa/inet.h>
 
 #include "l2.h"
-#include "l2_config.h"
+#include "l2_p.h"
 
 #if defined(HAVE_INET_PTON)
 #define l2_inet_pton inet_pton


ossp-pkg/l2/l2_p.h 1.14 -> 1.15

--- l2_p.h       2001/09/10 10:15:11     1.14
+++ l2_p.h       2001/09/11 10:37:04     1.15
@@ -33,9 +33,15 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include "l2.h"
+#include "l2_config.h"
 #include "l2_ut_pcre.h"
 #include "l2_ut_sa.h"
 
+#if defined(HAVE_DMALLOC_H) && defined(WITH_DMALLOC)
+#include "dmalloc.h"
+#endif
+
 #define L2_MAX_MSGSIZE    4096
 #define L2_MAX_CHANNELS    128
 #define L2_MAX_FORMATTERS  128


ossp-pkg/l2/l2_ut_sa.c 1.5 -> 1.6

--- l2_ut_sa.c   2001/09/09 15:54:31     1.5
+++ l2_ut_sa.c   2001/09/11 10:37:04     1.6
@@ -46,7 +46,7 @@
 #include <arpa/inet.h>
 
 /* own headers */
-#include "l2_config.h"
+#include "l2_p.h"
 #include "l2_ut_sa.h"
 
 struct sa_addr_st {

CVSTrac 2.0.1