From 33f4a0e556e040a513c04a1f129e69265c19e65c Mon Sep 17 00:00:00 2001 From: Julien 'Lta' BALLET Date: Tue, 8 Jul 2014 01:24:53 +0200 Subject: [PATCH] Fix libtasn1 version detection. Move tasn1 compat types to config.h --- configure.ac | 12 +++++++++--- contrib/spnego/spnego_asn1.h | 13 ------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index f5d2314..6cecc8a 100644 --- a/configure.ac +++ b/configure.ac @@ -60,15 +60,21 @@ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include ], [ asn1_node test; ]) ], [ AC_MSG_RESULT([yes]) - HAS_TASN1_3PLUS=yes + HAVE_TASN1_3PLUS=yes ], [ AC_MSG_RESULT([no]) HAVE_TASN1_3PLUS=no ]) -AM_CONDITIONAL([HAVE_TASN1_3PLUS],[test x"$HAVE_TASN1_3PLUS" = x"yes"]) +AM_CONDITIONAL([HAVE_TASN1_3PLUS],[test x$HAVE_TASN1_3PLUS = xyes]) AS_IF([test x"$HAVE_TASN1_3PLUS" = x"yes"], [ - AC_DEFINE([HAVE_TASN1_3PLUS], [1], [libtasn1 has v 3.0 downcase types]) + AC_DEFINE([HAVE_TASN1_3PLUS], [1], [libtasn1 has v 3.0 downcase types]) + + dnl Ugly compatibility with old 2.x types + AC_DEFINE([ASN1_ARRAY_TYPE], [asn1_static_node], [...]) +], [ + dnl Ugly compatibility with new 3.x types + AC_DEFINE([asn1_static_node], [ASN1_ARRAY_TYPE], [...]) ]) AC_SEARCH_LIBS([strlcpy], [bsd], [], [ diff --git a/contrib/spnego/spnego_asn1.h b/contrib/spnego/spnego_asn1.h index 9c99d31..3534b99 100644 --- a/contrib/spnego/spnego_asn1.h +++ b/contrib/spnego/spnego_asn1.h @@ -6,19 +6,6 @@ #include -/* From tasn1 NEWS file */ -/* 66 ASN1_DATA_NODE -> asn1_data_node_st */ -/* 67 ASN1_ARRAY_TYPE -> asn1_static_node */ -/* 68 ASN1_TYPE -> asn1_node */ -/* 69 ASN1_TYPE_EMPTY -> NULL */ -/* 70 static_struct_asn -> asn1_static_node_st */ -/* 71 node_asn_struct -> asn1_node_st */ -/* 72 node_asn -> asn1_node_st */ -#ifndef HAVE_TASN1_3PLUS -# define asn1_static_node ASN1_ARRAY_TYPE -# define asn1_node ASN1_TYPE -#endif - extern const asn1_static_node spnego_asn1_conf[]; #endif