2019-03-23 09:24 UTC

View Revisions: Issue #387

Summary 0000387: Can't override CFLAGS at command line
Revision 2015-01-30 13:24 by Vincent Sanders
Description On OpenBSD/NetSurf 3.0, overriding CFLAGS at the command line (which should be allowed, as per "The client may also override all toolchain settings, including: ..." in Makefile.top) causes the build to fail.

Example:

    $ cd /usr/ports/pobj/hubbub-0.2.0/libhubbub-0.2.0/ && gmake NSSHARED=/usr/local/share/netsurf-buildsystem CFLAGS="`pkg-config --cflags libparserutils`"
     COMPILE: src/parser.c
    In file included from src/parser.c:18:
    src/treebuilder/treebuilder.h:19:33: error: tokeniser/tokeniser.h: No such file or directory
    gmake: *** [build-OpenBSD-OpenBSD-release-lib-static/src_parser.o] Error 1

It seems that setting CFLAGS on the command line overrides the assignment on line 25 of hubbub's Makefile:

    CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
        -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)

Note that similar things happen with all NetSurf projects, not just hubbub.
Revision 2013-05-03 18:52 by anthonyjbentley
Description On OpenBSD/NetSurf 3.0, overriding CFLAGS at the command line (which should be allowed, as per "The client may also override all toolchain settings, including: ..." in Makefile.top) causes the build to fail.

Example:

    $ cd /usr/ports/pobj/hubbub-0.2.0/libhubbub-0.2.0/ && gmake NSSHARED=/usr/local/share/netsurf-buildsystem CFLAGS="`pkg-config --cflags libparserutils`"
     COMPILE: src/parser.c
    In file included from src/parser.c:18:
    src/treebuilder/treebuilder.h:19:33: error: tokeniser/tokeniser.h: No such file or directory
    gmake: *** [build-OpenBSD-OpenBSD-release-lib-static/src_parser.o] Error 1

It seems that setting CFLAGS on the command line overrides the assignment on line 25 of hubbub's Makefile:

    CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
        -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)

Note that similar things happen with all NetSurf projects, not just hubbub.