fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
306 stars 59 forks source link

multimarkdown doesn't build on win32 (mingw32) without modifications #102

Closed Oleksiy-Yakovenko closed 8 years ago

Oleksiy-Yakovenko commented 9 years ago

things missing:

the makefile can be fixed like this:

windows: parser.c
    $(CC) -c -Wall -O3 *.c
    $(CC) *.o -Wl,--dy -o multimarkdown.exe

some random strndup implementation under MIT license can be found here.

fletcher commented 9 years ago

The windows target is designed for compiling on *nix for Windows.

F

Fletcher T. Penney fletcher@fletcherpenney.net

On Mar 3, 2015, at 9:11 AM, Alexey Yakovenko notifications@github.com wrote:

things missing:

windows makefile target is not compatible with native win32 - it's using the "/usr/bin/i586-mingw32msvc-cc" instead of $(CC) strndup function is missing (used in transclude.c) strtok.h needs to be included in the parser.leg the makefile can be fixed like this:

windows: parser.c $(CC) -c -Wall -O3 .c $(CC) .o -Wl,--dy -o multimarkdown.exe some random strndup implementation under MIT license can be found here.

— Reply to this email directly or view it on GitHub.

Oleksiy-Yakovenko commented 9 years ago

Yes, but these simple fixes would let it build on windows too.

fletcher commented 9 years ago

I haven't tested, but I believe that would break building on *nix. That's the entire reason the windows target exists.

Oleksiy-Yakovenko commented 9 years ago

I can't really see whether you're interested in making this work, or you actually want to keep it broken. Pls let me know if you want to get windows build work on windows, and I'll make a patch, and make sure it works on both windows+mingw32 and linux+mingw32. If not, just close the ticket, and I'll keep the fixes to myself :)

fletcher commented 9 years ago

Again -- the make windows command is designed to build for Windows, on a *nix machine. It's not designed for compiling on a Windows machine.

Oleksiy-Yakovenko commented 9 years ago

I know that from the comment in the makefile. Replacing /usr/bin/i586-mingw32msvc-cc with $(CC), and setting the CC environment variable correctly, is a very common way of implementing cross-compilation support. All you'd have to change is put CC=/usr/bin/i586-mingw32msvc-cc into your build script on a unix machine, before running "make windows". This way, it'll work for both use cases of building on windows for windows, and on linux for windows.

mn4367 commented 9 years ago

In #91 I used a plain vanilla MSYS/MinGW installation on Windows 7. The only problem I had was the missing strtok_r function error. Adding

#if defined(__WIN32)
#include "strtok.c"
#endif 

in parser.leg solved the problem for me and building went fine (although I don't know if that's really correct, but with strtok.h it didn't work).

The binary is fairly large (1.4 MB) but with strip multimarkdown.exe the size is about the same as that from the official builds.

fletcher commented 8 years ago

MultiMarkdown 5 is now available, and is using CMake to control the build process. As always, the expectation is to use make or make debug (for example), regardless of the OS. make windows is specifically for the use case of cross-compiling for Windows on a non-Windows system (e.g. Linux) with MinGW. I'm not interested in debating the terminology of that point. ;)

What I am interested in is that make should work on almost any OS, including Windows. If you have problems with getting MMD-5 to compile on Windows, then please let me know.

Closing this as MMD-4 is now deprecated, and future development on these lines should occur in MMD-5.

Thanks!