Tim Van Holder wrote:
> Of course, if you need to specify CC anyway, you might as well specify
> your host system too:
>
> ./configure CC='gcc -mno-cygwin' --host=i386-pc-mingw32
>
> After all, you're basically cross-compiling, aren't you.
Earnie Boyd wrote:
> This is the correct way to do it. You can shorten to --host=mingw32 if
> you wish.
I agree that this is basically a cross-compile. It is however just a
little bit annoying to specify the target OS twice,
with --host and -mno-cygwin.
So I decided to add the following bit to the configure script:
AC_CACHE_CHECK(
[for mingw32],
ac_cv_mingw32,
AC_TRY_COMPILE(,
[return __MINGW32__],
ac_cv_mingw32="yes",
ac_cv_mingw32="no")
)
if test $ac_cv_mingw32 = yes;then
LIBS="$LIBS -lwsock32"
fi
Ralf Corsepius wrote:
> However, I am not familiar with mingw, but is there a reason why the
> standard autoconf approach of applying feature tests instead doesn't
> work in this particular case?
> I mean, applying AC_CHECK_HEADER[S], AC_CHECK_LIB[S], AC_TRY_LINK
> and friends to detect a system's way to provide a certain
> functionality. At least I can imagine that Teun's application needs
> some networking function from wsock32 and would fail to link
> otherwise, i.e. it should be link-time detectable, i.e. detectable
> by AC_CHECK_FUNC or similar.
This not so easy. The function I want to test for is the select call.
However select is name mangled (Pascal calling convention) to
select@20 in libwsock32.a
Teun