Skip to content

Commit

Permalink
Fix libtasn1 version detection. Move tasn1 compat types to config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
elthariel committed Jul 7, 2014
1 parent c07d109 commit 33f4a0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
12 changes: 9 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,21 @@ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <libtasn1.h>], [ 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], [], [
Expand Down
13 changes: 0 additions & 13 deletions contrib/spnego/spnego_asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@

#include <libtasn1.h>

/* 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

0 comments on commit 33f4a0e

Please sign in to comment.