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
10 include $(INCLUDE_DIR
)/prereq.mk
12 define Require
/non-root
13 [ "$$(shell whoami)" != "root" ]
15 $(eval
$(call Require
,non-root
, \
16 Please do not compile
as root. \
19 # Required for the toolchain
20 define Require
/working-make
21 echo
'all: test' > $(TMP_DIR
)/check.mk
22 echo
'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR
)/check.mk
23 echo
'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR
)/check.mk
24 echo
'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR
)/check.mk
25 $(NO_TRACE_MAKE
) -f
$(TMP_DIR
)/check.mk
28 $(eval
$(call Require
,working-make
, \
29 Please
install GNU make v3.81 or later.
(This version has bugs
) \
32 define Require
/working-gcc
33 echo
'int main(int argc, char **argv) { return 0; }' | \
34 gcc
-x c
-o
$(TMP_DIR
)/a.out
-
37 $(eval
$(call Require
,working-gcc
, \
38 Please
install the GNU C Compiler
(gcc
). \
41 define Require
/working-g
++
42 echo
'int main(int argc, char **argv) { return 0; }' | \
43 g
++ -x c
++ -o
$(TMP_DIR
)/a.out
-lstdc
++ -
46 $(eval
$(call Require
,working-g
++, \
47 Please
install the GNU C
++ Compiler
(g
++). \
50 define Require
/ncurses
51 echo
'int main(int argc, char **argv) { initscr(); return 0; }' | \
52 gcc
-include ncurses.h
-x c
-o
$(TMP_DIR
)/a.out
-lncurses
-
55 $(eval
$(call Require
,ncurses
, \
56 Please
install ncurses.
(Missing libncurses.so or ncurses.h
) \
61 echo
'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
62 gcc
-include zlib.h
-x c
-o
$(TMP_DIR
)/a.out
-lz
-
65 $(eval
$(call Require
,zlib
, \
66 Please
install zlib.
(Missing libz.so or zlib.h
) \
70 $(eval
$(call RequireCommand
,bison
, \
71 Please
install GNU bison. \
74 $(eval
$(call RequireCommand
,flex
, \
75 Please
install flex. \
78 $(eval
$(call RequireCommand
,python
, \
79 Please
install python. \
82 $(eval
$(call RequireCommand
,unzip
, \
83 Please
install unzip. \
86 $(eval
$(call RequireCommand
,bzip2
, \
87 Please
install bzip2. \
90 $(eval
$(call RequireCommand
,patch
, \
91 Please
install patch. \
94 $(eval
$(call RequireCommand
,perl
, \
95 Please
install perl. \