WIP BoingIconBar Preferences; rewritten such that it uses the Zune
[AROS.git] / configure.in
blob2bca7ee004bcdac4bcf85625ed5faef5addad09a
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 # Leave at 'none' for no external toolchain
546 kernel_tool_prefix="none"
548 #-----------------------------------------------------------------------------
551 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
552 # it switched on by default, and we use the host compiler, so it compiles AROS
553 # code with this enabled resulting in link failures as we don't have support
554 # for it.
556 # We use two methods to disable it. For the host compiler (used to compile
557 # some hosted modules), we test to see if the compiler supports stack
558 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
559 # work on all platforms.
561 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
562 # (this is done unconditionally, as it should have no effect on compilers
563 # without the stack protection feature). This may be specific to the way that
564 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
565 # strong enough to disable it in a generic way though, so we'll live with it
566 # until another vendor ships GCC with it enabled in a different way, and deal
567 # with it then.
570 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
571 save_cflags="$CFLAGS"
572 CFLAGS="$CFLAGS -fno-stack-protector"
573 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
574 AC_MSG_RESULT($use_no_stack_protector)
575 if test "x-$use_no_stack_protector" = "x-yes" ; then
576     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
578 CFLAGS="$save_cflags"
580 #-----------------------------------------------------------------------------
582 # Disable pointer-signedness warnings if the compiler recognises the option
583 # (this only works for the host compiler at the moment)
585 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
586 save_cflags="$CFLAGS"
587 CFLAGS="$CFLAGS -Wno-pointer-sign"
588 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
589 AC_MSG_RESULT($use_no_sign_warning)
590 if test "x-$use_no_sign_warning" = "x-yes" ; then
591     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
593 CFLAGS="$save_cflags"
595 #-----------------------------------------------------------------------------
597 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
599 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
600 save_cflags="$CFLAGS"
601 CFLAGS="$CFLAGS -fgnu89-inline"
602 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
603 AC_MSG_RESULT($use_gnu89_inline)
604 if test "x-$use_gnu89_inline" = "x-yes" ; then
605     gnu89_inline="-fgnu89-inline"
607 CFLAGS="$save_cflags"
609 #-----------------------------------------------------------------------------
611 AC_MSG_CHECKING([for type of build])
612 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")
614 if test "$build_type" = "nightly"; then
615     build_type_string="NIGHTLY"
616 elif test "$build_type" = "snapshot"; then
617     build_type_string="SNAPSHOT"
618 elif test "$build_type" = "milestone"; then
619     build_type_string="MILESTONE"
620 elif test "$build_type" = "release"; then
621     build_type_string="RELEASE"
622 else
623     build_type_string="PERSONAL"
624     build_type="personal"
627 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
629 AC_MSG_RESULT($build_type)
631 #-----------------------------------------------------------------------------
632 all_debug_types="messages stack modules mungwall symbols"
634 AC_MSG_CHECKING([which debug types to enable])
635 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)]),
636  debug="$enableval",debug="")
638 if test "$debug" = "" -o "$debug" = "no"; then
639     debug="none"
640 elif test "$debug" = "yes"; then
641     debug="all"
644 if test "$debug" = "all" ; then
645     debug="messages stack modules symbols"
646     for d in $all_debug_types; do
647         export aros_${d}_debug="1"
648     done
649 else
650     for d in $all_debug_types; do
651         export aros_${d}_debug="0"
652     done
655 if test "$debug" != "none"; then
656     debug=`echo $debug | sed s/,/\ /g`
657     for d in $debug; do
658         found="0"
659         for d2 in $all_debug_types; do
660             if test "$d2" = "$d"; then
661                 found="1"
662                 break
663             fi
664         done
665         if test "$found" = "0"; then
666             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
667         fi
668         export aros_${d}_debug="1"
669     done
670     aros_debug="yes"
672 AC_MSG_RESULT($debug)
674 if test "$aros_messages_debug" = "1"; then
675     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
676 else
677     aros_messages_debug=""
679 if test "$aros_symbols_debug" = "1"; then
680     aros_symbols_debug="-g"
681 else
682     aros_symbols_debug=""
685 # These are the flags to pass when compiling debugged programs
686 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
687 aros_debug_aflags=""
688 aros_debug_ldflags="$aros_symbols_debug"
690 #-----------------------------------------------------------------------------
691 #   Checking if we should build crosstools..
692 AC_MSG_CHECKING([whether to build crosstools])
693 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="yes")
694 AC_MSG_RESULT($crosstools)
696 #-----------------------------------------------------------------------------
697 #   Checking for distcc and ccache.
699 #   Always apply the transforms in this particular order. Basically you should
700 #   always run 'ccache distcc compiler' in that order for the best performance.
702 AC_MSG_CHECKING([whether to enable distcc])
703 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
704 if test "$distcc" != "" -a "$distcc" != "no"; then
705     # AC_CHECK_PROG will print out the result in this case
706     AC_PATH_PROG(DISTCC,[distcc],distcc,)
707 else
708     AC_MSG_RESULT(no)
711 AC_MSG_CHECKING([whether to enable ccache])
712 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
713 if test "$ccache" != "" -a "$ccache" != "no"; then
714     # AC_CHECK_PROG will print out the result in this case
715     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
716 else
717     AC_MSG_RESULT(no)
720 #-----------------------------------------------------------------------------
721 AC_MSG_CHECKING([what specific host gcc version to use])
722 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")
723 AC_MSG_RESULT($kernel_tool_version)
725 #-----------------------------------------------------------------------------
726 AC_MSG_CHECKING([what specific target gcc version to use])
727 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")
728 AC_MSG_RESULT($target_tool_version)
730 #-----------------------------------------------------------------------------
731 AC_MSG_CHECKING([what optimization flags to use])
732 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
733 if test "$optimization" = "unknown"; then
734     dnl default is -O2 for normal builds, -O0 for debug builds
735     if test "$debug" != "none"; then
736         optimization="-O0"
737     else
738         optimization="-O2"
739     fi
741 aros_config_cflags="$aros_config_cflags $optimization"
742 AC_MSG_RESULT($optimization)
744 #-----------------------------------------------------------------------------
745 AC_MSG_CHECKING([what paranoia flags to use])
746 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
747 if test "$paranoia_flags" = "default"; then
748         paranoia_flags=""
749 else if test "$paranoia_flags" = "yes"; then
750         paranoia_flags="-Wall -Werror"
751 fi fi
752 AC_MSG_RESULT($paranoia_flags)
753 aros_config_cflags="$aros_config_cflags $paranoia_flags"
755 #-----------------------------------------------------------------------------
756 AC_MSG_CHECKING([what target variant to enable])
757 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
758 if test "$target_variant" = ""; then
759     aros_target_variant=""
760     aros_target_suffix=""
761     enableval="none"
762 else
763     aros_target_variant="$target_variant"
764     aros_target_suffix="-$target_variant"
766 AC_MSG_RESULT($enableval)
768 #-----------------------------------------------------------------------------
769 # Target-specific defaults. You can override then on a per-target basis.
771 # Bootloader name. Currently used by PC target.
772 target_bootloader="none"
774 #-----------------------------------------------------------------------------
775 # Additional options for some specific targets
777 case "$aros_target_variant" in
778 ios)
779     AC_MSG_CHECKING([XCode path])
780     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")
781     AC_MSG_RESULT($aros_xcode_path)
783     AC_MSG_CHECKING([what iOS SDK version to use])
784     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")
785     AC_MSG_RESULT($aros_sdk_version)
787     ;;
789 "android")
790     AC_MSG_CHECKING([Android SDK path])
791     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)
792     AC_MSG_RESULT($aros_android_sdk)
794     AC_MSG_CHECKING([Android NDK path])
795     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
796     AC_MSG_RESULT($aros_android_ndk)
798     AC_MSG_CHECKING([what Android SDK version to use])
799     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")
800     AC_MSG_RESULT($aros_sdk_version)
802     if test "$aros_android_ndk" != "none"; then
803         AC_MSG_CHECKING([what Android NDK version to use])
804         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")
805         AC_MSG_RESULT($aros_ndk_version)
806     fi
808     export PATH="$aros_android_sdk/tools:$PATH"
809     AC_PATH_PROG(android_tool, $android_tool)
810     AROS_REQUIRED(android,$android_tool)
812     aros_android_level=android-$aros_sdk_version
813     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
814         echo "Platform $aros_android_level is not installed in your SDK"
815         echo "Use --with-sdk-version=<API level number> to select another platform version"
816         echo "You can check what plaform versions are installed in your SDK"
817         echo "by examining contents of $aros_android_sdk/platforms directory"
818         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
819     fi
821     AC_PATH_PROG(ant, ant)
822     if test "$ant" = ""; then
823         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
824     fi
826     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
827     if test "$host_os" = "mingw32"; then
828         android_tool="cmd //c $android_tool"
829     fi
831     ;;
832 esac
834 #-----------------------------------------------------------------------------
836 # This is the target configuration switch.
837 case "$target_os" in
838     linux*)
839         aros_target_arch="linux"
840         aros_target_family="unix"
841         case "$target_cpu" in
842             *m68k*)
843                 aros_target_cpu="m68k"
844                 aros_object_format="m68kelf"
845                 aros_flavour="emulcompat"
846                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
847                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
848                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
849                 gcc_target_cpu="mc68000"
850                 ;;
851             *i?86*)
852                 aros_target_cpu="i386"
853                 aros_object_format="elf_i386"
854                 aros_flavour="emulation"
855                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
856                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
857                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
858                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
859                 aros_config_ldflags="-m32 -march=i486"
860                 aros_kernel_ldflags="-melf_i386"
861                 aros_default_wbdepth=8
862                 gcc_target_cpu="i386"
863                 pci_hidd_target="hidd-pci-linux"
864                 android_tool_dir_prefix="x86"
865                 android_tool_prefix="i686-android-linux"
866                 android_ndk_arch="x86"
867                 ;;
868             *x86_64*)
869                 aros_target_cpu="x86_64"
870                 aros_object_format="elf_x86_64"
871                 aros_flavour="emulation"
872                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
873                 aros_config_cflags="$aros_config_cflags -mno-red-zone -fno-omit-frame-pointer"
874                 aros_default_wbdepth=8
875                 pci_hidd_target="hidd-pci-linux"
876                 ;;
877             *powerpc*)
878                 aros_target_cpu="ppc"
879                 aros_object_format="elf32ppc"
880                 aros_flavour="emulation"
881                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
882                 aros_default_wbdepth=8
883                 gcc_target_cpu="ppc"
884                 ;;
885 # TODO
886 # Same as powerpc, but I need this for the nightly build to work again.
887 # Actually, the nightly should be made working with powerpc target.
888 # That just was too much work for the moment, another week or two.
889             *ppc*)
890                 aros_target_cpu="ppc"
891                 aros_object_format="elf32ppc"
892                 aros_flavour="emulation"
893                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
894                 aros_default_wbdepth=8
895                 gcc_target_cpu="ppc"
896                 ;;
897             *arm*)
898                 aros_target_cpu="arm"
899                 aros_object_format="armelf_linux_eabi"
900                 aros_flavour="emulation"
901                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
902                 gcc_target_cpu="arm"
903                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
904                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
905                 aros_arch_libs="-laeabi"
906                 android_tool_dir_prefix="arm-linux-androideabi"
907                 android_tool_prefix="arm-linux-androideabi"
908                 android_ndk_arch="arm"
909                 if test "$aros_host_cpu" != "arm" ; then
910                     kernel_tool_prefix="arm-linux-gnueabi-"
911                 fi
912                 ;;
913             *)
914                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
915                 ;;
916         esac
917         case "$aros_target_variant" in
918             android)
920                 dnl Not all Linux CPUs are supported by Android
921                 if test "$android_ndk_arch" = ""; then
922                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
923                 fi
925                 aros_default_wbwidth=320
926                 aros_default_wbheight=480
927                 if test "$aros_android_ndk" = "none"; then
928                     dnl Use standalone toolchain, don't adjust paths
929                     aros_kernel_cflags="-mandroid"
930                     aros_kernel_ldflags="-mandroid"
931                     CFLAGS="-mandroid"
932                 else
933                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
934                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
935                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
936                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
937                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
938                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
939                 fi
940                 need_x11=no
941                 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
942                 dnl in order not to fill mmakefiles with garbage
943                 x11_hidd_target=kernel-hidd-androidgfx-kobj
944                 # Disable implicit PIC mode
945                 aros_target_cflags="$aros_target_cflags -fno-pic"
946                 kernel_tool_prefix="$android_tool_prefix-"
947             ;;
948         esac
949     ;;
951     pc)
952         aros_target_arch="pc"
953         aros_shared_default="no"
954         target_bootloader="grub2"
955         case "$target_cpu" in
956             *i?86*)
957                 aros_target_cpu="i386"
959                 dnl If somebody hasn't already set the target object
960                 dnl format, then use this value. Mostly to support
961                 dnl FreeBSD cross-compilation.
962                 dnl TODO: Remove when we always use our compiler.
964                 if test "$aros_object_format" = "" ; then
965                     aros_object_format="elf_i386"
966                 fi
967                 aros_flavour="standalone"
968                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
969                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
970                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
971                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
972                 aros_config_ldflags="-m32 -march=i486"
973                 aros_kernel_ldflags="-melf_i386"
974                 aros_default_wbwidth=640
975                 aros_default_wbheight=480
976                 gcc_target_cpu="i386"
977                 ;;
978             *x86_64*)
979                 aros_target_cpu="x86_64"
980                 aros_serial_debug=1
981                 if test "$aros_object_format" = "" ; then
982                     aros_object_format="elf_x86_64"
983                 fi
984                 aros_flavour="standalone"
985                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
986                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
987                 aros_kernel_ldflags=""
988                 aros_default_wbwidth=640
989                 aros_default_wbheight=480
990                 ;;
991             *)
992                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
993                 ;;
994         esac
995         ;;
997     prep)
998         aros_target_arch="prep"
999         aros_shared_default="no"
1000         aros_target_cpu="ppc"
1001         aros_object_format="elf32ppc"
1002         aros_flavour="ppcnative"
1003         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1004         aros_kernel_ldflags=""
1005         aros_default_wbwidth=640
1006         aros_default_wbheight=480
1007         gcc_target_cpu="ppc"
1008         ;;
1010     freebsd*)
1011         aros_target_arch="freebsd"
1012         aros_target_family="unix"
1013         aros_target_cpu="i386"
1014         aros_flavour="emulation"
1015         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1016         gcc_target_cpu="i386"
1018         aros_target_strip_flags="-x"
1019         ;;
1021     darwin*)
1022         aros_target_arch="darwin"
1023         aros_target_family="unix"
1024         aros_flavour="emulation"
1025         case "$target_cpu" in
1026             *i?86*)
1027                 aros_ios_platform="iPhoneSimulator"
1028                 aros_target_cpu="i386"
1029                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1030                 aros_kernel_ldflags=""
1031                 aros_macosx_version="10.4"
1032                 aros_default_wbdepth=8
1033                 gcc_target_cpu="i386"
1034                 aros_object_format="elf_i386"
1035                 aros_kernel_ar_flags="-cr"
1036                 aros_target_strip_flags="-x"
1037                 kernel_tool_flags="-m32"
1038                 ;;
1039             *x86_64*)
1040                 aros_target_cpu="x86_64"
1041                 aros_object_format="elf_x86_64"
1042                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1043                 aros_macosx_version="10.6"
1044                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1045                 aros_kernel_cflags="-m64"
1046                 aros_kernel_ldflags="-m64"
1047                 aros_target_cflags="-mcmodel=large"
1048                 aros_default_wbdepth=8
1049                 aros_kernel_ar="ar"
1050                 aros_kernel_ar_flags="-cr"
1051                 aros_kernel_ld="ld"
1052                 aros_kernel_ranlib="ranlib"
1053                 ;;
1054             *ppc*)
1055                 aros_target_cpu="ppc"
1056                 aros_object_format="elf32ppc"
1057                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1058                 aros_kernel_ldflags=""
1059                 aros_macosx_version="10.0"
1060                 aros_default_wbdepth=8
1061                 gcc_target_cpu="ppc"
1062                 aros_kernel_ar="ar"
1063                 aros_kernel_ar_flags="-cr"
1064                 aros_kernel_ld="ld -arch ppc"
1065                 aros_kernel_ranlib="ranlib -arch ppc"
1066                 kernel_tool_prefix="powerpc-apple-darwin10-"
1067                 ;;
1068             *arm*)
1069                 aros_ios_platform="iPhoneOS"
1070                 aros_target_cpu="arm"
1071                 aros_object_format="armelf_linux_eabi"
1072                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1073                 aros_arch_libs="-laeabi"
1074                 aros_default_wbdepth=8
1075                 gcc_target_cpu="arm"
1076                 aros_kernel_ar="ar"
1077                 aros_kernel_ar_flags="-cr"
1078                 aros_kernel_ld="ld -arch arm"
1079                 aros_kernel_ranlib="ranlib -arch arm"
1080                 kernel_tool_prefix="arm-apple-darwin10-" 
1081                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1082                 ;;
1083             *)
1084                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1085                 ;;
1086         esac
1087         case "$aros_target_variant" in
1088             ios)
1089                 aros_ios_version="3.0"
1090                 aros_default_wbwidth=320
1091                 aros_default_wbheight=480
1092                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1093                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1094                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1095                 need_x11=no
1096                 # This is here because it may depend on iOS or SDK version
1097                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1098                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1099                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1100             ;;
1101             *)
1102                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1103                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1104             ;;
1105         esac
1106         ;;
1108     dragonfly*)
1109         aros_target_arch="dragonfly"
1110         aros_target_family="unix"
1111         aros_flavour="emulation"
1112         case "$target_cpu" in
1113             *i?86*)
1114                 aros_target_cpu="i386"
1115                 aros_object_format="elf_i386"
1116                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1117                 ;;
1118             *x86_64*)
1119                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1120                 aros_target_cpu="x86_64"
1121                 aros_object_format="elf_x86_64"
1122                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1123                 ;;
1124             *)
1125                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1126                 ;;
1127         esac
1128         ;;
1130     netbsd*)
1131         aros_target_arch="netbsd"
1132         aros_target_family="unix"
1133         case "$target_cpu" in
1134             *m68k*)
1135                 aros_target_cpu="m68k"
1136                 aros_object_format="m68kelf"
1137                 aros_flavour="emulcompat"
1138                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1139                 gcc_target_cpu="mc68000"
1140                 ;;
1141             *i?86*)
1142                 aros_target_cpu="i386"
1143                 aros_object_format="elf_i386"
1144                 aros_flavour="emulation"
1145                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1146                 aros_default_wbdepth=8
1147                 gcc_target_cpu="i386"
1148                 ;;
1149             *)
1150                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1151                 ;;
1152         esac
1153         aros_target_genmap="-Wl,-M -Xlinker >"
1154         aros_flavour="emulation"
1155         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1156         ;;   
1158     openbsd*)
1159         aros_target_arch="openbsd"
1160         aros_target_family="unix"
1161         case "$target_cpu" in
1162             *i?86*)
1163                 aros_target_cpu="i386"
1164                 aros_object_format="elf_i386"
1165                 aros_flavour="emulation"
1166                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1167                 gcc_target_cpu="i386"
1168                 ;;
1169             *)
1170                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1171                 ;;
1172         esac
1173         aros_target_genmap="-Wl,-M -Xlinker >"
1174         aros_target_nm_flags="-u"
1175         aros_flavour="emulation"
1176         ;;
1178     solaris*)
1179         aros_target_arch="solaris"
1180         aros_target_family="unix"
1181         case "$target_cpu" in
1182            *i?86*)
1183                aros_target_cpu="i386"
1184                aros_object_format="elf_i386"
1185                aros_flavour="emulation"
1186                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1187                aros_default_wbdepth=8
1188                gcc_target_cpu="i386"
1189                ;;
1190             *sparc*)
1191                 aros_target_cpu="sparc"
1192                 aros_object_format="elf_sparc"
1193                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1194                 gcc_target_cpu="sparc"
1195                 ;;
1196             *)
1197                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1198                 ;;
1199         esac
1200         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1201         aros_flavour="emulation"
1202         ;;
1204     morphos*)
1205         aros_target_arch="morphos"
1206         aros_shared_default="no"
1207         aros_target_cpu="ppc"
1208         aros_object_format="elf_ppc"
1209         aros_flavour="nativecompat"
1210         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1211         gcc_target_cpu="ppc"
1212         ;;
1214     sam440)
1215         aros_target_arch="sam440"
1216         aros_shared_default="no"
1217         aros_target_cpu="ppc"
1218         aros_object_format="elf32ppc"
1219         aros_flavour="ppcnative"
1220         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1221         aros_kernel_ldflags=""
1222         aros_default_wbwidth=1024
1223         aros_default_wbheight=768
1224         aros_default_wbdepth=24
1225         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1226         gcc_target_cpu="powerpc"
1227         ;;
1229     efika)
1230         aros_target_arch="efika"
1231         aros_shared_default="no"
1232         aros_target_cpu="arm"
1233         aros_object_format="armelf_linux_eabi"
1234         aros_flavour="standalone"
1235         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1236         aros_kernel_ldflags=""
1237         aros_default_wbwidth=1024
1238         aros_default_wbheight=600
1239         aros_arch_libs="-laeabi"
1240         gcc_default_cpu="armv7-a"
1241         gcc_default_fpu="vfpv3"
1242         gcc_default_float_abi="softfp"
1243         aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1244         aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1245         ;;
1246         
1247     chrp)
1248     aros_target_arch="chrp"
1249     aros_shared_default="no"
1250     aros_target_cpu="ppc"
1251     aros_object_format="elf32ppc"
1252     aros_flavour="ppcnative"
1253     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1254     aros_kernel_ldflags=""
1255     aros_default_wbwidth=640
1256     aros_default_wbheight=480
1257     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
1258     gcc_target_cpu="powerpc"
1259         case "$aros_target_variant" in
1260             efika)
1261             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1262             ;;
1263         esac
1264     ;;
1266     amiga*)
1267         aros_target_arch="amiga"
1268         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1269         aros_shared_default="no"
1271         case "$target_cpu" in
1272             *m68k*)
1273                 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")
1274                 aros_enable_mmu=no
1275                 aros_target_cpu="m68k"
1276                 aros_object_format="m68kelf"
1277                 aros_flavour="standcompat"
1278                 gcc_target_cpu="m68000"
1279                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -Os"
1280                 aros_config_aflags="$aros_config_aflags -${gcc_target_cpu}"
1281                 # Needed to get the correct multilib
1282                 aros_config_ldflags="-${gcc_target_cpu}"
1283                 aros_shared_ldflags="-${gcc_target_cpu}"
1284                 aros_kernel_ldflags="-${gcc_target_cpu}"
1285                 aros_target_nostdlib_ldflags="-${gcc_target_cpu}"
1286                 aros_target_strip_flags="-R.comment --strip-debug"
1287                 aros_default_wbwidth=640
1288                 aros_default_wbheight=256
1289                 aros_default_wbdepth=2
1290                 ;;
1291             *ppc*)
1292                 aros_cpu="ppc"
1293                 aros_flavour="native"
1294                 gcc_target_cpu="ppc"
1295                 ;;
1296             *)
1297                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1298                 ;;
1299         esac
1300         ;;
1302     mingw*)
1303         aros_target_arch="mingw32"
1304         aros_shared_default="no"
1305         aros_flavour="emulation"
1306         aros_shared_cflags=""
1307         need_crosstools="yes"
1308         need_dlopen="no"
1309         rescomp="windres"
1310         case "$target_cpu" in
1311             *i?86*)
1312                 aros_target_cpu="i386"
1313                 aros_object_format="elf_i386"
1314                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1315                 aros_default_wbdepth=8
1316                 gcc_target_cpu="i386"
1318                 kernel_tool_prefix="i386-mingw32-"
1319                 ;;
1320             *x86_64*)
1321                 aros_target_cpu="x86_64"
1322                 aros_object_format="elf_x86_64"
1323                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1324                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1325                 aros_default_wbdepth=8
1326                 kernel_tool_prefix="x86_64-w64-mingw32-"
1327                 ;;
1328             *arm*)
1329                 aros_target_cpu="arm"
1330                 aros_object_format="armelf_linux_eabi"
1331                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1332                 aros_arch_libs="-laeabi"
1333                 aros_default_wbdepth=8
1334                 gcc_target_cpu="arm"
1335                 gcc_default_float_abi="soft"
1336                 kernel_tool_prefix="arm-mingw32ce-"
1337                 aros_default_wbwidth=160
1338                 aros_default_wbheight=160
1339                 ;;
1340             *)
1341                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1342                 ;;
1343         esac
1344         if test $host_os = "cygwin"; then
1345                 aros_kernel_cflags="-mno-cygwin"
1346         fi
1347     ;;
1348     pp*)
1349         aros_target_arch="pp"
1350         aros_shared_default="no"
1351         case "$target_cpu" in
1352             *m68k*)
1353                 aros_target_cpu="m68k"
1354                 aros_object_format="m68kelf"
1355                 aros_flavour="palmnative"
1356                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1357                 aros_default_wbwidth=160
1358                 aros_default_wbheight=160
1359                 aros_default_wbdepth=1
1360                 aros_target_ar_flags="cru"
1361                 aros_compiler_libs="-lgcc1"
1362                 aros_shared_default=no
1363                 aros_shared_cflags="-fpic"
1364                 aros_shared_aflags=""
1365                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1366                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1367                 aros_debug_cflags="$aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
1368                 aros_debug_aflags=""
1369                 aros_debug_ldflags="$aros_symbols_debug"
1370                 aros_mungwall_debug="0"
1371                 aros_modules_debug="0"
1372                 gcc_target_cpu="mc68000"
1373                 ignore_undefined_symbols="-ius"
1374                 ;;
1375            *)
1376                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1377                 ;;
1378         esac
1379         ;;
1381     mac*)
1382         aros_target_arch="mac"
1383         aros_shared_default="no"
1384         case "$target_cpu" in
1385             *m68k*)
1386                 aros_target_cpu="m68k"
1387                 aros_object_format="m68kelf"
1388                 aros_flavour="mac68knative"
1389                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1390                 aros_default_wbwidth=512
1391                 aros_default_wbheight=384
1392                 aros_default_wbdepth=8
1393                 aros_target_ar_flags="cru"
1394                 aros_compiler_libs="-lgcc1"
1395                 aros_shared_default=no
1396                 aros_shared_cflags="-fpic"
1397                 aros_shared_aflags=""
1398                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1399                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1400                 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug -mc68000"
1401                 aros_debug_aflags=""
1402                 aros_debug_ldflags="$aros_symbols_debug"
1403                 aros_mungwall_debug="0"
1404                 aros_modules_debug="0"
1405                 gcc_target_cpu="mc68000"
1406                 ignore_undefined_symbols="-ius"
1407                 ;;
1408            *)
1409                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1410                 ;;
1411         esac
1412         ;;
1414     *)
1415         AC_MSG_ERROR([Unsupported target architecture $target])
1416         ;;
1417 esac
1419 #-----------------------------------------------------------------------------
1420 AC_MSG_CHECKING([where to install or search for cross tools binaries])
1421 AC_ARG_WITH(crosstools,AC_HELP_STRING([--with-crosstools=DIR],[Where to install or search for cross tools binaries]),with_crosstools=$withval,with_crosstools="default")
1422 if test "$with_crosstools" = "default"; then
1423     AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1424 else
1425     # Disable building crosstools if we are using an external set - otherwise
1426     # we may attempt to overwrite them if the tools-crosstools target is made!
1427     crosstools=no
1428     AROS_CROSSTOOLSDIR="$with_crosstools"
1429     PATH="$AROS_CROSSTOOLSDIR:$PATH"
1431 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1433 AC_MSG_CHECKING([Kernel tool prefix])
1434 AC_ARG_WITH(kernel-tool-prefix,AC_HELP_STRING([--with-kernel-tool-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"],[kernel_tool_prefix="$kernel_tool_prefix"])
1435 AC_MSG_RESULT($kernel_tool_prefix)
1437 target_tool_prefix=${target_cpu}-aros-
1439 # Now process extra architecture-specific options.
1440 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1441 # as well as floating-point ABI.
1442 case "$aros_target_cpu" in
1443 arm)
1444     dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1445     if test "$gcc_default_cpu" = ""; then
1446         gcc_default_cpu="armv6"
1447     fi
1448     if test "$gcc_default_fpu" = ""; then
1449         gcc_default_fpu="vfp"
1450     fi
1451     if test "$gcc_default_float_abi" = ""; then
1452         gcc_default_float_abi="softfp"
1453     fi
1455     AC_MSG_CHECKING([Which minimum CPU to use])
1456     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)
1457     AC_MSG_RESULT($aros_gcc_cpu)
1459     AC_MSG_CHECKING([Which minimum FPU to use])
1460     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)
1461     AC_MSG_RESULT($aros_gcc_fpu)
1463     AC_MSG_CHECKING([Which floating point ABI to use])
1464     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)
1465     AC_MSG_RESULT($aros_gcc_float_abi)
1467     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"
1468     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"
1469     ;;
1470 esac
1472 # Some formats need custom ELF specs.
1473 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1474 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1475     elf_specs_in=config/${aros_object_format}-specs.in
1476 else
1477     elf_specs_in=config/elf-specs.in
1480 AC_MSG_CHECKING([what specific AROS gcc version to use])
1481 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="")
1482 AC_MSG_RESULT($aros_gcc_version)
1484 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1485 # Since we override specs, we may need to put these defines there
1486 if test "$gcc_target_cpu" != ""; then
1487     gcc_target_cpu="-D__${gcc_target_cpu}__"
1490 AC_MSG_CHECKING([where to download sourcecode for external ports])
1491 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1492 if test "$with_portssrcdir" = "default"; then
1493     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1494 else
1495     AROS_PORTSSRCDIR="$with_portssrcdir"
1497 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1499 AC_MSG_CHECKING([which bootloader to use])
1500 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1501 if test "$target_bootloader" = "none"; then
1502     aros_target_bootloader=""
1503 else
1504     aros_target_bootloader="$target_bootloader"
1506 AC_MSG_RESULT($target_bootloader)
1508 AC_MSG_CHECKING([which icon-set to use])
1509 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1510 if test "$target_iconset" = "default"; then
1511     aros_target_iconset="Gorilla"
1512     target_iconset="default (Gorilla)"
1513 else
1514     aros_target_iconset="$target_iconset"
1516 AC_MSG_RESULT($target_iconset)
1518 AC_MSG_CHECKING([which GUI Theme to use])
1519 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1520 if test "$target_guitheme" = "default"; then
1521     aros_target_guitheme="Ice"
1522 else
1523     aros_target_guitheme="$target_guitheme"
1525 AC_MSG_RESULT($aros_target_guitheme)
1527 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1528 # for target code)
1529 cross_compiling=no
1530 if test "$aros_host_cpu" = "$aros_target_cpu" ; then
1531     # If host = target CPU, let's try to use the
1532     # host's toolchains if no others were requested
1533     if test "$kernel_tool_prefix" = "none" ; then
1534         kernel_tool_prefix=""
1535     fi
1536 else
1537     cross_compiling=yes
1540 dnl Native x86-64 Linux toolchain can also produce i386 binaries, given -m32 flag.
1541 if test "$aros_host_cpu" == "x86_64" ; then
1542     if test "$aros_target_cpu" == "i386" ; then
1543         if test "$aros_target_arch" != "mingw32"; then
1544             cross_compiling=no
1545             kernel_tool_prefix=""
1546         fi
1547     fi
1550 dnl Enforce cross-compile if we are on Darwin, but our target is not Darwin.
1551 dnl If target is Darwin disable cross-compiling otherwise kernel 
1552 dnl not setup correctly.
1553 if test "$aros_host_arch" == "darwin" ; then
1554     if test "$aros_target_arch" != "darwin" ; then
1555         cross_compiling=yes
1556     else
1557         cross_compiling=no
1558         kernel_tool_prefix=""
1559     fi
1562 dnl The same for MinGW
1563 if test "$aros_host_arch" == "mingw32" ; then
1564     if test "$aros_target_arch" != "mingw32" ; then
1565         cross_compiling=yes
1566     else
1567         cross_compiling=no
1568         kernel_tool_prefix=""
1569     fi
1572 #######################################################################
1573 ## Compute what toolchains to use, and their paths                   ##
1574 #######################################################################
1576 # This takes, as input:
1577 #   crosstools             {yes,no}
1578 #   aros_gcc_version       {default,[version]}
1579 #   kernel_tool_prefix     {none,[some-arch-os-]}
1580 #   target_tool_prefix     ${target_cpu}-aros-
1582 # The output is
1583 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1584 #        Where the 'kernel' binaries are located
1585 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1586 #        Where the 'target' binaries are located
1587 #        (not the symlink farm - that is aros_target_*!)
1589 # The rules are:
1590 #   if crosstools then
1591 #      if kernel_tools_prefix = "no-kernel-prefix-"
1592 #          aros_kernel_* = crosstools cc paths
1593 #          aros_kernel_cc = elf cc wrapper around crosstools cc
1594 #      else
1595 #          VALIDATE(${kernel_tools_prefix}*)
1596 #          aros_kernel_* = ${kernel_tools_prefix}*
1597 #          if ${kernel_tools_prefix}cc is an AROS gcc
1598 #              aros_kernel_cc = ${kernel_tools_prefix}cc
1599 #          else
1600 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1601 #          fi
1602 #      fi
1604 #      orig_target_* = aros built crosstools
1605 #      orig_target_cc = elf cc wrapper around crosstools cc
1606 #   else
1607 #      VALIDATE(${kernel_tools_prefix}*)
1609 #      orig_target_* = aros_kernel_*
1610 #      if aros_kernel_cc is an AROS gcc
1611 #          orig_target_cc = aros_kernel_cc
1612 #      else
1613 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
1614 #      fi
1615 #   fi
1618 AC_MSG_CHECKING([whether to use external toolchain])
1619 if test "$kernel_tool_prefix" = "none" ; then
1620     AC_MSG_RESULT([no]);
1621     if test "$crosstools" != "yes"; then
1622         AC_MSG_ERROR([--disable-crosstools requires --with-kernel-tool-prefix= for this arch])
1623     fi
1624     # We are building AROS crosstools, and no kernel
1625     # tools specified - assume target tools == kernel tools
1626     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1627     aros_kernel_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1628     aros_kernel_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1629     aros_kernel_cpp="${tmp_tool_prefix}cpp"
1630     aros_kernel_ld="${tmp_tool_prefix}ld"
1631     aros_kernel_as="${tmp_tool_prefix}as"
1632     aros_kernel_ar="${tmp_tool_prefix}ar"
1633     aros_kernel_ranlib="${tmp_tool_prefix}ranlib"
1634     aros_kernel_nm="${tmp_tool_prefix}nm"
1635     aros_kernel_strip="${tmp_tool_prefix}strip"
1636     aros_kernel_objcopy="${tmp_tool_prefix}objcopy"
1637     aros_kernel_objdump="${tmp_tool_prefix}objdump"
1638 else
1639     AC_MSG_RESULT([yes]);
1640     # Kernel tools specified - find them
1641     # Note that 'normally', aros_kernel_* overrides will
1642     # empty, unless specified in the per-arch sections above.
1644     AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
1645     AROS_REQUIRED(cpp,$aros_kernel_cpp)
1646     if test "x$aros_kernel_cc" = "x"; then
1647         aros_kernel_cc=${kernel_tool_prefix}gcc
1648     fi
1649     AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${aros_gcc_version})
1650     AROS_REQUIRED(cc,$aros_kernel_cc)
1651     if test "x$aros_kernel_cxx" = "x"; then
1652         aros_kernel_cxx=${kernel_tool_prefix}g++
1653     fi
1654     AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${aros_gcc_version})
1655     # If it's set, make sure it's really there
1656     if test "x$aros_kernel_cxx" != "x" ; then
1657         AROS_REQUIRED(cxx,$aros_kernel_cxx)
1658     fi
1659     AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1660     AROS_REQUIRED(ld,$aros_kernel_ld)
1661     AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1662     AROS_REQUIRED(as,$aros_kernel_as)
1663     AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1664     AROS_REQUIRED(ar,$aros_kernel_ar)
1665     AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1666     AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1667     AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1668     AROS_REQUIRED(nm,$aros_kernel_nm)
1669     AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1670     AROS_REQUIRED(strip,$aros_kernel_strip)
1672     # Objcopy and objdump are not required for the kernel
1673     # toolchain on many architectures.
1674     # So we'll look for them, but not make them strictly required.
1675     AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1676     AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1677     if test "x${crosstools}" != "xyes" ; then
1678         AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1679         AROS_REQUIRED(objdump,$aros_kernel_objdump)
1680     fi
1683 AC_MSG_CHECKING([which target tools to use])
1684 if test "$crosstools" = "yes"; then
1685     AC_MSG_RESULT([$target_tool_prefix])
1686     # We are are building AROS crosstools
1687     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1688     orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1689     orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1690     orig_target_cpp="${tmp_tool_prefix}cpp"
1691     orig_target_ld="${tmp_tool_prefix}ld"
1692     orig_target_as="${tmp_tool_prefix}as"
1693     orig_target_ar="${tmp_tool_prefix}ar"
1694     orig_target_ranlib="${tmp_tool_prefix}ranlib"
1695     orig_target_nm="${tmp_tool_prefix}nm"
1696     orig_target_strip="${tmp_tool_prefix}strip"
1697     orig_target_objcopy="${tmp_tool_prefix}objcopy"
1698     orig_target_objdump="${tmp_tool_prefix}objdump"
1699 else
1700     # We are *not* building AROS crosstools - use the kernel tools
1701     # However some ports (Windows-hosted for example) can't use kernel tools
1702     # to build AROS for sure. In this case we search for preinstalled AROS gcc
1703     # CHECKME: Currently i set need_crosstools only for mingw target, however
1704     # the same should be true for Android and Darwin ports.
1705     if test "$need_crosstools" = "yes" ; then
1706         AC_MSG_RESULT([$aros_target_cpu-aros])
1707         AC_PATH_PROG(orig_target_cpp,"$aros_target_cpu-aros-cpp")
1708         AC_PATH_PROG(orig_target_cc,"$aros_target_cpu-aros-gcc")
1709         AC_PATH_PROG(orig_target_cxx,"$aros_target_cpu-aros-g++")
1710         AC_PATH_PROG(orig_target_ld,"$aros_target_cpu-aros-ld")
1711         AC_PATH_PROG(orig_target_as,"$aros_target_cpu-aros-as")
1712         AC_PATH_PROG(orig_target_ar,"$aros_target_cpu-aros-ar")
1713         AC_PATH_PROG(orig_target_ranlib,"$aros_target_cpu-aros-ranlib")
1714         AC_PATH_PROG(orig_target_nm,"$aros_target_cpu-aros-nm")
1715         AC_PATH_PROG(orig_target_strip,"$aros_target_cpu-aros-strip")
1716         AC_PATH_PROG(orig_target_objcopy,"$aros_target_cpu-aros-objcopy")
1717         AC_PATH_PROG(orig_target_objdump,"$aros_target_cpu-aros-objdump")
1718         if test "$aros_gcc_version" != ""; then
1719             orig_target_cpp="$orig_target_cpp-$aros_gcc_version"
1720             orig_target_cc="$orig_target_cc-$aros_gcc_version"
1721             orig_target_cxx="$orig_target_cxx-$aros_gcc_version"
1722         fi
1723     else
1724         AC_MSG_RESULT([$kernel_tool_prefix])
1725         orig_target_cpp="${aros_kernel_cpp}"
1726         orig_target_cc="${aros_kernel_cc}"
1727         orig_target_cxx="${aros_kernel_cxx}"
1728         orig_target_ld="${aros_kernel_ld}"
1729         orig_target_as="${aros_kernel_as}"
1730         orig_target_ar="${aros_kernel_ar}"
1731         orig_target_ranlib="${aros_kernel_ranlib}"
1732         orig_target_nm="${aros_kernel_nm}"
1733         orig_target_strip="${aros_kernel_strip}"
1734         orig_target_objcopy="${aros_kernel_objcopy}"
1735         orig_target_objdump="${aros_kernel_objdump}"
1736     fi
1738     AROS_REQUIRED(cpp,$orig_target_cpp)
1739     AROS_REQUIRED(cc,$orig_target_cc)
1740     if test "x$orig_target_cxx" != "x" ; then
1741         AROS_REQUIRED(cxx,$orig_target_cxx)
1742     fi
1743     AROS_REQUIRED(ld,$orig_target_ld)
1744     AROS_REQUIRED(as,$orig_target_as)
1745     AROS_REQUIRED(ar,$orig_target_ar)
1746     AROS_REQUIRED(ranlib,$orig_target_ranlib)
1747     AROS_REQUIRED(nm,$orig_target_nm)
1748     AROS_REQUIRED(strip,$orig_target_strip)
1749     AROS_REQUIRED(objcopy,$orig_target_objcopy)
1750     AROS_REQUIRED(objdump,$orig_target_objdump)
1753 # At this point, all aros_kernel_* and aros_target_* 
1754 # tools should be set up correctly
1756 CC="$aros_kernel_cc $kernel_tool_flags"
1757 CPP="$aros_kernel_cpp"
1759 #-----------------------------------------------------------------------------
1761 # Disable pointer-signedness warnings if the compiler recognises the option
1763 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1764 save_cflags="$CFLAGS"
1765 if test "$crosstools" != "yes" ; then
1766     CFLAGS="$CFLAGS -Wno-pointer-sign"
1767     AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1768 else
1769     # we do know it is supported for the smallest version of gcc we are going to build
1770     # we assume it's also supported by later versions
1771     use_no_sign_warning=yes
1773 AC_MSG_RESULT($use_no_sign_warning)
1774 if test "x-$use_no_sign_warning" = "x-yes" ; then
1775     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1777 CFLAGS="$save_cflags"
1779 #-----------------------------------------------------------------------------
1781 # Find all the tools we need to compile. This could be cross-compiling
1782 # though! If that is the case we use the GNU form of the target and
1783 # simply add this to the front of the binary name. This is rather simple,
1784 # but it should work under most circumstances.
1786 # The default tools are to use the same as the host, but only if the
1787 # host and target CPU are the same. With GCC this is normally enough.
1790 aros_cc_pre=""
1791 aros_shared_ld="$aros_host_ld"
1793 aros_target_mkdep="$aros_host_mkdep"
1795 # The default tools executables to be linked to.
1796 if test "$rescomp" != ""; then
1797     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
1798     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1801 # Set up the sources for the symlink farm
1802 if test "$crosstools" = "yes"; then
1803     crosstools_target=tools-crosstools
1804 else
1805     crosstools_cxx_target=tools-crosstools
1808 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1809 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1812 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1813 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1814 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1815 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1816 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1817 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1818 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1820 # aros_cc_pre is a variable that is added to the front of the compiler name
1821 # in the generated aros-gcc shell script. We need this to enable the cache
1822 # to work across cleaned builds. Also, support DISTCC using the correct
1823 # environment variable.
1826 if test "x${DISTCC}" != "x" ; then
1827     if test "x${CCACHE}" != "x" ; then
1828         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1829     else
1830         aros_cc_pre="${DISTCC} "
1831     fi
1832 else
1833     if test "x${CCACHE}" != "x" ; then
1834         aros_cc_pre="${CCACHE} "
1835     fi
1838 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1840 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1841 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1842 AC_SUBST(aros_target_nix_ldflags,-nix)
1843 AC_SUBST(aros_target_detach_ldflags,-detach)
1844 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1846 # Target tools
1847 if test "$crosstools" != "yes"; then
1848     if test "$GCC" = "yes"; then
1849         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1850     fi
1851 else
1852     # We do not know which gcc version we are going to build and what we need to know
1853     # here is different for different versions so this will be set later during the
1854     # build of crosstools.
1855     aros_target_cc_path=@aros_target_cc_path@
1857 aros_target_cpp="${prefix}cpp"
1858 aros_target_cc="${prefix}gcc"
1859 aros_target_cxx="${prefix}g++"
1860 aros_target_as="${prefix}as"
1861 aros_target_ld="${prefix}ld"
1862 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1863 aros_target_objcopy="${prefix}objcopy"
1864 aros_target_objdump="${prefix}objdump"
1865 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1866 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1867 aros_target_strip="${prefix}strip"
1868 aros_plain_nm="${prefix}nm"
1869 aros_plain_ar="${prefix}ar"
1871 if test "$aros_kernel_includes" != "" ; then
1872     dnl find out about the kernel cc's include path
1873     AC_MSG_CHECKING([for the kernel compiler's include path])
1874     if test "$aros_kernel_cc_includes" = "" ; then
1875         # Try to guess where the directory is.
1876         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1877         if test -d $aros_kernel_cc_includes; then
1878             # Check if there is also an include-fixed directory and add it
1879             # to kernel compiler's include path as it may contain some of
1880             # the headers we need.
1881             if test -d "$aros_kernel_cc_includes"-fixed; then
1882                 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1883             fi
1884             # Check for specific includes directory. Neede for Ubuntu 11.10
1885             if test -d "/usr/include/i386-linux-gnu"; then
1886                 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1887             fi
1888         else
1889             # The directory doesn't exist, we need to do some more work.
1890             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1892             # These are the headers we're looking for.
1893             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1894                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1895                      zutil.h stdint.h"
1897             dirs=
1898             for h in $headers; do
1899                 # Which other headers are needed by each of the above?
1900                 deps=$(echo "#include <$h>" | \
1901                        $aros_kernel_cc -E -M - 2>/dev/null | \
1902                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1904                 # Copy all the needed headers to a directory beneath gendir.
1905                 for d in $deps; do
1906                     h=$(basename $d)
1907                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1908                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1909                     ! test -d $dir && mkdir -p $dir
1910                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1911                 done
1912             done            
1913         fi
1914     fi
1915     AC_MSG_RESULT($aros_kernel_cc_includes)
1916     # Adding -nostdinc to kernel includes as they are always used together.
1917     aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1920 if test "$crosstools" != "yes"; then
1921     dnl find out about the target cc's include path
1922     AC_MSG_CHECKING([for the target compiler's include path])
1923     if test "$aros_target_cc_includes" = "" ; then
1924         #try to guess where the directory is
1925         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1926         if ! test -d $aros_target_cc_includes; then
1927             #the directory doesn't exist, we need to do some more work
1928             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1929         
1930             #these are the headers we're looking for
1931             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1932                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1933                     zutil.h"
1935             dirs=
1936             for h in $headers; do
1937                 #which other headers each of the above headers needs?
1938                 deps=$(echo "#include <$h>" | \
1939                     $orig_target_cc -E -M - 2>/dev/null | \
1940                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1941             
1942                 #copy all the needed headers to a directory beneath gendir
1943                 for d in $deps; do
1944                     h=$(basename $d)
1945                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1946                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1947                     ! test -d $dir && mkdir -p $dir
1948                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1949                 done
1950             done
1951         fi
1952     fi
1953     AC_MSG_RESULT($aros_target_cc_includes)
1954 else
1955     # We do not know which gcc version we are going to build and what we need to know
1956     # here is different for different versions so this will be set later during the
1957     # build of crosstools.
1958     aros_target_cc_includes=@aros_target_cc_includes@
1962 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1963 # On GCC >= 4.0 -iquote should be used
1966 save_cc="$CC"
1967 save_cflags="$CFLAGS"
1968 CFLAGS="-iquote."
1969 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1970 if test "x-$crosstools" != "x-yes"; then
1971     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1972 else
1973     # we do know it is supported for the smallest version of gcc we are going to build
1974     # we assume it's also supported by later versions
1975     has_iquote=yes
1977 AC_MSG_RESULT($has_iquote)
1978 if test "x-$has_iquote" = "x-yes" ; then
1979     host_cflags_iquote=-iquote
1980     host_cflags_iquote_end=
1981 else
1982     host_cflags_iquote=-I
1983     host_cflags_iquote_end=-I-
1985 kernel_cflags_iquote=$host_cflags_iquote
1986 kernel_cflags_iquote_end=$host_cflags_iquote_end
1987 if test "x-$cross_compiling" = "x-yes"; then
1988     CC="$aros_kernel_cc"
1989     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1990     if test "x-$crosstools" != "x-yes"; then
1991         AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1992     else
1993         # we do know it is supported for the smallest version of gcc we are going to build
1994         # we assume it's also supported by later versions
1995         use_no_stack_protector=yes
1996     fi
1997     AC_MSG_RESULT($use_no_stack_protector)
1998     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1999     if test "x-$crosstools" != "x-yes"; then
2000         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2001     else
2002         # we do know it is supported for the smallest version of gcc we are going to build
2003         # we assume it's also supported by later versions
2004         has_iquote=yes
2005     fi
2006     AC_MSG_RESULT($has_iquote)
2007     if test "x-$has_iquote" = "x-yes" ; then
2008         kernel_cflags_iquote=-iquote
2009         kernel_cflags_iquote_end=
2010     else
2011         kernel_cflags_iquote=-I
2012         kernel_cflags_iquote_end=-I-
2013     fi
2015 aros_cflags_iquote=$kernel_cflags_iquote
2016 aros_cflags_iquote_end=$kernel_cflags_iquote_end
2017 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2018     CC="$orig_target_cc"
2019     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2020     if test "x-$crosstools" != "x-yes"; then
2021         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2022     else
2023         # we do know it is supported for the smallest version of gcc we are going to build
2024         # we assume it's also supported by later versions
2025         has_iquote=yes
2026     fi
2027     AC_MSG_RESULT($has_iquote)
2028     if test "x-$has_iquote" = "x-yes" ; then
2029         aros_cflags_iquote=-iquote
2030         aros_cflags_iquote_end=
2031     else
2032         aros_cflags_iquote=-I
2033         aros_cflags_iquote_end=-I-
2034     fi
2036 if test "x-$use_no_stack_protector" = "x-yes" ; then
2037     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2041 #-----------------------------------------------------------------------------
2043 # Check if the target compiler supports some options used for delinting:
2044 #  -Wunused-but-set-variable
2045 #  -Warray-bounds
2046 #  -Wenum-compare
2047 #  -Wstrict-overflow
2048 #  -Wformat-security
2050 if test "x-$crosstools" != "x-yes"; then
2051     if test "$orig_target_cc" != "$aros_kernel_cc"; then
2052         CC="$orig_target_cc"
2053     fi
2054     AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2055     CFLAGS=-Wunused-but-set-variable
2056     AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2057     AC_MSG_RESULT($aros_unused_but_set_variable)
2058     if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2059         aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2060     fi
2062     AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2063     CFLAGS=-Warray-bounds
2064     AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2065     AC_MSG_RESULT($aros_array_bounds)
2066     if test "x-$aros_array_bounds" = "x-yes" ; then
2067         aros_cflags_array_bounds=-Wno-array-bounds
2068     fi
2070     AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2071     CFLAGS=-Wenum-compare
2072     AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2073     AC_MSG_RESULT($aros_enum_compare)
2074     if test "x-$aros_enum_compare" = "x-yes" ; then
2075         aros_cflags_enum_compare=-Wno-enum-compare
2076     fi
2078     AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2079     CFLAGS=-Wstrict-overflow
2080     AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2081     AC_MSG_RESULT($aros_strict_overflow)
2082     if test "x-$aros_strict_overflow" = "x-yes" ; then
2083         aros_cflags_strict_overflow=-Wno-strict-overflow
2084     fi
2086     AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2087     CFLAGS=-Wformat-security
2088     AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2089     AC_MSG_RESULT($aros_format_security)
2090     if test "x-$aros_format_security" = "x-yes" ; then
2091         aros_cflags_format_security=-Wno-format-security
2092     fi
2093 else
2094     # We do not know which gcc version we are going to build and what we need to know
2095     # here is different for different versions so this will be set later during the
2096     # build of crosstools.
2097     aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2098     aros_cflags_array_bounds=@aros_cflags_array_bounds@
2099     aros_cflags_enum_compare=@aros_cflags_enum_compare@
2100     aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2101     aros_cflags_format_security=@aros_cflags_format_security@
2104 #-----------------------------------------------------------------------------
2106 # Check if we can explicitly choose older version of symbol hashing
2108 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2109 CC="$aros_kernel_cc"
2110 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2111 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2112 AC_MSG_RESULT($use_hash_style)
2113 if test "x-$use_hash_style" = "x-yes" ; then
2114     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2116 CC="$save_cc"
2117 CFLAGS="$save_cflags"
2119 AC_SUBST(host_cflags_iquote)
2120 AC_SUBST(host_cflags_iquote_end)
2121 AC_SUBST(kernel_cflags_iquote)
2122 AC_SUBST(kernel_cflags_iquote_end)
2123 AC_SUBST(aros_cflags_iquote)
2124 AC_SUBST(aros_cflags_iquote_end)
2127 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2128 AC_MSG_CHECKING([for default resolution of WBScreen])
2129 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2130 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2131 if test "$resolution" = "yes" ; then
2132     resolution="none"
2134 if test "$resolution" = "no" ; then
2135     resolution="none"
2137 if test "$resolution" != "none" ; then
2138     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2139     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2140     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2142 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2143 aros_cv_default_wbwidth=$aros_default_wbwidth
2144 aros_cv_default_wbheight=$aros_default_wbheight
2145 aros_cv_default_wbdepth=$aros_default_wbdepth
2147 dnl See if the user wants the serial debug output for native flavour
2148 AC_MSG_CHECKING([if serial debug is enabled])
2149 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)
2150 if test "$aros_serial_debug" = 0 ; then
2151     serial_debug_forced=""
2152     if test "$serial_debug" = "yes" ; then
2153         serial_debug="1"
2154     fi
2155     if test "$serial_debug" = "no" ; then
2156         serial_debug="none"
2157     fi
2158 else
2159     serial_debug_forced="(forced)"
2160     serial_debug=$aros_serial_debug
2162 if test "$serial_debug" != "none" ; then
2163     aros_serial_debug=$serial_debug
2164     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2165 else
2166     AC_MSG_RESULT(no)
2169 dnl See if the user wants the palm debug output hack for palm native flavour
2170 AC_MSG_CHECKING([if palm debug hack is enabled])
2171 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")
2172 if test "$palm_debug_hack" = "yes" ; then
2173     aros_palm_debug_hack="1"
2175 AC_MSG_RESULT($palm_debug_hack)
2177 dnl See if the user wants nesting supervisor activated for unix flavour
2178 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2179 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")
2180 if test "$nesting_supervisor" = "yes" ; then
2181     aros_nesting_supervisor="1"
2183 AC_MSG_RESULT($nesting_supervisor)
2185 dnl See if the user wants to disable MMU support
2186 dnl This can be overriden on per-target basis,
2187 dnl set $aros_enable_mmu to "yes" or "no" to do this
2188 if test "$aros_enable_mmu" = "" ; then
2189     AC_MSG_CHECKING([if MMU support is enabled])
2190     dnl Enabled by default
2191     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2192     if test "$aros_enable_mmu" = "" ; then
2193         aros_enable_mmu="yes"
2194     fi
2195     AC_MSG_RESULT($aros_enable_mmu)
2197 if test "$aros_enable_mmu" = "no" ; then
2198     aros_enable_mmu="0"
2199 else
2200     aros_enable_mmu="1"
2202     
2204 dnl things specifically required for hosted flavours
2205 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2207     if test "x-$need_dlopen" != "x-no" ; then
2208       dnl some kind of dynamic library access system is required for hostlib.resource
2209       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2210       if test "x-$have_dl" = "x-no" ; then
2211           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2212                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2213                                     have_dl="no")
2214       fi
2215       if test "x-$have_dl" = "x-no" ; then
2216           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2217       fi
2218     fi
2221     dnl x11 hidd
2222     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2223                                            [build X11 hidd for hosted (default=auto)]),
2224                                            x11_hidd="$enableval",
2225                                            x11_hidd="$need_x11")
2226     case "x-$x11_hidd" in
2227         x-yes|x-no|x-auto)                 ;;
2228         *)                 x11_hidd="$need_x11" ;;
2229     esac
2231     ENABLE_X11=0
2233     dnl they want it
2234     if test "x-$x11_hidd" != "x-no" ; then
2236         dnl find x11 stuff
2237         AC_PATH_X
2239         x_cflags=
2240         for path in $x_libraries
2241         do
2242             x_cflags="$x_cflags -L$path"
2243         done
2245         for path in $x_includes
2246         do
2247             x_cflags="$x_cflags -I$path"
2248         done
2249         
2250         if test "x-$no_x" = "x-yes" ; then
2252             dnl didn't find it
2253             if test "x-$x11_hidd" != "x-auto" ; then
2254                 dnl and they explicitly asked for it, bail out
2255                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2256             fi
2257         
2258         else
2259             dnl found it, setup the metatarget
2260             x11_hidd_target=kernel-x11gfx-kobj
2261             ENABLE_X11=1
2263             dnl setup shared memory extensions
2264             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2265                                                   [use X11 shared memory (default=auto)]),
2266                                                   x11_hidd_shm="$enableval",
2267                                                   x11_hidd_shm="auto")
2268             case "x-$x11_hidd_shm" in
2269                 x-yes|x-no|x-auto)                     ;;
2270                 *)                 x11_hidd_shm="auto" ;;
2271             esac
2273             have_xshm=no
2275             dnl they want it
2276             if test "x-$x11_hidd_shm" != "x-no" ; then
2278                 dnl system shm headers
2279                 AC_CHECK_HEADERS(sys/ipc.h)
2280                 AC_CHECK_HEADERS(sys/shm.h)
2282                 dnl got them
2283                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2285                     dnl make sure X libs have shm functions
2286                     save_cflags="$CFLAGS"
2287                     CFLAGS="$CFLAGS $x_cflags"
2288                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2289                     CFLAGS="$save_cflags"
2290                 fi
2291             fi
2293             dnl detection done, prepare output
2294             if test "x-$have_xshm" = "x-yes" ; then
2295                 dnl we can do shm
2296                 DO_XSHM_SUPPORT="1"
2297             elif test "x-$x11_hidd_shm" = "x-yes" ; then
2298                 dnl they explicitly asked for it, but we can't do it
2299                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2300             else
2301                 dnl otherwise just disable it
2302                 DO_XSHM_SUPPORT="0"
2303             fi
2305             
2306             dnl setup vidmode (fullscreen) extensions
2307             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2308                                                       [use X11 vidmode extension (default=auto)]),
2309                                                       x11_hidd_vidmode="$enableval",
2310                                                       x11_hidd_vidmode="auto")
2311             case "x-$x11_hidd_vidmode" in
2312                 x-yes|x-no|x-auto)                         ;;
2313                 *)                 x11_hidd_vidmode="auto" ;;
2314             esac
2316             have_vidmode=no
2318             dnl they want it
2319             if test "x-$x11_hidd_vidmode" != "x-no" ; then
2321                 dnl make sure X libs have vidmode functions
2322                 save_cflags="$CFLAGS"
2323                 CFLAGS="$CFLAGS $x_cflags"
2324                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2325                 CFLAGS="$save_cflags"
2326             fi
2328             dnl detection done, prepare output
2329             if test "x-$have_vidmode" = "x-yes" ; then
2330                 dnl we can do vidmode
2331                 DO_VIDMODE_SUPPORT="1"
2332             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2333                 dnl they explicitly asked for it, but we can't do it
2334                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2335             else
2336                 dnl otherwise just disable it
2337                 DO_VIDMODE_SUPPORT="0"
2338             fi
2339         fi
2341         aros_host_x11_includes=$x_includes 
2342         aros_host_x11_libdirs=$x_libraries
2343     fi
2346     dnl sdl hidd
2347     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2348                                            [build SDL hidd for hosted (default=auto)]),
2349                                            sdl_hidd="$enableval",
2350                                            sdl_hidd="auto")
2351     case "x-$sdl_hidd" in
2352         x-yes|x-no|x-auto)                 ;;
2353         *)                 sdl_hidd="auto" ;;
2354     esac
2356     dnl they want it
2357     if test "x-$sdl_hidd" != "x-no" ; then
2359         dnl find sdl
2360         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2362         if test "x-$have_sdl" != "x-yes" ; then
2364             dnl didn't find it
2365             if test "x-$sdl_hidd" != "x-auto" ; then
2366                 dnl and they explicitly asked for it, bail out
2367                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2368             fi
2370         else
2371             dnl found it, set up the metatarget
2372             sdl_hidd_target=kernel-hidd-sdl
2373             aros_host_sdl_cflags=SDL_CFLAGS
2374             aros_host_sdl_libs=SDL_LIBS
2375         fi
2376     fi
2378     dnl oss.library
2379     AC_CHECK_HEADER(sys/soundcard.h)
2380     if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2381         oss_library_target=workbench-libs-oss-unix
2382     fi
2386 dnl See if the user wants dbus.library
2387 AC_MSG_CHECKING([if building of dbus.library is enabled])
2388 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2389 if test "$dbus" = "yes" ; then
2390     ENABLE_DBUS=1
2391     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2392     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2393     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2394     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2395 else
2396     ENABLE_DBUS=0
2398 AC_MSG_RESULT($dbus)
2400 if test "$use_kernel_cc_wrapper" = "yes" ; then
2401     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2404 if test "${crosstools}" != "yes" ; then
2405     aros_target_toolchain=no
2406 else
2407     aros_target_toolchain=yes
2410 dnl --------------------------------------------------------------------
2411 dnl Configuration Output Section
2412 dnl --------------------------------------------------------------------
2414 # Generic
2415 AC_SUBST(aros_arch)
2416 AC_SUBST(aros_cpu)
2417 AC_SUBST(aros_flavour)
2418 AC_SUBST(aros_flavour_uc)
2419 AC_SUBST(aros_target_toolchain)
2420 AC_SUBST(AROS_BUILDDIR)
2421 AC_SUBST(AROS_BUILDDIR_UNIX)
2422 AC_SUBST(SRCDIR)
2423 AC_SUBST(AROS_CROSSTOOLSDIR)
2424 AC_SUBST(AROS_PORTSSRCDIR)
2426 # Compatability with other Amiga-like operation systems
2427 AC_SUBST(aros_amigaos_compliance)
2429 # Host related
2430 AC_SUBST(aros_cc_pre)
2431 AC_SUBST(aros_host_strip)
2432 AC_SUBST(aros_host_arch)
2433 AC_SUBST(aros_host_cpu)
2434 AC_SUBST(aros_host_cpp)
2435 AC_SUBST(aros_host_cc)
2436 AC_SUBST(aros_host_cxx)
2437 AC_SUBST(aros_host_ar)
2438 AC_SUBST(aros_host_ranlib)
2439 AC_SUBST(aros_host_ld)
2440 AC_SUBST(aros_host_make)
2441 AC_SUBST(aros_host_cflags)
2442 AC_SUBST(aros_host_cxxflags)
2443 AC_SUBST(gnu89_inline)
2444 AC_SUBST(aros_host_ldflags)
2445 AC_SUBST(aros_host_debug)
2446 AC_SUBST(aros_host_mkdep)
2447 AC_SUBST(aros_host_mkargs)
2448 AC_SUBST(aros_host_exe_suffix)
2449 AC_SUBST(aros_host_lib_suffix)
2450 AC_SUBST(aros_tools_dir)
2451 AC_SUBST(aros_host_aclocal)
2452 AC_SUBST(aros_host_autoconf)
2453 AC_SUBST(aros_host_autoheader)
2454 AC_SUBST(aros_host_automake)
2455 AC_SUBST(ant)
2457 # Target Related
2458 AC_SUBST(aros_target_guitheme)
2459 AC_SUBST(aros_target_iconset)
2460 AC_SUBST(aros_target_bootloader)
2461 AC_SUBST(aros_target_arch)
2462 AC_SUBST(aros_target_family)
2463 AC_SUBST(aros_target_cpu)
2464 AC_SUBST(aros_target_variant)
2465 AC_SUBST(aros_target_suffix)
2466 AC_SUBST(aros_target_ar)
2467 AC_SUBST(aros_target_ranlib)
2468 AC_SUBST(aros_plain_nm)
2469 AC_SUBST(aros_plain_ar)
2470 AC_SUBST(aros_kernel_ar)
2471 AC_SUBST(aros_kernel_ranlib)
2472 AC_SUBST(orig_target_cc)
2473 AC_SUBST(aros_target_cc)
2474 AC_SUBST(aros_kernel_cc)
2475 AC_SUBST(orig_target_cxx)
2476 AC_SUBST(aros_target_cxx)
2477 AC_SUBST(aros_kernel_cxx)
2478 AC_SUBST(orig_target_cpp)
2479 AC_SUBST(aros_target_cpp)
2480 AC_SUBST(aros_kernel_cpp)
2481 AC_SUBST(orig_target_as)
2482 AC_SUBST(aros_target_as)
2483 AC_SUBST(aros_kernel_as)
2484 AC_SUBST(orig_target_ld)
2485 AC_SUBST(aros_target_ld)
2486 AC_SUBST(aros_kernel_ld)
2487 AC_SUBST(aros_target_cc_includes)
2488 AC_SUBST(aros_target_cc_path)
2489 AC_SUBST(aros_target_objdump)
2490 AC_SUBST(aros_target_objcopy)
2491 AC_SUBST(aros_target_strip)
2492 AC_SUBST(aros_target_nm)
2493 AC_SUBST(aros_kernel_rescomp)
2494 AC_SUBST(aros_shared_default)
2495 AC_SUBST(aros_shared_ld)
2496 AC_SUBST(aros_object_format)
2497 AC_SUBST(aros_compiler_libs)
2498 AC_SUBST(aros_arch_libs)
2500 AC_SUBST(aros_config_cflags)
2501 AC_SUBST(aros_config_aflags)
2502 AC_SUBST(aros_config_ldflags)
2504 AC_SUBST(aros_shared_cflags)
2505 AC_SUBST(aros_shared_aflags)
2506 AC_SUBST(aros_shared_ldflags)
2507 AC_SUBST(aros_kernel_cflags)
2508 AC_SUBST(aros_kernel_includes)
2509 AC_SUBST(aros_kernel_objcflags)
2510 AC_SUBST(aros_kernel_ldflags)
2511 AC_SUBST(aros_target_cflags)
2512 AC_SUBST(aros_debug_cflags)
2513 AC_SUBST(aros_debug_aflags)
2514 AC_SUBST(aros_debug_ldflags)
2515 AC_SUBST(aros_target_genmap)
2516 AC_SUBST(aros_target_strip_flags)
2518 AC_SUBST(crosstools_target)
2519 AC_SUBST(crosstools_cxx_target)
2521 # Delinting target compiler flags
2522 AC_SUBST(aros_cflags_unused_but_set_variable)
2523 AC_SUBST(aros_cflags_array_bounds)
2524 AC_SUBST(aros_cflags_enum_compare)
2525 AC_SUBST(aros_cflags_strict_overflow)
2526 AC_SUBST(aros_cflags_format_security)
2528 # Graphics Related
2529 AC_SUBST(x11_hidd_target)
2530 AC_SUBST(sdl_hidd_target)
2531 AC_SUBST(pci_hidd_target)
2532 AC_SUBST(oss_library_target)
2534 AC_SUBST(aros_default_wbwidth)
2535 AC_SUBST(aros_default_wbheight)
2536 AC_SUBST(aros_default_wbdepth)
2537 AC_SUBST(DO_XSHM_SUPPORT)
2538 AC_SUBST(DO_VIDMODE_SUPPORT)
2540 AC_SUBST(aros_host_x11_includes)
2541 AC_SUBST(aros_host_x11_libdirs)
2542 AC_SUBST(aros_host_sdl_cflags)
2543 AC_SUBST(aros_host_sdl_libs)
2545 # Native version related
2546 AC_SUBST(aros_serial_debug)
2548 # Palm native version related
2549 AC_SUBST(aros_palm_debug_hack)
2551 # Unix/Hosted version related
2552 AC_SUBST(aros_nesting_supervisor)
2554 # MMU related
2555 AC_SUBST(aros_enable_mmu)
2557 # Apple iOS related
2558 AC_SUBST(aros_ios_platform)
2559 AC_SUBST(aros_ios_version)
2560 AC_SUBST(aros_ios_sdk)
2562 # Android related
2563 AC_SUBST(android_tool)
2564 AC_SUBST(aros_android_level)
2566 # DBUS related
2567 AC_SUBST(ENABLE_DBUS)
2568 AC_SUBST(DBUS_CFLAGS)
2569 AC_SUBST(DBUS_LIBFLAGS)
2570 AC_SUBST(KERNEL_DBUS_KOBJ)
2571 AC_SUBST(KERNEL_DBUS_INCLUDES)
2573 #X11 related
2574 AC_SUBST(ENABLE_X11)
2576 # Debug related
2577 AC_SUBST(aros_debug)
2578 AC_SUBST(aros_mungwall_debug)
2579 AC_SUBST(aros_stack_debug)
2580 AC_SUBST(aros_modules_debug)
2582 # Collect-aros stuff: "-ius" to ignore undefined symbols
2583 AC_SUBST(ignore_undefined_symbols)
2585 # C compiler related
2586 AC_SUBST(gcc_target_cpu)
2588 dnl Prepare for output, make up all the generated patches
2589 case "$aros_flavour" in
2590 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2591                 aros_flavour="emulation" ;;
2592 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2593                 aros_flavour="emulation" ;;
2594 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2595                 aros_flavour="standalone";;
2596 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2597                 aros_flavour="standalone";;
2598 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2599                 aros_flavour="native" ;;
2600 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2601                 aros_flavour="native" ;;
2602 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2603                 aros_flavour="linklib" ;;
2604 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2605                 aros_flavour="palmnative" ;;
2606 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2607                 aros_flavour="mac68knative" ;;
2608 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2609                 aros_flavour="ppcnative" ;;
2610 esac
2612 if test ! -d ${aros_inc_dir} ; then
2613     ${MKDIR} ${aros_inc_dir}
2615 if test ! -d ${aros_geninc_dir} ; then
2616     ${MKDIR} ${aros_geninc_dir}
2618 if test ! -d ${aros_hostcfg_dir} ; then
2619     ${MKDIR} ${aros_hostcfg_dir}
2621 if test ! -d ${aros_targetcfg_dir} ; then
2622     ${MKDIR} ${aros_targetcfg_dir}
2624 if test ! -d ${aros_tools_dir} ; then
2625     ${MKDIR} ${aros_tools_dir}
2627 if test ! -d ${aros_scripts_dir} ; then
2628     ${MKDIR} ${aros_scripts_dir}
2631 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2633 AC_CONFIG_COMMANDS([compiler_executable],
2634     [
2635         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2636         mkdir -p $prefix
2637         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2638         prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2640         echo ${prefix2}
2641         echo ${prefix3}
2642         chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2644         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
2645         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
2646         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
2647         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
2648         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2649         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2650         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
2652         ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix3}-ld$aros_host_exe_suffix
2653     ],
2654     [
2655         aros_host_exe_suffix=${aros_host_exe_suffix}
2656         aros_tools_dir=${aros_tools_dir}
2657         aros_target_cpu=${aros_target_cpu}
2658         aros_target_arch=${aros_target_arch}
2659         aros_target_suffix=${aros_target_suffix}
2660         orig_target_nm=${orig_target_nm}
2661         orig_target_as=${orig_target_as}
2662         orig_target_ar=${orig_target_ar}
2663         orig_target_ranlib=${orig_target_ranlib}
2664         orig_target_objdump=${orig_target_objdump}
2665         orig_target_objcopy=${orig_target_objcopy}
2666         orig_target_strip=${orig_target_strip}
2667         aros_kernel_ld=${aros_kernel_ld}
2668     ]
2670 AC_CONFIG_COMMANDS([genmf_executable],
2671     [chmod a+x ${aros_tools_dir}/genmf.py],
2672     [aros_tools_dir=${aros_tools_dir}]
2675 AC_CONFIG_FILES(
2676     Makefile
2677     config/make.cfg
2678     ${aros_inc_dir}/config.h:config/config.h.in
2679     ${aros_geninc_dir}/config.h:config/config.h.in
2680     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2681     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2682     mmake.config
2683     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2684     ${aros_targetcfg_dir}/specs:config/specs.in
2685     ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2686     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2687     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2688     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2689     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2690     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2691     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2692     tools/collect-aros/env.h
2693     ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2696 AC_OUTPUT
2698 dnl This is in order to not define SHARED_CFLAGS sometimes
2699 dnl We don't always do aros_shared_ar, aros_shared_cflags
2701 #XXX compatability...
2702 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2704 if test -n "$aros_shared_cflags" ; then
2705     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2706     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg