Skip to content

Makefile fixes - #153

Merged
dra27 merged 8 commits into
ocaml:masterfrom
MisterDA:makefile-fixes
Mar 29, 2025
Merged

dra27 merged 8 commits into
ocaml:masterfrom
MisterDA:makefile-fixes

Conversation

@MisterDA

@MisterDA MisterDA commented Feb 14, 2025 •

Copy link
Copy Markdown
Contributor

This PR allows users to:

  • pass MSVC and MSVC64 variables to Make when building FlexDLL to allow choosing an alternative cl.exe-like compiler, say, clang-cl;
  • pass RC to choose an alternative resource compiler (like rc.exe or windres), say llvm-rc or llvm-windres;
  • pass MINCC, MIN64CC, CYG64CC to choose (respectively) an alternative MinGW-w64 (32 bits), MinGW-w64 (64 bits), Cygwin (64 bits) compiler. Their triplet prefix can be overridden with (respectively) MINCC_PREFIX, MIN64CC_PREFIX, CYG64_PREFIX.

It has also two Makefile fixes: one to support POSIX (really BSD) sed (looking at you, macOS!) and one to add missing OCaml versions when processing Compat.ml.in into Compat.ml.

@nojb nojb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know about the sed change and have not tested, but otherwise LGTM

@MisterDA

Copy link
Copy Markdown
Contributor Author

Thanks. I've added support for WINDRES too, and a change entry.

The sed change makes it POSIX-compatible. GNU sed manual reads (emphasis mine):

regexp1\|regexp2
Matches either regexp1 or regexp2. Use parentheses to use complex alternative regular expressions. The matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. It is a GNU extension.

it also has this note:

^ acts as a special character only at the beginning of the regular expression or subexpression (that is, after \( or \|). Portable scripts should avoid ^ at the beginning of a subexpression, though, as POSIX allows implementations that treat ^ as an ordinary character in that context.

so perhaps ^ in the whole expression should be factored out, but who cares.

@MisterDA
MisterDA force-pushed the makefile-fixes branch 4 times, most recently from 4879b90 to 9e53406 Compare February 21, 2025 10:55
@MisterDA

Copy link
Copy Markdown
Contributor Author

I think I've finally converged and haven't missed anything anymore.
The CI failure is a network failure.

@MisterDA

Copy link
Copy Markdown
Contributor Author

and haven't missed anything anymore.

famous last words

@nojb

nojb commented Mar 28, 2025

Copy link
Copy Markdown
Collaborator

and haven't missed anything anymore.

famous last words

Are you confident on your testing @MisterDA? If yes, I would say we can move to merge.

Comment thread Makefile Resolved
Comment thread Makefile Resolved
This allows choosing clang-cl instead of cl.exe as the default
compiler.
This allows using llvm-rc instead of rc.exe, or llvm-windres instead
of GNU windres.

Libtool uses the RC variable to allow users choosing an alternative
windres.
BSD sed doesn't support \| for alternation (see POSIX § 9.4.7 ERE
Alternation). sed -E is POSIX 2024, but quite portable.
@MisterDA

Copy link
Copy Markdown
Contributor Author

Are you confident on your testing @MisterDA? If yes, I would say we can move to merge.

With David's review and my latest tests, I am now.

@dra27 dra27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

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.

3 participants