1 From: Eric Bavier <bavier@member.fsf.org>
2 Date: Sat, 2 Apr 2016 01:31:03 -0500
3 Subject: [PATCH] Build against external libbrotli.
6 Makefile | 20 ++++----------------
7 src/woff2_dec.cc | 2 +-
8 src/woff2_enc.cc | 2 +-
9 3 files changed, 6 insertions(+), 18 deletions(-)
11 diff --git a/Makefile b/Makefile
12 index 92b8d54..618a751 100644
18 -CPPFLAGS = -I./brotli/dec/ -I./brotli/enc/ -I./src
19 +CPPFLAGS := -I./src $(shell pkg-config --cflags libbrotlienc libbrotlidec)
23 @@ -22,29 +22,17 @@ OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
24 woff2_dec.o woff2_enc.o woff2_common.o woff2_out.o \
28 -ENCOBJ = $(BROTLI)/enc/*.o
29 -DECOBJ = $(BROTLI)/dec/*.o
30 +BROTLI_LIBS := $(shell pkg-config --libs libbrotlienc libbrotlidec)
32 OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
33 EXECUTABLES=woff2_compress woff2_decompress
35 EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))
37 -ifeq (,$(wildcard $(BROTLI)/*))
38 - $(error Brotli dependency not found : you must initialize the Git submodule)
41 all : $(OBJS) $(EXECUTABLES)
43 -$(EXECUTABLES) : $(EXE_OBJS) deps
44 - $(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/$@.o -o $@
47 - $(MAKE) -C $(BROTLI)/dec
48 - $(MAKE) -C $(BROTLI)/enc
49 +$(EXECUTABLES) : $(EXE_OBJS) $(OBJS)
50 + $(CXX) $(LDFLAGS) $(OBJS) $(SRCDIR)/$@.o -o $@ $(BROTLI_LIBS) $(LIBS)
53 rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
54 - $(MAKE) -C $(BROTLI)/dec clean
55 - $(MAKE) -C $(BROTLI)/enc clean
56 diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc
57 index 837eede..98c01ce 100644
58 --- a/src/woff2_dec.cc
59 +++ b/src/woff2_dec.cc
64 -#include "./decode.h"
65 +#include "brotli/dec/decode.h"
69 diff --git a/src/woff2_enc.cc b/src/woff2_enc.cc
70 index 920c614..00d74da 100644
71 --- a/src/woff2_enc.cc
72 +++ b/src/woff2_enc.cc
77 -#include "./encode.h"
78 +#include "brotli/enc/encode.h"
81 #include "./normalize.h"