Skip to content

Configure test broken for --with-winidn on mingw32 #1669

@jeroen

Description

@jeroen

I am building a version of mingw-w64-curl with --with-winidn (PKGBUILD). It works great on mingw64 however when building in mingw32 I see:

checking whether versioned symbols are wanted... no
checking whether to enable Windows native IDN (Windows native builds only)... yes
checking if IdnToUnicode can be linked... no
configure: WARNING: Cannot find libraries for IDN support: IDN disabled

And the resulting binary then does:

* Rebuilt URL to: http://www.malmö.se/
* IDN support not present, can't parse Unicode domains
* timeout on name lookup is not supported
* getaddrinfo(3) failed for www.malmö.se:80
* Couldn't resolve host 'www.malmö.se'

The problem is that on 32bit IdnToUnicode is only available on Windows Vista and higher. Therefore it is only exposed if we compile with:

-D_WIN32_WINNT=0x0600 -DWINVER=0x0600

However the configure test seems to conflict with this macro. The config.log file shows:

configure:26798: checking whether to enable Windows native IDN (Windows native builds only)
configure:26816: result: yes
configure:26843: checking if IdnToUnicode can be linked
configure:26872: i686-w64-mingw32-gcc -o conftest.exe -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 -Werror-implicit-function-declaration -O2 -Wno-system-headers -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -IC:/msys32/mingw32/include  -pipe -LC:/msys32/mingw32/lib  conftest.c -lnormaliz -lcrypt32 -lwldap32 -lz -lws2_32  >&5
C:\msys32\tmp\cccptlBZ.o:conftest.c:(.text.startup+0xc): undefined reference to `IdnToUnicode'

I tried running exactly the same command on a simple test.c file which has a call to IdnToUnicode() and there it works fine. So the conftest.c as generated by autotools does not work with -DWINVER=0x0600:

if test "$want_winidn" = "yes"; then
    clean_CPPFLAGS="$CPPFLAGS"
  clean_LDFLAGS="$LDFLAGS"
  clean_LIBS="$LIBS"
  WINIDN_LIBS="-lnormaliz"
  #
  if test "$want_winidn_path" != "default"; then
            WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
    WINIDN_CPPFLAGS="-I$want_winidn_path/include"
    WINIDN_DIR="$want_winidn_path/lib$libsuff"
  fi
  #
  CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
  LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
  LIBS="$WINIDN_LIBS $LIBS"
  #
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IdnToUnicode can be linked" >&5
$as_echo_n "checking if IdnToUnicode can be linked... " >&6; }
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


#define IdnToUnicode innocuous_IdnToUnicode
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef IdnToUnicode
#ifdef __cplusplus
extern "C"
#endif
char IdnToUnicode ();
#if defined __stub_IdnToUnicode || defined __stub___IdnToUnicode
choke me
#endif

int main (void)
{
return IdnToUnicode ();
 ;
 return 0;
}

Is a way to improve this test so that it works in conjunction with -D_WIN32_WINNT=0x0600 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions