run: |
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \
--host=${TRIPLET} \
- --with-schannel \
+ --with-schannel --with-winidn \
--without-libpsl \
--disable-dependency-tracking
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DBUILD_EXAMPLES=ON \
- -DCURL_USE_SCHANNEL=ON \
+ -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \
-DCURL_USE_LIBPSL=OFF
- name: 'cmake configure log'
if test "$want_winidn" = "yes"; then
dnl WinIDN library support has been requested
- clean_CFLAGS="$CFLAGS"
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
clean_LIBS="$LIBS"
dnl pkg-config not available or provides no info
WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
WINIDN_CPPFLAGS="-I$want_winidn_path/include"
- WINIDN_DIR="$want_winidn_path/lib$libsuff"
fi
#
- dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
- #include <windows.h>
- ]],[[
- #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
- #error
- #endif
- ]])
- ],[
- ],[
- CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
- CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
- CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
- CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
- WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
- ])
- #
CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
LIBS="$WINIDN_LIBS $LIBS"
AC_LANG_PROGRAM([[
#include <windows.h>
]],[[
+ #if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \
+ (!defined(WINVER) || WINVER < 0x600)
+ WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags,
+ const WCHAR *lpASCIICharStr,
+ int cchASCIIChar,
+ WCHAR *lpUnicodeCharStr,
+ int cchUnicodeChar);
+ #endif
IdnToUnicode(0, NULL, 0, NULL, 0);
]])
],[
curl_idn_msg="enabled (Windows-native)"
else
AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
- CFLAGS="$clean_CFLAGS"
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
#ifdef USE_WIN32_IDN
/* using Windows kernel32 and normaliz libraries. */
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600
+#if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \
+ (!defined(WINVER) || WINVER < 0x600)
WINBASEAPI int WINAPI IdnToAscii(DWORD dwFlags,
const WCHAR *lpUnicodeCharStr,
int cchUnicodeChar,