remove CURLDEBUG as per #82

pull/354/head
Brad House 4 years ago
parent 0c85e62af2
commit abe1ff1ff3
  1. 14
      Makefile.am
  2. 7
      Makefile.dj
  3. 6
      Makefile.netware
  4. 14
      ares_init.c
  5. 9
      ares_private.h
  6. 4
      configure.ac
  7. 91
      m4/cares-compilers.m4
  8. 40
      m4/cares-confopts.m4

@ -21,18 +21,8 @@ ACLOCAL_AMFLAGS = -I m4
# $(top_builddir) is for c-ares's generated ares_config.h file
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
if CURLDEBUG
AM_CPPFLAGS = -I$(top_builddir)/../include/curl \
-I$(top_builddir)/../include \
-I$(top_srcdir)/../include \
-I$(top_builddir)/../lib \
-I$(top_srcdir)/../lib \
-I$(top_builddir) \
-I$(top_srcdir)
else
AM_CPPFLAGS = -I$(top_builddir) \
-I$(top_srcdir)
endif
lib_LTLIBRARIES = libcares.la
@ -42,11 +32,7 @@ MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \
vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw \
msvc_ver.inc
if CURLDEBUG
PROGS =
else
PROGS = ahost adig acountry
endif
noinst_PROGRAMS =$(PROGS)

@ -15,12 +15,7 @@ CFLAGS += -DWATT32 -Dselect=select_s
LDFLAGS = -s
ifeq ($(USE_CURLDEBUG),1)
EX_LIBS = ../lib/libcurl.a
OBJ_HACK = $(OBJECTS)
else
OBJ_HACK = libcares.a
endif
OBJ_HACK = libcares.a
ifeq ($(USE_SSL),1)
EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a

@ -34,7 +34,7 @@ ifndef LIBARCH
LIBARCH = LIBC
endif
# must be equal to NDEBUG or DEBUG, CURLDEBUG
# must be equal to NDEBUG or DEBUG
ifndef DB
DB = NDEBUG
endif
@ -134,9 +134,7 @@ else
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
# INCLUDES += -I$(SDK_CLIB)/include
endif
ifeq ($(DB),CURLDEBUG)
INCLUDES += -I../include
endif
CFLAGS += -I. $(INCLUDES)
ifeq ($(MTSAFE),YES)

@ -115,20 +115,6 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
int status = ARES_SUCCESS;
struct timeval now;
#ifdef CURLDEBUG
const char *env = getenv("CARES_MEMDEBUG");
if (env)
curl_memdebug(env);
env = getenv("CARES_MEMLIMIT");
if (env) {
char *endptr;
long num = strtol(env, &endptr, 10);
if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
curl_memlimit(num);
}
#endif
if (ares_library_initialized() != ARES_SUCCESS)
return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */

@ -415,13 +415,4 @@ int ares__connect_socket(ares_channel channel,
(c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
} WHILE_FALSE
#ifdef CURLDEBUG
/* This is low-level hard-hacking memory leak tracking and similar. Using the
libcurl lowlevel code from within library is ugly and only works when
c-ares is built and linked with a similarly curldebug-enabled libcurl,
but we do this anyway for convenience. */
#define HEADER_CURL_SETUP_ONCE_H
#include "../lib/memdebug.h"
#endif
#endif /* __ARES_PRIVATE_H */

@ -17,7 +17,6 @@ CARES_CHECK_OPTION_DEBUG
CARES_CHECK_OPTION_OPTIMIZE
CARES_CHECK_OPTION_WARNINGS
CARES_CHECK_OPTION_WERROR
CARES_CHECK_OPTION_CURLDEBUG
CARES_CHECK_OPTION_SYMBOL_HIDING
CARES_CHECK_OPTION_EXPOSE_STATICS
@ -175,9 +174,6 @@ CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH
CARES_CHECK_COMPILER_SYMBOL_HIDING
CARES_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
dnl **********************************************************************
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************

@ -1179,97 +1179,6 @@ squeeze() {
])
dnl CARES_CHECK_CURLDEBUG
dnl -------------------------------------------------
dnl Settings which depend on configure's curldebug given
dnl option, and other additional configure pre-requisites.
dnl Using the curl debug memory tracking feature in c-ares
dnl is a hack that actually can only be used/enabled when
dnl c-ares is built directly in curl's CVS tree, as a static
dnl library or as a shared one on those systems on which
dnl shared libraries support undefined symbols, along with
dnl an equally configured libcurl.
AC_DEFUN([CARES_CHECK_CURLDEBUG], [
AC_REQUIRE([XC_LIBTOOL])dnl
AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl
cares_builddir=`pwd`
supports_curldebug="unknown"
if test "$want_curldebug" = "yes"; then
if test "x$enable_shared" != "xno" &&
test "x$enable_shared" != "xyes"; then
AC_MSG_WARN([unknown enable_shared setting.])
supports_curldebug="no"
fi
if test "x$enable_static" != "xno" &&
test "x$enable_static" != "xyes"; then
AC_MSG_WARN([unknown enable_static setting.])
supports_curldebug="no"
fi
if test "$supports_curldebug" != "no"; then
if test "$enable_shared" = "yes" &&
test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then
supports_curldebug="no"
AC_MSG_WARN([shared library does not support undefined symbols.])
fi
if test ! -f "$srcdir/../include/curl/curlbuild.h.dist"; then
AC_MSG_WARN([c-ares source not embedded in curl's CVS tree.])
supports_curldebug="no"
elif test ! -f "$srcdir/../include/curl/Makefile.in"; then
AC_MSG_WARN([curl's buildconf has not been run.])
supports_curldebug="no"
elif test ! -f "$cares_builddir/../libcurl.pc" ||
test ! -f "$cares_builddir/../include/curl/curlbuild.h"; then
AC_MSG_WARN([curl's configure has not been run.])
supports_curldebug="no"
elif test ! -f "$cares_builddir/../lib/curl_config.h"; then
AC_MSG_WARN([libcurl's curl_config.h is missing.])
supports_curldebug="no"
elif test ! -f "$cares_builddir/../config.status"; then
AC_MSG_WARN([curl's config.status is missing.])
supports_curldebug="no"
fi
if test "$supports_curldebug" != "no"; then
grep '^#define USE_ARES' "$cares_builddir/../lib/curl_config.h" >/dev/null
if test "$?" -ne "0"; then
AC_MSG_WARN([libcurl configured without c-ares support.])
supports_curldebug="no"
fi
fi
if test "$supports_curldebug" != "no"; then
grep 'CPPFLAGS.*CURLDEBUG' "$cares_builddir/../config.status" >/dev/null
if test "$?" -ne "0"; then
AC_MSG_WARN([libcurl configured without curldebug support.])
supports_curldebug="no"
fi
fi
fi
fi
#
if test "$want_curldebug" = "yes"; then
AC_MSG_CHECKING([if curl debug memory tracking can be enabled])
test "$supports_curldebug" = "no" || supports_curldebug="yes"
AC_MSG_RESULT([$supports_curldebug])
if test "$supports_curldebug" = "no"; then
AC_MSG_WARN([cannot enable curl debug memory tracking.])
want_curldebug="no"
fi
fi
#
if test "$want_curldebug" = "yes"; then
dnl TODO: Verify if the BUILDING_LIBCURL definition is still required.
AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
CPPFLAGS="-DCURLDEBUG $CPPFLAGS"
squeeze CPPFLAGS
fi
#
if test "$want_debug" = "yes"; then
CPPFLAGS="-DDEBUGBUILD $CPPFLAGS"
squeeze CPPFLAGS
fi
])
dnl CARES_CHECK_COMPILER_HALT_ON_ERROR
dnl -------------------------------------------------
dnl Verifies if the compiler actually halts after the

@ -18,45 +18,6 @@
# serial 11
dnl CARES_CHECK_OPTION_CURLDEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-curldebug or --disable-curldebug, and set
dnl shell variable want_curldebug value as appropriate.
AC_DEFUN([CARES_CHECK_OPTION_CURLDEBUG], [
AC_BEFORE([$0],[CARES_CHECK_CURLDEBUG])dnl
AC_MSG_CHECKING([whether to enable curl debug memory tracking])
OPT_CURLDEBUG_BUILD="default"
AC_ARG_ENABLE(curldebug,
AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
OPT_CURLDEBUG_BUILD=$enableval)
case "$OPT_CURLDEBUG_BUILD" in
no)
dnl --disable-curldebug option used
want_curldebug="no"
;;
default)
dnl configure option not specified
want_curldebug="no"
;;
*)
dnl --enable-curldebug option used.
dnl The use of this option value is a request to enable curl's
dnl debug memory tracking for the c-ares library. This is a big
dnl hack that can only be done when a whole bunch of requisites
dnl are simultaneously satisfied. Later on, these requisites are
dnl verified and if they are not fully satisfied the option will
dnl be ignored and act as if --disable-curldebug had been given
dnl setting shell variable want_curldebug to 'no'.
want_curldebug="yes"
;;
esac
AC_MSG_RESULT([$want_curldebug])
])
dnl CARES_CHECK_OPTION_DEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
@ -65,7 +26,6 @@ dnl variable want_debug value as appropriate.
AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl
AC_BEFORE([$0],[CARES_CHECK_OPTION_CURLDEBUG])dnl
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"

Loading…
Cancel
Save