diff options
author | Alexandre Pion <pion@afnic.fr> | 2022-02-15 17:30:54 +0100 |
---|---|---|
committer | Alexandre Pion <pion@afnic.fr> | 2022-02-15 17:30:54 +0100 |
commit | 8771f31146a84101c8a0a19e579acdd728bf7953 (patch) | |
tree | 3b9d406fda26de5d9adf1933d7acf79a79049217 | |
parent | a1244604741333142e8a3ba7b85e72ecad705748 (diff) |
Use libidn2 library
The define IDNA_ACE_PREFIX is not defined in the idn2.h header.
Therefore we use another define IDN2_OK to test that the lib is
properly loaded.
-rw-r--r-- | Makefile.PL | 9 | ||||
-rw-r--r-- | include/LDNS.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Makefile.PL b/Makefile.PL index dbf3e39..9724ad1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -99,12 +99,11 @@ else { if ( $opt_idn ) { print "Feature idn enabled\n"; check_lib_or_exit( - lib => 'idn', - header => 'idna.h', + lib => 'idn2', + header => 'idn2.h', function => - 'if(strcmp(IDNA_ACE_PREFIX,"xn--")==0) return 0; else return 1;' - ); - cc_libs 'idn'; + 'return IDN2_OK;'); + cc_libs 'idn2'; cc_define '-DWE_CAN_HAZ_IDN'; } else { diff --git a/include/LDNS.h b/include/LDNS.h index 53bfb29..9de985a 100644 --- a/include/LDNS.h +++ b/include/LDNS.h @@ -13,7 +13,7 @@ #include <ldns/ldns.h> #ifdef WE_CAN_HAZ_IDN -#include <idna.h> +#include <idn2.h> #endif /* ldns 1.6.17 does not have this in its header files, but it is in the published documentation and we need it */ |