From b782b01c290fbc4f67e0030cb534f8238383329f Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 11 Jul 2025 22:09:42 +0200 Subject: Report if IPv6 support is enabled with the -v flag The IPv6 support is stored in the config.h header file, instead of being passed with the -D flag, so it is easier to read from version.cc. --- configure.ac | 7 ++++--- src/IO/http.c | 2 +- src/dns.c | 1 + src/dns.h | 1 + src/version.cc | 5 +++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 4d1d763c..364b06e7 100644 --- a/configure.ac +++ b/configure.ac @@ -693,6 +693,10 @@ connect(fd, (struct sockaddr *)&sa, len); AC_MSG_RESULT([$enable_ipv6]) fi +if test "x$enable_ipv6" = "xyes"; then + AC_DEFINE([ENABLE_IPV6], [1], [Enable IPv6 support]) +fi + dnl ---------- dnl HTML tests dnl ---------- @@ -732,9 +736,6 @@ if test "x$enable_cookies" = "xno" ; then CFLAGS="$CFLAGS -DDISABLE_COOKIES" CXXFLAGS="$CXXFLAGS -DDISABLE_COOKIES" fi -if test "x$enable_ipv6" = "xyes" ; then - CFLAGS="$CFLAGS -DENABLE_IPV6" -fi if test "x$enable_efence" = "xyes" ; then LIBS="-lefence $LIBS" fi diff --git a/src/IO/http.c b/src/IO/http.c index d552664d..7050c7dd 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -15,7 +15,7 @@ */ -#include +#include "config.h" #include /* isdigit */ #include diff --git a/src/dns.c b/src/dns.c index 188ee691..c9bc76dd 100644 --- a/src/dns.c +++ b/src/dns.c @@ -13,6 +13,7 @@ * Non blocking pthread-handled Dns scheme */ +#include "config.h" /* * Uncomment the following line for debugging or gprof profiling. diff --git a/src/dns.h b/src/dns.h index 61ae6410..ad707998 100644 --- a/src/dns.h +++ b/src/dns.h @@ -1,6 +1,7 @@ #ifndef __DNS_H__ #define __DNS_H__ +#include "config.h" #include #ifdef __cplusplus diff --git a/src/version.cc b/src/version.cc index 18eb5019..e1eb30c3 100644 --- a/src/version.cc +++ b/src/version.cc @@ -140,6 +140,11 @@ static void print_features() " +TLS" #else " -TLS" +#endif +#ifdef ENABLE_IPV6 + " +IPV6" +#else + " -IPV6" #endif "\n"); } -- cgit v1.2.3