Replaced --with-crosstools-prefix with --with-crosstools. Value defaults to $aros_tar...
[AROS.git] / configure.in
blobe74b90c2b7b6833706ec9fe88d4c39a77d5cabc6
1 dnl Copyright © 1997-2012, The AROS Development Team. All rights reserved.
2 dnl $Id$
3 dnl
4 dnl Desc: Autoconf source for configuration file
5 dnl Lang: english
7 # Note: After file changes, generate configure anew and commit _both_ files.
9 #TODO
10 # method of getting shared/non-shared ld/ar tool for target.
12 # ------------------------------------------------------------------------
13 # Here starts the first section of the configure.in file.
14 # ------------------------------------------------------------------------
16 AC_INIT(mmakefile)
17 AC_PREREQ(2.61)
18 AC_CONFIG_AUX_DIR(scripts/autoconf)
20 # Check what host we are running on.
21 # If a target is not suggested, we use this one.
22 # Note that what we call a target, Autoconf calls a host.
23 AC_CANONICAL_HOST
25 # The AROS target is slightly different to the normal GNU style
26 # format. We don't have the middle part, and we reverse the order
27 # of the $(CPU) and $(OS) bits.
29 # Don't strip the version of the target yet, it might be
30 # useful on some systems.
32 AC_MSG_CHECKING([for AROS style target])
34 if test "$target" = "NONE" ; then
35     target=$host_os-$host_cpu
36 else
37     if test "$target" = "" ; then
38         target=$host_os-$host_cpu
39     fi
41 AC_MSG_RESULT($target)
43 if test "$host_os" = "mingw32" ; then
44     PWDCMD="pwd -W"
47 # Don't know where else to put this...
48 AC_MSG_CHECKING([building AROS in])
49 AROS_BUILDDIR=`${PWDCMD-pwd}`
50 AROS_BUILDDIR_UNIX=${PWD}
51 AC_MSG_RESULT($AROS_BUILDDIR)
53 AC_MSG_CHECKING([AROS source in])
54 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
55 SRCDIR=${srcpwd}
56 AC_MSG_RESULT($SRCDIR)
58 # Parse the target field into something useful.
59 changequote(<<,>>)
60 target_os=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\1/'`
61 target_cpu=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\2/'`
62 changequote([,])
64 # Some debug output, to be removed again.
65 AC_MSG_CHECKING([for target system (debug output)])
66 AC_MSG_RESULT($target_os)
67 AC_MSG_CHECKING([for target cpu (debug output)])
68 AC_MSG_RESULT($target_cpu)
70 dnl --------------------------------------------------------------------
71 dnl Set the default Workbench resolution
72 dnl --------------------------------------------------------------------
73 aros_default_wbwidth=800
74 aros_default_wbheight=600
75 aros_default_wbdepth=4
77 dnl --------------------------------------------------------------------
78 dnl Host Configuration Section
79 dnl --------------------------------------------------------------------
80 dnl
81 dnl The idea here is to find out all the information we need about the
82 dnl host. This means things like tools for building directory structures,
83 dnl copying files around and the like.
85 # The first step is to find the host binaries.
86 # Check for a compiler.
87 AC_PROG_CC
88 AC_PROG_CC_STDC
89 AC_PROG_CXX
90 AC_PROG_CPP
92 # Check for a compatible awk
93 AC_CHECK_PROGS(AWK,[gawk nawk])
94 AROS_REQUIRED(gawk,$AWK)
95 AROS_PROG(MMAKE,mmake)
97 # Perform some default variable assignments. Note all of these will be
98 # Regenerated from the script, so there is no need to cache them.
100 aros_host_cpp="$CPP"
101 aros_host_cc="$CC"
102 aros_host_cxx="$CXX"
103 AROS_TOOL_CCPATH(aros_host_ld,ld)
104 AROS_REQUIRED(ld,$aros_host_ld)
105 aros_host_make="make"
106 aros_host_cflags=$CFLAGS
107 aros_host_cxxflags=$CXXFLAGS
108 aros_host_ldflags=$LDFLAGS
109 aros_host_debug="-g -O0"
110 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
111 aros_host_mkargs="--no-print-directory"
112 aros_host_exe_suffix="$EXEEXT"
113 aros_host_lib_suffix=""
115 # Ignore all compliance, AROS ROMs = 0
116 # KickStart v1.0 = 30
117 # KickStart v1.3 = 34
118 # KickStart v2.0 = 37
119 # KickStart v3.0 = 39
120 # KickStart v3.1 = 40
121 # AmigaOS   v3.5 = 44
122 aros_amigaos_compliance=0
124 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
125 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
126 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
127 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
129 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
130 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
132 case "$aros_host_cc" in
133     *gcc*)
134         aros_host_cc_pipe="-pipe"
135         ;;
136     icc)
137         aros_host_cc_pipe=""
138         ;;
139     *)
140         aros_host_cc_pipe=""
141         ;;
142 esac
144 aros_kernel_cc_includes=""
145 aros_target_cc_includes=""
147 # ----------------------------------------------------------------------------------------
148 # Host-specific defaults
150 # This is the main host configuration section. It is where the host
151 # can change the values of any variables it needs to change. We do
152 # not look at anything that compiles to the target yet, we'll get
153 # to that later.
155 case "$host_os" in
156     aros*)
157         aros_host_arch="aros"
158         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
159         case "$host_cpu" in
160             *i?86*)
161                 aros_host_cpu="i386"
162                 ;;
163             *x86_64*)
164                 aros_host_cpu="x86_64"
165                 ;;
166             *powerpc*)
167                 aros_host_cpu="ppc"
168                 ;;
169             *)
170                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
171                 aros_host_cpu="$host_cpu"
172                 ;;
173         esac
174         ;;
176     linux*)
177         aros_host_arch="linux"
178         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
179         android_build_os="linux-x86"
180         android_tool="android"
181         default_android_sdk="/opt/android-sdk-linux_x86"
182         case "$host_cpu" in
183             *i?86*)
184                 aros_host_cpu="i386"
185                 ;;
186             *x86_64*)
187                 aros_host_cpu="x86_64"
188                 ;;
189             *m68k*)
190                 aros_host_cpu="m68k"
191                 ;;
192             *powerpc*)
193                 aros_host_cpu="ppc"
194                 ;;
195             *arm*)
196                 aros_host_cpu="arm"
197                 ;;
198             *)
199                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
200                 aros_host_cpu="$host_cpu"
201                 ;;
202         esac
203         ;;
205     freebsd*)
206         aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
207         aros_host_make="gmake"
208         aros_host_arch="freebsd"
209         aros_host_cpu="i386"
211         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
213         dnl FreeBSD 5.x (and later) has changed the default object format.
214         dnl The double [[]] is necessary to get around m4's quoting rules.
215         case $host_os in
216             freebsd[[234]]*)
217                 aros_object_format="elf_i386"
218                 ;;
220             *)
221                 aros_object_format="elf_i386_fbsd"
222                 ;;
223         esac
225         ;;
227     darwin*)
228         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
229         aros_host_arch="darwin"
230         android_build_os="darwin-x86"
231         android_tool="android"
232         default_android_sdk="/android-sdk-mac_x86"
233         case "$host_cpu" in
234             *i?86*)
235                 aros_host_cpu="i386"
236                 ;;
237             *x86_64*)
238                 aros_host_cpu="x86_64"
239                 ;;
240             *powerpc*)
241                 aros_host_cpu="ppc"
242                 ;;
243             *)
244                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
245                 aros_host_cpu="$host_cpu"
246                 ;;
247         esac
249         aros_host_ldflags="$aros_host_ldflags -liconv"
251         ;;
253     dragonfly*)
254         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
255         aros_host_make="gmake"
256         aros_host_arch="dragonfly"
257         case $host_cpu in
258             *i?86*)
259                 aros_host_cpu="i386"
260                 ;;
261             *amd64*)
262                 aros_host_cpu="x86_64"
263                 ;;
264             *)
265                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
266                 aros_host_cpu="$host_cpu"
267                 ;;
268         esac
269         ;;
271     netbsd*)
272         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
273         aros_host_make="gmake"
274         aros_host_arch="netbsd"
275         case "$host_cpu" in
276             *i?86*)
277                 aros_host_cpu="i386"
278                 ;;
279             *m68k*)
280                 aros_host_cpu="m68k"
281                 ;;
282             *)
283                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
284                 aros_host_cpu="$host_cpu"
285                 ;;
286         esac    
287         aros_host_lib_suffix=".0.0"
288         ;;
290     openbsd*)
291         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
292         aros_host_make="gmake"
293         aros_host_arch="openbsd"
294         case "$host_cpu" in
295             *i?86*)
296                 aros_host_cpu="i386"
297                 ;;
298             *)
299                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
300                 aros_host_cpu="$host_cpu"
301                 ;;
302         esac
303         ;;
304         
305     solaris*)
306         aros_host_arch="solaris"
307         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
308         case "$host_cpu" in
309             *i?86*)
310                 aros_host_cpu="i386"
311                 ;;
312             *sparc*)
313                 aros_host_cpu="sparc"
314                 ;;
315             *)
316                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
317                 aros_host_cpu="$host_cpu"
318                 ;;
319         esac
320         ;;
322     morphos*)
323         aros_host_arch="morphos"
324         aros_host_cpu="ppc"
325         ;;
327     amiga*)
328         aros_host_arch="amiga"
329         SORT="/gg/bin/sort"
330         TEST="/gg/bin/test"
331         UNIQ="/gg/bin/uniq"
332         FOR="for"
333         TOUCH="/gg/bin/touch"
334         case "$host_cpu" in
335             *m68k*)
336                 aros_host_cpu="m68k"
337                 ;;
338             *powerpc*)
339                 aros_host_cpu="ppc"
340                 ;;
341             *)
342                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
343                 aros_host_cpu="$host_cpu"
344                 ;;
345         esac
346         ;;
348     cygwin*)
349         aros_host_arch="cygwin"
350         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
351         android_build_os="windows"
352         android_tool="android.bat"
353         default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
355         case "$host_cpu" in
356             *i?86*)
357                 aros_host_cpu="i386"
358                 ;;
359             *)
360                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
361                 aros_host_cpu="$host_cpu"
362                 ;;
363         esac
364         ;;
366     mingw32*)
367         aros_host_arch="mingw32"
368         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
369         android_build_os="windows"
370         android_tool="android.bat"
371         default_android_sdk="/c/android-sdk-windows-1.6_r1"
373         case "$host_cpu" in
374         *i?86*)
375             dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
376             dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
377             dnl Here we attempt to detect Windows home platform by asking gcc about its target.
378             dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
380             AC_MSG_CHECKING([for Windows native gcc target])
381             host_cpu=`gcc -dumpmachine`
382             AC_MSG_RESULT($host_cpu)
383             ;;
385         esac
387         case "$host_cpu" in
388         *i?86*)
389             aros_host_cpu="i386"
390             ;;
392         mingw32*)
393             dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
394             aros_host_cpu="i386"
395             ;;
397         *x86_64*)
398             aros_host_cpu="x86_64"
399             dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
400             dnl directory, so we have to add it explicitly here.
401             aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
402             ;;
404         *)
405             AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
406             aros_host_cpu="$host_cpu"
407             ;;
408         esac
409         ;;
410     *)
411         AC_MSG_ERROR([Unsupported host architecture $host])
412         ;;
413 esac
415 AROS_PROG(aros_host_ar,[ar],[cr])
416 AROS_REQUIRED(ar,$aros_host_ar)
417 AROS_PROG(aros_host_ranlib,ranlib)
418 AROS_REQUIRED(ranlib,$aros_host_ranlib)
419 AROS_PROG(aros_host_strip,strip)
420 AROS_REQUIRED(strip,$aros_host_strip)
422 AROS_PROG(RM,[rm],[-rf])
423 AROS_REQUIRED(rm,$RM)
424 AROS_PROG(CP,[cp])
425 AROS_REQUIRED(cp,$CP)
426 AROS_PROG(MV,[mv])
427 AROS_REQUIRED(mv,$MV)
428 AROS_PROG(ECHO,[echo])
429 AROS_REQUIRED(echo,$ECHO)
430 AROS_PROG(MKDIR,[mkdir],[-p])
431 AROS_REQUIRED(mkdir,$MKDIR)
432 AROS_PROG(TOUCH,[touch])
433 AROS_REQUIRED(touch,$TOUCH)
434 AROS_PROG(SORT,[sort])
435 AROS_REQUIRED(sort,$SORT)
436 AROS_PROG(UNIQ,[uniq])
437 AROS_REQUIRED(uniq,$UNIQ)
438 AROS_PROG(NOP,[true])
439 AROS_REQUIRED(true,$NOP)
440 AROS_PROG(CAT,[cat])
441 AROS_REQUIRED(cat,$CAT)
442 AROS_PROG(BISON,[bison])
443 AROS_REQUIRED(bison,$BISON)
444 AROS_PROG(FLEX,[flex])
445 AROS_REQUIRED(flex,$FLEX)
446 AROS_PROG(PNGTOPNM,[pngtopnm])
447 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
448 AROS_PROG(PPMTOILBM,[ppmtoilbm])
449 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
450 AROS_PROG(SED,[sed])
451 AROS_REQUIRED(sed,$SED)
452 AROS_PROG(CHMOD,[chmod])
453 AROS_REQUIRED(chmod,$CHMOD)
454 AROS_PROG(PATCH,[patch])
455 AROS_REQUIRED(patch,$PATCH)
457 AM_PATH_PYTHON(2.5)
459 AC_SUBST(FOR, for)
460 AC_SUBST(IF, if)
461 AC_SUBST(TEST, test)
462 AC_SUBST(CMP, cmp)
464 dnl ---------------------------------------------------------------------------
465 dnl Look for things about the host system, good for hosted targets.
466 dnl ---------------------------------------------------------------------------
468 # Check for some includes for the X11 HIDD and the kernel
469 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
470     sys/mmap.h sys/mman.h sysexits.h \
471     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
474 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
476 AC_HEADER_DIRENT
477 AC_HEADER_STAT
478 AC_HEADER_STDC
479 AC_HEADER_SYS_WAIT
480 AC_HEADER_TIME
481 AC_STRUCT_ST_BLKSIZE
482 AC_STRUCT_ST_BLOCKS
483 AC_STRUCT_ST_RDEV
484 AC_STRUCT_TM
485 AC_STRUCT_TIMEZONE
486 AC_TYPE_OFF_T
487 AC_TYPE_PID_T
488 AC_TYPE_SIZE_T
489 AC_TYPE_UID_T
491 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
493 # Look for some functions
494 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
495     clone kse_create rfork_thread thr_create sa_register \
496     getcontext makecontext setcontext sigaltstack swapcontext])
498 AC_FUNC_MMAP
501 dnl --------------------------------------------------------------------
502 dnl Target Configuration Section
503 dnl --------------------------------------------------------------------
505 dnl The target configuration section is responsible for setting up all
506 dnl the paths for includes, and tools required to build AROS to some
507 dnl particular target.
509 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
510 aros_config_aflags="-Wall -x assembler-with-cpp -c"
511 aros_config_ldflags=""
513 aros_shared_default=yes
515 aros_shared_cflags="-fPIC"
516 aros_shared_aflags=""
517 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
518 aros_kernel_ldflags="-Wl,-rpath,./lib"
520 aros_kernel_ar_flags="cr"
521 aros_target_ar_flags="cr"
522 aros_target_nm_flags="-C -ul"
523 aros_target_strip_flags="--strip-unneeded -R.comment"
525 aros_compiler_libs=
526 aros_arch_libs=
528 aros_target_genmap="-Wl,-Map -Xlinker"
530 # Native flavour stuff
531 aros_serial_debug="0"
533 # Palm native flavour stuff
534 aros_palm_debug_hack="0"
536 # Unix flavour stuff
537 aros_nesting_supervisor="0"
539 # Collect-aros stuff: "-ius" to ignore undefined symbols
540 ignore_undefined_symbols=""
542 # Check for X11 by default
543 need_x11="auto"
545 #-----------------------------------------------------------------------------
548 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
549 # it switched on by default, and we use the host compiler, so it compiles AROS
550 # code with this enabled resulting in link failures as we don't have support
551 # for it.
553 # We use two methods to disable it. For the host compiler (used to compile
554 # some hosted modules), we test to see if the compiler supports stack
555 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
556 # work on all platforms.
558 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
559 # (this is done unconditionally, as it should have no effect on compilers
560 # without the stack protection feature). This may be specific to the way that
561 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
562 # strong enough to disable it in a generic way though, so we'll live with it
563 # until another vendor ships GCC with it enabled in a different way, and deal
564 # with it then.
567 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
568 save_cflags="$CFLAGS"
569 CFLAGS="$CFLAGS -fno-stack-protector"
570 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
571 AC_MSG_RESULT($use_no_stack_protector)
572 if test "x-$use_no_stack_protector" = "x-yes" ; then
573     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
575 CFLAGS="$save_cflags"
577 #-----------------------------------------------------------------------------
579 # Disable pointer-signedness warnings if the compiler recognises the option
580 # (this only works for the host compiler at the moment)
582 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
583 save_cflags="$CFLAGS"
584 CFLAGS="$CFLAGS -Wno-pointer-sign"
585 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
586 AC_MSG_RESULT($use_no_sign_warning)
587 if test "x-$use_no_sign_warning" = "x-yes" ; then
588     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
590 CFLAGS="$save_cflags"
592 #-----------------------------------------------------------------------------
594 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
596 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
597 save_cflags="$CFLAGS"
598 CFLAGS="$CFLAGS -fgnu89-inline"
599 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
600 AC_MSG_RESULT($use_gnu89_inline)
601 if test "x-$use_gnu89_inline" = "x-yes" ; then
602     gnu89_inline="-fgnu89-inline"
604 CFLAGS="$save_cflags"
606 #-----------------------------------------------------------------------------
608 AC_MSG_CHECKING([for type of build])
609 AC_ARG_ENABLE(build_type,AC_HELP_STRING([--enable-build-type=TYPE],[Select the build type. Available types are: personal, nightly, snapshot, milestone, release. Do NOT use this option unless you know what you are doing! (default=personal)]),build_type=$enableval,build_type="personal")
611 if test "$build_type" = "nightly"; then
612     build_type_string="NIGHTLY"
613 elif test "$build_type" = "snapshot"; then
614     build_type_string="SNAPSHOT"
615 elif test "$build_type" = "milestone"; then
616     build_type_string="MILESTONE"
617 elif test "$build_type" = "release"; then
618     build_type_string="RELEASE"
619 else
620     build_type_string="PERSONAL"
621     build_type="personal"
624 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
626 AC_MSG_RESULT($build_type)
628 #-----------------------------------------------------------------------------
629 all_debug_types="messages stack modules mungwall symbols"
631 AC_MSG_CHECKING([which debug types to enable])
632 AC_ARG_ENABLE(debug,AC_HELP_STRING([--enable-debug=list],[Enable different types of debug. Commas or whitespaces can be used to separate the items in the list. Available types of debug are: all, none, messages, stack, mungwall, modules, symbols. If no list is provided then "all" is assumed. (default=none)]),
633  debug="$enableval",debug="")
635 if test "$debug" = "" -o "$debug" = "no"; then
636     debug="none"
637 elif test "$debug" = "yes"; then
638     debug="all"
641 if test "$debug" = "all" ; then
642     debug="messages stack modules symbols"
643     for d in $all_debug_types; do
644         export aros_${d}_debug="1"
645     done
646 else
647     for d in $all_debug_types; do
648         export aros_${d}_debug="0"
649     done
652 if test "$debug" != "none"; then
653     debug=`echo $debug | sed s/,/\ /g`
654     for d in $debug; do
655         found="0"
656         for d2 in $all_debug_types; do
657             if test "$d2" = "$d"; then
658                 found="1"
659                 break
660             fi
661         done
662         if test "$found" = "0"; then
663             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
664         fi
665         export aros_${d}_debug="1"
666     done
667     aros_debug="yes"
669 AC_MSG_RESULT($debug)
671 if test "$aros_messages_debug" = "1"; then
672     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
673 else
674     aros_messages_debug=""
676 if test "$aros_symbols_debug" = "1"; then
677     aros_symbols_debug="-g"
678 else
679     aros_symbols_debug=""
682 # These are the flags to pass when compiling debugged programs
683 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
684 aros_debug_aflags=""
685 aros_debug_ldflags="$aros_symbols_debug"
687 #-----------------------------------------------------------------------------
688 #   Checking for distcc and ccache.
690 #   Always apply the transforms in this particular order. Basically you should
691 #   always run 'ccache distcc compiler' in that order for the best performance.
693 AC_MSG_CHECKING([whether to enable distcc])
694 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
695 if test "$distcc" != "" -a "$distcc" != "no"; then
696     # AC_CHECK_PROG will print out the result in this case
697     AC_PATH_PROG(DISTCC,[distcc],distcc,)
698 else
699     AC_MSG_RESULT(no)
702 AC_MSG_CHECKING([whether to enable ccache])
703 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
704 if test "$ccache" != "" -a "$ccache" != "no"; then
705     # AC_CHECK_PROG will print out the result in this case
706     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
707 else
708     AC_MSG_RESULT(no)
711 #-----------------------------------------------------------------------------
712 AC_MSG_CHECKING([what specific host gcc version to use])
713 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-kernel-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),kernel_tool_version="$withval",kernel_tool_version="default")
714 AC_MSG_RESULT($kernel_tool_version)
716 #-----------------------------------------------------------------------------
717 AC_MSG_CHECKING([what specific target gcc version to use])
718 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),target_tool_version="$withval",target_tool_version="default")
719 AC_MSG_RESULT($target_tool_version)
721 #-----------------------------------------------------------------------------
722 AC_MSG_CHECKING([what optimization flags to use])
723 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
724 if test "$optimization" = "unknown"; then
725     dnl default is -O2 for normal builds, -O0 for debug builds
726     if test "$debug" != "none"; then
727         optimization="-O0"
728     else
729         optimization="-O2"
730     fi
732 aros_config_cflags="$aros_config_cflags $optimization"
733 AC_MSG_RESULT($optimization)
735 #-----------------------------------------------------------------------------
736 AC_MSG_CHECKING([what paranoia flags to use])
737 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
738 if test "$paranoia_flags" = "default"; then
739         paranoia_flags=""
740 else if test "$paranoia_flags" = "yes"; then
741         paranoia_flags="-Wall -Werror"
742 fi fi
743 AC_MSG_RESULT($paranoia_flags)
744 aros_config_cflags="$aros_config_cflags $paranoia_flags"
746 #-----------------------------------------------------------------------------
747 AC_MSG_CHECKING([what target variant to enable])
748 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
749 if test "$target_variant" = ""; then
750     aros_target_variant=""
751     aros_target_suffix=""
752     enableval="none"
753 else
754     aros_target_variant="$target_variant"
755     aros_target_suffix="-$target_variant"
757 AC_MSG_RESULT($enableval)
759 #-----------------------------------------------------------------------------
760 # Target-specific defaults. You can override then on a per-target basis.
762 # Bootloader name. Currently used by PC target.
763 target_bootloader="none"
765 #-----------------------------------------------------------------------------
766 # Additional options for some specific targets
768 case "$aros_target_variant" in
769 ios)
770     AC_MSG_CHECKING([XCode path])
771     AC_ARG_WITH(xcode,AC_HELP_STRING([--with-xcode=PATH],[Specify XCode path for iOS targets (default=/Developer).]),aros_xcode_path="$withval",aros_xcode_path="/Developer")
772     AC_MSG_RESULT($aros_xcode_path)
774     AC_MSG_CHECKING([what iOS SDK version to use])
775     AC_ARG_WITH(sdk-version,AC_HELP_STRING([--with-sdk-version=VERSION],[Use iOS SDK version VERSION (default=4.1).]),aros_sdk_version="$withval",aros_sdk_version="4.1")
776     AC_MSG_RESULT($aros_sdk_version)
778     ;;
780 "android")
781     AC_MSG_CHECKING([Android SDK path])
782     AC_ARG_WITH(sdk,AC_HELP_STRING([--with-sdk=PATH],[Specify Android SDK path (default=$default_android_sdk).]),aros_android_sdk="$withval",aros_android_sdk=$default_android_sdk)
783     AC_MSG_RESULT($aros_android_sdk)
785     AC_MSG_CHECKING([Android NDK path])
786     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
787     AC_MSG_RESULT($aros_android_ndk)
789     AC_MSG_CHECKING([what Android SDK version to use])
790     AC_ARG_WITH(sdk-version,AC_HELP_STRING([--with-sdk-version=LEVEL],[Use Android SDK for API LEVEL (default=12).]),aros_sdk_version="$withval",aros_sdk_version="12")
791     AC_MSG_RESULT($aros_sdk_version)
793     if test "$aros_android_ndk" != "none"; then
794         AC_MSG_CHECKING([what Android NDK version to use])
795         AC_ARG_WITH(ndk-version,AC_HELP_STRING([--with-ndk-version=LEVEL],[Use Android NDK for API LEVEL (default=9).]),aros_ndk_version="$withval",aros_ndk_version="9")
796         AC_MSG_RESULT($aros_ndk_version)
797     fi
799     export PATH="$aros_android_sdk/tools:$PATH"
800     AC_PATH_PROG(android_tool, $android_tool)
801     AROS_REQUIRED(android,$android_tool)
803     aros_android_level=android-$aros_sdk_version
804     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
805         echo "Platform $aros_android_level is not installed in your SDK"
806         echo "Use --with-sdk-version=<API level number> to select another platform version"
807         echo "You can check what plaform versions are installed in your SDK"
808         echo "by examining contents of $aros_android_sdk/platforms directory"
809         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
810     fi
812     AC_PATH_PROG(ant, ant)
813     if test "$ant" = ""; then
814         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
815     fi
817     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
818     if test "$host_os" = "mingw32"; then
819         android_tool="cmd //c $android_tool"
820     fi
822     ;;
823 esac
825 #-----------------------------------------------------------------------------
826 # External toolchains
827 kernel_tool_prefix="none"
828 aros_tool_prefix="none"
829 elf_tool_prefix="${target_cpu}-elf-"
831 # This is the target configuration switch.
832 case "$target_os" in
833     linux*)
834         aros_target_arch="linux"
835         aros_target_family="unix"
836         case "$target_cpu" in
837             *m68k*)
838                 aros_target_cpu="m68k"
839                 aros_object_format="m68kelf"
840                 aros_flavour="emulcompat"
841                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
842                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
843                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
844                 gcc_target_cpu="mc68000"
845                 ;;
846             *i?86*)
847                 aros_target_cpu="i386"
848                 aros_object_format="elf_i386"
849                 aros_flavour="emulation"
850                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
851                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
852                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
853                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
854                 aros_config_ldflags="-m32 -march=i486"
855                 aros_kernel_ldflags="-melf_i386"
856                 aros_default_wbdepth=8
857                 gcc_target_cpu="i386"
858                 pci_hidd_target="hidd-pci-linux"
859                 android_tool_dir_prefix="x86"
860                 android_tool_prefix="i686-android-linux"
861                 android_ndk_arch="x86"
862                 ;;
863             *x86_64*)
864                 aros_target_cpu="x86_64"
865                 aros_object_format="elf_x86_64"
866                 aros_flavour="emulation"
867                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
868                 aros_config_cflags="$aros_config_cflags -mno-red-zone -fno-omit-frame-pointer"
869                 aros_default_wbdepth=8
870                 pci_hidd_target="hidd-pci-linux"
871                 ;;
872             *powerpc*)
873                 aros_target_cpu="ppc"
874                 aros_object_format="elf32ppc"
875                 aros_flavour="emulation"
876                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
877                 aros_default_wbdepth=8
878                 gcc_target_cpu="ppc"
879                 ;;
880 # TODO
881 # Same as powerpc, but I need this for the nightly build to work again.
882 # Actually, the nightly should be made working with powerpc target.
883 # That just was too much work for the moment, another week or two.
884             *ppc*)
885                 aros_target_cpu="ppc"
886                 aros_object_format="elf32ppc"
887                 aros_flavour="emulation"
888                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
889                 aros_default_wbdepth=8
890                 gcc_target_cpu="ppc"
891                 ;;
892             *arm*)
893                 aros_target_cpu="arm"
894                 aros_object_format="armelf_linux_eabi"
895                 aros_flavour="emulation"
896                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
897                 gcc_target_cpu="arm"
898                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
899                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
900                 aros_arch_libs="-laeabi"
901                 android_tool_dir_prefix="arm-linux-androideabi"
902                 android_tool_prefix="arm-linux-androideabi"
903                 android_ndk_arch="arm"
904                 if test "$aros_host_cpu" != "arm" ; then
905                     kernel_tool_prefix="arm-linux-gnueabi-"
906                 fi
907                 ;;
908             *)
909                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
910                 ;;
911         esac
912         case "$aros_target_variant" in
913             android)
915                 dnl Not all Linux CPUs are supported by Android
916                 if test "$android_ndk_arch" = ""; then
917                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
918                 fi
920                 aros_default_wbwidth=320
921                 aros_default_wbheight=480
922                 if test "$aros_android_ndk" = "none"; then
923                     dnl Use standalone toolchain, don't adjust paths
924                     aros_kernel_cflags="-mandroid"
925                     aros_kernel_ldflags="-mandroid"
926                     CFLAGS="-mandroid"
927                 else
928                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
929                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
930                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
931                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
932                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
933                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
934                 fi
935                 need_x11=no
936                 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
937                 dnl in order not to fill mmakefiles with garbage
938                 x11_hidd_target=kernel-hidd-androidgfx-kobj
939                 # Disable implicit PIC mode
940                 aros_target_cflags="$aros_target_cflags -fno-pic"
941                 kernel_tool_prefix="$android_tool_prefix-"
942             ;;
943         esac
944     ;;
946     pc)
947         aros_target_arch="pc"
948         aros_shared_default="no"
949         target_bootloader="grub2"
950         case "$target_cpu" in
951             *i?86*)
952                 aros_target_cpu="i386"
954                 dnl If somebody hasn't already set the target object
955                 dnl format, then use this value. Mostly to support
956                 dnl FreeBSD cross-compilation.
957                 dnl TODO: Remove when we always use our compiler.
959                 if test "$aros_object_format" = "" ; then
960                     aros_object_format="elf_i386"
961                 fi
962                 aros_flavour="standalone"
963                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
964                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
965                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
966                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
967                 aros_config_ldflags="-m32 -march=i486"
968                 aros_kernel_ldflags="-melf_i386"
969                 aros_default_wbwidth=640
970                 aros_default_wbheight=480
971                 gcc_target_cpu="i386"
972                 ;;
973             *x86_64*)
974                 aros_target_cpu="x86_64"
975                 aros_serial_debug=1
976                 if test "$aros_object_format" = "" ; then
977                     aros_object_format="elf_x86_64"
978                 fi
979                 aros_flavour="standalone"
980                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
981                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
982                 aros_kernel_ldflags=""
983                 aros_default_wbwidth=640
984                 aros_default_wbheight=480
985                 ;;
986             *)
987                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
988                 ;;
989         esac
990         ;;
992     prep)
993         aros_target_arch="prep"
994         aros_shared_default="no"
995         aros_target_cpu="ppc"
996         aros_object_format="elf32ppc"
997         aros_flavour="ppcnative"
998         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
999         aros_kernel_ldflags=""
1000         aros_default_wbwidth=640
1001         aros_default_wbheight=480
1002         gcc_target_cpu="ppc"
1003         ;;
1005     freebsd*)
1006         aros_target_arch="freebsd"
1007         aros_target_family="unix"
1008         aros_target_cpu="i386"
1009         aros_flavour="emulation"
1010         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1011         gcc_target_cpu="i386"
1013         aros_target_strip_flags="-x"
1014         ;;
1016     darwin*)
1017         aros_target_arch="darwin"
1018         aros_target_family="unix"
1019         aros_flavour="emulation"
1020         case "$target_cpu" in
1021             *i?86*)
1022                 aros_ios_platform="iPhoneSimulator"
1023                 aros_target_cpu="i386"
1024                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1025                 aros_kernel_ldflags=""
1026                 aros_macosx_version="10.4"
1027                 aros_default_wbdepth=8
1028                 gcc_target_cpu="i386"
1029                 aros_object_format="elf_i386"
1030                 aros_kernel_ar_flags="-cr"
1031                 aros_target_strip_flags="-x"
1032                 kernel_tool_flags="-m32"
1033                 ;;
1034             *x86_64*)
1035                 aros_target_cpu="x86_64"
1036                 aros_object_format="elf_x86_64"
1037                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1038                 aros_macosx_version="10.6"
1039                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1040                 aros_kernel_cflags="-m64"
1041                 aros_kernel_ldflags="-m64"
1042                 aros_target_cflags="-mcmodel=large"
1043                 aros_default_wbdepth=8
1044                 aros_kernel_ar="ar"
1045                 aros_kernel_ar_flags="-cr"
1046                 aros_kernel_ld="ld"
1047                 aros_kernel_ranlib="ranlib"
1048                 ;;
1049             *ppc*)
1050                 aros_target_cpu="ppc"
1051                 aros_object_format="elf32ppc"
1052                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1053                 aros_kernel_ldflags=""
1054                 aros_macosx_version="10.0"
1055                 aros_default_wbdepth=8
1056                 gcc_target_cpu="ppc"
1057                 aros_kernel_ar="ar"
1058                 aros_kernel_ar_flags="-cr"
1059                 aros_kernel_ld="ld -arch ppc"
1060                 aros_kernel_ranlib="ranlib -arch ppc"
1061                 kernel_tool_prefix="powerpc-apple-darwin10-"
1062                 ;;
1063             *arm*)
1064                 aros_ios_platform="iPhoneOS"
1065                 aros_target_cpu="arm"
1066                 aros_object_format="armelf_linux_eabi"
1067                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1068                 aros_arch_libs="-laeabi"
1069                 aros_default_wbdepth=8
1070                 gcc_target_cpu="arm"
1071                 aros_kernel_ar="ar"
1072                 aros_kernel_ar_flags="-cr"
1073                 aros_kernel_ld="ld -arch arm"
1074                 aros_kernel_ranlib="ranlib -arch arm"
1075                 kernel_tool_prefix="arm-apple-darwin10-" 
1076                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1077                 ;;
1078             *)
1079                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1080                 ;;
1081         esac
1082         case "$aros_target_variant" in
1083             ios)
1084                 aros_ios_version="3.0"
1085                 aros_default_wbwidth=320
1086                 aros_default_wbheight=480
1087                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1088                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1089                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1090                 need_x11=no
1091                 # This is here because it may depend on iOS or SDK version
1092                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1093                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1094                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1095             ;;
1096             *)
1097                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1098                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1099             ;;
1100         esac
1101         ;;
1103     dragonfly*)
1104         aros_target_arch="dragonfly"
1105         aros_target_family="unix"
1106         aros_flavour="emulation"
1107         case "$target_cpu" in
1108             *i?86*)
1109                 aros_target_cpu="i386"
1110                 aros_object_format="elf_i386"
1111                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1112                 ;;
1113             *x86_64*)
1114                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1115                 aros_target_cpu="x86_64"
1116                 aros_object_format="elf_x86_64"
1117                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1118                 ;;
1119             *)
1120                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1121                 ;;
1122         esac
1123         ;;
1125     netbsd*)
1126         aros_target_arch="netbsd"
1127         aros_target_family="unix"
1128         case "$target_cpu" in
1129             *m68k*)
1130                 aros_target_cpu="m68k"
1131                 aros_object_format="m68kelf"
1132                 aros_flavour="emulcompat"
1133                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1134                 gcc_target_cpu="mc68000"
1135                 ;;
1136             *i?86*)
1137                 aros_target_cpu="i386"
1138                 aros_object_format="elf_i386"
1139                 aros_flavour="emulation"
1140                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1141                 aros_default_wbdepth=8
1142                 gcc_target_cpu="i386"
1143                 ;;
1144             *)
1145                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1146                 ;;
1147         esac
1148         aros_target_genmap="-Wl,-M -Xlinker >"
1149         aros_flavour="emulation"
1150         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1151         ;;   
1153     openbsd*)
1154         aros_target_arch="openbsd"
1155         aros_target_family="unix"
1156         case "$target_cpu" in
1157             *i?86*)
1158                 aros_target_cpu="i386"
1159                 aros_object_format="elf_i386"
1160                 aros_flavour="emulation"
1161                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1162                 gcc_target_cpu="i386"
1163                 ;;
1164             *)
1165                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1166                 ;;
1167         esac
1168         aros_target_genmap="-Wl,-M -Xlinker >"
1169         aros_target_nm_flags="-u"
1170         aros_flavour="emulation"
1171         ;;
1173     solaris*)
1174         aros_target_arch="solaris"
1175         aros_target_family="unix"
1176         case "$target_cpu" in
1177            *i?86*)
1178                aros_target_cpu="i386"
1179                aros_object_format="elf_i386"
1180                aros_flavour="emulation"
1181                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1182                aros_default_wbdepth=8
1183                gcc_target_cpu="i386"
1184                ;;
1185             *sparc*)
1186                 aros_target_cpu="sparc"
1187                 aros_object_format="elf_sparc"
1188                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1189                 gcc_target_cpu="sparc"
1190                 ;;
1191             *)
1192                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1193                 ;;
1194         esac
1195         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1196         aros_flavour="emulation"
1197         ;;
1199     morphos*)
1200         aros_target_arch="morphos"
1201         aros_shared_default="no"
1202         aros_target_cpu="ppc"
1203         aros_object_format="elf_ppc"
1204         aros_flavour="nativecompat"
1205         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1206         gcc_target_cpu="ppc"
1207         ;;
1209     sam440)
1210         aros_target_arch="sam440"
1211         aros_shared_default="no"
1212         aros_target_cpu="ppc"
1213         aros_object_format="elf32ppc"
1214         aros_flavour="ppcnative"
1215         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1216         aros_kernel_ldflags=""
1217         aros_default_wbwidth=1024
1218         aros_default_wbheight=768
1219         aros_default_wbdepth=24
1220         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1221         gcc_target_cpu="powerpc"
1222         ;;
1224     efika)
1225         aros_target_arch="efika"
1226         aros_shared_default="no"
1227         aros_target_cpu="arm"
1228         aros_object_format="armelf_linux_eabi"
1229         aros_flavour="standalone"
1230         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1231         aros_kernel_ldflags=""
1232         aros_default_wbwidth=1024
1233         aros_default_wbheight=600
1234         aros_arch_libs="-laeabi"
1235         gcc_default_cpu="armv7-a"
1236         gcc_default_fpu="vfpv3"
1237         gcc_default_float_abi="softfp"
1238         aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1239         aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1240         ;;
1241         
1242     chrp)
1243     aros_target_arch="chrp"
1244     aros_shared_default="no"
1245     aros_target_cpu="ppc"
1246     aros_object_format="elf32ppc"
1247     aros_flavour="ppcnative"
1248     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1249     aros_kernel_ldflags=""
1250     aros_default_wbwidth=640
1251     aros_default_wbheight=480
1252     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
1253     gcc_target_cpu="powerpc"
1254         case "$aros_target_variant" in
1255             efika)
1256             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1257             ;;
1258         esac
1259     ;;
1261     amiga*)
1262         aros_target_arch="amiga"
1263         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1264         aros_shared_default="no"
1266         case "$target_cpu" in
1267             *m68k*)
1268                 AC_ARG_ENABLE(amigaos_compliance,AC_HELP_STRING([--enable-amigaos-compliance=VERSION],[Enforce userspace AmigaOS compliance to a specific KickStart version (default=none).]),aros_amigaos_compliance="$enableval")
1269                 aros_enable_mmu=no
1270                 aros_target_cpu="m68k"
1271                 aros_object_format="m68kelf"
1272                 aros_flavour="standcompat"
1273                 gcc_target_cpu="m68000"
1274                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -Os"
1275                 aros_config_aflags="$aros_config_aflags -${gcc_target_cpu}"
1276                 # Needed to get the correct multilib
1277                 aros_config_ldflags="-${gcc_target_cpu}"
1278                 aros_shared_ldflags="-${gcc_target_cpu}"
1279                 aros_kernel_ldflags="-${gcc_target_cpu}"
1280                 aros_target_nostdlib_ldflags="-${gcc_target_cpu}"
1281                 aros_target_strip_flags="-R.comment --strip-debug"
1282                 aros_default_wbwidth=640
1283                 aros_default_wbheight=256
1284                 aros_default_wbdepth=2
1285                 ;;
1286             *ppc*)
1287                 aros_cpu="ppc"
1288                 aros_flavour="native"
1289                 gcc_target_cpu="ppc"
1290                 ;;
1291             *)
1292                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1293                 ;;
1294         esac
1295         ;;
1297     mingw*)
1298         aros_target_arch="mingw32"
1299         aros_shared_default="no"
1300         aros_flavour="emulation"
1301         aros_shared_cflags=""
1302         need_crosstools="yes"
1303         need_dlopen="no"
1304         rescomp="windres"
1305         case "$target_cpu" in
1306             *i?86*)
1307                 aros_target_cpu="i386"
1308                 aros_object_format="elf_i386"
1309                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1310                 aros_default_wbdepth=8
1311                 gcc_target_cpu="i386"
1313                 kernel_tool_prefix="i386-mingw32-"
1314                 ;;
1315             *x86_64*)
1316                 aros_target_cpu="x86_64"
1317                 aros_object_format="elf_x86_64"
1318                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1319                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1320                 aros_default_wbdepth=8
1321                 kernel_tool_prefix="x86_64-w64-mingw32-"
1322                 ;;
1323             *arm*)
1324                 aros_target_cpu="arm"
1325                 aros_object_format="armelf_linux_eabi"
1326                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1327                 aros_arch_libs="-laeabi"
1328                 aros_default_wbdepth=8
1329                 gcc_target_cpu="arm"
1330                 gcc_default_float_abi="soft"
1331                 kernel_tool_prefix="arm-mingw32ce-"
1332                 aros_default_wbwidth=160
1333                 aros_default_wbheight=160
1334                 ;;
1335             *)
1336                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1337                 ;;
1338         esac
1339         if test $host_os = "cygwin"; then
1340                 aros_kernel_cflags="-mno-cygwin"
1341         fi
1342     ;;
1343     pp*)
1344         aros_target_arch="pp"
1345         aros_shared_default="no"
1346         case "$target_cpu" in
1347             *m68k*)
1348                 aros_target_cpu="m68k"
1349                 aros_object_format="m68kelf"
1350                 aros_flavour="palmnative"
1351                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1352                 aros_default_wbwidth=160
1353                 aros_default_wbheight=160
1354                 aros_default_wbdepth=1
1355                 aros_target_ar_flags="cru"
1356                 aros_compiler_libs="-lgcc1"
1357                 aros_shared_default=no
1358                 aros_shared_cflags="-fpic"
1359                 aros_shared_aflags=""
1360                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1361                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1362                 aros_debug_cflags="$aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
1363                 aros_debug_aflags=""
1364                 aros_debug_ldflags="$aros_symbols_debug"
1365                 aros_mungwall_debug="0"
1366                 aros_modules_debug="0"
1367                 gcc_target_cpu="mc68000"
1368                 ignore_undefined_symbols="-ius"
1369                 ;;
1370            *)
1371                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1372                 ;;
1373         esac
1374         ;;
1376     mac*)
1377         aros_target_arch="mac"
1378         aros_shared_default="no"
1379         case "$target_cpu" in
1380             *m68k*)
1381                 aros_target_cpu="m68k"
1382                 aros_object_format="m68kelf"
1383                 aros_flavour="mac68knative"
1384                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1385                 aros_default_wbwidth=512
1386                 aros_default_wbheight=384
1387                 aros_default_wbdepth=8
1388                 aros_target_ar_flags="cru"
1389                 aros_compiler_libs="-lgcc1"
1390                 aros_shared_default=no
1391                 aros_shared_cflags="-fpic"
1392                 aros_shared_aflags=""
1393                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1394                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1395                 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug -mc68000"
1396                 aros_debug_aflags=""
1397                 aros_debug_ldflags="$aros_symbols_debug"
1398                 aros_mungwall_debug="0"
1399                 aros_modules_debug="0"
1400                 gcc_target_cpu="mc68000"
1401                 ignore_undefined_symbols="-ius"
1402                 ;;
1403            *)
1404                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1405                 ;;
1406         esac
1407         ;;
1409     *)
1410         AC_MSG_ERROR([Unsupported target architecture $target])
1411         ;;
1412 esac
1414 #-----------------------------------------------------------------------------
1415 crosstools_guess=yes
1417 AC_MSG_CHECKING([Kernel toolchain prefix])
1418 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1419 AC_MSG_RESULT($kernel_tool_prefix)
1421 AC_MSG_CHECKING([ELF toolchain prefix])
1422 AC_ARG_WITH(elf-toolchain-prefix,AC_HELP_STRING([--with-elf-toolchain-prefix=...],[Specify crosscompile toolchain prefix to wrap for AROS objects]),[elf_tool_prefix="$withval"
1423                                                  crosstools_guess=no])
1424 AC_MSG_RESULT($elf_tool_prefix)
1426 AC_MSG_CHECKING([AROS toolchain prefix])
1427 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain]),[aros_tool_prefix="$withval"
1428                 crosstools_guess=no])
1429 if test "$aros_tool_prefix" = "yes" ; then
1430     aros_tool_prefix=$aros_target_cpu-aros-
1432 AC_MSG_RESULT($aros_tool_prefix)
1434 #-----------------------------------------------------------------------------
1435 #   Checking if we should build crosstools..
1436 AC_MSG_CHECKING([whether to build crosstools])
1437 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1438 AC_MSG_RESULT($crosstools)
1440 if test "${crosstools}" = "yes"; then
1441     if test "${crosstools_guess}" = "no"; then
1442         AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1443     fi
1445     AC_MSG_CHECKING([where to install the crosstools binaries])
1446     AC_ARG_WITH(aros-toolchain-install,AC_HELP_STRING([--with-aros-toolchain-install=DIR],[Where to install or search for cross tools binaries]),[aros_toolchain_install=$withval])
1447     if test "x$aros_toolchain_install" = "x"; then
1448         AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1449     else
1450         AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1451         PATH="$AROS_CROSSTOOLSDIR:$PATH"
1452     fi
1453     AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1457 # Now process extra architecture-specific options.
1458 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1459 # as well as floating-point ABI.
1460 case "$aros_target_cpu" in
1461 arm)
1462     dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1463     if test "$gcc_default_cpu" = ""; then
1464         gcc_default_cpu="armv6"
1465     fi
1466     if test "$gcc_default_fpu" = ""; then
1467         gcc_default_fpu="vfp"
1468     fi
1469     if test "$gcc_default_float_abi" = ""; then
1470         gcc_default_float_abi="softfp"
1471     fi
1473     AC_MSG_CHECKING([Which minimum CPU to use])
1474     AC_ARG_WITH(cpu,AC_HELP_STRING([--with-cpu=<spec>],[Specify minumum CPU (default=$gcc_default_cpu).]),aros_gcc_cpu="$withval",aros_gcc_cpu=$gcc_default_cpu)
1475     AC_MSG_RESULT($aros_gcc_cpu)
1477     AC_MSG_CHECKING([Which minimum FPU to use])
1478     AC_ARG_WITH(fpu,AC_HELP_STRING([--with-fpu=<spec>],[Specify minumum FPU (default=$gcc_default_fpu).]),aros_gcc_fpu="$withval",aros_gcc_fpu=$gcc_default_fpu)
1479     AC_MSG_RESULT($aros_gcc_fpu)
1481     AC_MSG_CHECKING([Which floating point ABI to use])
1482     AC_ARG_WITH(float,AC_HELP_STRING([--with-float=<spec>],[Specify floating point ABI (default=$gcc_default_float_abi).]),aros_gcc_float_abi="$withval",aros_gcc_float_abi=$gcc_default_float_abi)
1483     AC_MSG_RESULT($aros_gcc_float_abi)
1485     aros_config_cflags="$aros_config_cflags -marm -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi -fno-asynchronous-unwind-tables -fno-exceptions"
1486     aros_config_aflags="$aros_config_aflags -marm -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi -fno-asynchronous-unwind-tables -fno-exceptions"
1487     ;;
1488 esac
1490 # Some formats need custom ELF specs.
1491 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1492 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1493     elf_specs_in=config/${aros_object_format}-specs.in
1494 else
1495     elf_specs_in=config/elf-specs.in
1498 AC_MSG_CHECKING([what specific AROS gcc version to use])
1499 AC_ARG_WITH(aros-gcc,AC_HELP_STRING([--with-aros-gcc=VERSION],[Use aros-gcc-VERSION for building AROS]),aros_gcc_version="-$withval",aros_gcc_version="")
1500 AC_MSG_RESULT($aros_gcc_version)
1502 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1503 # Since we override specs, we may need to put these defines there
1504 if test "$gcc_target_cpu" != ""; then
1505     gcc_target_cpu="-D__${gcc_target_cpu}__"
1508 AC_MSG_CHECKING([where to download sourcecode for external ports])
1509 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1510 if test "$with_portssrcdir" = "default"; then
1511     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1512 else
1513     AROS_PORTSSRCDIR="$with_portssrcdir"
1515 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1517 AC_MSG_CHECKING([which bootloader to use])
1518 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1519 if test "$target_bootloader" = "none"; then
1520     aros_target_bootloader=""
1521 else
1522     aros_target_bootloader="$target_bootloader"
1524 AC_MSG_RESULT($target_bootloader)
1526 AC_MSG_CHECKING([which icon-set to use])
1527 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1528 if test "$target_iconset" = "default"; then
1529     aros_target_iconset="Gorilla"
1530     target_iconset="default (Gorilla)"
1531 else
1532     aros_target_iconset="$target_iconset"
1534 AC_MSG_RESULT($target_iconset)
1536 AC_MSG_CHECKING([which GUI Theme to use])
1537 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1538 if test "$target_guitheme" = "default"; then
1539     aros_target_guitheme="Ice"
1540 else
1541     aros_target_guitheme="$target_guitheme"
1543 AC_MSG_RESULT($aros_target_guitheme)
1545 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1546 # for target code)
1547 cross_compiling=no
1548 if test "$aros_host_cpu" = "$aros_target_cpu" ; then
1549     # If host = target CPU, let's try to use the
1550     # host's toolchains if no others were requested
1551     if test "$kernel_tool_prefix" = "none" ; then
1552         kernel_tool_prefix=""
1553     fi
1554 else
1555     cross_compiling=yes
1558 dnl Native x86-64 Linux toolchain can also produce i386 binaries, given -m32 flag.
1559 if test "$aros_host_cpu" == "x86_64" ; then
1560     if test "$aros_target_cpu" == "i386" ; then
1561         if test "$aros_target_arch" != "mingw32"; then
1562             cross_compiling=no
1563             kernel_tool_prefix=""
1564         fi
1565     fi
1568 dnl Enforce cross-compile if we are on Darwin, but our target is not Darwin.
1569 dnl If target is Darwin disable cross-compiling otherwise kernel 
1570 dnl not setup correctly.
1571 if test "$aros_host_arch" == "darwin" ; then
1572     if test "$aros_target_arch" != "darwin" ; then
1573         cross_compiling=yes
1574     else
1575         cross_compiling=no
1576         kernel_tool_prefix=""
1577     fi
1580 dnl The same for MinGW
1581 if test "$aros_host_arch" == "mingw32" ; then
1582     if test "$aros_target_arch" != "mingw32" ; then
1583         cross_compiling=yes
1584     else
1585         cross_compiling=no
1586         kernel_tool_prefix=""
1587     fi
1590 #######################################################################
1591 ## Compute what toolchains to use, and their paths                   ##
1592 #######################################################################
1594 # This takes, as input:
1595 #   crosstools             {yes,no}
1596 #   aros_gcc_version       {default,[version]}
1597 #   kernel_tool_prefix     {none,[some-arch-os-]}
1598 #   aros_tool_prefix       ${target_cpu}-aros-
1600 # The output is
1601 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1602 #        Where the 'kernel' binaries are located
1603 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1604 #        Where the 'target' binaries are located
1605 #        (not the symlink farm - that is aros_target_*!)
1607 # The rules are:
1608 #   if crosstools then
1609 #      if kernel_tools_prefix = "no-kernel-prefix-"
1610 #          aros_kernel_* = crosstools cc paths
1611 #          aros_kernel_cc = elf cc wrapper around crosstools cc
1612 #      else
1613 #          VALIDATE(${kernel_tools_prefix}*)
1614 #          aros_kernel_* = ${kernel_tools_prefix}*
1615 #          if ${kernel_tools_prefix}cc is an AROS gcc
1616 #              aros_kernel_cc = ${kernel_tools_prefix}cc
1617 #          else
1618 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1619 #          fi
1620 #      fi
1622 #      orig_target_* = aros built crosstools
1623 #      orig_target_cc = elf cc wrapper around crosstools cc
1624 #   else
1625 #      VALIDATE(${kernel_tools_prefix}*)
1627 #      orig_target_* = aros_kernel_*
1628 #      if aros_kernel_cc is an AROS gcc
1629 #          orig_target_cc = aros_kernel_cc
1630 #      else
1631 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
1632 #      fi
1633 #   fi
1635 target_tool_prefix="${target_cpu}-aros-"
1637 AC_MSG_CHECKING([which kernel tools])
1638 if test "$kernel_tool_prefix" = "none" ; then
1639     AC_MSG_RESULT([target]);
1640     # We are building AROS crosstools, and no kernel
1641     # tools specified - assume target tools == kernel tools
1642     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1643     aros_kernel_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1644     aros_kernel_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1645     aros_kernel_cpp="${tmp_tool_prefix}cpp"
1646     aros_kernel_ld="${tmp_tool_prefix}ld"
1647     aros_kernel_as="${tmp_tool_prefix}as"
1648     aros_kernel_ar="${tmp_tool_prefix}ar"
1649     aros_kernel_ranlib="${tmp_tool_prefix}ranlib"
1650     aros_kernel_nm="${tmp_tool_prefix}nm"
1651     aros_kernel_strip="${tmp_tool_prefix}strip"
1652     aros_kernel_objcopy="${tmp_tool_prefix}objcopy"
1653     aros_kernel_objdump="${tmp_tool_prefix}objdump"
1654 else
1655     AC_MSG_RESULT([$kernel_tool_prefix]);
1656     # Kernel tools required - find them
1657     # Note that 'normally', aros_kernel_* overrides will
1658     # empty, unless specified in the per-arch sections above.
1659     AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
1660     AROS_REQUIRED(cpp,$aros_kernel_cpp)
1661     if test "x$aros_kernel_cc" = "x"; then
1662         aros_kernel_cc=${kernel_tool_prefix}gcc
1663     fi
1664     AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${aros_gcc_version})
1665     AROS_REQUIRED(cc,$aros_kernel_cc)
1666     if test "x$aros_kernel_cxx" = "x"; then
1667         aros_kernel_cxx=${kernel_tool_prefix}g++
1668     fi
1669     AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${aros_gcc_version})
1670     # If it's set, make sure it's really there
1671     if test "x$aros_kernel_cxx" != "x" ; then
1672         AROS_REQUIRED(cxx,$aros_kernel_cxx)
1673     fi
1674     AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1675     AROS_REQUIRED(ld,$aros_kernel_ld)
1676     AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1677     AROS_REQUIRED(as,$aros_kernel_as)
1678     AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1679     AROS_REQUIRED(ar,$aros_kernel_ar)
1680     AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1681     AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1682     AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1683     AROS_REQUIRED(nm,$aros_kernel_nm)
1684     AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1685     AROS_REQUIRED(strip,$aros_kernel_strip)
1687     # Objcopy and objdump are not required for the kernel
1688     # toolchain on many architectures.
1689     # So we'll look for them, but not make them strictly required.
1690     AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1691     AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1692     if test "x${crosstools}" != "xyes" ; then
1693         AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1694         AROS_REQUIRED(objdump,$aros_kernel_objdump)
1695     fi
1698 AC_MSG_CHECKING([which target tools to use])
1699 if test "$crosstools" = "yes"; then
1700     AC_MSG_RESULT([$target_tool_prefix])
1701     # We are are building AROS crosstools
1702     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1703     orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1704     orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1705     orig_target_cpp="${tmp_tool_prefix}cpp"
1706     orig_target_ld="${tmp_tool_prefix}ld"
1707     orig_target_as="${tmp_tool_prefix}as"
1708     orig_target_ar="${tmp_tool_prefix}ar"
1709     orig_target_ranlib="${tmp_tool_prefix}ranlib"
1710     orig_target_nm="${tmp_tool_prefix}nm"
1711     orig_target_strip="${tmp_tool_prefix}strip"
1712     orig_target_objcopy="${tmp_tool_prefix}objcopy"
1713     orig_target_objdump="${tmp_tool_prefix}objdump"
1714 else
1715     # Determine whether AROS or ELF tools should be used
1716     if test "$aros_tool_prefix" = "none"; then
1717         aros_tool_prefix="${elf_tool_prefix}"
1718     fi
1720     AC_MSG_RESULT([$aros_tool_prefix])
1721     # We are *not* building AROS crosstools - use the AROS or ELF tools
1722     AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}cpp)
1723     AROS_REQUIRED(cpp,$orig_target_cpp)
1724     AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}gcc)
1725     AROS_REQUIRED(cc,$orig_target_cc)
1726     if test "x$orig_target_cxx" != "x" ; then
1727         AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}g++)
1728         AROS_REQUIRED(cxx,$orig_target_cxx)
1729     fi
1730     AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}ld)
1731     AROS_REQUIRED(ld,$orig_target_ld)
1732     AROS_TOOL_TARGET(orig_target_as,as,${aros_tool_prefix}as)
1733     AROS_REQUIRED(as,$orig_target_as)
1734     AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}ar)
1735     AROS_REQUIRED(ar,$orig_target_ar)
1736     AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}ranlib)
1737     AROS_REQUIRED(ranlib,$orig_target_ranlib)
1738     AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}nm)
1739     AROS_REQUIRED(nm,$orig_target_nm)
1740     AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}strip)
1741     AROS_REQUIRED(strip,$orig_target_strip)
1742     AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}objcopy)
1743     AROS_REQUIRED(objcopy,$orig_target_objcopy)
1744     AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}objdump)
1745     AROS_REQUIRED(objdump,$orig_target_objdump)
1748 # At this point, all aros_kernel_* and aros_target_* 
1749 # tools should be set up correctly
1751 CC="$aros_kernel_cc $kernel_tool_flags"
1752 CPP="$aros_kernel_cpp"
1754 #-----------------------------------------------------------------------------
1756 # Disable pointer-signedness warnings if the compiler recognises the option
1758 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1759 save_cflags="$CFLAGS"
1760 if test "$crosstools" != "yes" ; then
1761     CFLAGS="$CFLAGS -Wno-pointer-sign"
1762     AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1763 else
1764     # we do know it is supported for the smallest version of gcc we are going to build
1765     # we assume it's also supported by later versions
1766     use_no_sign_warning=yes
1768 AC_MSG_RESULT($use_no_sign_warning)
1769 if test "x-$use_no_sign_warning" = "x-yes" ; then
1770     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1772 CFLAGS="$save_cflags"
1774 #-----------------------------------------------------------------------------
1776 # Find all the tools we need to compile. This could be cross-compiling
1777 # though! If that is the case we use the GNU form of the target and
1778 # simply add this to the front of the binary name. This is rather simple,
1779 # but it should work under most circumstances.
1781 # The default tools are to use the same as the host, but only if the
1782 # host and target CPU are the same. With GCC this is normally enough.
1785 aros_cc_pre=""
1786 aros_shared_ld="$aros_host_ld"
1788 aros_target_mkdep="$aros_host_mkdep"
1790 # The default tools executables to be linked to.
1791 if test "$rescomp" != ""; then
1792     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
1793     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1796 # Set up the sources for the symlink farm
1797 if test "$crosstools" = "yes"; then
1798     crosstools_target=tools-crosstools
1799 else
1800     crosstools_cxx_target=tools-crosstools
1803 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1804 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1807 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1808 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1809 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1810 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1811 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1812 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1813 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1815 # aros_cc_pre is a variable that is added to the front of the compiler name
1816 # in the generated aros-gcc shell script. We need this to enable the cache
1817 # to work across cleaned builds. Also, support DISTCC using the correct
1818 # environment variable.
1821 if test "x${DISTCC}" != "x" ; then
1822     if test "x${CCACHE}" != "x" ; then
1823         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1824     else
1825         aros_cc_pre="${DISTCC} "
1826     fi
1827 else
1828     if test "x${CCACHE}" != "x" ; then
1829         aros_cc_pre="${CCACHE} "
1830     fi
1833 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1835 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1836 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1837 AC_SUBST(aros_target_nix_ldflags,-nix)
1838 AC_SUBST(aros_target_detach_ldflags,-detach)
1839 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1841 # Target tools
1842 if test "$crosstools" != "yes"; then
1843     if test "$GCC" = "yes"; then
1844         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1845     fi
1846 else
1847     # We do not know which gcc version we are going to build and what we need to know
1848     # here is different for different versions so this will be set later during the
1849     # build of crosstools.
1850     aros_target_cc_path=@aros_target_cc_path@
1852 aros_target_cpp="${prefix}cpp"
1853 aros_target_cc="${prefix}gcc"
1854 aros_target_cxx="${prefix}g++"
1855 aros_target_as="${prefix}as"
1856 aros_target_ld="${prefix}ld"
1857 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1858 aros_target_objcopy="${prefix}objcopy"
1859 aros_target_objdump="${prefix}objdump"
1860 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1861 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1862 aros_target_strip="${prefix}strip"
1863 aros_plain_nm="${prefix}nm"
1864 aros_plain_ar="${prefix}ar"
1866 if test "$aros_kernel_includes" != "" ; then
1867     dnl find out about the kernel cc's include path
1868     AC_MSG_CHECKING([for the kernel compiler's include path])
1869     if test "$aros_kernel_cc_includes" = "" ; then
1870         # Try to guess where the directory is.
1871         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1872         if test -d $aros_kernel_cc_includes; then
1873             # Check if there is also an include-fixed directory and add it
1874             # to kernel compiler's include path as it may contain some of
1875             # the headers we need.
1876             if test -d "$aros_kernel_cc_includes"-fixed; then
1877                 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1878             fi
1879             # Check for specific includes directory. Neede for Ubuntu 11.10
1880             if test -d "/usr/include/i386-linux-gnu"; then
1881                 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1882             fi
1883         else
1884             # The directory doesn't exist, we need to do some more work.
1885             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1887             # These are the headers we're looking for.
1888             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1889                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1890                      zutil.h stdint.h"
1892             dirs=
1893             for h in $headers; do
1894                 # Which other headers are needed by each of the above?
1895                 deps=$(echo "#include <$h>" | \
1896                        $aros_kernel_cc -E -M - 2>/dev/null | \
1897                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1899                 # Copy all the needed headers to a directory beneath gendir.
1900                 for d in $deps; do
1901                     h=$(basename $d)
1902                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1903                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1904                     ! test -d $dir && mkdir -p $dir
1905                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1906                 done
1907             done            
1908         fi
1909     fi
1910     AC_MSG_RESULT($aros_kernel_cc_includes)
1911     # Adding -nostdinc to kernel includes as they are always used together.
1912     aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1915 if test "$crosstools" != "yes"; then
1916     dnl find out about the target cc's include path
1917     AC_MSG_CHECKING([for the target compiler's include path])
1918     if test "$aros_target_cc_includes" = "" ; then
1919         #try to guess where the directory is
1920         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1921         if ! test -d $aros_target_cc_includes; then
1922             #the directory doesn't exist, we need to do some more work
1923             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1924         
1925             #these are the headers we're looking for
1926             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1927                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1928                     zutil.h"
1930             dirs=
1931             for h in $headers; do
1932                 #which other headers each of the above headers needs?
1933                 deps=$(echo "#include <$h>" | \
1934                     $orig_target_cc -E -M - 2>/dev/null | \
1935                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1936             
1937                 #copy all the needed headers to a directory beneath gendir
1938                 for d in $deps; do
1939                     h=$(basename $d)
1940                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1941                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1942                     ! test -d $dir && mkdir -p $dir
1943                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1944                 done
1945             done
1946         fi
1947     fi
1948     AC_MSG_RESULT($aros_target_cc_includes)
1949 else
1950     # We do not know which gcc version we are going to build and what we need to know
1951     # here is different for different versions so this will be set later during the
1952     # build of crosstools.
1953     aros_target_cc_includes=@aros_target_cc_includes@
1957 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1958 # On GCC >= 4.0 -iquote should be used
1961 save_cc="$CC"
1962 save_cflags="$CFLAGS"
1963 CFLAGS="-iquote."
1964 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1965 if test "x-$crosstools" != "x-yes"; then
1966     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1967 else
1968     # we do know it is supported for the smallest version of gcc we are going to build
1969     # we assume it's also supported by later versions
1970     has_iquote=yes
1972 AC_MSG_RESULT($has_iquote)
1973 if test "x-$has_iquote" = "x-yes" ; then
1974     host_cflags_iquote=-iquote
1975     host_cflags_iquote_end=
1976 else
1977     host_cflags_iquote=-I
1978     host_cflags_iquote_end=-I-
1980 kernel_cflags_iquote=$host_cflags_iquote
1981 kernel_cflags_iquote_end=$host_cflags_iquote_end
1982 if test "x-$cross_compiling" = "x-yes"; then
1983     CC="$aros_kernel_cc"
1984     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1985     if test "x-$crosstools" != "x-yes"; then
1986         AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1987     else
1988         # we do know it is supported for the smallest version of gcc we are going to build
1989         # we assume it's also supported by later versions
1990         use_no_stack_protector=yes
1991     fi
1992     AC_MSG_RESULT($use_no_stack_protector)
1993     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1994     if test "x-$crosstools" != "x-yes"; then
1995         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1996     else
1997         # we do know it is supported for the smallest version of gcc we are going to build
1998         # we assume it's also supported by later versions
1999         has_iquote=yes
2000     fi
2001     AC_MSG_RESULT($has_iquote)
2002     if test "x-$has_iquote" = "x-yes" ; then
2003         kernel_cflags_iquote=-iquote
2004         kernel_cflags_iquote_end=
2005     else
2006         kernel_cflags_iquote=-I
2007         kernel_cflags_iquote_end=-I-
2008     fi
2010 aros_cflags_iquote=$kernel_cflags_iquote
2011 aros_cflags_iquote_end=$kernel_cflags_iquote_end
2012 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2013     CC="$orig_target_cc"
2014     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2015     if test "x-$crosstools" != "x-yes"; then
2016         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2017     else
2018         # we do know it is supported for the smallest version of gcc we are going to build
2019         # we assume it's also supported by later versions
2020         has_iquote=yes
2021     fi
2022     AC_MSG_RESULT($has_iquote)
2023     if test "x-$has_iquote" = "x-yes" ; then
2024         aros_cflags_iquote=-iquote
2025         aros_cflags_iquote_end=
2026     else
2027         aros_cflags_iquote=-I
2028         aros_cflags_iquote_end=-I-
2029     fi
2031 if test "x-$use_no_stack_protector" = "x-yes" ; then
2032     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2036 #-----------------------------------------------------------------------------
2038 # Check if the target compiler supports some options used for delinting:
2039 #  -Wunused-but-set-variable
2040 #  -Warray-bounds
2041 #  -Wenum-compare
2042 #  -Wstrict-overflow
2043 #  -Wformat-security
2045 if test "x-$crosstools" != "x-yes"; then
2046     if test "$orig_target_cc" != "$aros_kernel_cc"; then
2047         CC="$orig_target_cc"
2048     fi
2049     AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2050     CFLAGS=-Wunused-but-set-variable
2051     AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2052     AC_MSG_RESULT($aros_unused_but_set_variable)
2053     if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2054         aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2055     fi
2057     AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2058     CFLAGS=-Warray-bounds
2059     AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2060     AC_MSG_RESULT($aros_array_bounds)
2061     if test "x-$aros_array_bounds" = "x-yes" ; then
2062         aros_cflags_array_bounds=-Wno-array-bounds
2063     fi
2065     AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2066     CFLAGS=-Wenum-compare
2067     AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2068     AC_MSG_RESULT($aros_enum_compare)
2069     if test "x-$aros_enum_compare" = "x-yes" ; then
2070         aros_cflags_enum_compare=-Wno-enum-compare
2071     fi
2073     AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2074     CFLAGS=-Wstrict-overflow
2075     AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2076     AC_MSG_RESULT($aros_strict_overflow)
2077     if test "x-$aros_strict_overflow" = "x-yes" ; then
2078         aros_cflags_strict_overflow=-Wno-strict-overflow
2079     fi
2081     AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2082     CFLAGS=-Wformat-security
2083     AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2084     AC_MSG_RESULT($aros_format_security)
2085     if test "x-$aros_format_security" = "x-yes" ; then
2086         aros_cflags_format_security=-Wno-format-security
2087     fi
2088 else
2089     # We do not know which gcc version we are going to build and what we need to know
2090     # here is different for different versions so this will be set later during the
2091     # build of crosstools.
2092     aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2093     aros_cflags_array_bounds=@aros_cflags_array_bounds@
2094     aros_cflags_enum_compare=@aros_cflags_enum_compare@
2095     aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2096     aros_cflags_format_security=@aros_cflags_format_security@
2099 #-----------------------------------------------------------------------------
2101 # Check if we can explicitly choose older version of symbol hashing
2103 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2104 CC="$aros_kernel_cc"
2105 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2106 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2107 AC_MSG_RESULT($use_hash_style)
2108 if test "x-$use_hash_style" = "x-yes" ; then
2109     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2111 CC="$save_cc"
2112 CFLAGS="$save_cflags"
2114 AC_SUBST(host_cflags_iquote)
2115 AC_SUBST(host_cflags_iquote_end)
2116 AC_SUBST(kernel_cflags_iquote)
2117 AC_SUBST(kernel_cflags_iquote_end)
2118 AC_SUBST(aros_cflags_iquote)
2119 AC_SUBST(aros_cflags_iquote_end)
2122 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2123 AC_MSG_CHECKING([for default resolution of WBScreen])
2124 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2125 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2126 if test "$resolution" = "yes" ; then
2127     resolution="none"
2129 if test "$resolution" = "no" ; then
2130     resolution="none"
2132 if test "$resolution" != "none" ; then
2133     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2134     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2135     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2137 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2138 aros_cv_default_wbwidth=$aros_default_wbwidth
2139 aros_cv_default_wbheight=$aros_default_wbheight
2140 aros_cv_default_wbdepth=$aros_default_wbdepth
2142 dnl See if the user wants the serial debug output for native flavour
2143 AC_MSG_CHECKING([if serial debug is enabled])
2144 AC_ARG_WITH(serial-debug,AC_HELP_STRING([--with-serial-debug],[Enable serial debug output in native (default=no)]),serial_debug=$withval,serial_debug=none)
2145 if test "$aros_serial_debug" = 0 ; then
2146     serial_debug_forced=""
2147     if test "$serial_debug" = "yes" ; then
2148         serial_debug="1"
2149     fi
2150     if test "$serial_debug" = "no" ; then
2151         serial_debug="none"
2152     fi
2153 else
2154     serial_debug_forced="(forced)"
2155     serial_debug=$aros_serial_debug
2157 if test "$serial_debug" != "none" ; then
2158     aros_serial_debug=$serial_debug
2159     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2160 else
2161     AC_MSG_RESULT(no)
2164 dnl See if the user wants the palm debug output hack for palm native flavour
2165 AC_MSG_CHECKING([if palm debug hack is enabled])
2166 AC_ARG_ENABLE(palm_debug_hack,AC_HELP_STRING([--enable-palm-debug-hack],[Enable palm debug output hack in palm native (default=no)]),palm_debug_hack="yes",palm_debug_hack="no")
2167 if test "$palm_debug_hack" = "yes" ; then
2168     aros_palm_debug_hack="1"
2170 AC_MSG_RESULT($palm_debug_hack)
2172 dnl See if the user wants nesting supervisor activated for unix flavour
2173 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2174 AC_ARG_ENABLE(nesting_supervisor,AC_HELP_STRING([--enable-nesting-supervisor],[Enable nesting supervisor support in unix (default=no)]),nesting_supervisor="yes",nesting_supervisor="no")
2175 if test "$nesting_supervisor" = "yes" ; then
2176     aros_nesting_supervisor="1"
2178 AC_MSG_RESULT($nesting_supervisor)
2180 dnl See if the user wants to disable MMU support
2181 dnl This can be overriden on per-target basis,
2182 dnl set $aros_enable_mmu to "yes" or "no" to do this
2183 if test "$aros_enable_mmu" = "" ; then
2184     AC_MSG_CHECKING([if MMU support is enabled])
2185     dnl Enabled by default
2186     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2187     if test "$aros_enable_mmu" = "" ; then
2188         aros_enable_mmu="yes"
2189     fi
2190     AC_MSG_RESULT($aros_enable_mmu)
2192 if test "$aros_enable_mmu" = "no" ; then
2193     aros_enable_mmu="0"
2194 else
2195     aros_enable_mmu="1"
2197     
2199 dnl things specifically required for hosted flavours
2200 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2202     if test "x-$need_dlopen" != "x-no" ; then
2203       dnl some kind of dynamic library access system is required for hostlib.resource
2204       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2205       if test "x-$have_dl" = "x-no" ; then
2206           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2207                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2208                                     have_dl="no")
2209       fi
2210       if test "x-$have_dl" = "x-no" ; then
2211           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2212       fi
2213     fi
2216     dnl x11 hidd
2217     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2218                                            [build X11 hidd for hosted (default=auto)]),
2219                                            x11_hidd="$enableval",
2220                                            x11_hidd="$need_x11")
2221     case "x-$x11_hidd" in
2222         x-yes|x-no|x-auto)                 ;;
2223         *)                 x11_hidd="$need_x11" ;;
2224     esac
2226     ENABLE_X11=0
2228     dnl they want it
2229     if test "x-$x11_hidd" != "x-no" ; then
2231         dnl find x11 stuff
2232         AC_PATH_X
2234         x_cflags=
2235         for path in $x_libraries
2236         do
2237             x_cflags="$x_cflags -L$path"
2238         done
2240         for path in $x_includes
2241         do
2242             x_cflags="$x_cflags -I$path"
2243         done
2244         
2245         if test "x-$no_x" = "x-yes" ; then
2247             dnl didn't find it
2248             if test "x-$x11_hidd" != "x-auto" ; then
2249                 dnl and they explicitly asked for it, bail out
2250                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2251             fi
2252         
2253         else
2254             dnl found it, setup the metatarget
2255             x11_hidd_target=kernel-x11gfx-kobj
2256             ENABLE_X11=1
2258             dnl setup shared memory extensions
2259             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2260                                                   [use X11 shared memory (default=auto)]),
2261                                                   x11_hidd_shm="$enableval",
2262                                                   x11_hidd_shm="auto")
2263             case "x-$x11_hidd_shm" in
2264                 x-yes|x-no|x-auto)                     ;;
2265                 *)                 x11_hidd_shm="auto" ;;
2266             esac
2268             have_xshm=no
2270             dnl they want it
2271             if test "x-$x11_hidd_shm" != "x-no" ; then
2273                 dnl system shm headers
2274                 AC_CHECK_HEADERS(sys/ipc.h)
2275                 AC_CHECK_HEADERS(sys/shm.h)
2277                 dnl got them
2278                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2280                     dnl make sure X libs have shm functions
2281                     save_cflags="$CFLAGS"
2282                     CFLAGS="$CFLAGS $x_cflags"
2283                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2284                     CFLAGS="$save_cflags"
2285                 fi
2286             fi
2288             dnl detection done, prepare output
2289             if test "x-$have_xshm" = "x-yes" ; then
2290                 dnl we can do shm
2291                 DO_XSHM_SUPPORT="1"
2292             elif test "x-$x11_hidd_shm" = "x-yes" ; then
2293                 dnl they explicitly asked for it, but we can't do it
2294                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2295             else
2296                 dnl otherwise just disable it
2297                 DO_XSHM_SUPPORT="0"
2298             fi
2300             
2301             dnl setup vidmode (fullscreen) extensions
2302             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2303                                                       [use X11 vidmode extension (default=auto)]),
2304                                                       x11_hidd_vidmode="$enableval",
2305                                                       x11_hidd_vidmode="auto")
2306             case "x-$x11_hidd_vidmode" in
2307                 x-yes|x-no|x-auto)                         ;;
2308                 *)                 x11_hidd_vidmode="auto" ;;
2309             esac
2311             have_vidmode=no
2313             dnl they want it
2314             if test "x-$x11_hidd_vidmode" != "x-no" ; then
2316                 dnl make sure X libs have vidmode functions
2317                 save_cflags="$CFLAGS"
2318                 CFLAGS="$CFLAGS $x_cflags"
2319                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2320                 CFLAGS="$save_cflags"
2321             fi
2323             dnl detection done, prepare output
2324             if test "x-$have_vidmode" = "x-yes" ; then
2325                 dnl we can do vidmode
2326                 DO_VIDMODE_SUPPORT="1"
2327             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2328                 dnl they explicitly asked for it, but we can't do it
2329                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2330             else
2331                 dnl otherwise just disable it
2332                 DO_VIDMODE_SUPPORT="0"
2333             fi
2334         fi
2336         aros_host_x11_includes=$x_includes 
2337         aros_host_x11_libdirs=$x_libraries
2338     fi
2341     dnl sdl hidd
2342     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2343                                            [build SDL hidd for hosted (default=auto)]),
2344                                            sdl_hidd="$enableval",
2345                                            sdl_hidd="auto")
2346     case "x-$sdl_hidd" in
2347         x-yes|x-no|x-auto)                 ;;
2348         *)                 sdl_hidd="auto" ;;
2349     esac
2351     dnl they want it
2352     if test "x-$sdl_hidd" != "x-no" ; then
2354         dnl find sdl
2355         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2357         if test "x-$have_sdl" != "x-yes" ; then
2359             dnl didn't find it
2360             if test "x-$sdl_hidd" != "x-auto" ; then
2361                 dnl and they explicitly asked for it, bail out
2362                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2363             fi
2365         else
2366             dnl found it, set up the metatarget
2367             sdl_hidd_target=kernel-hidd-sdl
2368             aros_host_sdl_cflags=SDL_CFLAGS
2369             aros_host_sdl_libs=SDL_LIBS
2370         fi
2371     fi
2373     dnl oss.library
2374     AC_CHECK_HEADER(sys/soundcard.h)
2375     if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2376         oss_library_target=workbench-libs-oss-unix
2377     fi
2381 dnl See if the user wants dbus.library
2382 AC_MSG_CHECKING([if building of dbus.library is enabled])
2383 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2384 if test "$dbus" = "yes" ; then
2385     ENABLE_DBUS=1
2386     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2387     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2388     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2389     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2390 else
2391     ENABLE_DBUS=0
2393 AC_MSG_RESULT($dbus)
2395 if test "$use_kernel_cc_wrapper" = "yes" ; then
2396     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2399 if test "${crosstools}" != "yes" ; then
2400     aros_target_toolchain=no
2401 else
2402     aros_target_toolchain=yes
2405 dnl --------------------------------------------------------------------
2406 dnl Configuration Output Section
2407 dnl --------------------------------------------------------------------
2409 # Generic
2410 AC_SUBST(aros_arch)
2411 AC_SUBST(aros_cpu)
2412 AC_SUBST(aros_flavour)
2413 AC_SUBST(aros_flavour_uc)
2414 AC_SUBST(aros_target_toolchain)
2415 AC_SUBST(AROS_BUILDDIR)
2416 AC_SUBST(AROS_BUILDDIR_UNIX)
2417 AC_SUBST(SRCDIR)
2418 AC_SUBST(AROS_CROSSTOOLSDIR)
2419 AC_SUBST(AROS_PORTSSRCDIR)
2421 # Compatability with other Amiga-like operation systems
2422 AC_SUBST(aros_amigaos_compliance)
2424 # Host related
2425 AC_SUBST(aros_cc_pre)
2426 AC_SUBST(aros_host_strip)
2427 AC_SUBST(aros_host_arch)
2428 AC_SUBST(aros_host_cpu)
2429 AC_SUBST(aros_host_cpp)
2430 AC_SUBST(aros_host_cc)
2431 AC_SUBST(aros_host_cxx)
2432 AC_SUBST(aros_host_ar)
2433 AC_SUBST(aros_host_ranlib)
2434 AC_SUBST(aros_host_ld)
2435 AC_SUBST(aros_host_make)
2436 AC_SUBST(aros_host_cflags)
2437 AC_SUBST(aros_host_cxxflags)
2438 AC_SUBST(gnu89_inline)
2439 AC_SUBST(aros_host_ldflags)
2440 AC_SUBST(aros_host_debug)
2441 AC_SUBST(aros_host_mkdep)
2442 AC_SUBST(aros_host_mkargs)
2443 AC_SUBST(aros_host_exe_suffix)
2444 AC_SUBST(aros_host_lib_suffix)
2445 AC_SUBST(aros_tools_dir)
2446 AC_SUBST(aros_host_aclocal)
2447 AC_SUBST(aros_host_autoconf)
2448 AC_SUBST(aros_host_autoheader)
2449 AC_SUBST(aros_host_automake)
2450 AC_SUBST(ant)
2452 # Target Related
2453 AC_SUBST(aros_target_guitheme)
2454 AC_SUBST(aros_target_iconset)
2455 AC_SUBST(aros_target_bootloader)
2456 AC_SUBST(aros_target_arch)
2457 AC_SUBST(aros_target_family)
2458 AC_SUBST(aros_target_cpu)
2459 AC_SUBST(aros_target_variant)
2460 AC_SUBST(aros_target_suffix)
2461 AC_SUBST(aros_target_ar)
2462 AC_SUBST(aros_target_ranlib)
2463 AC_SUBST(aros_plain_nm)
2464 AC_SUBST(aros_plain_ar)
2465 AC_SUBST(aros_kernel_ar)
2466 AC_SUBST(aros_kernel_ranlib)
2467 AC_SUBST(orig_target_cc)
2468 AC_SUBST(aros_target_cc)
2469 AC_SUBST(aros_kernel_cc)
2470 AC_SUBST(orig_target_cxx)
2471 AC_SUBST(aros_target_cxx)
2472 AC_SUBST(aros_kernel_cxx)
2473 AC_SUBST(orig_target_cpp)
2474 AC_SUBST(aros_target_cpp)
2475 AC_SUBST(aros_kernel_cpp)
2476 AC_SUBST(orig_target_as)
2477 AC_SUBST(aros_target_as)
2478 AC_SUBST(aros_kernel_as)
2479 AC_SUBST(orig_target_ld)
2480 AC_SUBST(aros_target_ld)
2481 AC_SUBST(aros_kernel_ld)
2482 AC_SUBST(aros_target_cc_includes)
2483 AC_SUBST(aros_target_cc_path)
2484 AC_SUBST(aros_target_objdump)
2485 AC_SUBST(aros_target_objcopy)
2486 AC_SUBST(aros_target_strip)
2487 AC_SUBST(aros_target_nm)
2488 AC_SUBST(aros_kernel_rescomp)
2489 AC_SUBST(aros_shared_default)
2490 AC_SUBST(aros_shared_ld)
2491 AC_SUBST(aros_object_format)
2492 AC_SUBST(aros_compiler_libs)
2493 AC_SUBST(aros_arch_libs)
2495 AC_SUBST(aros_config_cflags)
2496 AC_SUBST(aros_config_aflags)
2497 AC_SUBST(aros_config_ldflags)
2499 AC_SUBST(aros_shared_cflags)
2500 AC_SUBST(aros_shared_aflags)
2501 AC_SUBST(aros_shared_ldflags)
2502 AC_SUBST(aros_kernel_cflags)
2503 AC_SUBST(aros_kernel_includes)
2504 AC_SUBST(aros_kernel_objcflags)
2505 AC_SUBST(aros_kernel_ldflags)
2506 AC_SUBST(aros_target_cflags)
2507 AC_SUBST(aros_debug_cflags)
2508 AC_SUBST(aros_debug_aflags)
2509 AC_SUBST(aros_debug_ldflags)
2510 AC_SUBST(aros_target_genmap)
2511 AC_SUBST(aros_target_strip_flags)
2513 AC_SUBST(crosstools_target)
2514 AC_SUBST(crosstools_cxx_target)
2516 # Delinting target compiler flags
2517 AC_SUBST(aros_cflags_unused_but_set_variable)
2518 AC_SUBST(aros_cflags_array_bounds)
2519 AC_SUBST(aros_cflags_enum_compare)
2520 AC_SUBST(aros_cflags_strict_overflow)
2521 AC_SUBST(aros_cflags_format_security)
2523 # Graphics Related
2524 AC_SUBST(x11_hidd_target)
2525 AC_SUBST(sdl_hidd_target)
2526 AC_SUBST(pci_hidd_target)
2527 AC_SUBST(oss_library_target)
2529 AC_SUBST(aros_default_wbwidth)
2530 AC_SUBST(aros_default_wbheight)
2531 AC_SUBST(aros_default_wbdepth)
2532 AC_SUBST(DO_XSHM_SUPPORT)
2533 AC_SUBST(DO_VIDMODE_SUPPORT)
2535 AC_SUBST(aros_host_x11_includes)
2536 AC_SUBST(aros_host_x11_libdirs)
2537 AC_SUBST(aros_host_sdl_cflags)
2538 AC_SUBST(aros_host_sdl_libs)
2540 # Native version related
2541 AC_SUBST(aros_serial_debug)
2543 # Palm native version related
2544 AC_SUBST(aros_palm_debug_hack)
2546 # Unix/Hosted version related
2547 AC_SUBST(aros_nesting_supervisor)
2549 # MMU related
2550 AC_SUBST(aros_enable_mmu)
2552 # Apple iOS related
2553 AC_SUBST(aros_ios_platform)
2554 AC_SUBST(aros_ios_version)
2555 AC_SUBST(aros_ios_sdk)
2557 # Android related
2558 AC_SUBST(android_tool)
2559 AC_SUBST(aros_android_level)
2561 # DBUS related
2562 AC_SUBST(ENABLE_DBUS)
2563 AC_SUBST(DBUS_CFLAGS)
2564 AC_SUBST(DBUS_LIBFLAGS)
2565 AC_SUBST(KERNEL_DBUS_KOBJ)
2566 AC_SUBST(KERNEL_DBUS_INCLUDES)
2568 #X11 related
2569 AC_SUBST(ENABLE_X11)
2571 # Debug related
2572 AC_SUBST(aros_debug)
2573 AC_SUBST(aros_mungwall_debug)
2574 AC_SUBST(aros_stack_debug)
2575 AC_SUBST(aros_modules_debug)
2577 # Collect-aros stuff: "-ius" to ignore undefined symbols
2578 AC_SUBST(ignore_undefined_symbols)
2580 # C compiler related
2581 AC_SUBST(gcc_target_cpu)
2583 dnl Prepare for output, make up all the generated patches
2584 case "$aros_flavour" in
2585 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2586                 aros_flavour="emulation" ;;
2587 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2588                 aros_flavour="emulation" ;;
2589 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2590                 aros_flavour="standalone";;
2591 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2592                 aros_flavour="standalone";;
2593 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2594                 aros_flavour="native" ;;
2595 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2596                 aros_flavour="native" ;;
2597 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2598                 aros_flavour="linklib" ;;
2599 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2600                 aros_flavour="palmnative" ;;
2601 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2602                 aros_flavour="mac68knative" ;;
2603 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2604                 aros_flavour="ppcnative" ;;
2605 esac
2607 if test ! -d ${aros_inc_dir} ; then
2608     ${MKDIR} ${aros_inc_dir}
2610 if test ! -d ${aros_geninc_dir} ; then
2611     ${MKDIR} ${aros_geninc_dir}
2613 if test ! -d ${aros_hostcfg_dir} ; then
2614     ${MKDIR} ${aros_hostcfg_dir}
2616 if test ! -d ${aros_targetcfg_dir} ; then
2617     ${MKDIR} ${aros_targetcfg_dir}
2619 if test ! -d ${aros_tools_dir} ; then
2620     ${MKDIR} ${aros_tools_dir}
2622 if test ! -d ${aros_scripts_dir} ; then
2623     ${MKDIR} ${aros_scripts_dir}
2626 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2628 AC_CONFIG_COMMANDS([compiler_executable],
2629     [
2630         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2631         mkdir -p $prefix
2632         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2633         prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2635         echo ${prefix2}
2636         echo ${prefix3}
2637         chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2639         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
2640         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
2641         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
2642         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
2643         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2644         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2645         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
2647         ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix3}-ld$aros_host_exe_suffix
2648     ],
2649     [
2650         aros_host_exe_suffix=${aros_host_exe_suffix}
2651         aros_tools_dir=${aros_tools_dir}
2652         aros_target_cpu=${aros_target_cpu}
2653         aros_target_arch=${aros_target_arch}
2654         aros_target_suffix=${aros_target_suffix}
2655         orig_target_nm=${orig_target_nm}
2656         orig_target_as=${orig_target_as}
2657         orig_target_ar=${orig_target_ar}
2658         orig_target_ranlib=${orig_target_ranlib}
2659         orig_target_objdump=${orig_target_objdump}
2660         orig_target_objcopy=${orig_target_objcopy}
2661         orig_target_strip=${orig_target_strip}
2662         aros_kernel_ld=${aros_kernel_ld}
2663     ]
2665 AC_CONFIG_COMMANDS([genmf_executable],
2666     [chmod a+x ${aros_tools_dir}/genmf.py],
2667     [aros_tools_dir=${aros_tools_dir}]
2670 AC_CONFIG_FILES(
2671     Makefile
2672     config/make.cfg
2673     ${aros_inc_dir}/config.h:config/config.h.in
2674     ${aros_geninc_dir}/config.h:config/config.h.in
2675     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2676     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2677     mmake.config
2678     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2679     ${aros_targetcfg_dir}/specs:config/specs.in
2680     ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2681     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2682     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2683     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2684     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2685     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2686     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2687     tools/collect-aros/env.h
2688     ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2691 AC_OUTPUT
2693 dnl This is in order to not define SHARED_CFLAGS sometimes
2694 dnl We don't always do aros_shared_ar, aros_shared_cflags
2696 #XXX compatability...
2697 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2699 if test -n "$aros_shared_cflags" ; then
2700     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2701     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg