-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add native Windows compiler support #157
Conversation
Yes, I would like to understand the impact this would have on cygwin/msys/mingw users. It seems like a fine thing to do, but we need to do some detection so that you can have win32-cyginw and win32-vc or something. |
You might have to bring this up on erlang-questions to get more input from Windows users. I don't know the platform that well but I'd guess that a config option nominating the build environment will be required. |
If there's any help or input I and my team can give, please feel free to drop me a line! Our current project is a Windows service in Erlang/OTP and it's starting to look like we'll need rebar compilation support for NIFs and port drivers in the upcoming phase of our project (I.E. very soon). |
So do we need to distinguish between compiling with VC and cygwin? Would the platform string look like win32-vc and win32-cygwin? |
To reiterate -- do we need to distinguish between VC and cygwin? If not, then I'm ok to merge this. |
After a long hiatus I rebased this change onto recent rebar to use port_specs etc. Hopefully we can find a common solution.
The attached patch works fine for my needs - generic unix/mac support + windows working, and with a customised shebang file I can distribute these within my projects if required. But this approach doesn't work wrt 2. and 3. above. What about if rebar took os:type() and then, for windows, extended it as follows:
Then we could use {win32, cygwin/msvc} {win32, mingw/gcc} etc etc to set defaults cleanly in rebar_port_compiler that largely Does The Right Thing. And it should be possible, within a project, to force a specific combination if needed. Thoughts? |
First of all: I've come to the conclusion that the shell question is an utter "red herring." As far as I can determine, any application that calls exec(3) or equivalent will always end up inside a cmd.exe instance. This goes for ruby/rake, jruby/rake and erts/rebar at a minimum, and those are just the things I've personally used. So if we're on an NT OS, we should always expect cmd.exe shell syntax. I'm personally fine with having a default compiler toolchain of GCC - I would, however, appreciate not having to set a lot of different port_env(s) in all of my MSVC based projects. Along the lines of @dch's idea, if there were some way to provide "named" port_env's so I could just say something like |
On 2 June 2012 04:09, Matt Campbell
An excellent point regarding spawning new procs. But if you are
+1 that's kinda what I'd like to see. Matt - how do you manage your port_env settings today? In rebar.config
|
- compatible with rebar 2.0.0
add native Windows compiler support
Microsoft's native Visual C++ compiler is used to build Erlang from source.
For NIFs to be loaded successfully into the Erlang VM, and run stable, they
must be built against the same VC++ runtime, and using the same compiler as
was used for building the VM itself.