开发者

How do I process the configure file when cross-compiling with mingw?

I have a small open source program tha开发者_Python百科t builds with an autoconf configure script.

I ran configure I tried to compile with:

make CC="/opt/local/bin/i386-mingw32-g++"

That didn't work because the configure script found include files that were not available to the mingw system.

So then I tried:

./configure CC="/opt/local/bin/i386-mingw32-g++"

Is that the right way to do it?


You want:

./configure --host=i686-pc-mingw32

...which tells configure that you want to target a different platform. Provided your cross-compile environment is setup correctly i.e. you have an "i686-pc-mingw32-gcc" in your path, it should all just work.


Well, this seems to work:

  MBIN=/opt/local/bin/
  PREFIX=/opt/local/i386-mingw32
  export CC=$MBIN/i386-mingw32-gcc
  export CXX=$MBIN/i386-mingw32-g++
  export RANLIB=$MBIN/i386-mingw32-ranlib
  export AR=$MBIN/i386-mingw32-ar
  export MINGWFLAGS="-mwin32 -mconsole -march=pentium4 "
  export CFLAGS="$MINGWFLAGS"
  export CXXFLAGS="$MINGWFLAGS"
  VARS="CC=$CC CXX=$CXX RANLIB=$RANLIB AR=$AR"
  make $VARS CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜