npcap icon indicating copy to clipboard operation
npcap copied to clipboard

examples: build: support mingw build

Open alonbl opened this issue 3 years ago • 4 comments

Currently cygwin build is supported, while cygwin is actually mingw, it has its own flags and settings to build native windows executables.

This change adds minimal support for mingw build keeping backward compatibility.

Changes:

  • Case sensitive paths, the SDK uses Include and Lib directories, while build had include and lib.
  • Move -mno-cygwin flag to CYGWIN_FLAGS so that it can be overridden, default remains the same.
  • Add LIBARCH make variable to be able to link against a specific variant of library.
  • Add missing winsock linkage when needed and convert existing to winsock2.

Build using mingw-w64 is supported using:

make CC=x86_64-w64-mingw32-gcc CYGWIN_FLAGS= LIBARCH=/x64

Signed-off-by: Alon Bar-Lev [email protected]

alonbl avatar Oct 15 '22 18:10 alonbl

BTW: I suggest to drop cygwin by adding -mno-cygwin to CFLAGS if someone desires.

alonbl avatar Oct 15 '22 19:10 alonbl

Dear https://github.com/nmap team,

Have you seen this PR?

Neustradamus avatar Jan 02 '23 17:01 Neustradamus

@bonsaiviking: may you interested in review? Thanks!

alonbl avatar Jan 04 '23 18:01 alonbl