I played around this a bit with zlib-1.2.8 library, and noticed the following: - invoking node.js with cygwin paths (/cygdrive/c/xxx) will fail, unless one builds node under cygwin, or writes a shell script wrapper which converts cygdrive paths in command line arguments to normal Windows paths. There doesn't seem to be a node.js available for cygwin specifically. - unix configure and makefiles and mingw32-make don't generally play well together. mingw32-make is not capable to build makefiles that have cygwin paths, even if you run mingw32-make under cygwin. It's best to try to use either MSYS or cygwin make when configure scripts are in play. - If the target library has a CMakeLists.txt file, that is better used instead, since CMake is designed to support Windows-host+Emscripten-target cross-compilation situations. Configure scripts are very primitive and unix-specific, and not at all cross-platform. - Wherever configure would invoke 'clang' or 'gcc' natively, in Emscripten it should instead invoke 'emcc'. If this is not happening, then it is probably an emconfigure bug, or an issue with too rudimentary a configure script. - Clang is hardcoded on Windows to invoke Visual Studio linker if one tries to generate native executables with that. This is because Clang does not implement its own linker. Emscripten never tries to link out native executables, and therefore I'm not sure if configure scripts might have something platform-specific for the configure step that is invoking clang directly past emcc. If you see a command line invocation of 'emcc/em++ xxxxxx' results in Visual Studio link.exe (or native GCC/MinGW /usr/bin/link) being invoked, then that is an Emscripten bug. That is, whenever emscripten invokes clang internally, it should never do so to link out a native executable. - As a hack, one can try removing /usr/bin/link from cygwin path, or add visual studio link.exe before /usr/bin to path, to make VS linker visible to cygwin environment for any native clang builds configure scripts might try. - The proper fix would be to develop configure scripts to understand that it should not try to generate native executables, but instead it's generating .js files which are run by calling 'node output.js'. This will probably need platform-specific added information to the configure scripts in question.
If you have good automated repro steps (e.g. a .sh script that downloads a library, unzips, configures and builds) for issues, feel free to report them and we can have a look. Jukka 2014-04-18 9:26 GMT+03:00 Max Savenkov <[email protected]>: > I'm working on porting Allegro game programming library to Emscripten. For > this, I need to compile some open-source projects (libpng, libjpeg, > libogg/libvorbes, freetype) which rely on 'configure' script. I'm working > in Windows, so I'm trying to get it to work with cygwin or MinGW. So far, > no luck. > > First, I was getting errors about Popen unable to find emcc. I did > something (I messed with a lot of things, so I don't exactly remember > what), and now I'm getting error like > > configure:2867: python c:\X\emscripten\emscripten\1.13.0\emcc -V >&5 > clang.exe: error: unsupported option '-V -nostdinc'" > > and > > configure:2920: python c:\X\emscripten\emscripten\1.13.0\emcc > conftest.c >&5 > link: unknown option -- o > Try `/usr/bin/link --help' for more information. > > I think emm is trying to pass MSVC's linker arguments to MinGW's linker or > something like that. > > I have read on the net that this is a common problem, but there are > workarounds. Could anyone point me to a step-by-step instruction on how to > get emconfigure+(MinGW or cygwin)+configure to work under Windows? > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
