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

add prefixnonocaml option #46

Merged
merged 1 commit into from
Jul 19, 2019
Merged

add prefixnonocaml option #46

merged 1 commit into from
Jul 19, 2019

Conversation

Et7f3
Copy link
Contributor

@Et7f3 Et7f3 commented Apr 5, 2019

ar and gcc can have prefix. So this patch add option to choose prefix for non ocaml tool.

ar and gcc can have prefix. So this patch add option to choose prefix for non ocaml tool.
@antoinemine
Copy link
Collaborator

Using the CC environment variable, you should already be able to do "CC=x86_64-w64-mingw32-gcc ./configure". I see that there is no support to change ar with an AR environment variable, but we don't seem to use ar at the moment.
Can you confirme whether "CC=prefix-gcc ./configure" would work ? In this case, the patch is not needed.
If not, would adding an AR variable to get "AR=prefix-ar CC=prefix-gcc ./configure" would work ? That would be a preferred solution to adding a -prefixnonocaml option.
It may also be the case that you need to pass the prefixed version of cc to ocaml, which could be done with OCAMLFLAG="-cc prefix-gcc".

@Et7f3
Copy link
Contributor Author

Et7f3 commented Apr 6, 2019

I have checked: I don't see where ar is used. because of my ar is called /bin/x86_64-w64-mingw32-ar.exe the ./configure script doesn't work.

binary ocaml: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldep: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlmklib: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldoc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ar: not found
required program ar not found
% AR=/bin/x86_64-w64-mingw32-ar.exe ./configure
binary ocaml: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldep: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlmklib: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldoc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ar: not found
required program ar not found```

@Et7f3
Copy link
Contributor Author

Et7f3 commented Apr 6, 2019

I have commented this line #searchbinreq $ar to test with CC variable.
the result:

as excepted it can't find my gcc because of prefix

% ./configure
binary ocaml: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldep: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlmklib: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldoc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary perl: found in /usr/bin
binary gcc: not found
binary cc: not found
required program cc not found

with variable CC it doesn't fix

% CC=/bin/x86_64-w64-mingw32-gcc.exe ./configure
binary ocaml: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldep: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlmklib: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldoc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary perl: found in /usr/bin
binary /bin/x86_64-w64-mingw32-gcc.exe: found
binary ocamlopt: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
checking compilation with /bin/x86_64-w64-mingw32-gcc.exe : not working
checking compilation with /bin/x86_64-w64-mingw32-gcc.exe -O: not working
cannot compile and link program

try without CC variable: it work fine

% cp /bin/x86_64-w64-mingw32-gcc.exe /bin/cc.exe
% ./configure
binary ocaml: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldep: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamlmklib: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary ocamldoc: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
binary perl: found in /usr/bin
binary gcc: not found
binary cc: found in /usr/bin
binary ocamlopt: found in /cygdrive/c/Users/root/.esy/3_/i/ocaml-4.7.1004-d00f8396/bin
checking compilation with cc -O3 -Wall -Wextra : working
include caml/mlvalues.h: not found
cannot include caml/mlvalues.h

It as a error but is it because of cygwin see my other pull request.

@antoinemine
Copy link
Collaborator

Sorry for the delay. OK, if it helps compilation on Cygwin (it doesn't hurt other targets).

@antoinemine antoinemine merged commit c327b28 into ocaml:master Jul 19, 2019
@Et7f3 Et7f3 deleted the patch-2 branch November 24, 2019 12:13
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