Support configuring the CFLAGS, particularly the optimisation flags, in Makefile.config

svn path=/trunk/netsurf/; revision=5094
This commit is contained in:
Daniel Silverstone 2008-08-13 15:31:41 +00:00
parent a5c54e54a4
commit b99cb3d1e0
2 changed files with 9 additions and 13 deletions

View File

@ -300,7 +300,7 @@ ifeq ($(TARGET),gtk)
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
-DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
$(WARNFLAGS) -I. -g $(OPT2FLAGS) \
$(WARNFLAGS) -I. -g \
$(shell $(PKG_CONFIG) --cflags libglade-2.0 gtk+-2.0) \
$(shell xml2-config --cflags)
@ -324,11 +324,11 @@ endif
ifeq ($(TARGET),riscos)
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
RESOURCES = $(TPD_RISCOS)
CFLAGS += -I. $(OPTFLAGS) $(WARNFLAGS) -Driscos \
CFLAGS += -I. $(WARNFLAGS) -Driscos \
-std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
-mpoke-function-name
@ -420,7 +420,7 @@ ifeq ($(TARGET),debug)
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
$(WARNFLAGS) -I. -g $(OPT0FLAGS) \
$(WARNFLAGS) -I. -g \
$(shell $(PKG_CONFIG) --cflags libnsgif libnsbmp) \
$(shell xml2-config --cflags)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl openssl)
@ -455,13 +455,6 @@ ifneq ($(GCCVER),2)
WARNFLAGS += -Wno-unused-parameter
endif
OPT0FLAGS = -O0
# -O and -O2 can use -Wuninitialized which gives us more static checking.
# unfortunately the optimiser is what provides the hints in the code tree
# so we cannot do it when we do -O0 (E.g. debug)
OPTFLAGS = -O -Wuninitialized
OPT2FLAGS = -O2 -Wuninitialized
CLEANS := clean-target
include Makefile.sources

View File

@ -48,6 +48,9 @@ NETSURF_HOMEPAGE := "http://www.netsurf-browser.org/welcome/"
# Valid options: YES, NO
NETSURF_USE_LIBICONV_PLUG := YES
# Initial CFLAGS. Typically optimisation level etc.
CFLAGS := -O2 -Wuninitialized
# ----------------------------------------------------------------------------
# RISC OS-specific options
# ----------------------------------------------------------------------------
@ -68,7 +71,7 @@ ifeq ($(TARGET),riscos)
# Enable NetSurf's RISC OS Sprite support via Tinct
# Valid options: YES, NO
NETSURF_USE_SPRITE := YES
# Enable NetSurf's ArtWorks support via AWRender
# Valid options: YES, NO
NETSURF_USE_ARTWORKS := YES
@ -87,7 +90,7 @@ ifeq ($(TARGET),gtk)
# Where to search for NetSurf's resources after looking in ~/.netsurf and
# $NETSURFRES. It must have a trailing /
NETSURF_GTK_RESOURCES := /usr/local/share/netsurf/
# Where to install the netsurf binary
NETSURF_GTK_BIN := /usr/local/bin/