Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f4f41ba

Browse files
committed
Improve configure's check for ICU presence.
Without ICU's header files, "configure --with-icu" would succeed anyway, at least when using the non-pkgconfig-based setup. Then you got a bunch of ugly failures at build. Add an explicit header check to tighten that up.
1 parent 52f8a59 commit f4f41ba

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

configure

+17-6
Original file line numberDiff line numberDiff line change
@@ -13910,17 +13910,27 @@ done
1391013910

1391113911

1391213912
if test "$with_icu" = yes; then
13913-
# ICU functions are macros, so we need to do this the long way.
13913+
ac_save_CPPFLAGS=$CPPFLAGS
13914+
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
13915+
13916+
# Verify we have ICU's header files
13917+
ac_fn_c_check_header_mongrel "$LINENO" "unicode/ucol.h" "ac_cv_header_unicode_ucol_h" "$ac_includes_default"
13918+
if test "x$ac_cv_header_unicode_ucol_h" = xyes; then :
13919+
13920+
else
13921+
as_fn_error $? "header file <unicode/ucol.h> is required for ICU" "$LINENO" 5
13922+
fi
1391413923

13915-
# ucol_strcollUTF8() appeared in ICU 50.
13924+
13925+
13926+
# ucol_strcollUTF8() appeared in ICU 50, so check if we have it.
13927+
# ICU functions are macros, so we need to do this the long way.
1391613928
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucol_strcollUTF8" >&5
1391713929
$as_echo_n "checking for ucol_strcollUTF8... " >&6; }
1391813930
if ${pgac_cv_func_ucol_strcollUTF8+:} false; then :
1391913931
$as_echo_n "(cached) " >&6
1392013932
else
13921-
ac_save_CPPFLAGS=$CPPFLAGS
13922-
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
13923-
ac_save_LIBS=$LIBS
13933+
ac_save_LIBS=$LIBS
1392413934
LIBS="$ICU_LIBS $LIBS"
1392513935
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1392613936
/* end confdefs.h. */
@@ -13941,7 +13951,6 @@ else
1394113951
fi
1394213952
rm -f core conftest.err conftest.$ac_objext \
1394313953
conftest$ac_exeext conftest.$ac_ext
13944-
CPPFLAGS=$ac_save_CPPFLAGS
1394513954
LIBS=$ac_save_LIBS
1394613955
fi
1394713956
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_ucol_strcollUTF8" >&5
@@ -13951,6 +13960,8 @@ $as_echo "$pgac_cv_func_ucol_strcollUTF8" >&6; }
1395113960
$as_echo "#define HAVE_UCOL_STRCOLLUTF8 1" >>confdefs.h
1395213961

1395313962
fi
13963+
13964+
CPPFLAGS=$ac_save_CPPFLAGS
1395413965
fi
1395513966

1395613967
# Lastly, restore full LIBS list and check for readline/libedit symbols

configure.in

+11-6
Original file line numberDiff line numberDiff line change
@@ -1655,25 +1655,30 @@ AC_CHECK_FUNCS([strtoll strtoq], [break])
16551655
AC_CHECK_FUNCS([strtoull strtouq], [break])
16561656

16571657
if test "$with_icu" = yes; then
1658-
# ICU functions are macros, so we need to do this the long way.
1658+
ac_save_CPPFLAGS=$CPPFLAGS
1659+
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
1660+
1661+
# Verify we have ICU's header files
1662+
AC_CHECK_HEADER(unicode/ucol.h, [],
1663+
[AC_MSG_ERROR([header file <unicode/ucol.h> is required for ICU])])
16591664

1660-
# ucol_strcollUTF8() appeared in ICU 50.
1665+
# ucol_strcollUTF8() appeared in ICU 50, so check if we have it.
1666+
# ICU functions are macros, so we need to do this the long way.
16611667
AC_CACHE_CHECK([for ucol_strcollUTF8], [pgac_cv_func_ucol_strcollUTF8],
1662-
[ac_save_CPPFLAGS=$CPPFLAGS
1663-
CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
1664-
ac_save_LIBS=$LIBS
1668+
[ac_save_LIBS=$LIBS
16651669
LIBS="$ICU_LIBS $LIBS"
16661670
AC_LINK_IFELSE([AC_LANG_PROGRAM(
16671671
[#include <unicode/ucol.h>
16681672
],
16691673
[ucol_strcollUTF8(NULL, NULL, 0, NULL, 0, NULL);])],
16701674
[pgac_cv_func_ucol_strcollUTF8=yes],
16711675
[pgac_cv_func_ucol_strcollUTF8=no])
1672-
CPPFLAGS=$ac_save_CPPFLAGS
16731676
LIBS=$ac_save_LIBS])
16741677
if test "$pgac_cv_func_ucol_strcollUTF8" = yes ; then
16751678
AC_DEFINE([HAVE_UCOL_STRCOLLUTF8], 1, [Define to 1 if you have the `ucol_strcollUTF8' function.])
16761679
fi
1680+
1681+
CPPFLAGS=$ac_save_CPPFLAGS
16771682
fi
16781683

16791684
# Lastly, restore full LIBS list and check for readline/libedit symbols

0 commit comments

Comments
 (0)