autoconf: Include statements should be in CPPFLAGS, not CFLAGS #220

Closed
opened 2026-01-29 20:40:09 +00:00 by claunia · 1 comment
Owner

Originally created by @rcanavan on GitHub (Mar 26, 2018).

When updating brotli from an older version, build may fail with error: ‘BROTLI_DECODER_PARAM_LARGE_WINDOW’ undeclared because the Include statements for the brotli headers use the installed location first when invoking the compiler. This can be fixed by moving the include statement for brotli's own header files from AM_CFLAGS to AM_CPPFLAGS.

diff --git a/src/ext/brotli-1.0.3/Makefile.in b/src/ext/brotli-1.0.3/Makefile.in
index 75dac8d617..44068c093e 100644
--- brotli-1.0.3/Makefile.in
+++ brotli-1.0.3/Makefile.in
@@ -495,7 +495,7 @@ BROTLI_INCLUDE = \
 
 brotliincludedir = $(includedir)/brotli
 brotliinclude_HEADERS = $(BROTLI_INCLUDE)
-AM_CFLAGS = -I$(top_srcdir)/c/include
+AM_CPPFLAGS = -I$(top_srcdir)/c/include
 brotli_SOURCES = $(BROTLI_CLI_C)
 brotli_LDADD = libbrotlidec.la libbrotlienc.la libbrotlicommon.la -lm
 #brotli_LDFLAGS = -static
Originally created by @rcanavan on GitHub (Mar 26, 2018). When updating brotli from an older version, build may fail with ```error: ‘BROTLI_DECODER_PARAM_LARGE_WINDOW’ undeclared``` because the Include statements for the brotli headers use the installed location first when invoking the compiler. This can be fixed by moving the include statement for brotli's own header files from AM_CFLAGS to AM_CPPFLAGS. ``` diff --git a/src/ext/brotli-1.0.3/Makefile.in b/src/ext/brotli-1.0.3/Makefile.in index 75dac8d617..44068c093e 100644 --- brotli-1.0.3/Makefile.in +++ brotli-1.0.3/Makefile.in @@ -495,7 +495,7 @@ BROTLI_INCLUDE = \ brotliincludedir = $(includedir)/brotli brotliinclude_HEADERS = $(BROTLI_INCLUDE) -AM_CFLAGS = -I$(top_srcdir)/c/include +AM_CPPFLAGS = -I$(top_srcdir)/c/include brotli_SOURCES = $(BROTLI_CLI_C) brotli_LDADD = libbrotlidec.la libbrotlienc.la libbrotlicommon.la -lm #brotli_LDFLAGS = -static ```
Author
Owner

@eustas commented on GitHub (Mar 28, 2018):

Can not reproduce.
What I do:

docker run -it debian:testing bash
# from now on, we are inside the container
apt-get update
apt-get install gcc "g++" make autoconf libtool bc git
# confirm
cd home
git clone http://github.com/google/brotli
cd brotli
git checkout da254cffdb160bd6ac1cd6ea01944099978cbb71
# that is a commit before large-window
./bootstrap
./configure
make
make install
git clean -dfx
git checkout master
./bootstrap
./configure
make

Tried replacing AM_CFLAGS with AM_CPPFLAGS, but found that the place where -Ixxx is inserted is not changed.

Could you provide the steps to reproduce the problem?

@eustas commented on GitHub (Mar 28, 2018): Can not reproduce. What I do: ``` docker run -it debian:testing bash # from now on, we are inside the container apt-get update apt-get install gcc "g++" make autoconf libtool bc git # confirm cd home git clone http://github.com/google/brotli cd brotli git checkout da254cffdb160bd6ac1cd6ea01944099978cbb71 # that is a commit before large-window ./bootstrap ./configure make make install git clean -dfx git checkout master ./bootstrap ./configure make ``` Tried replacing `AM_CFLAGS` with `AM_CPPFLAGS`, but found that the place where `-Ixxx` is inserted is not changed. Could you provide the steps to reproduce the problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#220