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 define Require
/non-root
12 [ "$$(shell whoami)" != "root" ]
14 $(eval
$(call Require
,non-root
, \
15 Building OpenWrt
as root is not supported
! \
18 # Required for the toolchain
19 define Require
/working-make
20 echo
'all: test' > $(TMP_DIR
)/check.mk
21 echo
'e0 = $$$$(foreach s,foobar,$$$$(eval $$$$s:))' >> $(TMP_DIR
)/check.mk
22 echo
'e1 = $$$$(foreach s,foobar, $$$$(eval $$$$s:))' >> $(TMP_DIR
)/check.mk
23 echo
'test: $$$$(strip $$$$(e0)) $$$$(strip $$$$(e1))' >> $(TMP_DIR
)/check.mk
24 $(NO_TRACE_MAKE
) -f
$(TMP_DIR
)/check.mk
27 $(eval
$(call Require
,working-make
, \
28 Your make version is buggy. Please
install GNU make v3.81 or later. \
31 define Require
/working-gcc
32 echo
'int main(int argc, char **argv) { return 0; }' | \
33 gcc
-x c
-o
$(TMP_DIR
)/a.out
-
36 $(eval
$(call Require
,working-gcc
, \
37 No working GNU C Compiler
(gcc
) was found on your system. \
40 define Require
/working-g
++
41 echo
'int main(int argc, char **argv) { return 0; }' | \
42 g
++ -x c
++ -o
$(TMP_DIR
)/a.out
-lstdc
++ -
45 $(eval
$(call Require
,working-g
++, \
46 No working GNU C
++ Compiler
(g
++) was found on your system. \
49 define Require
/ncurses
50 echo
'int main(int argc, char **argv) { initscr(); return 0; }' | \
51 gcc
-include ncurses.h
-x c
-o
$(TMP_DIR
)/a.out
-lncurses
-
54 $(eval
$(call Require
,ncurses
, \
55 No ncurses development files were not found on your system. \
60 echo
'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
61 gcc
-include zlib.h
-x c
-o
$(TMP_DIR
)/a.out
-lz
-
64 $(eval
$(call Require
,zlib
, \
65 No zlib development files were not found on your system. \
69 $(eval
$(call RequireCommand
,bison
, \
70 Please
install GNU bison. \
73 $(eval
$(call RequireCommand
,flex
, \
74 Please
install flex. \
77 $(eval
$(call RequireCommand
,python
, \
78 Please
install python. \
81 $(eval
$(call RequireCommand
,unzip
, \
82 Please
install unzip. \
85 $(eval
$(call RequireCommand
,bzip2
, \
86 Please
install bzip2. \
89 $(eval
$(call RequireCommand
,patch
, \
90 Please
install patch. \
93 $(eval
$(call RequireCommand
,perl
, \
94 Please
install perl. \