diff --git a/acinclude.m4 b/acinclude.m4 index 43c1195..306bf1f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -48,6 +48,32 @@ AC_DEFUN([SIPSAK_OLD_FQDN], ]) ]) +AC_DEFUN([SIPSAK_TLS], +[ + AC_MSG_CHECKING([disable TLS]) + AC_ARG_ENABLE([tls], + AC_HELP_STRING([--disable-tls], [compile without TLS transport]), + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([SIPSAK_NO_TLS], [1], [Skip TLS transport]) + ], + [ AC_MSG_RESULT([not requested]) + ]) +]) + +AC_DEFUN([SIPSAK_DBG_PRINT], +[ + AC_MSG_CHECKING([enable debug messages]) + AC_ARG_ENABLE([debug], + AC_HELP_STRING([--enable-debug], [compile extra debug messages]), + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([SIPSAK_PRINT_DBG], [1], [Enable debug messages]) + ], + [ AC_MSG_RESULT([not requested]) + ]) +]) + dnl AM_PATH_CHECK([MINIMUM-VERSION]) dnl Test for check, and define CHECK_CFLAGS, CHECK_LIBS and HAVE_CHECK_H dnl diff --git a/config.h.in b/config.h.in index 88f4c2a..f16b550 100644 --- a/config.h.in +++ b/config.h.in @@ -232,6 +232,12 @@ /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 +/* Skip TLS transport */ +#undef SIPSAK_NO_TLS + +/* Enable debug messages */ +#undef SIPSAK_PRINT_DBG + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/configure b/configure index 7ca1a56..53e8876 100755 --- a/configure +++ b/configure @@ -1533,6 +1533,8 @@ Optional Features: --enable-distcc compile in parallel with distcc --enable-timeout=SEC SIP timer T1 in SEC milliseconds (default 500) --disbale-ips compile with oldstyle --numeric behavior + --disable-tls compile without TLS transport + --enable-debug compile extra debug messages Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -7932,6 +7934,48 @@ cat >>confdefs.h <<\_ACEOF _ACEOF +else + { echo "$as_me:$LINENO: result: not requested" >&5 +echo "${ECHO_T}not requested" >&6; } + +fi + + + + { echo "$as_me:$LINENO: checking disable TLS" >&5 +echo $ECHO_N "checking disable TLS... $ECHO_C" >&6; } + # Check whether --enable-tls was given. +if test "${enable_tls+set}" = set; then + enableval=$enable_tls; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define SIPSAK_NO_TLS 1 +_ACEOF + + +else + { echo "$as_me:$LINENO: result: not requested" >&5 +echo "${ECHO_T}not requested" >&6; } + +fi + + + + { echo "$as_me:$LINENO: checking enable debug messages" >&5 +echo $ECHO_N "checking enable debug messages... $ECHO_C" >&6; } + # Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then + enableval=$enable_debug; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define SIPSAK_PRINT_DBG 1 +_ACEOF + + else { echo "$as_me:$LINENO: result: not requested" >&5 echo "${ECHO_T}not requested" >&6; } diff --git a/configure.ac b/configure.ac index 01810e3..5213a97 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,8 @@ fi SIPSAK_TIMER SIPSAK_OLD_FQDN +SIPSAK_TLS +SIPSAK_DBG_PRINT AC_CONFIG_FILES([Makefile tests/Makefile]) diff --git a/sipsak.h b/sipsak.h index 40ea995..9c94a8f 100644 --- a/sipsak.h +++ b/sipsak.h @@ -74,6 +74,9 @@ #ifdef HAVE_GNUTLS # define HAVE_EXTERNAL_MD5 # define USE_GNUTLS +# ifndef SIPSAK_NO_TLS +# define WITH_TLS_TRANSP 1 +# endif # include #else # ifdef HAVE_OPENSSL_MD5_H @@ -92,6 +95,10 @@ # endif #endif +#ifdef SIPSAK_PRINT_DBG +# define DEBUG 1 +#endif + #ifndef REG_NOERROR # define REG_NOERROR 0 #endif @@ -128,8 +135,6 @@ #define REQ_FLOOD 6 #define REQ_RAND 7 -#undef WITH_TLS_TRANSP - #define SIP_TLS_TRANSPORT 1 #define SIP_TCP_TRANSPORT 2 #define SIP_UDP_TRANSPORT 3 @@ -299,10 +304,6 @@ #endif #define SIPSAK_HASHHEXLEN 2 * SIPSAK_HASHLEN -// FIXME: this has to replaced with a real evaluation -#define WITH_TLS_TRANSP 1 -#define DEBUG 1 - #ifdef WITH_TLS_TRANSP char *cert_file, *ca_file; # ifdef USE_GNUTLS