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

Use AC_SEARCH_LIBS instead of AC_CHECK_LIB for sframe #389

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

qmfrederik
Copy link
Contributor

Commit 4515e4a introduced a AC_CHECK_LIB(sframe, sframe_decode) in configure.ac.

This causes libs-base to take a hard dependency on libsframe; AC_CHECK_LIB will prepend lsframe to LIBS even if the library is not found. This results in a build failure on systems that don't have libsframe installed (and on which libsframe isn't available). For example, libsframe is not available on Enterprise Linux (e.g. Rocky Linux).

This PR slightly modifies the original commit by using AC_SEARCH_LIBS making the library optional.

Make it optional, this library is not available on Enterprise linux
@qmfrederik qmfrederik requested a review from rfm as a code owner April 20, 2024 20:11
@qmfrederik
Copy link
Contributor Author

@rfm The commit message stated "libsframe needed on some systems" but it didn't mention which systems, so I couldn't verify this PR on those systems.

@qmfrederik
Copy link
Contributor Author

FYI, the build error on Rocky Linux 9 is:

./configure
[...]
checking for sframe_decode in -lsframe... yes
[...]
checking ffi.h usability... yes
checking ffi.h presence... yes
checking for ffi.h... yes
checking for forwarding callback in runtime... yes
checking FFI library usage... configure: error: The ffi library (libffi) does not appear to be working.  Perhaps it's missing or you need a more recent version.  Version 3.0.9 or later should work, and you can find a link to it n the list of packages for download at http://www.gnustep.org/resources/sources.html

and in config.log we have:

configure:9508: checking for sframe_decode in -lsframe
configure:9533: clang -o conftest -g -O2  -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include  -x objective-c -fuse-ld=lld -L/usr/local/lib64 -lstdc++ -L/usr/local/lib64 -L/usr/local/lib64 -L/usr/local/lib64 -L/usr/local/lib64 conftest.c -lsframe  -lz -lrt -ldl  -lpthread >&5
configure:9533: $? = 0
configure:9542: result: yes
[...]
configure:11499: checking FFI library usage
configure:11520: clang -o conftest -g -O2  -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include  -x objective-c  -fuse-ld=lld -L/usr/local/lib64 -lstdc++ -L/usr/local/lib64 -L/usr/local/lib64 -L/usr/local/lib64 -L/usr/local/lib64 conftest.c -L/usr/lib64/../lib64 -lffi  -lsframe -lz -lrt -ldl  -lpthread -lz >&5
configure:11520: $? = 0
configure:11520: ./conftest
./conftest: error while loading shared libraries: libsframe.so.0: cannot open shared object file: No such file or directory
configure:11520: $? = 127
configure: program exited with status 127

@qmfrederik
Copy link
Contributor Author

@rfm OK - digging a bit deeper, looks like what happened is that a recent binutils version introduced libsframe and made it a
dependency of libbfd. This probably caused the build failure you're seeing.

I tested these changes on Ubuntu 24.04 (which has the libsframe as a separate library) and that works.

Would you mind having a look at this PR? The build is broken as is on Rocky Linux.

@rfm
Copy link
Contributor

rfm commented Apr 23, 2024

I'm away this week, but will look at it when I get home. I was under the impression that, if libsframe was not found autoconf would simply produce a configuration that didn't try to log no with it (so nothing could be broken by testing for it), but I guess I misunderstood something. I'm sure it can be fixed quite easily.

@rfm rfm merged commit 4f24e0e into gnustep:master Apr 28, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants