Skip to content

Instantly share code, notes, and snippets.

@mundry
Last active October 16, 2016 18:18
Show Gist options
  • Save mundry/a0182abe4a712af09f3f45a4e701be11 to your computer and use it in GitHub Desktop.
Save mundry/a0182abe4a712af09f3f45a4e701be11 to your computer and use it in GitHub Desktop.
Patch to use pkg-config during ngx_brotli's auto-discovery. Requires pkg-config to be configured properly (e.g. through PKG_CONFIG_PATH) before nginx's configure script is executed.
--- a/config
+++ b/config
@@ -66,8 +66,8 @@ ngx_feature_test="BrotliEncoderCreateInstance(NULL, NULL, NULL)"
# auto-discovery
ngx_feature="Brotli library"
-ngx_feature_path=
-ngx_feature_libs="-lbrotlienc -lm"
+ngx_feature_path="$(pkg-config --cflags-only-I libbrotlienc | sed 's/-I//g')"
+ngx_feature_libs="$(pkg-config --libs libbrotlienc)"
. auto/feature
if [ $ngx_found = no ]; then
@@ -116,8 +116,8 @@ if [ $ngx_found = no ]; then
# auto-discovery
ngx_feature="Brotli library"
- ngx_feature_path=
- ngx_feature_libs="-lbrotlienc -lm"
+ ngx_feature_path="$(pkg-config --cflags-only-I libbrotlienc | sed 's/-I//g')"
+ ngx_feature_libs="$(pkg-config --libs libbrotlienc)"
. auto/feature
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment