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

CMakeLists.txt: fix static library names #116

Closed
wants to merge 1 commit into from
Closed

CMakeLists.txt: fix static library names #116

wants to merge 1 commit into from

Conversation

ffontaine
Copy link
Contributor

Don't suffix static libraries with -${RELNUM} or static linking of mpd will fail because the pkg-config file contains -lzzip and not -lzzip-0:

/srv/storage/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lzzip

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

Don't suffix static libraries with -${RELNUM} or static linking of mpd
will fail because the pkg-config file contains -lzzip and not -lzzip-0:

/srv/storage/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lzzip

Fixes:
 - http://autobuild.buildroot.org/results/78d4ae05211ccea9aca2fa2d6a9befdff54610e3

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@gdraheim
Copy link
Owner

There are no symlinks installed for a static-linkage build? I am kinda missing that because distro makers do only need the dynamic-linkage builds.

If I read the patch correctly then it does put the current linkage rules into an if(BUILD_SHARED_LIBS) section. I am not particularly sure if that breaks other compile setups but then again, the highest priority is keeping distro makers happy which the patch seems to ensure. But I would need some more testing that the dynamic-linking scenario is really identical.

@gdraheim
Copy link
Owner

@Biswa96 - checking into the mingw discussions: the zziplib cmake build was tweaked in such a way that the binaries for the Linux distros have the exact same file names. That's what drives the version markers on the libs. May be it would be beneficial to provide a cmake option that disables it, so that the default dll files will get generated?

@Biswa96
Copy link
Contributor

Biswa96 commented May 18, 2021

As you wish. The only requirement is that the library names should be same in pkg-config file. That linked pull request was reverted due to that different name in pkg-config file.

Any yes. mingw follows Linux or unix-like names for libraries as it uses GNU tools.

@gdraheim
Copy link
Owner

After checking the current cmake setup, I think the real problem comes from having wrapped the "ln -s libzzip-0.so libzzip.so" code being restricted to shared-lib builds. Creating a symlink for any build type should help.

if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
add_custom_target(libzzip_libtool_links ALL
    COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:libzzip> ${lib}${libname}${dll}
    )
install(FILES
    ${outdir}/${lib}${libname}${dll}
    DESTINATION ${CMAKE_INSTALL_LIBDIR})

@gdraheim
Copy link
Owner

I am rejecting this patch in favour of #117 where I want to align pkgconfig and RELNUM build options.

@gdraheim gdraheim closed this May 22, 2021
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.

3 participants