Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To compile with Visual Studio 2013, I'm using Cygwin because this is where I have Autotools installed.
- 1. navigate to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
- 2. open either the x86 or x64 native tools command prompt depending on what you want to build
- 3. $ C:\cygwin64\Cygwin.bat
- 4. $ cd path/to/libffi
- 5. $ ./autogen.sh
- Once inside Cygwin, to build the x86 architecture (if you launched the x86 prompt)
- 6. $ mkdir build-x86
- 7. $ cd build-x86
- 8. $ ../configure CC=../msvcc.sh CXX=../msvcc.sh LD=link CPP="cl -nologo -EP" --build=i686-unknown-cygwin
- Once inside Cygwin, to build the x86_64 architecture (if you launched the x64 prompt)
- 6. $ mkdir build-x64
- 7. $ cd build-x64
- 8. $ ../configure CC="../msvcc.sh -m64" CXX="../msvcc.sh -m64" LD=link CPP="cl -nologo -EP" --build=i686-unknown-cygwin
- 9. $ rm include/ffitarget.h
- 10. $ cp ../src/x86/ffitarget.h include/
- Finally,
- 9. $ rm include/ffitarget.h
- 10. $ cp ../src/x86/ffitarget.h include/
- 11. comment out #define FFI_TARGET_HAS_COMPLEX_TYPE from include/ffitarget.h
- 12. make
- Steps 9. and 10. are required because Visual Studio doesn't understand Cygwin's symlinks. And now you realize Windows platform with Visual Studio is really a second class citizen if msvcc.sh wasn't a strong enough hint ;)
- If you reproduce this, on tag v3.2.1 you will build for the x86 architecture just fine while MASM bails out on win64.asm with error A2075 for the x86_64 architecture. To make the x86_64 architecture, I have to replace "jmp SHORT" with "jmp" in win64.asm lines 1026 and 1035.
- You can reproduce these steps with Visual Studio 2012: just launch the appropriate command prompt before Cygwin and you'll face the C99 issues.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement