Skip to content

autotools: detect and link brotlicommon library for brotli - #17723

Closed
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:am-brotlicommon
Closed

vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:am-brotlicommon

Conversation

@vszakats

@vszakats vszakats commented Jun 23, 2025 •

Copy link
Copy Markdown
Member

brotlicommon is necessary when linking brotli statically.
E.g. on Alpine Linux with PKG_CONFIG='pkg-config --static'.

It also syncs brotli libs listed in libcurl.pc and curl-config with
those generated by cmake, which already listed brotlicommon there.

Also:

  • remove workaround from GHA/configure-vs-cmake CI jobs.

Ref: 69cda1b
Follow-up to f2adb3b #15431
Reported-by: Christopher Boyd
Fixes #17678

@vszakats vszakats added the build label Jun 23, 2025
@github-actions github-actions Bot added the CI Continuous Integration label Jun 23, 2025
@vszakats vszakats changed the title autotools: try detecting/linking brotlicommon autotools: detect and link brotlicommon library for brotli Jun 23, 2025
@vszakats vszakats changed the title autotools: detect and link brotlicommon library for brotli autotools: detect and link brotlicommon library for brotli Jun 23, 2025
@vszakats vszakats changed the title autotools: detect and link brotlicommon library for brotli autotools: detect and link brotlicommon library for static brotli Jun 23, 2025
@vszakats vszakats changed the title autotools: detect and link brotlicommon library for static brotli autotools: detect and link brotlicommon library for brotli Jun 23, 2025
@vszakats
vszakats requested review from bagder and dfandrich June 25, 2025 09:35
@dfandrich

Copy link
Copy Markdown
Contributor

It looks like libbrotlicommon has been there since the first cmake-buildable version of libbrotli (0.6.0) so this seems safe to me.

Comment thread configure.ac
CPP_BROTLI="$CPP_BROTLI `$PKGCONFIG --cflags-only-I libbrotlicommon`"
fi

DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can end up empty which adds an empty component to CURL_LIBRARY_PATH but I assume that ends up being harmless.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this case should be covered by this check later in the detection:

curl/configure.ac

Lines 1485 to 1495 in 6c85579

if test -n "$DIR_BROTLI"; then
dnl when the brotli shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
dnl to prevent further configure tests to fail due to this
if test "x$cross_compiling" != "xyes"; then
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
fi
fi

@vszakats vszakats closed this in 4914c21 Jun 25, 2025
@vszakats
vszakats deleted the am-brotlicommon branch June 25, 2025 17:46
@vszakats

Copy link
Copy Markdown
Member Author

@bagder @dfandrich Thanks for your reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration

Development

Successfully merging this pull request may close these issues.

On alpine/musl, LIBS=-lbrotlicommon is needed with -lbrotlidec

3 participants