2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/prereq.mk
11 # Required for the toolchain
12 define Require/working-make
13 echo 'all: test' > $(TMP_DIR)/check.mk
14 echo 'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk
15 echo 'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR)/check.mk
16 echo 'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR)/check.mk
17 $(NO_TRACE_MAKE) -f $(TMP_DIR)/check.mk
20 $(eval $(call Require,working-make, \
21 Your make version is buggy. Please install GNU make v3.81 or later. \
24 define Require/working-gcc
25 echo 'int main(int argc, char **argv) { return 0; }' | \
26 gcc -x c -o $(TMP_DIR)/a.out -
29 $(eval $(call Require,working-gcc, \
30 No working GNU C Compiler (gcc) was found on your system. \
33 define Require/working-g++
34 echo 'int main(int argc, char **argv) { return 0; }' | \
35 g++ -x c++ -o $(TMP_DIR)/a.out -lstdc++ -
38 $(eval $(call Require,working-g++, \
39 No working GNU C++ Compiler (g++) was found on your system. \
42 define Require/ncurses
43 echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
44 gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out -lncurses -
47 $(eval $(call Require,ncurses, \
48 No ncurses development files were not found on your system. \
53 echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
54 gcc -include zlib.h -x c -o $(TMP_DIR)/a.out -lz -
57 $(eval $(call Require,zlib, \
58 No zlib development files were not found on your system. \
62 $(eval $(call RequireCommand,bison, \
63 Please install GNU bison. \
66 $(eval $(call RequireCommand,flex, \
67 Please install flex. \
70 $(eval $(call RequireCommand,python, \
71 Please install python. \
74 $(eval $(call RequireCommand,unzip, \
75 Please install unzip. \
78 $(eval $(call RequireCommand,bzip2, \
79 Please install bzip2. \
82 $(eval $(call RequireCommand,patch, \
83 Please install patch. \
86 $(eval $(call RequireCommand,perl, \
87 Please install perl. \