From 0a48980efcbb36e382f8459cd8a522c777b66769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sun, 9 Jul 2017 22:09:09 +0200 Subject: [PATCH] Use libidn2 as default --- .travis.yml | 6 +++++- configure.ac | 53 +++++++++++++++++++++++++++++----------------------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index c893cc2..3362b06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/configure.ac b/configure.ac index b8f262a..5648cd8 100644 --- a/configure.ac +++ b/configure.ac @@ -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) - libidn: IDNA2003 library (also needs libunistring) - --disable-runtime Do not link runtime IDNA functionality + 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) - libidn: IDNA2003 library (also needs libunistring) - --disable-builtin Do not generate built-in PSL data + 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 - 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 + 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