Skip to content

Commit

Permalink
Brotli: fix build after recent changes in libbrotli.
Browse files Browse the repository at this point in the history
Headers are now in <brotli/...> and not <brotli/enc/...>.

Change-Id: Ia5d9bcb89e8d09daaaabc319333f6868421fc7f0
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
  • Loading branch information
PiotrSikora committed Sep 8, 2016
1 parent b6ad502 commit 1252981
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
55 changes: 54 additions & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ fi
# filter module (depends on Brotli library)
#

# <brotli/encode.h>

ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <brotli/enc/encode.h>"
ngx_feature_incs="#include <brotli/encode.h>"
ngx_feature_test="BrotliEncoderCreateInstance(NULL, NULL, NULL)"

# auto-discovery
Expand Down Expand Up @@ -104,6 +106,57 @@ if [ $ngx_found = no ]; then
. auto/feature
fi

# <brotli/enc/encode.h>

if [ $ngx_found = no ]; then
ngx_feature_name=NGX_HAVE_BROTLI_ENC_ENCODE_H
ngx_feature_run=no
ngx_feature_incs="#include <brotli/enc/encode.h>"
ngx_feature_test="BrotliEncoderCreateInstance(NULL, NULL, NULL)"

# auto-discovery
ngx_feature="Brotli library"
ngx_feature_path=
ngx_feature_libs="-lbrotlienc -lm"
. auto/feature
fi

if [ $ngx_found = no ]; then
# FreeBSD, OpenBSD
ngx_feature="Brotli library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lbrotlienc -lm"
else
ngx_feature_libs="-L/usr/local/lib -lbrotlienc -lm"
fi
. auto/feature
fi

if [ $ngx_found = no ]; then
# NetBSD
ngx_feature="Brotli library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lbrotlienc -lm"
else
ngx_feature_libs="-L/usr/pkg/lib -lbrotlienc -lm"
fi
. auto/feature
fi

if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="Brotli library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lbrotlienc -lm"
else
ngx_feature_libs="-L/opt/local/lib -lbrotlienc -lm"
fi
. auto/feature
fi

if [ $ngx_found = no ]; then
echo "$0: error: ngx_brotli filter module requires Brotli library."
exit 1
Expand Down
4 changes: 4 additions & 0 deletions src/ngx_http_brotli_filter_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
#include <ngx_core.h>
#include <ngx_http.h>

#if (NGX_HAVE_BROTLI_ENC_ENCODE_H)
#include <brotli/enc/encode.h>
#else
#include <brotli/encode.h>
#endif


typedef struct {
Expand Down

0 comments on commit 1252981

Please sign in to comment.