1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
8 if [ -z $
(which gmake
2>/dev
/null
) ];then
9 makecmd
=$
(which make 2>/dev
/null
)
11 makecmd
=$
(which gmake
2>/dev
/null
)
14 if [[ $NO_ERROR != @
(0|
1) ]]; then
15 echo Please
do not invoke this
script directly
!
30 ERROR: OpenADK cannot be built in a case-insensitive file system.
34 echo "Building OpenADK on $os needs a small registry change."
35 echo 'http://cygwin.com/cygwin-ug-net/using-specialnames.html'
38 echo "Building OpenADK on $os needs a case-sensitive disk partition."
39 echo "For Snow Leopard and above you can use diskutil to resize your existing disk."
40 echo "For older versions you might consider to use a disk image."
41 echo "Example: sudo diskutil resizeVolume disk0s2 90G 1 jhfsx adk 30G"
65 echo "Building OpenADK on $os is currently unsupported."
74 include ${TOPDIR}/prereq.mk
79 ${HOSTCC} ${HOSTCFLAGS} -o $@ $^ ${LDADD}
89 printf("Yay! Native compiler works.\n");
93 X
=$
($makecmd TOPDIR
=$topdir 2>&1)
94 if [[ $X != *@
(Native compiler works
)* ]]; then
95 echo "$X" |
sed 's/^/| /'
96 echo Cannot compile a simple
test programme.
97 echo You must
install a
host make and C compiler
,
98 echo usually GCC
, to proceed.
104 if ! which tar >/dev
/null
2>&1; then
105 echo You must
install tar to
continue.
110 if ! which gzip >/dev
/null
2>&1; then
111 echo You must
install gzip to
continue.
116 if ! which lzma
>/dev
/null
2>&1; then
117 echo You must
install lzma to
continue.
122 if ! which bzip2 >/dev
/null
2>&1; then
123 echo You must
install bzip2 to
continue.
128 if ! which patch >/dev
/null
2>&1; then
129 echo You must
install patch to
continue.
139 #define STDIN_FILENO 0
149 zstdin = gzdopen(STDIN_FILENO, "rb");
150 i = gzread(zstdin, buf, sizeof (buf));
151 if ((i > 0) && (i < sizeof (buf)))
153 buf[sizeof (buf) - 1] = '\0';
158 X
=$
(echo 'Yay! Native compiler works.' |
gzip | \
159 $makecmd TOPDIR
=$topdir LDADD
=-lz 2>&1)
160 if [[ $X != *@
(Native compiler works
)* ]]; then
161 echo "$X" |
sed 's/^/| /'
162 echo Cannot compile a libz
test programm.
163 echo You must
install the zlib development package
,
164 echo usually called libz-dev
, and the run-time library.
169 if [[ ! -s /usr
/include
/ncurses.h
]]; then
170 if [[ ! -s /usr
/include
/curses.h
]]; then
171 if [[ ! -s /usr
/include
/ncurses
/ncurses.h
]]; then
172 echo Install ncurses header files
, please.
179 if ! which gawk
>/dev
/null
2>&1; then
180 echo You must
install GNU
awk to
continue.
185 if ! which sed >/dev
/null
2>&1; then
186 echo You must
install GNU
sed to
continue.
191 if ! sed --version 2>/dev
/null|
grep GNU
>/dev
/null
;then
192 if ! which gsed
>/dev
/null
2>&1; then
193 echo You must
install GNU
sed to
continue.
199 if ! which wget
>/dev
/null
2>&1; then
200 echo You must
install wget to
continue.
205 if ! which file >/dev
/null
2>&1; then
206 echo You must
install \"file\" to
continue.
211 if ! which perl
>/dev
/null
2>&1; then
212 echo You must
install perl to
continue.
217 if ! which m4 >/dev
/null
2>&1; then
218 echo "You must install m4 (macro processor) to continue."
223 if ! which pkg-config
>/dev
/null
2>&1; then
224 echo "You need pkg-config to continue."