ソースを参照

[build] Perform tool checks on each make invocation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13年前
コミット
7514172b50
1個のファイルの変更17行の追加15行の削除
  1. 17
    15
      src/Makefile.housekeeping

+ 17
- 15
src/Makefile.housekeeping ファイルの表示

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

読み込み中…
キャンセル
保存