Summary
try-compile: optional argument to specify output file
Metadata
- Id: d98e3f88b146683d02c1cf9501447221741f7f57
- Trac id: 1329
- Type: enhancement
- Reporter: iraikov
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty: trivial
- Resolution: worksforme
- Priority: major
- Milestone: 4.12.0
- Version: 4.11.0
- Changetime: 2016-09-27 22:20:08 UTC
- Created: 2016-09-20 06:45:39 UTC
- Keywords:
Description
try-compile provides the -o argument with a temporary path to the compiler, however it is sometimes useful to override it and specify the output executable explicitly. For example, the sundials egg setup script compiles a program that when run outputs the version string of the detected SUNDIALS installation, which is then used for conditional compilation. To do this, the script needs to provide its own -o argument, which unfortunately conflicts with the -o already provided by try-compile.
Changes and comments
[2016-09-20 07:52:19 UTC] mario wrote:
Note that the example you mention as use-case breaks cross-compilation.
[2016-09-20 22:18:19 UTC] iraikov wrote:
Do I understand correctly that in the case of cross-compilation try-compile will create an executable for the target platform rather than the host platform? Is there a better way to extract the version number of a C library that is defined as a macro?
Replying to mario: > Note that the example you mention as use-case breaks cross-compilation.
[2016-09-21 08:07:34 UTC] mario wrote:
Hi Ivan. Yes, that's the issue. Maybe in the case of cross-compilation the setup script should expect this information to be provided. If I remember correctly, the crypt egg handles a similar problem.
[2016-09-27 22:20:08 UTC] iraikov changed status from new to closed
[2016-09-27 22:20:08 UTC] iraikov set resolution to worksforme
[2016-09-27 22:20:08 UTC] iraikov wrote:
Thanks for the suggestion to look at crypt. It seems that in the case of cross-compilation, the crypt setup procedure lets the user control the compilation process via environment variables, and in the normal case it uses a Scheme program to detect native features, so I just implemented the same for sundials and no longer rely on try-compile to produce executables in the current directory.