]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
* Fix: python rdf2str for added RDF types, and fix python version develop
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Jul 2026 09:14:22 +0000 (11:14 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 29 Jul 2026 09:14:22 +0000 (11:14 +0200)
  check in configure for swig check, and fix to not pass deprecated
  option to swig with new swig version.

Changelog
configure.ac
contrib/python/ldns_rdf.i

index 270f8e5e3d54a2763b34fd16a5dd4c08ea4423cd..363dd9e0c9a75d8867138991ff51fccb02f56e59 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -11,6 +11,9 @@
        * Fix to parse SVCB and HTTPS svcparam ech=0.
        * Fix #314: Replace removed Python 2 C API macros for SWIG 4.5.0
          compatibility
+       * Fix: python rdf2str for added RDF types, and fix python version
+         check in configure for swig check, and fix to not pass deprecated
+         option to swig with new swig version.
 
 1.9.2  2026-06-10
        * Fix to set VERSION_INFO to create .so.3 instead of .so.11 which will
index eaf605e0a1ecbaf4cf4670cb0433f42c850e7e11..a7082ce014d82b5a9f3c4770a695030752f1bac8 100644 (file)
@@ -252,21 +252,15 @@ if test x_$withval != x_no; then
        ldns_have_python=yes
    fi
 
-   # pass additional Python 3 option to SWIG
-   if test `$PYTHON -c "import sys; \
-       ver = sys.version.split()[[0]]; \
-       print(ver >= '3')"` = "True"; then
-       AC_SUBST(SWIGPY3, ["-py3 -DPY3"])
-   fi
-
    # check for SWIG
    if test x_$ldns_have_python != x_no; then
         sinclude(ax_pkg_swig.m4)
 
         # check for >=SWIG-2.0.4 if Python 3.2 used
         if test `$PYTHON -c "import sys; \
-            ver = sys.version.split()[[0]]; \
-            print(ver >= '3.2')"` = "True"; then
+            ver = sys.version.split()[[0]].split('.'); \
+           print(int(ver[[0]]) > 3 or (int(ver[[0]])==3 and int(ver[[1]])>=2))"` \
+           = "True"; then
             AX_PKG_SWIG(2.0.4, [], [AC_MSG_ERROR([SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater.])])
         else
             AX_PKG_SWIG
@@ -280,6 +274,21 @@ if test x_$withval != x_no; then
                AC_SUBST(swig, "$SWIG")
                ldns_with_pyldns=yes
        fi
+       # pass additional Python 3 option to SWIG
+       if test `$PYTHON -c "import sys; \
+               ver = sys.version.split()[[0]].split('.')[[0]]; \
+               print(int(ver) >= 3)"` = "True" \
+               -a -n "$available_swig_vernum" ; then
+               # have options when swig is older than 4.1.1
+               check_major=4
+               check_minor=1
+               check_patch=1
+               required_swig_vernum=`expr $check_major \* 10000 \
+                   \+ $check_minor \* 100 \+ $check_patch`
+               if test "$available_swig_vernum" -lt "$required_swig_vernum"; then
+                       AC_SUBST(SWIGPY3, ["-py3 -DPY3"])
+               fi
+       fi
    else
        AC_MSG_RESULT([*** don't have Python, skipping SWIG, no pyldns ***]) # '
    fi
index ed1f0d009db2a3f29800538783f4f8a0f8f5c0b9..f0c169898a63ca05f6f8750d4ae4d7ec84cc5753 100644 (file)
                        case LDNS_RDF_TYPE_INT8:       return "INT8";
                        case LDNS_RDF_TYPE_INT16:      return "INT16";
                        case LDNS_RDF_TYPE_INT32:      return "INT32";
+                       case LDNS_RDF_TYPE_INT64:      return "INT64";
                        case LDNS_RDF_TYPE_A:          return "A";
                        case LDNS_RDF_TYPE_AAAA:       return "AAAA";
                        case LDNS_RDF_TYPE_STR:        return "STR";
                        case LDNS_RDF_TYPE_ILNP64:     return "ILNP64";
                         case LDNS_RDF_TYPE_EUI48:      return "EUI48";
                         case LDNS_RDF_TYPE_EUI64:      return "EUI64";
+                        case LDNS_RDF_TYPE_UNQUOTED:   return "UNQUOTED";
                         case LDNS_RDF_TYPE_TAG:        return "TAG";
                         case LDNS_RDF_TYPE_LONG_STR:   return "LONG_STR";
                        case LDNS_RDF_TYPE_AMTRELAY:   return "AMTRELAY";
                         case LDNS_RDF_TYPE_SVCPARAMS:  return "SVCPARAMS";
+                        case LDNS_RDF_TYPE_IPN:        return "IPN";
                         case LDNS_RDF_TYPE_CERTIFICATE_USAGE:
                             return "CERTIFICATE_USAGE";
                         case LDNS_RDF_TYPE_SELECTOR:   return "SELECTOR";