solidrun-imx6: fix wifi
[openadk.git] / scripts / prereq.sh
blob68bea8f50c7ff9f7b72b303357604bb09fd2b045
1 #!/bin/sh
2 # This file is part of the OpenADK project. OpenADK is copyrighted
3 # material, please see the LICENCE file in the top-level directory.
5 # resolve prerequisites for OpenADK build
7 topdir=$(pwd)
8 target="$@"
9 flags="$MAKEFLAGS"
10 out=0
12 mirror=http://distfiles.openadk.org
13 makever=4.1
14 bashver=4.3.30
15 dlverbose=0
17 # detect operating system
18 os=$(env uname)
19 osver=$(env uname -r)
20 printf " ---> $os $osver for build detected.\n"
22 # check if the filesystem is case sensitive
23 rm -f foo
24 echo >FOO
25 if [ -e foo ]; then
26 printf "ERROR: OpenADK cannot be built in a case-insensitive file system."
27 case $os in
28 CYG*)
29 printf "Building OpenADK on $os needs a small registry change."
30 printf "http://cygwin.com/cygwin-ug-net/using-specialnames.html"
32 Darwin*)
33 printf "Building OpenADK on $os needs a case-sensitive disk partition."
34 printf "For Snow Leopard and above you can use diskutil to resize your existing disk."
35 printf "Example: sudo diskutil resizeVolume disk0s2 90G 1 jhfsx adk 30G"
36 printf "For older versions you might consider to use a disk image:"
37 printf "hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 30g ~/openadk.dmg"
39 esac
40 rm -f FOO
41 exit 1
43 rm -f FOO
45 # do we have a download tool?
46 tools="curl wget"
47 for tool in $tools; do
48 printf " ---> checking if $tool is installed.. "
49 if which $tool >/dev/null; then
50 printf "found\n"
51 case $tool in
52 curl)
53 FETCHCMD="$(which $tool) -L -k -f -\# -o "
55 wget)
56 FETCHCMD="$(which $tool) --no-check-certificate -O "
58 esac
59 break
60 else
61 printf "not found\n"
62 continue
64 done
65 if [ -z "$FETCHCMD" ]; then
66 printf "ERROR: no download tool found. Fatal error.\n"
67 exit 1
70 # do we have a checksum tool?
71 tools="sha256sum sha256 cksum shasum"
72 for tool in $tools; do
73 printf " ---> checking if $tool is installed.. "
74 if which $tool >/dev/null 2>/dev/null; then
75 printf "found\n"
76 # check if cksum is usable
77 case $tool in
78 sha256sum)
79 SHA256=$(which $tool)
81 sha256)
82 SHA256="$(which $tool) -q"
84 cksum)
85 if cksum -q >/dev/null 2>/dev/null; then
86 SHA256="$(which $tool) -q -a sha256"
87 else
88 continue
91 shasum)
92 SHA256="$(which $tool) -a 256"
94 esac
95 break
96 else
97 printf "not found\n"
98 continue
100 done
101 if [ -z "$SHA256" ]; then
102 printf "ERROR: no checksum tool found. Fatal error.\n"
103 exit 1
106 # create download dir
107 if [ ! -d $topdir/dl ]; then
108 mkdir -p $topdir/dl
111 # check for c compiler
112 compilerbins="clang cc gcc"
113 for compilerbin in $compilerbins; do
114 printf " ---> checking if $compilerbin is installed.. "
115 if which $compilerbin >/dev/null; then
116 printf "found\n"
117 CC=$compilerbin
118 CCFOUND=1
119 break
120 else
121 printf "not found\n"
122 continue
124 done
125 if [ -z "$CCFOUND" ]; then
126 printf "ERROR: no C compiler found. Fatal error.\n"
127 exit 1
130 # check for c++ compiler
131 compilerbins="clang++ c++ g++"
132 for compilerbin in $compilerbins; do
133 printf " ---> checking if $compilerbin is installed.. "
134 if which $compilerbin >/dev/null; then
135 printf "found\n"
136 CXX=$compilerbin
137 CXXFOUND=1
138 break
139 else
140 printf "not found\n"
141 continue
143 done
144 if [ -z "$CXXFOUND" ]; then
145 printf "ERROR: no C++ compiler found. Fatal error.\n"
146 exit 1
149 gnu_host_name=$(${CC} -dumpmachine)
151 # relocation of topdir?
152 olddir=$(grep "^ADK_TOPDIR" prereq.mk 2>/dev/null |cut -d '=' -f 2)
153 newdir=$(pwd)
155 if [ ! -z "$olddir" ]; then
156 if [ "$olddir" != "$newdir" ]; then
157 printf " ---> adk directory was relocated, fixing .."
158 sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.pc|xargs) 2>/dev/null
159 sed -i -e "s#$olddir#$newdir#g" $(find host_${gnu_host_name} -type f|xargs) 2>/dev/null
160 sed -i -e "s#$olddir#$newdir#g" $(find target_*/scripts -type f|xargs) 2>/dev/null
161 sed -i -e "s#$olddir#$newdir#" target_*/etc/ipkg.conf 2>/dev/null
162 sleep 2
163 printf "done\n"
168 case :$PATH: in
169 (*:$topdir/host_${gnu_host_name}/bin:*) ;;
170 (*) export PATH=$topdir/host_${gnu_host_name}/bin:$PATH ;;
171 esac
173 # check for GNU make
174 makebins="gmake make"
175 for makebin in $makebins; do
176 printf " ---> checking if $makebin is installed.. "
177 if which $makebin >/dev/null 2>/dev/null; then
178 printf "found\n"
179 printf " ---> checking if it is GNU make.. "
180 $makebin --version 2>/dev/null| grep GNU >/dev/null
181 if [ $? -eq 0 ]; then
182 printf "yes\n"
183 MAKE=$(which $makebin)
184 break
185 else
186 # we need to build GNU make
187 printf "no\n"
188 printf " ---> compiling missing GNU make.. "
189 cd dl
190 $FETCHCMD make-${makever}.tar.gz $mirror/make-${makever}.tar.gz
191 if [ $? -ne 0 ]; then
192 printf "ERROR: failed to download make from $mirror\n"
193 exit 1
195 cd ..
196 mkdir tmp
197 cd tmp
198 tar xzf ../dl/make-${makever}.tar.gz
199 cd make-$makever
200 ./configure --prefix=$topdir/host_$gnu_host_name/
201 make
202 make install
203 cd ..
204 cd ..
205 rm -rf tmp
206 MAKE=$topdir/host_$gnu_host_name/bin/make
207 makebin=$topdir/host_$gnu_host_name/bin/make
208 printf " done\n"
210 else
211 printf "not found\n"
212 continue
214 done
216 # check for bash
217 printf " ---> checking if bash is installed.. "
218 if which bash >/dev/null; then
219 printf "found\n"
220 printf " ---> checking if it is bash 4.x.. "
221 bash --version 2>/dev/null| grep -i "Version 4" >/dev/null
222 if [ $? -eq 0 ]; then
223 printf "yes\n"
224 else
225 # we need to build GNU bash 4.x
226 printf "not found\n"
227 printf " ---> compiling missing GNU bash.. "
228 cd dl
229 $FETCHCMD bash-${bashver}.tar.gz $mirror/bash-${bashver}.tar.gz
230 if [ $? -ne 0 ]; then
231 printf "ERROR: failed to download make from $mirror\n"
232 exit 1
234 cd ..
235 mkdir tmp
236 cd tmp
237 tar xzf ../dl/bash-${bashver}.tar.gz
238 cd bash-${bashver}
239 ./configure --prefix=$topdir/host_$gnu_host_name/
240 make
241 make install
242 cd ..
243 cd ..
244 rm -rf tmp
245 printf " done\n"
249 # skip the script if distclean / cleandir
250 if [ "$target" = "distclean" -o "$target" = "cleandir" ]; then
251 touch prereq.mk
252 $makebin ADK_TOPDIR=$topdir -s -f Makefile.adk $flags $target
253 exit 0
256 printf " ---> checking if strings is installed.. "
257 if ! which strings >/dev/null 2>&1; then
258 echo You must install strings to continue.
259 echo
260 out=1
261 printf "not found\n"
263 printf "found\n"
265 printf " ---> checking if perl is installed.. "
266 if ! which perl >/dev/null 2>&1; then
267 echo You must install perl to continue.
268 echo
269 out=1
270 printf "not found\n"
272 printf "found\n"
274 printf " ---> checking if gzip is installed.. "
275 if ! which gzip >/dev/null 2>&1; then
276 echo You must install gzip to continue.
277 echo
278 out=1
279 printf "not found\n"
281 printf "found\n"
283 printf " ---> checking if git is installed.. "
284 if ! which git >/dev/null 2>&1; then
285 echo You must install git to continue.
286 echo
287 out=1
288 printf "not found\n"
290 printf "found\n"
293 # creating prereq.mk
294 echo "ADK_TOPDIR:=$(readlink -nf . 2>/dev/null || pwd -P)" > $topdir/prereq.mk
295 echo "BASH:=$(which bash)" >> $topdir/prereq.mk
296 echo "SHELL:=$(which bash)" >> $topdir/prereq.mk
297 echo "GMAKE:=$MAKE" >> $topdir/prereq.mk
298 echo "MAKE:=$MAKE" >> $topdir/prereq.mk
299 echo "FETCHCMD:=$FETCHCMD" >> $topdir/prereq.mk
300 echo "SHA256:=$SHA256" >> $topdir/prereq.mk
301 echo "GNU_HOST_NAME:=${gnu_host_name}" >> $topdir/prereq.mk
302 echo "OS_FOR_BUILD:=${os}" >> $topdir/prereq.mk
303 echo "ARCH_FOR_BUILD:=$(${CC} -dumpmachine | sed \
304 -e 's/x86_64-linux-gnux32/x32/' \
305 -e s'/-.*//' \
306 -e 's/sparc.*/sparc/' \
307 -e 's/armeb.*/armeb/g' \
308 -e 's/arm.*/arm/g' \
309 -e 's/m68k.*/m68k/' \
310 -e 's/sh[234]/sh/' \
311 -e 's/mips-.*/mips/' \
312 -e 's/mipsel-.*/mipsel/' \
313 -e 's/i[3-9]86/x86/' \
314 )" >>prereq.mk
316 if [ "$CC" = "clang" ]; then
317 echo "HOST_CC:=${CC} -fbracket-depth=1024" >> $topdir/prereq.mk
318 else
319 echo "HOST_CC:=${CC}" >> $topdir/prereq.mk
321 if [ "$CXX" = "clang++" ]; then
322 echo "HOST_CXX:=${CXX} -fbracket-depth=1024" >> $topdir/prereq.mk
323 else
324 echo "HOST_CXX:=${CXX}" >> $topdir/prereq.mk
327 echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk
328 echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk
329 echo 'LANGUAGE:=C' >> $topdir/prereq.mk
330 echo 'LC_ALL:=C' >> $topdir/prereq.mk
331 echo "_PATH:=$PATH" >> $topdir/prereq.mk
332 echo "PATH:=${topdir}/scripts:/usr/sbin:$PATH" >> $topdir/prereq.mk
333 echo "GIT:=$(which git 2>/dev/null)" >> $topdir/prereq.mk
334 if [ $dlverbose -eq 0 ]; then
335 echo "GITOPTS:=--quiet" >> $topdir/prereq.mk
337 echo "export ADK_TOPDIR GIT GITOPTS SHA256 BASH SHELL" >> $topdir/prereq.mk
339 # create temporary Makefile
340 cat >Makefile.tmp <<'EOF'
341 include ${ADK_TOPDIR}/prereq.mk
342 all: test
344 test: test.c
345 @${HOST_CC} ${HOST_CFLAGS} -o $@ $^ ${LDADD}
348 # check if compiler works
349 cat >test.c <<-'EOF'
350 #include <stdio.h>
352 main()
354 printf("YES");
355 return (0);
359 $MAKE --no-print-directory ADK_TOPDIR=$topdir -f Makefile.tmp 2>&1
360 X=$(./test)
361 if [ $X != YES ]; then
362 echo "$X" | sed 's/^/| /'
363 echo Cannot compile a simple test programme.
364 echo You must install a host make and C compiler.
365 echo
366 out=1
368 rm test.c test 2>/dev/null
370 # check for zlib
371 cat >test.c <<-'EOF'
372 #include <stdio.h>
373 #include <zlib.h>
375 #ifndef STDIN_FILENO
376 #define STDIN_FILENO 0
377 #endif
380 main()
382 gzFile zstdin;
383 char buf[1024];
384 int i;
386 zstdin = gzdopen(STDIN_FILENO, "rb");
387 i = gzread(zstdin, buf, sizeof (buf));
388 if ((i > 0) && (i < sizeof (buf)))
389 buf[i] = '\0';
390 buf[sizeof (buf) - 1] = '\0';
391 printf("%s\n", buf);
392 return (0);
396 $MAKE --no-print-directory LDADD=-lz ADK_TOPDIR=$topdir -f Makefile.tmp 2>&1
397 X=$(echo YES | gzip | ./test)
398 if [ $X != YES ]; then
399 echo "$X" | sed 's/^/| /'
400 echo Cannot compile a libz test programm.
401 echo You must install the zlib development package,
402 echo usually called libz-dev, and the run-time library.
403 echo
404 out=1
407 rm test.c test 2>/dev/null
408 rm Makefile.tmp 2>/dev/null
410 # error out on any required prerequisite
411 if [ $out -ne 0 ]; then
412 exit $out
415 host_build_bc=0
416 if which bc >/dev/null 2>&1; then
417 if ! echo quit|bc -q 2>/dev/null >/dev/null; then
418 host_build_bc=1
419 else
420 if bc -v 2>&1| grep -q BSD >/dev/null 2>&1; then
421 host_build_bc=1
424 else
425 host_build_bc=1
428 host_build_bison=0
429 if ! which bison >/dev/null 2>&1; then
430 host_build_bison=1
433 host_build_bzip2=0
434 if ! which bzip2 >/dev/null 2>&1; then
435 host_build_bzip2=1
438 host_build_file=0
439 if ! which file >/dev/null 2>&1; then
440 host_build_file=1
443 host_build_flex=0
444 if ! which flex >/dev/null 2>&1; then
445 host_build_flex=1
448 host_build_m4=0
449 if ! which m4 >/dev/null 2>&1; then
450 host_build_m4=1
453 host_build_mkimage=0
454 if ! which mkimage >/dev/null 2>&1; then
455 host_build_mkimage=1
458 host_build_mksh=0
459 if ! which mksh >/dev/null 2>&1; then
460 host_build_mksh=1
463 host_build_patch=0
464 if ! which patch >/dev/null 2>&1; then
465 host_build_patch=1
468 host_build_pkgconf=0
469 if ! which pkgconf >/dev/null 2>&1; then
470 host_build_pkgconf=1
473 host_build_tar=0
474 if which tar >/dev/null 2>&1; then
475 if ! tar --version 2>/dev/null|grep GNU >/dev/null;then
476 host_build_tar=1
478 else
479 host_build_tar=1
482 host_build_findutils=0
483 if which xargs >/dev/null 2>&1; then
484 if ! xargs --version 2>/dev/null|grep GNU >/dev/null;then
485 host_build_findutils=1
489 if which find >/dev/null 2>&1; then
490 if ! find --version 2>/dev/null|grep GNU >/dev/null;then
491 host_build_findutils=1
495 host_build_grep=0
496 if which grep >/dev/null 2>&1; then
497 if ! grep --version 2>/dev/null|grep GNU >/dev/null;then
498 host_build_grep=1
502 host_build_gawk=0
503 if ! which gawk >/dev/null 2>&1; then
504 host_build_gawk=1
507 host_build_sed=0
508 if which sed >/dev/null 2>&1; then
509 if ! sed --version 2>/dev/null|grep GNU >/dev/null;then
510 host_build_sed=1
514 host_build_xz=0
515 if ! which xz >/dev/null 2>&1; then
516 host_build_xz=1
519 # optional
520 host_build_cdrtools=0
521 if ! which mkisofs >/dev/null 2>&1; then
522 host_build_cdrtools=1
525 host_build_ccache=0
526 if ! which ccache >/dev/null 2>&1; then
527 host_build_ccache=1
530 host_build_genext2fs=0
531 if ! which genext2fs >/dev/null 2>&1; then
532 host_build_genext2fs=1
535 host_build_lzma=0
536 if ! which lzma >/dev/null 2>&1; then
537 host_build_lzma=1
540 host_build_lz4=0
541 if ! which lz4c >/dev/null 2>&1; then
542 host_build_lz4=1
545 host_build_lzop=0
546 if ! which lzop >/dev/null 2>&1; then
547 host_build_lzop=1
550 host_build_qemu=0
551 if ! which qemu-img >/dev/null 2>&1; then
552 host_build_qemu=1
555 host_build_coreutils=0
556 if which tr >/dev/null 2>&1; then
557 if ! tr --version 2>/dev/null|grep GNU >/dev/null;then
558 host_build_coreutils=1
562 echo "config ADK_HOST_BUILD_TOOLS" > $topdir/target/config/Config.in.prereq
563 printf "\t%s\n" "bool" >> $topdir/target/config/Config.in.prereq
564 printf "\t%s\n" "default y" >> $topdir/target/config/Config.in.prereq
565 # always required
566 if [ $host_build_bc -eq 1 ]; then
567 printf "\t%s\n" "select ADK_HOST_BUILD_BC" >> $topdir/target/config/Config.in.prereq
569 if [ $host_build_bison -eq 1 ]; then
570 printf "\t%s\n" "select ADK_HOST_BUILD_BISON" >> $topdir/target/config/Config.in.prereq
572 if [ $host_build_bzip2 -eq 1 ]; then
573 printf "\t%s\n" "select ADK_HOST_BUILD_BZIP2" >> $topdir/target/config/Config.in.prereq
575 if [ $host_build_file -eq 1 ]; then
576 printf "\t%s\n" "select ADK_HOST_BUILD_FILE" >> $topdir/target/config/Config.in.prereq
578 if [ $host_build_flex -eq 1 ]; then
579 printf "\t%s\n" "select ADK_HOST_BUILD_FLEX" >> $topdir/target/config/Config.in.prereq
581 if [ $host_build_gawk -eq 1 ]; then
582 printf "\t%s\n" "select ADK_HOST_BUILD_GAWK" >> $topdir/target/config/Config.in.prereq
584 if [ $host_build_grep -eq 1 ]; then
585 printf "\t%s\n" "select ADK_HOST_BUILD_GREP" >> $topdir/target/config/Config.in.prereq
587 if [ $host_build_m4 -eq 1 ]; then
588 printf "\t%s\n" "select ADK_HOST_BUILD_M4" >> $topdir/target/config/Config.in.prereq
590 if [ $host_build_mkimage -eq 1 ]; then
591 printf "\t%s\n" "select ADK_HOST_BUILD_U_BOOT" >> $topdir/target/config/Config.in.prereq
593 if [ $host_build_mksh -eq 1 ]; then
594 printf "\t%s\n" "select ADK_HOST_BUILD_MKSH" >> $topdir/target/config/Config.in.prereq
596 if [ $host_build_patch -eq 1 ]; then
597 printf "\t%s\n" "select ADK_HOST_BUILD_PATCH" >> $topdir/target/config/Config.in.prereq
599 if [ $host_build_pkgconf -eq 1 ]; then
600 printf "\t%s\n" "select ADK_HOST_BUILD_PKGCONF" >> $topdir/target/config/Config.in.prereq
602 if [ $host_build_findutils -eq 1 ]; then
603 printf "\t%s\n" "select ADK_HOST_BUILD_FINDUTILS" >> $topdir/target/config/Config.in.prereq
605 if [ $host_build_sed -eq 1 ]; then
606 printf "\t%s\n" "select ADK_HOST_BUILD_SED" >> $topdir/target/config/Config.in.prereq
608 if [ $host_build_tar -eq 1 ]; then
609 printf "\t%s\n" "select ADK_HOST_BUILD_TAR" >> $topdir/target/config/Config.in.prereq
611 if [ $host_build_xz -eq 1 ]; then
612 printf "\t%s\n" "select ADK_HOST_BUILD_XZ" >> $topdir/target/config/Config.in.prereq
614 # optional
615 if [ $host_build_ccache -eq 1 ]; then
616 printf "\t%s\n" "select ADK_HOST_BUILD_CCACHE if ADK_HOST_NEED_CCACHE" >> $topdir/target/config/Config.in.prereq
618 if [ $host_build_cdrtools -eq 1 ]; then
619 printf "\t%s\n" "select ADK_HOST_BUILD_CDRTOOLS if ADK_HOST_NEED_CDRTOOLS" >> $topdir/target/config/Config.in.prereq
621 if [ $host_build_genext2fs -eq 1 ]; then
622 printf "\t%s\n" "select ADK_HOST_BUILD_GENEXT2FS if ADK_HOST_NEED_GENEXT2FS" >> $topdir/target/config/Config.in.prereq
624 if [ $host_build_lzma -eq 1 ]; then
625 printf "\t%s\n" "select ADK_HOST_BUILD_LZMA if ADK_HOST_NEED_LZMA" >> $topdir/target/config/Config.in.prereq
627 if [ $host_build_lz4 -eq 1 ]; then
628 printf "\t%s\n" "select ADK_HOST_BUILD_LZ4 if ADK_HOST_NEED_LZ4" >> $topdir/target/config/Config.in.prereq
630 if [ $host_build_lzop -eq 1 ]; then
631 printf "\t%s\n" "select ADK_HOST_BUILD_LZOP if ADK_HOST_NEED_LZOP" >> $topdir/target/config/Config.in.prereq
633 if [ $host_build_qemu -eq 1 ]; then
634 printf "\t%s\n" "select ADK_HOST_BUILD_QEMU if ADK_HOST_NEED_QEMU" >> $topdir/target/config/Config.in.prereq
636 if [ $host_build_coreutils -eq 1 ]; then
637 printf "\t%s\n" "select ADK_HOST_BUILD_COREUTILS if ADK_HOST_NEED_COREUTILS" >> $topdir/target/config/Config.in.prereq
640 # create Host OS symbols
641 case $os in
642 Linux)
643 printf "\nconfig ADK_HOST_LINUX\n" >> $topdir/target/config/Config.in.prereq
644 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
645 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
647 Darwin)
648 printf "\nconfig ADK_HOST_DARWIN\n" >> $topdir/target/config/Config.in.prereq
649 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
650 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
652 OpenBSD)
653 printf "\nconfig ADK_HOST_OPENBSD\n" >> $topdir/target/config/Config.in.prereq
654 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
655 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
657 FreeBSD)
658 printf "\nconfig ADK_HOST_FREEBSD\n" >> $topdir/target/config/Config.in.prereq
659 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
660 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
662 NetBSD)
663 printf "\nconfig ADK_HOST_NETBSD\n" >> $topdir/target/config/Config.in.prereq
664 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
665 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
667 MirBSD)
668 printf "\nconfig ADK_HOST_MIRBSD\n" >> $topdir/target/config/Config.in.prereq
669 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
670 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
672 Cygwin*)
673 printf "\nconfig ADK_HOST_CYGWIN\n" >> $topdir/target/config/Config.in.prereq
674 printf "\tbool\n" >> $topdir/target/config/Config.in.prereq
675 printf "\tdefault y\n" >> $topdir/target/config/Config.in.prereq
677 esac
679 if [ "$target" = "defconfig" ]; then
680 $makebin ADK_TOPDIR=$topdir --no-print-directory -f Makefile.adk $flags $target
681 exit 0
684 if [ ! -f $topdir/.config ]; then
685 # create a config if no exist
686 touch .firstrun
687 $makebin ADK_TOPDIR=$topdir --no-print-directory -f Makefile.adk menuconfig
688 else
689 # scan host-tool prerequisites of certain packages before building.
690 . $topdir/.config
691 if [ -n "$ADK_PACKAGE_KODI" ]; then
692 NEED_JAVA="$NEED_JAVA kodi"
695 if [ -n "$ADK_PACKAGE_ICU4C" ]; then
696 NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
699 if [ -n "$ADK_PACKAGE_XKEYBOARD_CONFIG" ]; then
700 NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
703 if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_100DPI" ]; then
704 NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
707 if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_75DPI" ]; then
708 NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
711 if [ -n "$ADK_PACKAGE_FONT_ADOBE_100DPI" ]; then
712 NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
715 if [ -n "$ADK_PACKAGE_FONT_ADOBE_75DPI" ]; then
716 NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
719 if [ -n "$NEED_MKFONTDIR" ]; then
720 if ! which mkfontdir >/dev/null 2>&1; then
721 printf "You need mkfontdir to build $NEED_MKFONTDIR \n"
722 out=1
726 if [ -n "$NEED_XKBCOMP" ]; then
727 if ! which xkbcomp >/dev/null 2>&1; then
728 printf "You need xkbcomp to build $NEED_XKBCOMP \n"
729 out=1
733 if [ -n "$NEED_JAVA" ]; then
734 if ! which java >/dev/null 2>&1; then
735 printf "You need java to build $NEED_JAVA \n"
736 out=1
740 if [ -n "$NEED_STATIC_LIBSTDCXX" ]; then
741 cat >test.c <<-'EOF'
742 #include <stdio.h>
744 main()
746 return (0);
749 if ! $CXX -static-libstdc++ -o test test.c 2>/dev/null ; then
750 printf "You need static version of libstdc++ installed to build $NEED_STATIC_LIBSTDCXX \n"
751 out=1
752 rm test test.c 2>/dev/null
756 # error out
757 if [ $out -ne 0 ]; then
758 exit $out
761 # start build
762 $makebin ADK_TOPDIR=$topdir --no-print-directory -f Makefile.adk $flags $target