Skip to content

Cosmetic updates - #110

Merged
dra27 merged 5 commits into
ocaml:masterfrom
dra27:misc
Nov 17, 2022
Merged

dra27 merged 5 commits into
ocaml:masterfrom
dra27:misc

Conversation

@dra27

@dra27 dra27 commented Nov 17, 2022 •

Copy link
Copy Markdown
Member
  • Eliminate spurious error messages when ocamlopt isn't available in the environment
  • Missing .gitignore patterns for release tarballs and zips
  • Tidy up LICENSE file
  • Add additional fields to the version information block in flexlink.exe
  • Add a -vnum and -version command line argument (finally)

@nojb

nojb commented Nov 17, 2022 •

Copy link
Copy Markdown
Collaborator

Hello @dra27! I just saw this PR fly past and thought I would take advantage of it to pose an unrelated question. We maintain the following diff for one of our clients (who builds OCaml from source, with the "boostrapped" FlexDLL):

diff --git a/mlfi/ocaml/flexdll/Makefile b/mlfi/ocaml/flexdll/Makefile
--- a/mlfi/ocaml/flexdll/Makefile
+++ b/mlfi/ocaml/flexdll/Makefile
@@ -161,7 +161,7 @@ Compat.ml: COMPILER-$(COMPAT_VERSION) $(addsuffix .ml, $(COMPAT_MODULES))
 flexlink.exe: $(OBJS) $(RES)
        @echo Building flexlink.exe with TOOLCHAIN=$(TOOLCHAIN) for OCaml $(OCAML_VERSION)
        rm -f flexlink.exe
-       $(RES_PREFIX) $(OCAMLOPT) -o flexlink.exe $(LINKFLAGS) $(OBJS)
+       FLEXLINKFLAGS="" $(RES_PREFIX) $(OCAMLOPT) -o flexlink.exe $(LINKFLAGS) $(OBJS)

 version.res: version.rc
        $(RES_PREFIX) rc version.rc

The point is that they set FLEXLINKFLAGS to pass some flags to flexlink when building the compiler (if memory serves, it is -link <resource file> to add icons and copyright information to the built objects), but this variable should be unset when building flexlink itself. As far as I can see there is no way to do this from "outside" the build system. Does it make sense? Do you see how to achieve this, or a better way to go about it?

@dra27

dra27 commented Nov 17, 2022

Copy link
Copy Markdown
Member Author

🙂 I agree that can't easily be done from outside. The patch could be done in the compiler's build system, which I'm guessing might simplify things, as I presume the compiler is patched, but flexdll is otherwise unpatched? In the compiler's root Makefile, there's FLEXLINK_BUILD_ENV and I think that adding FLEXLINKFLAGS= to that should have the desired effect. That might not work with without an export in there somewhere - in which case the alternative would be to change the recipes for boot/flexlink.byte$(EXE) and flexlink.opt$(EXE) directly so that FLEXLINKFLAGS= appears before recursive make invocation (i.e. the difference between a shell variable set in a command vs a make variable being exported to commands).

@dra27
dra27 merged commit f5ccd97 into ocaml:master Nov 17, 2022
@dra27
dra27 deleted the misc branch November 17, 2022 12:56
@nojb

nojb commented Nov 17, 2022

Copy link
Copy Markdown
Collaborator

🙂 I agree that can't easily be done from outside.

Thanks for the explanation!

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.

2 participants