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
10 include $(INCLUDE_DIR
)/host.mk
12 PKG_NAME
:=Build dependency
14 define Require
/non-root
15 [ "$$(shell whoami)" != "root" ]
17 $(eval
$(call Require
,non-root
, \
18 Please do not compile
as root. \
21 define Require
/umask-0022
22 [ "$$(shell umask)" -eq
22 ]
24 $(eval
$(call Require
,umask-0022
, \
25 Please compile with umask
0022. \
28 # Required for the toolchain
29 define Require
/working-make
30 $(MAKE
) -v | awk
'($$$$1 == "GNU") && ($$$$2 = "Make") && ($$$$3 >= "3.81") { print "ok" }' | grep ok
> /dev
/null
33 $(eval
$(call Require
,working-make
, \
34 Please
install GNU make v3.81 or later.
(This version has bugs
) \
37 define Require
/case-sensitive-fs
38 rm -f
$(TMP_DIR
)/test.
*
39 touch
$(TMP_DIR
)/test.fs
40 [ \
! -f
$(TMP_DIR
)/test.FS
]
43 $(eval
$(call Require
,case-sensitive-fs
, \
44 OpenWrt can only be built on a case-sensitive filesystem \
48 getopt
--help
2>&1 | grep long
>/dev
/null
50 $(eval
$(call Require
,getopt
, \
51 Please
install GNU getopt \
54 define Require
/fileutils
55 gcp
--help || cp
--help
57 $(eval
$(call Require
,fileutils
, \
58 Please
install GNU fileutils \
61 define Require
/working-gcc
62 echo
'int main(int argc, char **argv) { return 0; }' | \
63 gcc
-x c
-o
$(TMP_DIR
)/a.out
-
66 $(eval
$(call Require
,working-gcc
, \
67 Please
install the GNU C Compiler
(gcc
). \
70 define Require
/working-g
++
71 echo
'int main(int argc, char **argv) { return 0; }' | \
72 g
++ -x c
++ -o
$(TMP_DIR
)/a.out
- -lstdc
++ && \
76 $(eval
$(call Require
,working-g
++, \
77 Please
install the GNU C
++ Compiler
(g
++). \
80 define Require
/ncurses
81 echo
'int main(int argc, char **argv) { initscr(); return 0; }' | \
82 gcc
-include ncurses.h
-x c
-o
$(TMP_DIR
)/a.out
- -lncurses
85 $(eval
$(call Require
,ncurses
, \
86 Please
install ncurses.
(Missing libncurses.so or ncurses.h
) \
91 echo
'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
92 gcc
-include zlib.h
-x c
-o
$(TMP_DIR
)/a.out
- -lz
95 $(eval
$(call Require
,zlib
, \
96 Please
install zlib.
(Missing libz.so or zlib.h
) \
99 $(eval
$(call RequireCommand
,gawk
, \
100 Please
install GNU awk. \
103 $(eval
$(call RequireCommand
,flex
, \
104 Please
install flex. \
107 $(eval
$(call RequireCommand
,unzip
, \
108 Please
install unzip. \
111 $(eval
$(call RequireCommand
,bzip2
, \
112 Please
install bzip2. \
115 $(eval
$(call RequireCommand
,patch
, \
116 Please
install patch. \
119 $(eval
$(call RequireCommand
,perl
, \
120 Please
install perl. \
123 $(eval
$(call RequireCommand
,python
, \
124 Please
install python. \
127 $(eval
$(call RequireCommand
,wget
, \
128 Please
install wget. \
131 define Require
/gnutar
132 $(TAR
) --version
2>&1 | grep GNU
> /dev
/null
135 $(eval
$(call Require
,gnutar
, \
136 Please
install GNU
tar. \
139 $(eval
$(call RequireCommand
,svn
, \
140 Please
install the subversion client. \
143 define Require
/gnu-find
144 $(FIND
) --version
2>/dev
/null
147 $(eval
$(call Require
,gnu-find
, \
148 Please
install GNU find \
151 define Require
/getopt-extended
152 getopt
--long
- - >/dev
/null
155 $(eval
$(call Require
,getopt-extended
, \
156 Please
install an extended getopt version that supports
--long \