forked from da-x/colinux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·810 lines (679 loc) · 22.7 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
#!/bin/sh
# File: configure
#
# Simlpe configure script for develop coLinux and cross platform, checks
# build environment (gcc and tools) and create bin/user-build.cfg.
#
# - Henry Nestler <[email protected]>
#
# More arguments and directory options:
# ./configure --help
# Some defaults from config file (Kernel version and dir, binutil version)
. bin/build-common.sh --get-vars
# Some default values
target=$TARGET
nonopt=NONE
prefix=NONE
distdir="\$USER_TOPDIR/dist"
downloaddir=NONE
builddir="\$USER_TOPDIR/build"
logfile="\$USER_TOPDIR/log/build-colinux-\$\$.log"
errfile="\$USER_TOPDIR/log/build-colinux-\$\$.err"
targetkernelsource="\$BUILD_DIR/linux-\$KERNEL_VERSION-source"
targetkernelbuild="\$BUILD_DIR/linux-\$KERNEL_VERSION-build"
targetkerneldir=NONE
targetmoduledir="\$COLINUX_TARGET_KERNEL_BUILD/_install"
hostkerneldir=NONE
colinux_os=NONE
configfile="bin/user-build.cfg"
no_create=""
verbose=no
kernel_untar=no
gcc_guest_target=i686-co-linux
gcc_guest_build=no
enable_wx=no
# Try the directory containing this script, then its working dir.
prog=$0
confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
test "x$confdir" = "x$prog" && confdir=.
# Go into source dir and give path absolute
srcdir=`( cd $confdir ; pwd )`
# Go into upper of source dir and give path absolute
topdir=`( cd $srcdir/.. ; pwd )`
prev=
for option
do
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
eval "$prev=\$option"
prev=
continue
fi
case "$option" in
-*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$option" in
help | -help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options]
Options: [defaults in brackets after descriptions]
Configuration:
--help print this message
Host type:
--target=TARGET configure for TARGET [$target]
--colinux-os=OS target platform string OS=linux|winnt [winnt]
Directories:
--srcdir=DIR directory of this script
[$srcdir]
--topdir=TOPDIR base directory for all other dirs
[$topdir]
--downloaddir=DIR source download
[\$TOPDIR/download]
--builddir=BUILD_DIR extract and compile tools
[\$TOPDIR/build]
--prefix=PREFIX install architecture-independent files in PREFIX
[\$TOPDIR/mingw32]
--distdir=DIR distribution of all winnt files
[\$TOPDIR/dist]
--targetkernelsource=DIR path to patched colinux guest kernel source tree
[$targetkernelsource]
--targetkernelbuild=DIR output directory for building colinux guest kernel
[$targetkernelbuild]
--targetkerneldir=DIR path to patched colinux guest kernel tree, source
and builds in same directory (obsolate, see above)
--targetmoduledir=DIR Modules output for target kernel (Guest)
[$targetmoduledir]
--hostkerneldir=DIR path to your host kernel (only for linux as host)
[/usr/src/linux]
Options:
--configfile=FILE outputfile for batch build [$configfile]
--logfile=ARG logfile for build process, open append.
use \$\$ for process id and separate files.
[\$TOPDIR/log/build-colinux-\$\$.log]
--errfile=ARG error file for build process, open append.
[\$TOPDIR/log/build-colinux-\$\$.err]
--kernel-untar Untar can overwrite kernel tree, if exist. Is good
for clean builds or automation builds.
--disable-kernel-untar Never overwrite kernel sources. (default)
--dry-run Test only configure steps, don't write config.
--verbose More messages in configure.
--gcc-guest-build Build C compiler from source of gnu cross compiler,
and use for kernel compiling. Should use, if gcc version
(major + minor) is different from your distribution.
--enable-wx Build WxWidgets lib and console-wx (default disabled).
-------------------------------------------------------------------------------
Sample for WinNT as host (default):
./configure --target=i686-pc-mingw32 \\
--downloaddir=$DOWNLOADS \\
--prefix=$PREFIX
Sample for Linux as host:
./configure --target=i686-pc-linux \\
--downloaddir=$DOWNLOADS \\
--targetkerneldir=$BUILD_DIR/linux-$KERNEL_VERSION \\
--hostkerneldir=/usr/src/linux-`uname -r`
Sample for WinNT and Linux as host in same config:
./configure \\
--downloaddir=$DOWNLOADS \\
--prefix=$PREFIX \\
--targetkerneldir=$BUILD_DIR/linux-$KERNEL_VERSION \\
--hostkerneldir=/usr/src/linux-`uname -r`
EOF
exit 0 ;;
--topdir)
prev=topdir ;;
--topdir=*)
topdir="$optarg" ;;
--srcdir)
prev=srcdir ;;
--srcdir=*)
srcdir="$optarg" ;;
--target)
prev=target ;;
--target=*)
target="$optarg" ;;
--prefix)
prev=prefix ;;
--prefix=*)
prefix="$optarg" ;;
--downloaddir)
prev=downloaddir ;;
--downloaddir=*)
downloaddir="$optarg" ;;
--builddir)
prev=builddir ;;
--builddir=*)
builddir="$optarg" ;;
--distdir)
prev=distdir ;;
--distdir=*)
distdir="$optarg" ;;
--targetkernelsource)
prev=targetkernelsource ;;
--targetkernelsource=*)
targetkernelsource="$optarg" ;;
--targetkernelbuild)
prev=targetkernelbuild ;;
--targetkernelbuild=*)
targetkernelbuild="$optarg" ;;
--targetkerneldir)
prev=targetkerneldir ;;
--targetkerneldir=*)
targetkerneldir="$optarg" ;;
--targetmoduledir)
prev=targetmoduledir ;;
--targetmoduledir=*)
targetmoduledir="$optarg" ;;
--hostkerneldir)
prev=hostkerneldir ;;
--hostkerneldir=*)
hostkerneldir="$optarg" ;;
--colinux-os)
prev=colinux-os ;;
--colinux-os=*)
colinux_os="$optarg" ;;
--configfile)
prev=configfile ;;
--configfile=*)
configfile="$optarg" ;;
--logfile)
prev=logfile ;;
--logfile=*)
logfile="$optarg" ;;
--errfile)
prev=errfile ;;
--errfile=*)
errfile="$optarg" ;;
--no-create|--dry-run)
no_create=yes ;;
--no-kernel-untar | \
--disable-kernel-untar)
kernel_untar=no ;;
--kernel-untar | \
--enable-kernel-untar)
kernel_untar=yes ;;
--gcc-guest*)
gcc_guest_build=yes ;;
--enable-wx)
enable_wx=yes ;;
--disable-wx)
enable_wx=no ;;
-v | -verbose | --verbose)
verbose=yes ;;
-*) { echo "configure: error: $option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
*)
if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$option"
;;
esac
done
if test -n "$prev"; then
{ echo "configure: error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
#
# Check for target system
#
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
if [ "$verbose" = "yes" ]; then
echo " confdir=$confdir"
echo " srcdir=$srcdir"
echo " topdir=$topdir"
echo " TOPDIR=$TOPDIR"
echo " BINDIR=$BINDIR"
echo " target_cpu=$target_cpu"
echo " target_vendor=$target_vendor"
echo " target_os=$target_os"
echo " colinux version=$CO_VERSION"
echo " target kernel_dir=$KERNEL_DIR"
echo " target kernel_version=$KERNEL_VERSION"
fi
#
# Check building for linux or winnt
# Mapping real OS into coLinux OS-Name
#
case $colinux_os in
NONE)
case $target_os in
linux|Linux) colinux_os="linux" ;;
darwin*|Darwin) colinux_os="darwin" ;;
*) colinux_os="winnt" ;;
esac ;;
esac
echo "Setting colinux_os=$colinux_os"
# Default prefix directory
case $prefix in
NONE)
case $target_os in
NONE) prefix="$topdir/prefix-unknown" ;;
*) prefix="$topdir/$target_os" ;;
esac
echo "Setting prefix=$prefix"
;;
esac
# Default download directory
case $downloaddir in
NONE)
downloaddir="$topdir/download"
echo "Setting downloaddir=$downloaddir"
;;
esac
# Splitted target kernel directories?
case $targetkerneldir in
NONE)
targetkerneldir_cfg="# COLINUX_TARGET_KERNEL_PATH=\"\$BUILD_DIR/linux-\$KERNEL_VERSION\""
;;
*)
targetkerneldir_cfg="COLINUX_TARGET_KERNEL_PATH=\"$targetkerneldir\""
targetkernelsource="\$COLINUX_TARGET_KERNEL_PATH"
targetkernelbuild="\$COLINUX_TARGET_KERNEL_PATH"
;;
esac
#
# Check host system
#
if [ "$target_os" = "linux" ] ; then
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
echo " UNAME_RELEASE=$UNAME_RELEASE"
# Search Linux-Host kernel sourcs:
# 1. /lib/modules/$UNAME_RELEASE/build
# 2. /lib/modules/$UNAME_RELEASE/source
# 3. /usr/src/linux
# 4. /usr/src/linux-$UNAME_RELEASE
if [ "$hostkerneldir" = "NONE" ] ; then
if [ -d /lib/modules/$UNAME_RELEASE/build ] ; then
hostkerneldir="/lib/modules/$UNAME_RELEASE/build"
elif [ -d /lib/modules/$UNAME_RELEASE/source ] ; then
hostkerneldir="/lib/modules/$UNAME_RELEASE/source"
elif [ -d /usr/src/linux ] ; then
hostkerneldir="/usr/src/linux"
elif [ -d /usr/src/linux-$UNAME_RELEASE ] ; then
hostkerneldir="/usr/src/linux-$UNAME_RELEASE"
else
{ echo "configure: error: source directory for host kernel missing, use --hostkerneldir" 1>&2; exit 1; }
fi
echo "Setting hostkerneldir=$hostkerneldir"
fi
fi
if [ "$hostkerneldir" != "NONE" ] ; then
if [ ! -f $hostkerneldir/Makefile ] ; then
{ echo "configure: error: missing configured host kernel in $hostkerneldir" 1>&2; exit 1; }
fi
HOST_KERNELRELEASE=`cd $hostkerneldir; make kernelrelease 2>/dev/null | tail -n1`
if [ -n "$HOST_KERNELRELEASE" ]; then
set -- `echo "$HOST_KERNELRELEASE" | sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\)$/\1 \2 \3 \4/'`
HOST_VERSION="$1"
HOST_PATCHLEVEL="$2"
HOST_SUBLEVEL="$3"
HOST_EXTRAVERSION="$4"
else
HOST_VERSION=`grep "^VERSION = " $hostkerneldir/Makefile | sed -e 's/\([^0-9]*\)\(.*\)$/\2/'`
HOST_PATCHLEVEL=`grep "^PATCHLEVEL = " $hostkerneldir/Makefile | sed -e 's/\([^0-9]*\)\(.*\)$/\2/'`
HOST_SUBLEVEL=`grep "^SUBLEVEL = " $hostkerneldir/Makefile | sed -e 's/\([^0-9]*\)\(.*\)$/\2/'`
HOST_EXTRAVERSION=`grep "^EXTRAVERSION = " $hostkerneldir/Makefile | sed -e 's/\([^0-9\.]*\)\(.*\)$/\2/'`
HOST_KERNELRELEASE="$HOST_VERSION.$HOST_PATCHLEVEL.$HOST_SUBLEVEL$HOST_EXTRAVERSION"
fi
echo " HOST_VERSION=$HOST_VERSION"
echo " HOST_PATCHLEVEL=$HOST_PATCHLEVEL"
echo " HOST_SUBLEVEL=$HOST_SUBLEVEL"
test -n "$HOST_EXTRAVERSION" && echo " HOST_EXTRAVERSION=$HOST_EXTRAVERSION"
# Hostkernel must be >= 2.6 (compile external module)
if [ "$HOST_VERSION" != "2" -o "$HOST_PATCHLEVEL" -lt 6 ] ; then
{ echo "configure: error: host kernel $HOST_VERSION.$HOST_PATCHLEVEL.$HOST_SUBLEVEL is to old! Need 2.6.x" 1>&2; exit 1; }
fi
if [ "$HOST_KERNELRELEASE" != "`uname -r`" ] ; then
echo -e "\n WARNING! Running kernel is not same as host kernel - You can not run colinux on this machine!\n"
fi
fi
# Remove path from md5 files
W32LIBS_CHECKSUM=`basename $W32LIBS_CHECKSUM`
KERNEL_CHECKSUM=`basename $KERNEL_CHECKSUM`
# $1 Name of component
# $2 yes: add to warnings | no: add to failed
add_failed()
{
if [ "$2" != "yes" ]; then
test -z "$failed" && failed="$1" || failed="$failed, $1"
else
test -z "$warnings" && warnings="$1" || warnings="$warnings, $1"
fi
}
# $1 Name of component
# $2 Call for check
# $3 Minimum version need, or empty string
# $4 Maximum version supported, or empty string
# '--warn' optional as first param, add to warning list
# Example: "wget-1.8" "wget --version" "1.8.x"
check_exec_tool()
{
local v1="" v2="" v3="" i1="" i2="" i3="" warn=""
if [ "$1" = "--warn" ]; then
warn="yes"
shift
fi
echo -n "Checking $1 ... "
if ($2) </dev/null >/dev/null 2>&1; then
if [ -n "$3" ]; then
# get needed version, transform the 'x' into 0
eval `echo $3 | sed -e \
's/\([0-9]*\)\.\([0-9x]*\)\.\([0-9x]*\)/v1=\1 v2=\2 v3=\3/' -e 'y/x/0/'`
# get installed version
eval `($2) 2>&1 | sed -n -e \
's/^[^0-9]*\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/i1=\1 i2=\2 i3=\3/p'`
if [ "$v3" = "0" -a -z "$i1" ]; then
# get installed version with two numbers
eval `($2) 2>&1 | sed -n -e \
's/^.*\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/i1=\1 i2=\2/p'`
i3="0"
fi
if [ -z "$i1" -o -z "$v1" -o -z "$i2" -o -z "$v2" -o -z "$i3" -o -z "$v3" ]; then
echo "Version not dectect"
add_failed "$1" $warn
return 1
fi
echo -n "($i1.$i2.$i3) "
if [ $i1 -lt $v1 -o \
$i1 -eq $v1 -a $i2 -lt $v2 -o \
$i1 -eq $v1 -a $i2 -eq $v2 -a $i3 -lt $v3 ]; then
echo "wrong version, need $3"
add_failed "$1" $warn
return 1
fi
if [ -n "$4" ]; then
local m1="" m2="" m3=""
# get needed version, transform the 'x' into 999
eval `echo $4 | sed -e \
's/\([0-9]*\)\.\([0-9x]*\)\.\([0-9x]*\)/m1=\1 m2=\2 m3=\3/'`
test "$m2" = "x" && m2="999"
test "$m3" = "x" && m3="999"
if [ $i1 -gt $m1 -o \
$i1 -eq $m1 -a $i2 -gt $m2 -o \
$i1 -eq $m1 -a $i2 -eq $m2 -a $i3 -gt $m3 ]; then
echo "version not supported, maximum $4"
add_failed "$1" $warn
return 1
fi
fi
fi
echo "found"
else
echo "missing (no exec)"
add_failed "$1" $warn
return 1
fi
return 0
}
as_helper()
{
if [ "$gcc_guest_build" = "yes" ]; then
echo " Build guest '${gcc_guest_target_prefix}as' and binutils for kernel later"
return
fi
exit 1
}
gcc_helper()
{
if [ "$gcc_guest_build" = "yes" ]; then
echo " Build guest '${gcc_guest_target_prefix}gcc' for kernel later"
return
fi
# ABI from local GCC
LOCAL_ABI=`echo | gcc -E -dM - | sed -n -e 's/.* __GXX_ABI_VERSION \([0-9]*\)/\1/p'`
# ABI from known mingw compilers
case $GCC_VERSION in
4.3.*|4.2.*|4.1.*|4.0.*|3.4.*)
MINGW_ABI="1002"
;;
3.3.*)
MINGW_ABI="102"
;;
# 3.2.*)
# MINGW_ABI="101"
# ;;
*) MINGW_ABI="unknown"
;;
esac
if [ x$LOCAL_ABI = x$MINGW_ABI ]; then
echo " ABI seems be compatible. Use local gcc `gcc -dumpversion` for kernel, $GCC_VERSION for daemons."
return
fi
cat <<EOF
Cross gcc and local gcc should be the same major and minor version.
Please use option "--gcc-guest-build" to enable building of guest gcc
from sources, if building cross tools later. (Need for kernel building)
--- OR ---
# download source for gcc $GCC_NEEDED, configure and build self:
cd $srcdir/bin
./build-cross.sh --download-only
cd /tmp
tar xzf $downloaddir/gcc-core-$GCC_RELEASE-src.tar.gz
tar xzf $downloaddir/gcc-g++-$GCC_RELEASE-src.tar.gz
cd gcc-$GCC_RELEASE
./configure --prefix=\$HOME/$gcc_guest_target
make && make install
cd / ; rm -rf /tmp/gcc-$GCC_RELEASE
# Than run configure and make again with binary path to this directory:
export PATH="\$HOME/$gcc_guest_target/bin:\$PATH"
cd $srcdir
./configure && make
EOF
exit 1
}
check_depmod()
{
echo -n "Checking depmod ... "
# Locate depmod in user dirs and check for module-init-tools version
if depmod_cfg=`PATH="$prefix/$target/bin:/sbin:/usr/sbin:/usr/local/sbin:$PATH" \
which depmod 2>/dev/null`; then
# Depmod 2.4.x is bugy with "-V" only, "--help" does nothing real.
installed=`$depmod_cfg -V --help 2>/dev/null | grep module-init-tools`
if [ -z "$installed" ]; then
cat << EOF
($depmod_cfg) wrong version.
Warning: you may need to install module-init-tools"
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
Install the file 'depmod', in directory
$prefix/$target/bin,
to use only for cross buildings.
EOF
add_failed "$1"
else
echo "($installed) found"
fi
else
echo "missing (no exec)"
add_failed "$1"
fi
}
#
# Check for tools
#
warning=""
failed=""
# Get version from script, replace the last digit
GCC_NEEDED=`echo "$GCC_VERSION" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*$/\1.\2/'`.x
# Build specific path
if [ "$gcc_guest_build" = "no" ]; then
gcc_guest_build_comment="# "
gcc_guest_target_prefix=""
else
gcc_guest_build_comment=""
gcc_guest_target_prefix=${gcc_guest_target}-
PATH=$PATH:$prefix/$gcc_guest_target/bin
fi
# General tools for winnt and linux
check_exec_tool "wget" "wget --version" ""
check_exec_tool "Python interpreter" "python -V" "2.3.x" ""
check_exec_tool "patch" "patch --version" ""
check_exec_tool "make" "make --version" ""
check_exec_tool "bunzip2" "bunzip2 --help" ""
case $colinux_os in
linux) # for Linux as host
check_exec_tool "gcc for kernel" "${gcc_guest_target_prefix}gcc -dumpversion" "$GCC_NEEDED"
check_exec_tool "gcc g++" "${gcc_guest_target_prefix}g++ --version" "$GCC_NEEDED"
check_exec_tool "FLTK devel (patched)" "fltk-config --version" "$FLTK_VERSION" && \
if nm `fltk-config --libs` | grep -q "fl_x_global_event_hook"
then
if [ "$verbose" = "yes" ]; then
echo " `fltk-config --libs`: Label fl_x_global_event_hook found"
fi
else
echo " `fltk-config --libs`: label fl_x_global_event_hook not found"
echo " Please set right path to a patched FLTK"
fi
;;
darwin) # for darwin as host
GCC_NEEDED=""
# maybe we should check here for the XCode version, too
# ToDo: fail on PPC arch!
check_exec_tool "gcc for kernel" "${gcc_guest_target_prefix}gcc -dumpversion" "$GCC_NEEDED"
check_exec_tool "gcc g++" "${gcc_guest_target_prefix}g++ --version" "$GCC_NEEDED"
# check_exec_tool "FLTK devel (patched)" "fltk-config --version" "$FLTK_VERSION" && \
# if nm `fltk-config --libs` | grep -q "fl_x_global_event_hook"
# then
# if [ "$verbose" = "yes" ]; then
# echo " `fltk-config --libs`: Label fl_x_global_event_hook found"
# fi
# else
# echo " `fltk-config --libs`: label fl_x_global_event_hook not found"
# echo " Please set right path to a patched FLTK"
# fi
;;
*) # for Winnt as host
# Check GCC for kernel
check_exec_tool --warn "${gcc_guest_target_prefix}gcc for kernel" "${gcc_guest_target_prefix}gcc -dumpversion" \
"$GCC_NEEDED" "$GCC_NEEDED" || gcc_helper
check_exec_tool --warn "${gcc_guest_target_prefix}as binutils for kernel" "${gcc_guest_target_prefix}as --version" \
"$BINUTILS_REQUIREMENTS" || as_helper
# Locate users depmod and check for module-init-tools
check_depmod "depmod"
check_exec_tool "unzip" "unzip -h"
check_exec_tool "zip" "zip -h"
# bison-1.75-109 need by binutils (yacc 91.7.30 have a error YYEMPTY)
check_exec_tool "bison" "bison --version"
# need by binutils ...
check_exec_tool "texinfo" "texindex --version"
check_exec_tool "flex" "flex --version"
check_exec_tool "gettext" "gettext --version"
;;
esac
#
# Stop, if some tools missing or wrong version
#
if [ -n "$warnings" ]
then
echo " warnings: $warnings"
fi
if [ -n "$failed" ]
then
echo " failed: $failed"
exit 1
fi
#
# do nothing, if trace option enabled
#
test "$no_create" = yes && { echo "nothing created!" 1>&2; exit 1; }
# Backup old config file
test -f $configfile -a ! -f $configfile.old && mv $configfile $configfile.old
#
# Create config-file
# Needed for winnt in scripts, such bin/build-colinux.sh
#
echo "Create $configfile"
cat > $configfile << EOF
# File: $configfile
# Configfile for coLinux $CO_VERSION, kernel $KERNEL_VERSION
# created by configure at `date`
# Setup target OS (winnt or linux)
#
COLINUX_HOST_OS="$colinux_os"
# Directory where we start for all subdirs in build processing
# default: \$HOME/colinux-devel (use only in this file)
#
USER_TOPDIR="$topdir"
# Directory where we store download sources or where find source already stored
# default: \$USER_TOPDIR/download
#
DOWNLOADS="$downloaddir"
# In this directoy the cross-tools will be extract and compile (GCC and Co.)
# default: \$USER_TOPDIR/build
#
BUILD_DIR="$builddir"
# Directory for compiler binary (build by cross)
# default: \$USER_TOPDIR/mingw32
# (/usr/local/mingw32 not supported by this scripts, need root level)
#
PREFIX="$prefix"
# Overwrite kernelversion. Check series files for available versions.
# default: empty
#
# KERNEL_VERSION=$KERNEL_VERSION
# Path to guest kernel, need for colinux daemons build processing (obsolate)
# default: \$BUILD_DIR/linux-\$KERNEL_VERSION
#
$targetkerneldir_cfg
# Directory target kernel source path for unpacking source (Guest kernel)
# default: \$BUILD_DIR/linux-\$KERNEL_VERSION-source
#
COLINUX_TARGET_KERNEL_SOURCE="$targetkernelsource"
# Directory target kernel for building (Guest kernel)
# default: \$BUILD_DIR/linux-\$KERNEL_VERSION-build
#
COLINUX_TARGET_KERNEL_BUILD="$targetkernelbuild"
# Output directory for target modules. Used for INSTALL_MOD_PATH in kernel build
# default: \$COLINUX_TARGET_KERNEL_BUILD/_install
#
COLINUX_TARGET_MODULE_PATH="$targetmoduledir"
# HOST-Kernel (only, if host system is linux)
# default: /path/to/your/host/kernel/source
#
COLINUX_HOST_KERNEL_DIR="$hostkerneldir"
# Install directory for target binaries (daemons, kernel and modules)
# default: \$USER_TOPDIR/dist
#
COLINUX_INSTALL_DIR="$distdir"
# Logfile of building (append)
#
COLINUX_BUILD_LOG="$logfile"
COLINUX_BUILD_ERR="$errfile"
# Overwrite kerneltree before rebuild? yes/no
# yes: Build script will overwrite kerneltree and config.
# no: Leave kernel source untouched. User friendly for patches and config (default).
#
COLINUX_KERNEL_UNTAR="$kernel_untar"
# Strip the kernel image
# yes: Smalest size for package dist.
# no: Leave all debug symbols in image. Good choice for error tracing with gdb.
#
COLINUX_KERNEL_STRIP="no"
# Path to depmod, installed from module-init-tools
# default: /sbin/depmod
#
COLINUX_DEPMOD=$depmod_cfg
# "COLINUX_GCC_GUEST_TARGET" is running colinux guest system.
# This compiler will use for building colinux kernel as CROSS_COMPILE.
# Enable GUEST specific compiler, if your compiler from distribution
# is not compatible with current cross gcc.
# default: empty
# optional: $gcc_guest_target
#
${gcc_guest_build_comment}COLINUX_GCC_GUEST_TARGET="$gcc_guest_target"
${gcc_guest_build_comment}COLINUX_GCC_GUEST_PATH="\$PREFIX/\$COLINUX_GCC_GUEST_TARGET/bin"
# Library WxWidgets is disabled by default.
# To build colinux-console-wx.exe with this lib, set COLINUX_ENABLE_WX="yes".
COLINUX_ENABLE_WX="$enable_wx"
EOF
cat <<EOF
Configure DONE
Ready for "make download && make && make package && make installer"
Run "make help" for more instructions, and read doc/building.
EOF