direct-io.hg

changeset 11792:bd207697f0c7

Avoid need for GREP variable by avoiding GNUisms. The
only one we appear to have is use of '-q'. Replace it
with redirection to /dev/null.

Also avoid use of 'tail' by replacing with 'head' or
'grep' as appropriate.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Oct 18 13:43:35 2006 +0100 (2006-10-18)
parents 5525b18b7224
children 5c029fda79dc
files Config.mk buildconfigs/Rules.mk config/Linux.mk config/SunOS.mk xen/Makefile xen/arch/x86/Makefile
line diff
     1.1 --- a/Config.mk	Wed Oct 18 11:38:59 2006 +0100
     1.2 +++ b/Config.mk	Wed Oct 18 13:43:35 2006 +0100
     1.3 @@ -26,7 +26,7 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/includ
     1.4  EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
     1.5  endif
     1.6  
     1.7 -test-gcc-flag = $(shell $(1) -v --help 2>&1 | $(GREP) -q " $(2) " && echo $(2))
     1.8 +test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep " $(2) " >/dev/null 2>&1 && echo $(2))
     1.9  
    1.10  ifneq ($(debug),y)
    1.11  CFLAGS += -DNDEBUG
     2.1 --- a/buildconfigs/Rules.mk	Wed Oct 18 11:38:59 2006 +0100
     2.2 +++ b/buildconfigs/Rules.mk	Wed Oct 18 13:43:35 2006 +0100
     2.3 @@ -22,7 +22,7 @@ endif
     2.4  
     2.5  # Expand Linux series to Linux version
     2.6  LINUX_SERIES	?= 2.6
     2.7 -LINUX_VER	?= $(shell $(GREP) "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
     2.8 +LINUX_VER	?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
     2.9  
    2.10  # Setup Linux search path
    2.11  LINUX_SRC_PATH	?= .:..
    2.12 @@ -125,7 +125,7 @@ config-update-pae:
    2.13  ifeq ($(XEN_TARGET_X86_PAE),y)
    2.14  	sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
    2.15  else
    2.16 -	$(GREP) '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
    2.17 +	grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
    2.18  endif
    2.19  
    2.20  # never delete any intermediate files.
     3.1 --- a/config/Linux.mk	Wed Oct 18 11:38:59 2006 +0100
     3.2 +++ b/config/Linux.mk	Wed Oct 18 13:43:35 2006 +0100
     3.3 @@ -11,8 +11,6 @@ STRIP      = $(CROSS_COMPILE)strip
     3.4  OBJCOPY    = $(CROSS_COMPILE)objcopy
     3.5  OBJDUMP    = $(CROSS_COMPILE)objdump
     3.6  
     3.7 -GREP       = grep
     3.8 -
     3.9  INSTALL      = install
    3.10  INSTALL_DIR  = $(INSTALL) -d -m0755
    3.11  INSTALL_DATA = $(INSTALL) -m0644
     4.1 --- a/config/SunOS.mk	Wed Oct 18 11:38:59 2006 +0100
     4.2 +++ b/config/SunOS.mk	Wed Oct 18 13:43:35 2006 +0100
     4.3 @@ -11,7 +11,6 @@ STRIP      = $(CROSS_COMPILE)gstrip
     4.4  OBJCOPY    = $(CROSS_COMPILE)gobjcopy
     4.5  OBJDUMP    = $(CROSS_COMPILE)gobjdump
     4.6  
     4.7 -GREP       = ggrep
     4.8  SHELL      = bash
     4.9  
    4.10  INSTALL      = ginstall
     5.1 --- a/xen/Makefile	Wed Oct 18 11:38:59 2006 +0100
     5.2 +++ b/xen/Makefile	Wed Oct 18 13:43:35 2006 +0100
     5.3 @@ -96,7 +96,7 @@ include/xen/compile.h: include/xen/compi
     5.4  	    -e 's/@@whoami@@/$(USER)/g' \
     5.5  	    -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
     5.6  	    -e 's/@@hostname@@/$(shell hostname)/g' \
     5.7 -	    -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1 | sed -e "s;|;/;")|g' \
     5.8 +	    -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | grep -i "gcc.*version")!g' \
     5.9  	    -e 's/@@version@@/$(XEN_VERSION)/g' \
    5.10  	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
    5.11  	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
    5.12 @@ -154,7 +154,7 @@ endef
    5.13  
    5.14  .PHONY: MAP
    5.15  MAP:
    5.16 -	$(NM) $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
    5.17 +	$(NM) -n $(TARGET) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
    5.18  
    5.19  .PHONY: FORCE
    5.20  FORCE:
     6.1 --- a/xen/arch/x86/Makefile	Wed Oct 18 11:38:59 2006 +0100
     6.2 +++ b/xen/arch/x86/Makefile	Wed Oct 18 13:43:35 2006 +0100
     6.3 @@ -46,8 +46,7 @@ obj-$(crash_debug) += gdbstub.o
     6.4  
     6.5  $(TARGET): $(TARGET)-syms boot/mkelf32
     6.6  	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
     6.7 -	`$(NM) $(TARGET)-syms | sort | tail -n 1 | \
     6.8 -	 sed -e 's/^\([^ ]*\).*/0x\1/'`
     6.9 +	`$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`
    6.10  
    6.11  $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
    6.12  	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o