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

Fix: enable cross compilation by removing the AC_CHECK_FILE macro #307

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

oleorhagen
Copy link
Contributor

From the man-page on the AC_CHECK_FILE macro, we can read that:

You might also need to check for the existence of files. Before using these macros, ask yourself whether a runtime test might not be a better solution. Be aware that, like most Autoconf macros, they test a feature of the host machine, and therefore, they die when cross-compiling.

Therefore, move to using a simple shell if/else as the replacement.

From the man-page on the `AC_CHECK_FILE` macro, we can read that:

```
You might also need to check for the existence of files. Before using these macros, ask yourself whether a runtime test might not be a better solution. Be aware that, like most Autoconf macros, they test a feature of the host machine, and therefore, they die when cross-compiling.
```

Therefore, move to using a simple shell if/else as the replacement.

Signed-off-by: Ole Petter <[email protected]>
@simo5
Copy link
Member

simo5 commented Nov 13, 2023

Not sure why this is needed, if you fail the check simply nss testing is unavailable, which is what you want during a cross compile anyway, because you can't test cross compiled binaries directly on the build host.
What am I missing ?

@oleorhagen
Copy link
Contributor Author

Not sure why this is needed, if you fail the check simply nss testing is unavailable, which is what you want during a cross compile anyway, because you can't test cross compiled binaries directly on the build host. What am I missing ?

The AC_CHECK_FILE macro will literally exit the with the error:

configure: error: cannot check for file existence when cross compiling

when cross compiling 😞

@simo5
Copy link
Member

simo5 commented Nov 14, 2023

I see, that is annoying.
I will merge this.

@simo5 simo5 merged commit d994cc2 into latchset:main Nov 14, 2023
11 of 19 checks passed
@oleorhagen
Copy link
Contributor Author

Thanks 😸

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