Quellcode durchsuchen

[build] Perform tool checks on each make invocation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown vor 14 Jahren
Ursprung
Commit
7514172b50
1 geänderte Dateien mit 17 neuen und 15 gelöschten Zeilen
  1. 17
    15
      src/Makefile.housekeeping

+ 17
- 15
src/Makefile.housekeeping Datei anzeigen

88
 #
88
 #
89
 # Check for tools that can cause failed builds
89
 # Check for tools that can cause failed builds
90
 #
90
 #
91
-.toolcheck :
91
+
92
-	@if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
92
+ifeq ($(CCTYPE),gcc)
93
-		$(ECHO) 'gcc 2.96 is unsuitable for compiling Etherboot'; \
93
+GCC_2_96_BANNER := $(shell $(CC) -v 2>&1 | grep -is 'gcc version 2\.96')
94
-		$(ECHO) 'Use gcc 2.95 or gcc 3.x instead'; \
94
+ifneq ($(GCC_2_96_BANNER),)
95
-		exit 1; \
95
+$(warning gcc 2.96 is unsuitable for compiling iPXE)
96
-	fi
96
+$(warning Use gcc 2.95 or a newer version instead)
97
-	@if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
97
+$(error Unsuitable build environment found)
98
-		$(ECHO) 'Your Perl version has a Unicode handling bug'; \
98
+endif
99
-		$(ECHO) 'Execute this command before compiling Etherboot:'; \
99
+endif
100
-		$(ECHO) 'export LANG=$${LANG%.UTF-8}'; \
100
+
101
-		exit 1; \
101
+PERL_UNICODE_CHECK := $(shell $(PERL) -e 'use bytes; print chr(255)' | wc -c)
102
-	fi
102
+ifeq ($(PERL_UNICODE_CHECK),2)
103
-	@$(TOUCH) $@
103
+$(warning Your Perl version has a Unicode handling bug)
104
-MAKEDEPS	+= .toolcheck
104
+$(warning Execute this command before building iPXE:)
105
-VERYCLEANUP	+= .toolcheck
105
+$(warning export LANG=$${LANG%.UTF-8})
106
+$(error Unsuitable build environment found)
107
+endif
106
 
108
 
107
 ###############################################################################
109
 ###############################################################################
108
 #
110
 #

Laden…
Abbrechen
Speichern