Skip to content
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

examples: build: support mingw build #641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alonbl
Copy link

@alonbl alonbl commented Oct 15, 2022

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]

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
Copy link
Author

alonbl commented Oct 15, 2022

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

@Neustradamus
Copy link

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

Have you seen this PR?

@alonbl
Copy link
Author

alonbl commented Jan 4, 2023

@bonsaiviking: may you interested in review? Thanks!

@eabase
Copy link

eabase commented Oct 24, 2024

BUMP!

Why has this not been merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants