diff mbox series

[6/8] Kconfig: add HAVE_LINUX property

Message ID 20180423123109.18590-6-christian.storm@siemens.com
State Changes Requested
Headers show
Series [1/8] core: warn about non-Linux parent SIGTERM tracking | expand

Commit Message

Storm, Christian April 23, 2018, 12:31 p.m. UTC
Introduce the HAVE_LINUX property to mark Linux-only
features as such, e.g., systemd and mtd support.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 Kconfig       | 7 ++++++-
 Makefile      | 6 ++++++
 Makefile.deps | 4 ++++
 3 files changed, 16 insertions(+), 1 deletion(-)

Comments

Stefano Babic April 23, 2018, 6:02 p.m. UTC | #1
On 23/04/2018 14:31, Christian Storm wrote:
> Introduce the HAVE_LINUX property to mark Linux-only
> features as such, e.g., systemd and mtd support.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  Kconfig       | 7 ++++++-
>  Makefile      | 6 ++++++
>  Makefile.deps | 4 ++++
>  3 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/Kconfig b/Kconfig
> index 1bce6d4..c7d1d5c 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -5,6 +5,10 @@
>  
>  mainmenu "Swupdate Configuration"
>  
> +config HAVE_LINUX
> +	bool
> +	option env="HAVE_LINUX"
> +
>  config HAVE_DOT_CONFIG
>  	bool
>  	default y
> @@ -75,6 +79,7 @@ config CURL_SSL
>  
>  config SYSTEMD
>  	bool "enable systemd support"
> +	depends on HAVE_LINUX
>  	default n
>  	help
>  	  Enable support for systemd's start-up completion
> @@ -160,7 +165,7 @@ config MTD
>  	  Enable MTD support.
>  
>  comment "MTD support needs libmtd"
> -	depends on !HAVE_LIBMTD
> +	depends on !HAVE_LIBMTD && HAVE_LINUX
>  
>  config LUA
>  	bool "lua"
> diff --git a/Makefile b/Makefile
> index 54af2a8..52b3b1e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -16,6 +16,12 @@ NAME =
>  # o  print "Entering directory ...";
>  MAKEFLAGS += -r --no-print-directory
>  
> +OSNAME := $(shell uname -s)
> +ifeq ($(OSNAME),Linux)
> +export HAVE_LINUX = y
> +else
> +export HAVE_LINUX = n
> +endif
>  
>  # To put more focus on warnings, be less verbose as default
>  # Use 'make V=1' to see the full commands
> diff --git a/Makefile.deps b/Makefile.deps
> index 1a01ca0..c49fe83 100644
> --- a/Makefile.deps
> +++ b/Makefile.deps
> @@ -15,7 +15,11 @@ export HAVE_LIBCURL = y
>  endif
>  
>  ifeq ($(HAVE_LIBMTD),)
> +ifeq ($(HAVE_LINUX),y)
>  export HAVE_LIBMTD = y
> +else
> +export HAVE_LIBMTD = n
> +endif
>  endif
>  
>  ifeq ($(HAVE_LIBUBI),)
> 

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index 1bce6d4..c7d1d5c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -5,6 +5,10 @@ 
 
 mainmenu "Swupdate Configuration"
 
+config HAVE_LINUX
+	bool
+	option env="HAVE_LINUX"
+
 config HAVE_DOT_CONFIG
 	bool
 	default y
@@ -75,6 +79,7 @@  config CURL_SSL
 
 config SYSTEMD
 	bool "enable systemd support"
+	depends on HAVE_LINUX
 	default n
 	help
 	  Enable support for systemd's start-up completion
@@ -160,7 +165,7 @@  config MTD
 	  Enable MTD support.
 
 comment "MTD support needs libmtd"
-	depends on !HAVE_LIBMTD
+	depends on !HAVE_LIBMTD && HAVE_LINUX
 
 config LUA
 	bool "lua"
diff --git a/Makefile b/Makefile
index 54af2a8..52b3b1e 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,12 @@  NAME =
 # o  print "Entering directory ...";
 MAKEFLAGS += -r --no-print-directory
 
+OSNAME := $(shell uname -s)
+ifeq ($(OSNAME),Linux)
+export HAVE_LINUX = y
+else
+export HAVE_LINUX = n
+endif
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
diff --git a/Makefile.deps b/Makefile.deps
index 1a01ca0..c49fe83 100644
--- a/Makefile.deps
+++ b/Makefile.deps
@@ -15,7 +15,11 @@  export HAVE_LIBCURL = y
 endif
 
 ifeq ($(HAVE_LIBMTD),)
+ifeq ($(HAVE_LINUX),y)
 export HAVE_LIBMTD = y
+else
+export HAVE_LIBMTD = n
+endif
 endif
 
 ifeq ($(HAVE_LIBUBI),)