From af5353c68481d64ebe56e4d10f8ab8502ffcd172 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Sat, 20 Apr 2013 22:40:28 +0200 Subject: [PATCH] Make Jansson optional Signed-off-by: Christian Ruppert --- src/Makefile | 17 ++++++++++++----- src/src.mk | 2 ++ utils.mk | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index c5da53a..cb9d173 100644 --- a/src/Makefile +++ b/src/Makefile @@ -59,11 +59,15 @@ ifndef VDPAU_CFLAGS endif endif -ifndef JANSSON_CFLAGS - JANSSON_CFLAGS = -Wno-cast-qual - ifeq ($(TARGET_ARCH),armv7l) - JANSSON_CFLAGS += -Wno-unused-but-set-variable +ifeq ($(USE_EXTERNAL_JANSSON),0) + ifndef JANSSON_CFLAGS + JANSSON_CFLAGS = -Wno-cast-qual + ifeq ($(TARGET_ARCH),armv7l) + JANSSON_CFLAGS += -Wno-unused-but-set-variable + endif endif +else + LIBS += -ljansson endif ############################################################################## @@ -153,7 +157,9 @@ CFLAGS += -I $(XCONFIG_PARSER_DIR)/.. CFLAGS += -I libXNVCtrlAttributes CFLAGS += -I xpm_data CFLAGS += -I gtk+-2.x +ifeq ($(USE_EXTERNAL_JANSSON),0) CFLAGS += -I jansson +endif CFLAGS += -I $(COMMON_UTILS_DIR) CFLAGS += -I $(VIRTUAL_RESOLUTIONS_DIR) CFLAGS += -I $(OUTPUTDIR) @@ -162,8 +168,9 @@ CFLAGS += -DPROGRAM_NAME=\"nvidia-setttings\" $(call BUILD_OBJECT_LIST,$(GTK_SRC)): CFLAGS += $(GTK_CFLAGS) +ifeq ($(USE_EXTERNAL_JANSSON),0) $(call BUILD_OBJECT_LIST,$(JANSSON_SRC)): CFLAGS += $(JANSSON_CFLAGS) - +endif ############################################################################## # build rules diff --git a/src/src.mk b/src/src.mk index 327b41b..0ffd7d6 100644 --- a/src/src.mk +++ b/src/src.mk @@ -276,6 +276,7 @@ NVIDIA_SETTINGS_EXTRA_DIST += $(GTK_EXTRA_DIST) # # files in the src/jansson directory of nvidia-settings # +ifeq ($(USE_EXTERNAL_JANSSON),0) JANSSON_SRC += jansson/load.c JANSSON_SRC += jansson/value.c JANSSON_SRC += jansson/pack_unpack.c @@ -297,6 +298,7 @@ JANSSON_EXTRA_DIST += jansson/hashtable.h JANSSON_EXTRA_DIST += jansson/jansson_private.h NVIDIA_SETTINGS_EXTRA_DIST += $(JANSSON_EXTRA_DIST) +endif NVIDIA_SETTINGS_DIST_FILES += $(NVIDIA_SETTINGS_SRC) NVIDIA_SETTINGS_DIST_FILES += $(NVIDIA_SETTINGS_EXTRA_DIST) diff --git a/utils.mk b/utils.mk index 54b76d6..29e06a9 100644 --- a/utils.mk +++ b/utils.mk @@ -74,6 +74,8 @@ CHMOD ?= chmod NV_AUTO_DEPEND ?= 1 NV_VERBOSE ?= 0 +USE_EXTERNAL_JANSSON ?= 0 + ifndef TARGET_OS TARGET_OS := $(shell uname) endif -- 1.8.1.5