make macro name more correct

This commit is contained in:
Vincent Sanders 2012-12-13 16:31:05 +00:00
parent 17e20537d4
commit 45906b9dc2
9 changed files with 54 additions and 51 deletions

View File

@ -316,10 +316,12 @@ define feature_enabled
endif
endef
# Extend flags with appropriate values from pkg-config for enabled features
#
# 1: Feature name (ie, NETSURF_USE_RSVG -> RSVG)
# 2: pkg-config required modules for feature
# 3: Human-readable name for the feature
define pkg_config_find_and_add
define pkg_config_find_and_add_enabled
ifeq ($$(PKG_CONFIG),)
$$(error pkg-config is required to auto-detect feature availability)
endif

View File

@ -41,12 +41,12 @@ ifeq ($(HOST),amiga)
LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
endif
else
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,NSSVG))
$(eval $(call pkg_config_find_and_add,AMIGA_CAIRO,cairo,Cairo))
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,NSSVG))
$(eval $(call pkg_config_find_and_add_enabled,AMIGA_CAIRO,cairo,Cairo))
$(eval $(call feature_enabled,AMIGA_ICON,-DWITH_AMIGA_ICON,,Amiga icon))
$(eval $(call feature_enabled,AMIGA_DATATYPES,-DWITH_AMIGA_DATATYPES,,DataTypes))

View File

@ -55,8 +55,8 @@ NETSURF_USE_JS:=YES
NETSURF_USE_MOZJS:=YES
endif
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
-D_BSD_SOURCE \

View File

@ -78,9 +78,9 @@
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
endif
# ----------------------------------------------------------------------------

View File

@ -53,10 +53,10 @@ endif
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
$(eval $(call feature_enabled,IMAGEIO,-DWITH_APPLE_IMAGE,,Apple ImageIO ))
ifneq ($(UNIVERSAL),)

View File

@ -38,11 +38,11 @@ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
-D_BSD_SOURCE \

View File

@ -24,16 +24,16 @@ NETSURF_FEATURE_VIDEO_CFLAGS := -DWITH_VIDEO
# add a line similar to below for each optional lib here
# note: webp lacks pkg-config file
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,RSVG,librsvg-2.0,SVG))
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,RSVG,librsvg-2.0,SVG))
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp,WebP (libwebp)))
$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add,VIDEO,gstreamer-0.10,Video))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,VIDEO,gstreamer-0.10,Video))
# GTK and GLIB flags to disable depricated usage
GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \

View File

@ -22,17 +22,20 @@ NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
# add a line similar to below for each optional pkg-configed lib here
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
# no pkg-config for this library
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
#-Wno-unused-but-set-variable
WARNFLAGS += -Werror
MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
@ -47,19 +50,17 @@ MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \
MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0 lcms)
MONKEYWARNFLAGS := -Werror
#-Wno-unused-but-set-variable
CFLAGS += $(MONKEYCFLAGS) $(MONKEYWARNFLAGS)
CFLAGS += $(MONKEYCFLAGS)
LDFLAGS += $(MONKEYLDFLAGS)
# ---------------------------------------------------------------------------
# Windows flag setup
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Windows flag setup
# ---------------------------------------------------------------------------
ifeq ($(HOST),Windows_NT)
CFLAGS += -U__STRICT_ANSI__
endif
ifeq ($(HOST),Windows_NT)
CFLAGS += -U__STRICT_ANSI__
endif
# ----------------------------------------------------------------------------
# Source file setup

View File

@ -30,11 +30,11 @@ else
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
endif
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \