Skip to contentSkip to conversation

stubdom: allow to build with older tool chain

PATCH In review Jan Beulich 2 participants 2 messages Dec 13, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stubdom: allow to build with older tool chain

GNU make prior to 3.81 doesn't support $(realpath ...). This fixes a regression introduced in 23368:0f670f5146c8 (the option tested via cc-option-add got interpreted as the argument of the -I compiler option, as its intended argument was blank, and hence the compiler was falsely considered to support *any* option in the pciutils sub-tree).

Config.mk +3 -0
@@ -4,6 +4,9 @@ ifeq ($(filter /%,$(XEN_ROOT)),)
 $(error XEN_ROOT must be absolute)
 endif
 
+# fallback for older make
+realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
stubdom/Makefile +1 -1
@@ -158,7 +158,7 @@ $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARG
 	  chmod u+w lib/config.h && \
 	  echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
 	  ln -sf ../../libpci.config.mak lib/config.mk && \
-	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(realpath $(MINI_OS)/include)" lib/libpci.a && \
+	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
 	  $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
 	  $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
 	  $(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \

stubdom: allow to build with older tool chain

GNU make prior to 3.81 doesn't support $(realpath ...). This fixes a regression introduced in 23368:0f670f5146c8 (the option tested via cc-option-add got interpreted as the argument of the -I compiler option, as its intended argument was blank, and hence the compiler was falsely considered to support *any* option in the pciutils sub-tree).

Config.mk +3 -0
@@ -4,6 +4,9 @@ ifeq ($(filter /%,$(XEN_ROOT)),)
 $(error XEN_ROOT must be absolute)
 endif
 
+# fallback for older make
+realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
 -include $(XEN_ROOT)/.config
 
 # A debug build of Xen and tools?
stubdom/Makefile +1 -1
@@ -158,7 +158,7 @@ $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARG
 	  chmod u+w lib/config.h && \
 	  echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
 	  ln -sf ../../libpci.config.mak lib/config.mk && \
-	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(realpath $(MINI_OS)/include)" lib/libpci.a && \
+	  $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call realpath,$(MINI_OS)/include)" lib/libpci.a && \
 	  $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
 	  $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
 	  $(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

GNU make prior to 3.81 doesn't support $(realpath ...). This fixes a regression introduced in 23368:0f670f5146c8 (the option tested via cc-option-add got interpreted as the argument of the -I compiler option, as its intended argument was blank, and hence the compiler was falsely considered to support *any* option in the pciutils sub-tree).

Quoted 35 lines
Config.mk +3 -0
@@ -4,6 +4,9 @@ ifeq ($(filter /%,$(XEN_ROOT)),)
 $(error XEN_ROOT must be absolute)
 endif
 
+# fallback for older make
+realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) &&
 echo "$$PWD/$(notdir $(file))")))
+
 -include $(XEN_ROOT)/.config
 

# A debug build of Xen and tools?

stubdom/Makefile +1 -1
@@ -158,7 +158,7 @@ $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARG
 chmod u+w lib/config.h && \
 echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
 ln -sf ../../libpci.config.mak lib/config.mk && \
-   $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(realpath
 $(MINI_OS)/include)" lib/libpci.a && \
+   $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(call
 realpath,$(MINI_OS)/include)" lib/libpci.a && \
 $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/

&& \
$(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
$(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h
$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel