Use libidn2 as default

This commit is contained in:
Tim Rühsen 2017-07-09 22:09:09 +02:00
parent 083c8c6801
commit 0a48980efc
2 changed files with 35 additions and 24 deletions

View File

@ -10,6 +10,7 @@ compiler:
branches:
only:
- master
- tmp-default-libidn2
env:
- RUNTIME=libicu
@ -48,6 +49,9 @@ script:
- ./configure $CFI --enable-runtime=$RUNTIME --enable-builtin=libidn2 --enable-asan $UBSAN && make clean && make -j4 && make check -j4
- ./configure $CFI --enable-runtime=$RUNTIME --enable-builtin=libidn --enable-asan $UBSAN && make clean && make -j4 && make check -j4
- ./configure $CFI --enable-runtime=$RUNTIME --disable-builtin --enable-asan $UBSAN && make clean && make -j4 && make check -j4
- ./configure --enable-gtk-doc --enable-valgrind-tests && make clean && make -j4 && make check -j4
# libidn2 0.9.0 on Trusty has bugs, valgrinding the fuzz corpora fails
# so we use libicu here
- if [[ $RUNTIME == "libicu" ]]; then VALGRIND="--enable-valgrind-tests"; fi
- ./configure --enable-runtime=$RUNTIME --enable-builtin=libicu --enable-gtk-doc $VALGRIND && make clean && make -j4 && make check -j4 || cat fuzz/*_fuzzer.log
- make distcheck
- if [[ $CC == "gcc" && $RUNTIME == "libicu" ]]; then ./.travis_coveralls.sh; fi

View File

@ -131,17 +131,17 @@ AC_ARG_ENABLE(runtime,
[
--enable-runtime[[=IDNA library]]
Specify the IDNA library used for libpsl run-time conversions:
libicu [[default]]: IDNA2008 UTS#46 library
libidn2: IDNA2008 library (also needs libunistring)
libidn2 [[default]]: IDNA2008 library (also needs libunistring)
libicu: IDNA2008 UTS#46 library
libidn: IDNA2003 library (also needs libunistring)
--disable-runtime Do not link runtime IDNA functionality
], [
if test "$enableval" = "libicu" -o "$enableval" = "yes"; then
enable_runtime=libicu
AC_DEFINE([WITH_LIBICU], [1], [generate PSL data using libicu])
elif test "$enableval" = "libidn2"; then
if test "$enableval" = "libidn2" -o "$enableval" = "yes"; then
enable_runtime=libidn2
AC_DEFINE([WITH_LIBIDN2], [1], [generate PSL data using libidn2])
elif test "$enableval" = "libicu"; then
enable_runtime=libicu
AC_DEFINE([WITH_LIBICU], [1], [generate PSL data using libicu])
elif test "$enableval" = "libidn"; then
enable_runtime=libidn
AC_DEFINE([WITH_LIBIDN], [1], [generate PSL data using libidn])
@ -152,8 +152,8 @@ AC_ARG_ENABLE(runtime,
fi
], [
# this is the default if neither --enable-runtime nor --disable-runtime were specified
enable_runtime=libicu
AC_DEFINE([WITH_LIBICU], [1], [generate PSL data using libicu])
enable_runtime=libidn2
AC_DEFINE([WITH_LIBIDN2], [1], [generate PSL data using libidn2])
])
# Check for enable/disable builtin PSL data
@ -161,17 +161,17 @@ AC_ARG_ENABLE(builtin,
[
--enable-builtin[[=IDNA library]]
Specify the IDNA library used for built-in data generation:
libicu [[default]]: IDNA2008 UTS#46 library
libidn2: IDNA2008 library (also needs libunistring)
libidn2 [[default]]: IDNA2008 library (also needs libunistring)
libicu: IDNA2008 UTS#46 library
libidn: IDNA2003 library (also needs libunistring)
--disable-builtin Do not generate built-in PSL data
], [
if test "$enableval" = "libicu" -o "$enableval" = "yes"; then
enable_builtin=libicu
AC_DEFINE([BUILTIN_GENERATOR_LIBICU], [1], [generate PSL data using libicu])
elif test "$enableval" = "libidn2"; then
if test "$enableval" = "libidn2" -o "$enableval" = "yes"; then
enable_builtin=libidn2
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN2], [1], [generate PSL data using libidn2])
elif test "$enableval" = "libicu"; then
enable_builtin=libicu
AC_DEFINE([BUILTIN_GENERATOR_LIBICU], [1], [generate PSL data using libicu])
elif test "$enableval" = "libidn"; then
enable_builtin=libidn
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN], [1], [generate PSL data using libidn])
@ -182,8 +182,8 @@ AC_ARG_ENABLE(builtin,
fi
], [
# this is the default if neither --enable-builtin nor --disable-builtin were specified
enable_builtin=libicu
AC_DEFINE([BUILTIN_GENERATOR_LIBICU], [1], [generate PSL data using libicu])
enable_builtin=libidn2
AC_DEFINE([BUILTIN_GENERATOR_LIBIDN2], [1], [generate PSL data using libidn2])
])
if test "$enable_runtime" = "libicu" -o "$enable_builtin" = "libicu"; then
@ -211,9 +211,16 @@ fi
if test "$enable_runtime" = "libidn2" -o "$enable_builtin" = "libidn2"; then
# Check for libidn2
PKG_CHECK_MODULES([LIBIDN2], [idn2], [
HAVE_LIBIDN2=yes
if test "$enable_runtime" = "libidn2"; then
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
fi
], [
OLDLIBS=$LIBS
AC_SEARCH_LIBS(idn2_lookup_u8, idn2, HAVE_LIBIDN2=yes, AC_MSG_ERROR(You requested libidn2 but it is not installed.), -lunistring)
LIBS=$OLDLIBS
])
fi
if test "$enable_runtime" = "libidn" -o "$enable_builtin" = "libidn"; then