2 # Copyright (C) 2006-2012 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 # Required for the toolchain
22 define Require
/working-make
23 $(MAKE
) -v | awk
'($$$$1 == "GNU") && ($$$$2 == "Make") && ($$$$3 >= "3.81") { print "ok" }' | grep ok
> /dev
/null
26 $(eval
$(call Require
,working-make
, \
27 Please
install GNU make v3.81 or later.
(This version has bugs
) \
30 define Require
/case-sensitive-fs
31 rm -f
$(TMP_DIR
)/test.
*
32 touch
$(TMP_DIR
)/test.fs
33 [ \
! -f
$(TMP_DIR
)/test.FS
]
36 $(eval
$(call Require
,case-sensitive-fs
, \
37 OpenWrt can only be built on a case-sensitive filesystem \
41 getopt
--help
2>&1 | grep long
>/dev
/null
43 $(eval
$(call Require
,getopt
, \
44 Please
install GNU getopt \
47 define Require
/fileutils
48 gcp
--help || cp
--help
50 $(eval
$(call Require
,fileutils
, \
51 Please
install GNU fileutils \
54 define Require
/working-gcc
55 echo
'int main(int argc, char **argv) { return 0; }' | \
56 gcc
-x c
-o
$(TMP_DIR
)/a.out
-
59 $(eval
$(call Require
,working-gcc
, \
60 Please
install the GNU C Compiler
(gcc
). \
63 define Require
/working-g
++
64 echo
'int main(int argc, char **argv) { return 0; }' | \
65 g
++ -x c
++ -o
$(TMP_DIR
)/a.out
- -lstdc
++ && \
69 $(eval
$(call Require
,working-g
++, \
70 Please
install the GNU C
++ Compiler
(g
++). \
73 define Require
/working-gcc-static
74 echo
'int main(int argc, char **argv) { return 0; }' | \
75 gcc
-x c
-static
-o
$(TMP_DIR
)/a.out
-
78 $(eval
$(call Require
,working-gcc-static
, \
79 Please
install the static libc development package
(glibc-static on CentOS
/Fedora
/RHEL
). \
82 define Require
/working-g
++-static
83 echo
'int main(int argc, char **argv) { return 0; }' | \
84 g
++ -x c
++ -static
-o
$(TMP_DIR
)/a.out
- -lstdc
++ && \
88 $(eval
$(call Require
,working-g
++-static
, \
89 Please
install the static libstdc
++ development package
(libstdc
++-static on CentOS
/Fedora
/RHEL
). \
92 define Require
/ncurses
93 echo
'int main(int argc, char **argv) { initscr(); return 0; }' | \
94 gcc
-include ncurses.h
-x c
-o
$(TMP_DIR
)/a.out
- -lncurses
97 $(eval
$(call Require
,ncurses
, \
98 Please
install ncurses.
(Missing libncurses.so or ncurses.h
) \
103 echo
'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
104 gcc
-include zlib.h
-x c
-o
$(TMP_DIR
)/a.out
- -lz
107 $(eval
$(call Require
,zlib
, \
108 Please
install zlib.
(Missing libz.so or zlib.h
) \
111 define Require
/zlib-static
112 echo
'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
113 gcc
-include zlib.h
-x c
-static
-o
$(TMP_DIR
)/a.out
- -lz
116 $(eval
$(call Require
,zlib-static
, \
117 Please
install a static zlib.
(zlib-static on CentOS
/Fedora
/RHEL
). \
120 $(eval
$(call RequireCommand
,gawk
, \
121 Please
install GNU awk. \
124 $(eval
$(call RequireCommand
,unzip
, \
125 Please
install unzip. \
128 $(eval
$(call RequireCommand
,bzip2
, \
129 Please
install bzip2. \
132 $(eval
$(call RequireCommand
,patch
, \
133 Please
install patch. \
136 $(eval
$(call RequireCommand
,perl
, \
137 Please
install perl. \
140 $(eval
$(call RequireCommand
,python
, \
141 Please
install python. \
144 $(eval
$(call RequireCommand
,wget
, \
145 Please
install wget. \
149 git
--version | awk
'($$$$1 == "git") && ($$$$2 == "version") && ($$$$3 >= "1.6.5") { print "ok" }' | grep ok
> /dev
/null
152 $(eval
$(call Require
,git
, \
153 Please
install git
(git-core
) v1.6
.5 or later. \
156 define Require
/gnutar
157 $(TAR
) --version
2>&1 | grep GNU
> /dev
/null
160 $(eval
$(call Require
,gnutar
, \
161 Please
install GNU
tar. \
164 $(eval
$(call RequireCommand
,svn
, \
165 Please
install the subversion client. \
168 define Require
/gnu-find
169 $(FIND
) --version
2>/dev
/null
172 $(eval
$(call Require
,gnu-find
, \
173 Please
install GNU find \
176 define Require
/getopt-extended
177 getopt
--long
- - >/dev
/null
180 $(eval
$(call Require
,getopt-extended
, \
181 Please
install an extended getopt version that supports
--long \