From aa5af2587088691cb55bf4b2792ac8d113ca45af Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Thu, 6 Apr 2017 14:07:43 +0300 Subject: [PATCH] Compile the check for ICONV_CONST as C++ On OpenIndiana (SunOS) the result is different when compiled as C, and the C++ result is what matters to wxWidgets. Fixes compilation of src/common/strconv.cpp on OpenIndiana. --- configure | 18 +++++++++++++++--- configure.in | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 9619a0d3fc..93962b37ae 100755 --- a/configure +++ b/configure @@ -28118,6 +28118,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$TOOLKIT" != "MSW"; then if test "$wxUSE_LIBICONV" != "no" ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + @@ -28154,7 +28160,7 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ @@ -28176,7 +28182,7 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi @@ -28220,7 +28226,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : wx_cv_func_iconv_const="no" else wx_cv_func_iconv_const="yes" @@ -28249,6 +28255,12 @@ _ACEOF fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + LIBS="$LIBICONV $LIBS" fi diff --git a/configure.in b/configure.in index eb41af1590..3c88c2908c 100644 --- a/configure.in +++ b/configure.in @@ -4117,7 +4117,9 @@ if test "$TOOLKIT" != "MSW"; then dnl check for available version of iconv() if test "$wxUSE_LIBICONV" != "no" ; then + AC_LANG_PUSH(C++) AM_ICONV + AC_LANG_POP() LIBS="$LIBICONV $LIBS" fi