Cross compiling autoconf-based tools with mingw on Mac OS X

I would like to cross-compile some open source libraries (libiconv, gettext, glib2) for Windows using mingw on Mac OS X. I installed mingw on a Mac with MacPorts. But now I'm not sure what to give configure script to make it work. The cross-compilation tutorials I've seen all talk about makefiles, but no one mentions what to do with autoconf-based projects.

I am setting up the following:

./configure --prefix=/opt/local/i386-mingw32 --host=i586-mingw32msvc

but it does not seem to be so. As long as the configuration passes, running make will result in this error:

i686-apple-darwin9-gcc-4.0.1: no input files

I thought that the β€œ-host” argument for configuration should have told him to use the mingw compiler? I'm not sure what is going on here.

+3
1

, , . :

#!/bin/sh
make distclean
CC=/opt/local/bin/i386-mingw32-gcc
CXX=/opt/local/bin/i386-mingw32-g++
MINGWFLAGS="-mwin32 -mconsole -march=pentium4 "
CFLAGS="$MINGWFLAGS"
CXXFLAGS="$MINGWFLAGS"
./configure CC=$CC CXX=$CXX --target=i586-mingw32msvc --host=i586
echo make CC=$CC CXX=/opt/local/bin/i386-mingw32-g++ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
make CC=$CC CXX=/opt/local/bin/i386-mingw32-g++ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"

mingw, MacPorts:

sudo port install i386-mingw32-binutils i386-mingw32-gcc i386-mingw32-libunicows i386-mingw32-runtime i386-mingw32-w32api

!

+3

Source: https://habr.com/ru/post/1721725/


All Articles