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

support custom configure scripts #83

Open
jschlatow opened this issue Feb 8, 2024 · 4 comments
Open

support custom configure scripts #83

jschlatow opened this issue Feb 8, 2024 · 4 comments
Labels

Comments

@jschlatow
Copy link
Member

Currently, Goa only supports configure scripts generated by autoconf. Yesterday, I had a brief look at porting ffmpeg with Goa in order to replace the dated port of libav in genode-world. ffmpeg comes with a custom configure script that is not supported by Goa at the moment.

Since I'm not going to implement support for this right away, I am documenting my thoughts on this in this issue.

First, we need to change the way Goa detects autoconf projects. Currently, Goa selects autoconf whenever a configure or configure.ac file is present. In order to support custom configure scripts I think we need to change this detection mechanism. Autoconf should be selected only if a configure.ac file is present. If there is no configure.ac file but a configure file, Goa can assume a custom configure script.

Second, we need a way to provide a custom configure script with appropriate arguments. I think we can reuse the configure_args file for this. In contrast to autoconf-generated configure scripts, there will be no default arguments. We probably need a mechanism to allow the use of variables in configure_args in order to set tool-chain prefixes and compiler flags.

Third, we might need to introduce a switch to override Goa's build-system detection. There could be cases in which a project comes with an autoconf-compatible configure script but no configure.ac. A switch to select autoconf could become useful in this case. If anyone has come across such a project, please let me know.

@nfeske
Copy link
Member

nfeske commented Feb 8, 2024

Thanks for documenting your ideas.

It is certainly good to tune the heuristics about build-system detection further. However far we go however, I'm afraid that we might always end up with cases that cannot be handled automagically. When we encountered such a limitation in the past (I vaguely remember @ssumpf bringing up the topic while porting doom3), I suggested to import the 3rd-party code into a sub directory, e.g., src/3rd/ and adding a custom src/Makefile (as a patch) that invokes the 3rd-party build magic with the values known by make when called by Goa. For ffmpeg you may consider this approach as a stop-gap solution.

@jschlatow
Copy link
Member Author

That's a good point. With this in mind I'd rather like to keep the detection heuristics in Goa to a minimum and instead inform the user about possible solutions. For custom configure scripts, users have to assemble the arguments by themselves anyway. I think it does not matter whether they write it into a configure_args file or a src/Makefile.

Regarding the autoconf detection I'm thinking about letting Goa bail out if there is no configure.ac but only a configure script. It should print a message with possible solutions (custom Makefile or forcing Goa into using autoconf), though.

@nfeske
Copy link
Member

nfeske commented Feb 8, 2024

There are projects with custom configure scripts that adhere the expectations of Goa (I think vim is an example). It would be nice to keep Goa just working for such cases without the need for a custom src/Makefile.

forcing Goa into using autoconf

How about enabling this "force" by placing a configure_args file into the project directory? Would that be hint enough?

@jschlatow
Copy link
Member Author

There are projects with custom configure scripts that adhere the expectations of Goa (I think vim is an example). It would be nice to keep Goa just working for such cases without the need for a custom src/Makefile.

I totally agree. I also like your suggestion about using the presence of the configure_args file as indicator for Goa to use autoconf.

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

No branches or pull requests

2 participants