Skip to contentSkip to conversation

makefile fix for tail portability

PATCH New John Levon 1 participant 1 message Oct 18, 2006

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 makefile fix for tail portability

# HG changeset patch
# User [email protected]
# Date 1161130141 25200
# Node ID 10b7da0b79bc1ad886f3237fc7f9d1a9815a7c44
# Parent ddfd15fa79a7fee131ffc3e228daa85519e58095
Solaris's default tail cannot handle the standards-compliant -n option to tail.

config/Linux.mk +1 -0
@@ -11,6 +11,7 @@ OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 
+TAIL       = tail
 GREP       = grep
 
 INSTALL      = install
config/SunOS.mk +1 -0
@@ -11,6 +11,7 @@ OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJCOPY    = $(CROSS_COMPILE)gobjcopy
 OBJDUMP    = $(CROSS_COMPILE)gobjdump
 
+TAIL       = /usr/xpg4/bin/tail
 GREP       = ggrep
 SHELL      = bash
 
xen/Makefile +1 -1
@@ -96,7 +96,7 @@ include/xen/compile.h: include/xen/compi
 	    -e 's/@@whoami@@/$(shell whoami)/g' \
 	    -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \
 	    -e 's/@@hostname@@/$(shell hostname)/g' \
-	    -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -n 1 | sed -e "s;|;/;")|g' \
+	    -e 's|@@compiler@@|$(shell $(CC) $(CFLAGS) -v 2>&1 | $(TAIL) -n 1 | sed -e "s;|;/;")|g' \
 	    -e 's/@@version@@/$(XEN_VERSION)/g' \
 	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
 	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
xen/arch/x86/Makefile +1 -1
@@ -46,7 +46,7 @@ obj-$(crash_debug) += gdbstub.o
 
 $(TARGET): $(TARGET)-syms boot/mkelf32
 	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
-	`$(NM) $(TARGET)-syms | sort | tail -n 1 | \
+	`$(NM) $(TARGET)-syms | sort | $(TAIL) -n 1 | \
 	 sed -e 's/^\([^ ]*\).*/0x\1/'`
 
 $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds