Skip to content

mbedtls: don't require mbedtls from our pkgconfig file#4656

Merged
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:fix/mbedtls-no-pkgconfig
May 30, 2018
Merged

mbedtls: don't require mbedtls from our pkgconfig file#4656
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:fix/mbedtls-no-pkgconfig

Conversation

@tiennou
Copy link
Copy Markdown
Contributor

@tiennou tiennou commented May 25, 2018

mbedTLS has no pkgconfig file, hence we can't require it. For now, pass its link flags as our own.

Ref: #4651

Comment thread src/CMakeLists.txt
# mbedTLS has no pkgconfig file, hence we can't require it
# https://github.com/ARMmbed/mbedtls/issues/228
# For now, pass its link flags as our own
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure here: does MBEDTLS_LIBRARIES include MBEDTLS_LDFLAGS?

Copy link
Copy Markdown
Contributor Author

@tiennou tiennou May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little bit weirder : the FindmbedTLS module doesn't actually set MBEDTLS_LDFLAGS at all, so I hope this is sufficient. AFAIU, Libs.private only impacts static linking (ie. pkg-config libgit2 --static --libs), and the linker should already know what to do when dyn-linking.

The resulting pc file looks like this :

prefix="/usr/local"
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libgit2
Description: The git library, take 2
Version: 0.27.0

Libs: -L${libdir} -lgit2
Libs.private: -lcurl -L/usr/local/lib -lmbedtls -lmbedx509 -lmbedcrypto -lz -L/usr/local/Cellar/libssh2/1.8.0/lib -lssh2 -L/usr/lib -liconv
Requires.private: 

Cflags: -I${includedir}

Comment thread src/CMakeLists.txt Outdated
# https://github.com/ARMmbed/mbedtls/issues/228
# For now, pass its link flags as our own
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
# LIST(APPEND LIBGIT2_PC_REQUIRES "mbedtls")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say to just remove this line. Having commented-out sections can be confusing, and you're able to easily dig up this code by just git-blaming the above comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, removed.

mbedTLS has no pkgconfig file, hence we can't require it. For now, pass its link flags as our own.
@tiennou tiennou force-pushed the fix/mbedtls-no-pkgconfig branch from e67fdac to 64a78a8 Compare May 25, 2018 12:43
@tiennou tiennou mentioned this pull request May 25, 2018
@pks-t pks-t merged commit 36ae5c9 into libgit2:master May 30, 2018
@pks-t
Copy link
Copy Markdown
Member

pks-t commented May 30, 2018

Thanks, @tiennou!

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