diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-03-08 11:45:16 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-03-08 11:46:14 +0100 |
commit | 2630688e27e9068ffa7a39ba3972c2f4fb710910 (patch) | |
tree | 128409bc4f91b8cab20a1624099da82600233afb /mk | |
parent | bc04b829d4a6d63681022322636d633f57d0cd4b (diff) | |
download | embtoolkit-2630688e27e9068ffa7a39ba3972c2f4fb710910.tar.gz embtoolkit-2630688e27e9068ffa7a39ba3972c2f4fb710910.tar.bz2 embtoolkit-2630688e27e9068ffa7a39ba3972c2f4fb710910.tar.xz |
Build system: internal macros: improve strings comparison and avoid use of shell
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r-- | mk/macros.mk | 6 | ||||
-rw-r--r-- | mk/pkg-macros/configure.mk | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mk/macros.mk b/mk/macros.mk index bac27c0..ffe0a50 100644 --- a/mk/macros.mk +++ b/mk/macros.mk @@ -42,14 +42,14 @@ embtk_echo_blue = printf $(__embtk_color_blue)$(1)$(__embtk_no_color)"\n" __embtk_msg_h = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" # -# __embtk_mk_strcmp: +# __embtk_streq: # A macro for two strings comparison. It returns y if the strings are identical # and nothing if not. # Note: This macro strips passed parameters # Usage: -# $(call __embtk_mk_strcmp,str1,str2) +# $(call __embtk_streq,str1,str2) # -__embtk_mk_strcmp = $(shell [ $(strip $(1)) = $(strip $(2)) ] && echo y) +__embtk_streq = $(if $(subst x$(1),,x$(2)),,y) # # __embtk_mk_pathexist diff --git a/mk/pkg-macros/configure.mk b/mk/pkg-macros/configure.mk index 1d35755..0e4418e 100644 --- a/mk/pkg-macros/configure.mk +++ b/mk/pkg-macros/configure.mk @@ -129,8 +129,8 @@ define embtk_configure_hostpkg LDFLAGS="$(__embtk_hostpkg_ldflags)" \ PKG_CONFIG="$(PKGCONFIG_BIN)" \ PKG_CONFIG_PATH="$(EMBTK_HOST_PKG_CONFIG_PATH)" \ - $(if $(call __embtk_mk_strcmp,$(PKGV),CCACHE),,CC=$(HOSTCC_CACHED)) \ - $(if $(call __embtk_mk_strcmp,$(PKGV),CCACHE),,CXX=$(HOSTCXX_CACHED)) \ + $(if $(call __embtk_streq,$(PKGV),CCACHE),,CC=$(HOSTCC_CACHED)) \ + $(if $(call __embtk_streq,$(PKGV),CCACHE),,CXX=$(HOSTCXX_CACHED)) \ CONFIG_SHELL=$(CONFIG_EMBTK_SHELL) \ $(__embtk_pkg_configureenv) \ $(CONFIG_EMBTK_SHELL) $(__embtk_pkg_srcdir)/configure \ |