From e2d5ef5ebeea422dc5fd6117f3acf860ba7ab671 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 17 Feb 2019 11:50:52 +0000 Subject: [PATCH] MAKEFILE: Update pkg_config_find_and_add_enabled for default CFLAGS Since 90% of the time we can pre-calculate the CFLAGS for a pkg-config enabled feature, let's do just that to ensure fewer confusion moments as we add new pkg-config libraries. Signed-off-by: Daniel Silverstone --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f86042897..4e50a3023 100644 --- a/Makefile +++ b/Makefile @@ -432,6 +432,7 @@ define pkg_config_find_and_add_enabled endif NETSURF_FEATURE_$(1)_AVAILABLE := $$(shell $$(PKG_CONFIG) --exists $(2) && echo yes) + NETSURF_FEATURE_$(1)_CFLAGS ?= -DWITH_$(1) ifeq ($$(NETSURF_USE_$(1)),YES) ifeq ($$(NETSURF_FEATURE_$(1)_AVAILABLE),yes) @@ -535,15 +536,10 @@ LDFLAGS += -lz # Optional libraries with pkgconfig # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs -NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG -NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP -NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF -NETSURF_FEATURE_CURL_CFLAGS := -DWITH_CURL +# We only need to define the ones where the feature name doesn't exactly +# match the WITH_FEATURE flag NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG -NETSURF_FEATURE_OPENSSL_CFLAGS := -DWITH_OPENSSL NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE -NETSURF_FEATURE_NSPSL_CFLAGS := -DWITH_NSPSL -NETSURF_FEATURE_NSLOG_CFLAGS := -DWITH_NSLOG # libcurl and openssl ordering matters as if libcurl requires ssl it # needs to come first in link order to ensure its symbols can be