Skip to content

Find all tools with AC_CHECK_TOOL #31

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

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

Conversation

jamesjer
Copy link

@jamesjer jamesjer commented Jul 5, 2023

The Fedora Linux project is preparing to rebuild all of its OCaml packages with OCaml 5.0.0. This means that, for the first time in some years, we have bytecode-only architectures (ppc64le, for example). The configure run fails on such architectures if ocamlfind is installed. Line 81 of configure.ac does this:

AC_SUBST([OCAMLC], [["$OCAMLFIND ocamlc"]])

But running ocamlfind ocamlc prints nothing, at least with ocamlfind 1.9.6 and OCaml 5.0.0. The same goes for ocamlopt, ocamldoc, ocamldep, and ocamlmklib. This commit uses AC_CHECK_TOOL to find all of them, and ocamlfind is used only to look for the result, seq, and uchar modules. Note that OCAMLC is already set further up in configure.ac.

@shindere
Copy link
Collaborator

Many thanks for your report, @jamesjer.

I have been able to reproduce the problem you mention locally with the latest main branch.

Also, I do not doubt that your PR fixes the issue. Neither do I doubt
that there is room for improvement in the way configure works -- I expect to give it a proper thought later.

Meanwhile, I came up with PR #42 which I believe does fix the issue you report.

Would you mind giving it a try and letting me know whether it indeed solves the issue you wanted to address with this present PR, please?

@jamesjer
Copy link
Author

No, I am afraid that does not solve the issue. I tested by building on a Fedora 40 ppc64le box, which has OCaml 5.1.1, so ppc64le is a bytecode architecture. Problems are evident while configure runs:

checking OCaml target OS type... ocamlfind: Not supported in your configuration: ocamlopt
checking for flambda2... ocamlfind: Not supported in your configuration: ocamlopt
false

After running make all, the ocamldep step succeeds, but then the build fails immediately:

make[1]: Entering directory '/builddir/build/BUILD/stdcompat-20.1'
ocamlfind ocamlopt -c  -bin-annot -no-alias-deps -g -nolabels -I . -alert -deprecated stdcompat__native.mli -o stdcompat__native.cmi
ocamlfind: Not supported in your configuration: ocamlopt
make[1]: Leaving directory '/builddir/build/BUILD/stdcompat-20.1'
make[1]: *** [Makefile:1794: stdcompat__native.cmi] Error 2
make: *** [Makefile:938: all] Error 2

@shindere
Copy link
Collaborator

shindere commented Apr 18, 2025 via email

@shindere
Copy link
Collaborator

shindere commented Apr 18, 2025 via email

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