Bring back darwin hosted port to live, might also work for android hosted but is...
[AROS.git] / configure.in
blob5b4c53717c7c8356b3c6cc6745f6e933abe85356
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         cross_compile_native=yes
231         android_build_os="darwin-x86"
232         android_tool="android"
233         default_android_sdk="/android-sdk-mac_x86"
234         case "$host_cpu" in
235             *i?86*)
236                 aros_host_cpu="i386"
237                 ;;
238             *x86_64*)
239                 aros_host_cpu="x86_64"
240                 ;;
241             *powerpc*)
242                 aros_host_cpu="ppc"
243                 ;;
244             *)
245                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
246                 aros_host_cpu="$host_cpu"
247                 ;;
248         esac
250         aros_host_ldflags="$aros_host_ldflags -liconv"
252         ;;
254     dragonfly*)
255         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
256         aros_host_make="gmake"
257         aros_host_arch="dragonfly"
258         case $host_cpu in
259             *i?86*)
260                 aros_host_cpu="i386"
261                 ;;
262             *amd64*)
263                 aros_host_cpu="x86_64"
264                 ;;
265             *)
266                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
267                 aros_host_cpu="$host_cpu"
268                 ;;
269         esac
270         ;;
272     netbsd*)
273         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
274         aros_host_make="gmake"
275         aros_host_arch="netbsd"
276         case "$host_cpu" in
277             *i?86*)
278                 aros_host_cpu="i386"
279                 ;;
280             *m68k*)
281                 aros_host_cpu="m68k"
282                 ;;
283             *)
284                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
285                 aros_host_cpu="$host_cpu"
286                 ;;
287         esac    
288         aros_host_lib_suffix=".0.0"
289         ;;
291     openbsd*)
292         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
293         aros_host_make="gmake"
294         aros_host_arch="openbsd"
295         case "$host_cpu" in
296             *i?86*)
297                 aros_host_cpu="i386"
298                 ;;
299             *)
300                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
301                 aros_host_cpu="$host_cpu"
302                 ;;
303         esac
304         ;;
305         
306     solaris*)
307         aros_host_arch="solaris"
308         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
309         case "$host_cpu" in
310             *i?86*)
311                 aros_host_cpu="i386"
312                 ;;
313             *sparc*)
314                 aros_host_cpu="sparc"
315                 ;;
316             *)
317                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
318                 aros_host_cpu="$host_cpu"
319                 ;;
320         esac
321         ;;
323     morphos*)
324         aros_host_arch="morphos"
325         aros_host_cpu="ppc"
326         cross_compile_native=yes
327         ;;
329     amiga*)
330         aros_host_arch="amiga"
331         cross_compile_native=yes
332         SORT="/gg/bin/sort"
333         TEST="/gg/bin/test"
334         UNIQ="/gg/bin/uniq"
335         FOR="for"
336         TOUCH="/gg/bin/touch"
337         case "$host_cpu" in
338             *m68k*)
339                 aros_host_cpu="m68k"
340                 ;;
341             *powerpc*)
342                 aros_host_cpu="ppc"
343                 ;;
344             *)
345                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
346                 aros_host_cpu="$host_cpu"
347                 ;;
348         esac
349         ;;
351     cygwin*)
352         aros_host_arch="cygwin"
353         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
354         cross_compile_native=yes
355         android_build_os="windows"
356         android_tool="android.bat"
357         default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
359         case "$host_cpu" in
360             *i?86*)
361                 aros_host_cpu="i386"
362                 ;;
363             *)
364                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
365                 aros_host_cpu="$host_cpu"
366                 ;;
367         esac
368         ;;
370     mingw32*)
371         aros_host_arch="mingw32"
372         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
373         cross_compile_native=yes
374         android_build_os="windows"
375         android_tool="android.bat"
376         default_android_sdk="/c/android-sdk-windows-1.6_r1"
378         case "$host_cpu" in
379         *i?86*)
380             dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
381             dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
382             dnl Here we attempt to detect Windows home platform by asking gcc about its target.
383             dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
385             AC_MSG_CHECKING([for Windows native gcc target])
386             host_cpu=`gcc -dumpmachine`
387             AC_MSG_RESULT($host_cpu)
388             ;;
390         esac
392         case "$host_cpu" in
393         *i?86*)
394             aros_host_cpu="i386"
395             ;;
397         mingw32*)
398             dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
399             aros_host_cpu="i386"
400             ;;
402         *x86_64*)
403             aros_host_cpu="x86_64"
404             dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
405             dnl directory, so we have to add it explicitly here.
406             aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
407             ;;
409         *)
410             AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
411             aros_host_cpu="$host_cpu"
412             ;;
413         esac
414         ;;
415     *)
416         AC_MSG_ERROR([Unsupported host architecture $host])
417         ;;
418 esac
420 AROS_PROG(aros_host_ar,[ar],[cr])
421 AROS_REQUIRED(ar,$aros_host_ar)
422 AROS_PROG(aros_host_ranlib,ranlib)
423 AROS_REQUIRED(ranlib,$aros_host_ranlib)
424 AROS_PROG(aros_host_strip,strip)
425 AROS_REQUIRED(strip,$aros_host_strip)
427 AROS_PROG(RM,[rm],[-rf])
428 AROS_REQUIRED(rm,$RM)
429 AROS_PROG(CP,[cp])
430 AROS_REQUIRED(cp,$CP)
431 AROS_PROG(MV,[mv])
432 AROS_REQUIRED(mv,$MV)
433 AROS_PROG(ECHO,[echo])
434 AROS_REQUIRED(echo,$ECHO)
435 AROS_PROG(MKDIR,[mkdir],[-p])
436 AROS_REQUIRED(mkdir,$MKDIR)
437 AROS_PROG(TOUCH,[touch])
438 AROS_REQUIRED(touch,$TOUCH)
439 AROS_PROG(SORT,[sort])
440 AROS_REQUIRED(sort,$SORT)
441 AROS_PROG(UNIQ,[uniq])
442 AROS_REQUIRED(uniq,$UNIQ)
443 AROS_PROG(NOP,[true])
444 AROS_REQUIRED(true,$NOP)
445 AROS_PROG(CAT,[cat])
446 AROS_REQUIRED(cat,$CAT)
447 AROS_PROG(BISON,[bison])
448 AROS_REQUIRED(bison,$BISON)
449 AROS_PROG(FLEX,[flex])
450 AROS_REQUIRED(flex,$FLEX)
451 AROS_PROG(PNGTOPNM,[pngtopnm])
452 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
453 AROS_PROG(PPMTOILBM,[ppmtoilbm])
454 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
455 AROS_PROG(SED,[sed])
456 AROS_REQUIRED(sed,$SED)
457 AROS_PROG(CHMOD,[chmod])
458 AROS_REQUIRED(chmod,$CHMOD)
459 AROS_PROG(PATCH,[patch])
460 AROS_REQUIRED(patch,$PATCH)
462 AM_PATH_PYTHON(2.5)
464 AC_SUBST(FOR, for)
465 AC_SUBST(IF, if)
466 AC_SUBST(TEST, test)
467 AC_SUBST(CMP, cmp)
469 dnl ---------------------------------------------------------------------------
470 dnl Look for things about the host system, good for hosted targets.
471 dnl ---------------------------------------------------------------------------
473 # Check for some includes for the X11 HIDD and the kernel
474 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
475     sys/mmap.h sys/mman.h sysexits.h \
476     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
479 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
481 AC_HEADER_DIRENT
482 AC_HEADER_STAT
483 AC_HEADER_STDC
484 AC_HEADER_SYS_WAIT
485 AC_HEADER_TIME
486 AC_STRUCT_ST_BLKSIZE
487 AC_STRUCT_ST_BLOCKS
488 AC_STRUCT_ST_RDEV
489 AC_STRUCT_TM
490 AC_STRUCT_TIMEZONE
491 AC_TYPE_OFF_T
492 AC_TYPE_PID_T
493 AC_TYPE_SIZE_T
494 AC_TYPE_UID_T
496 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
498 # Look for some functions
499 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
500     clone kse_create rfork_thread thr_create sa_register \
501     getcontext makecontext setcontext sigaltstack swapcontext])
503 AC_FUNC_MMAP
506 dnl --------------------------------------------------------------------
507 dnl Target Configuration Section
508 dnl --------------------------------------------------------------------
510 dnl The target configuration section is responsible for setting up all
511 dnl the paths for includes, and tools required to build AROS to some
512 dnl particular target.
514 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
515 aros_config_aflags="-Wall -x assembler-with-cpp -c"
516 aros_config_ldflags=""
518 aros_shared_default=yes
520 aros_shared_cflags="-fPIC"
521 aros_shared_aflags=""
522 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
523 aros_kernel_ldflags="-Wl,-rpath,./lib"
525 aros_kernel_ar_flags="cr"
526 aros_target_ar_flags="cr"
527 aros_target_nm_flags="-C -ul"
528 aros_target_strip_flags="--strip-unneeded -R.comment"
530 aros_compiler_libs=
531 aros_arch_libs=
533 aros_target_genmap="-Wl,-Map -Xlinker"
535 # Native flavour stuff
536 aros_serial_debug="0"
538 # Palm native flavour stuff
539 aros_palm_debug_hack="0"
541 # Unix flavour stuff
542 aros_nesting_supervisor="0"
544 # Collect-aros stuff: "-ius" to ignore undefined symbols
545 ignore_undefined_symbols=""
547 # Check for X11 by default
548 need_x11="auto"
550 #-----------------------------------------------------------------------------
553 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
554 # it switched on by default, and we use the host compiler, so it compiles AROS
555 # code with this enabled resulting in link failures as we don't have support
556 # for it.
558 # We use two methods to disable it. For the host compiler (used to compile
559 # some hosted modules), we test to see if the compiler supports stack
560 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
561 # work on all platforms.
563 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
564 # (this is done unconditionally, as it should have no effect on compilers
565 # without the stack protection feature). This may be specific to the way that
566 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
567 # strong enough to disable it in a generic way though, so we'll live with it
568 # until another vendor ships GCC with it enabled in a different way, and deal
569 # with it then.
572 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
573 save_cflags="$CFLAGS"
574 CFLAGS="$CFLAGS -fno-stack-protector"
575 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
576 AC_MSG_RESULT($use_no_stack_protector)
577 if test "x-$use_no_stack_protector" = "x-yes" ; then
578     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
580 CFLAGS="$save_cflags"
582 #-----------------------------------------------------------------------------
584 # Disable pointer-signedness warnings if the compiler recognises the option
585 # (this only works for the host compiler at the moment)
587 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
588 save_cflags="$CFLAGS"
589 CFLAGS="$CFLAGS -Wno-pointer-sign"
590 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
591 AC_MSG_RESULT($use_no_sign_warning)
592 if test "x-$use_no_sign_warning" = "x-yes" ; then
593     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
595 CFLAGS="$save_cflags"
597 #-----------------------------------------------------------------------------
599 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
601 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
602 save_cflags="$CFLAGS"
603 CFLAGS="$CFLAGS -fgnu89-inline"
604 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
605 AC_MSG_RESULT($use_gnu89_inline)
606 if test "x-$use_gnu89_inline" = "x-yes" ; then
607     gnu89_inline="-fgnu89-inline"
609 CFLAGS="$save_cflags"
611 #-----------------------------------------------------------------------------
613 AC_MSG_CHECKING([for type of build])
614 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")
616 if test "$build_type" = "nightly"; then
617     build_type_string="NIGHTLY"
618 elif test "$build_type" = "snapshot"; then
619     build_type_string="SNAPSHOT"
620 elif test "$build_type" = "milestone"; then
621     build_type_string="MILESTONE"
622 elif test "$build_type" = "release"; then
623     build_type_string="RELEASE"
624 else
625     build_type_string="PERSONAL"
626     build_type="personal"
629 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
631 AC_MSG_RESULT($build_type)
633 #-----------------------------------------------------------------------------
634 all_debug_types="messages stack modules mungwall symbols"
636 AC_MSG_CHECKING([which debug types to enable])
637 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)]),
638  debug="$enableval",debug="")
640 if test "$debug" = "" -o "$debug" = "no"; then
641     debug="none"
642 elif test "$debug" = "yes"; then
643     debug="all"
646 if test "$debug" = "all" ; then
647     debug="messages stack modules symbols"
648     for d in $all_debug_types; do
649         export aros_${d}_debug="1"
650     done
651 else
652     for d in $all_debug_types; do
653         export aros_${d}_debug="0"
654     done
657 if test "$debug" != "none"; then
658     debug=`echo $debug | sed s/,/\ /g`
659     for d in $debug; do
660         found="0"
661         for d2 in $all_debug_types; do
662             if test "$d2" = "$d"; then
663                 found="1"
664                 break
665             fi
666         done
667         if test "$found" = "0"; then
668             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
669         fi
670         export aros_${d}_debug="1"
671     done
672     aros_debug="yes"
674 AC_MSG_RESULT($debug)
676 if test "$aros_messages_debug" = "1"; then
677     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
678 else
679     aros_messages_debug=""
681 if test "$aros_symbols_debug" = "1"; then
682     aros_symbols_debug="-g"
683 else
684     aros_symbols_debug=""
687 # These are the flags to pass when compiling debugged programs
688 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
689 aros_debug_aflags=""
690 aros_debug_ldflags="$aros_symbols_debug"
692 #-----------------------------------------------------------------------------
693 #   Checking for distcc and ccache.
695 #   Always apply the transforms in this particular order. Basically you should
696 #   always run 'ccache distcc compiler' in that order for the best performance.
698 AC_MSG_CHECKING([whether to enable distcc])
699 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
700 if test "$distcc" != "" -a "$distcc" != "no"; then
701     # AC_CHECK_PROG will print out the result in this case
702     AC_PATH_PROG(DISTCC,[distcc],distcc,)
703 else
704     AC_MSG_RESULT(no)
707 AC_MSG_CHECKING([whether to enable ccache])
708 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
709 if test "$ccache" != "" -a "$ccache" != "no"; then
710     # AC_CHECK_PROG will print out the result in this case
711     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
712 else
713     AC_MSG_RESULT(no)
716 #-----------------------------------------------------------------------------
717 AC_MSG_CHECKING([what specific host gcc version to use])
718 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")
719 AC_MSG_RESULT($kernel_tool_version)
721 #-----------------------------------------------------------------------------
722 AC_MSG_CHECKING([what specific target gcc version to use])
723 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")
724 AC_MSG_RESULT($target_tool_version)
726 #-----------------------------------------------------------------------------
727 AC_MSG_CHECKING([what optimization flags to use])
728 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
729 if test "$optimization" = "unknown"; then
730     dnl default is -O2 for normal builds, -O0 for debug builds
731     if test "$debug" != "none"; then
732         optimization="-O0"
733     else
734         optimization="-O2"
735     fi
737 aros_config_cflags="$aros_config_cflags $optimization"
738 AC_MSG_RESULT($optimization)
740 #-----------------------------------------------------------------------------
741 AC_MSG_CHECKING([what paranoia flags to use])
742 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
743 if test "$paranoia_flags" = "default"; then
744         paranoia_flags=""
745 else if test "$paranoia_flags" = "yes"; then
746         paranoia_flags="-Wall -Werror"
747 fi fi
748 AC_MSG_RESULT($paranoia_flags)
749 aros_config_cflags="$aros_config_cflags $paranoia_flags"
751 #-----------------------------------------------------------------------------
752 AC_MSG_CHECKING([what target variant to enable])
753 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
754 if test "$target_variant" = ""; then
755     aros_target_variant=""
756     aros_target_suffix=""
757     enableval="none"
758 else
759     aros_target_variant="$target_variant"
760     aros_target_suffix="-$target_variant"
762 AC_MSG_RESULT($enableval)
764 #-----------------------------------------------------------------------------
765 # Target-specific defaults. You can override then on a per-target basis.
767 # Bootloader name. Currently used by PC target.
768 target_bootloader="none"
770 #-----------------------------------------------------------------------------
771 # Additional options for some specific targets
773 case "$aros_target_variant" in
774 ios)
775     AC_MSG_CHECKING([XCode path])
776     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")
777     AC_MSG_RESULT($aros_xcode_path)
779     AC_MSG_CHECKING([what iOS SDK version to use])
780     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")
781     AC_MSG_RESULT($aros_sdk_version)
783     ;;
785 "android")
786     AC_MSG_CHECKING([Android SDK path])
787     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)
788     AC_MSG_RESULT($aros_android_sdk)
790     AC_MSG_CHECKING([Android NDK path])
791     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
792     AC_MSG_RESULT($aros_android_ndk)
794     AC_MSG_CHECKING([what Android SDK version to use])
795     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")
796     AC_MSG_RESULT($aros_sdk_version)
798     if test "$aros_android_ndk" != "none"; then
799         AC_MSG_CHECKING([what Android NDK version to use])
800         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")
801         AC_MSG_RESULT($aros_ndk_version)
802     fi
804     export PATH="$aros_android_sdk/tools:$PATH"
805     AC_PATH_PROG(android_tool, $android_tool)
806     AROS_REQUIRED(android,$android_tool)
808     aros_android_level=android-$aros_sdk_version
809     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
810         echo "Platform $aros_android_level is not installed in your SDK"
811         echo "Use --with-sdk-version=<API level number> to select another platform version"
812         echo "You can check what plaform versions are installed in your SDK"
813         echo "by examining contents of $aros_android_sdk/platforms directory"
814         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
815     fi
817     AC_PATH_PROG(ant, ant)
818     if test "$ant" = ""; then
819         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
820     fi
822     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
823     if test "$host_os" = "mingw32"; then
824         android_tool="cmd //c $android_tool"
825     fi
827     ;;
828 esac
830 #-----------------------------------------------------------------------------
831 # External toolchains
832 kernel_tool_prefix="none"
833 aros_tool_prefix="none"
834 elf_tool_prefix="${target_cpu}-elf-"
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                 kernel_tool_prefix="arm-linux-gnueabi-"
910                 ;;
911             *)
912                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
913                 ;;
914         esac
915         case "$aros_target_variant" in
916             android)
918                 dnl Not all Linux CPUs are supported by Android
919                 if test "$android_ndk_arch" = ""; then
920                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
921                 fi
923                 aros_default_wbwidth=320
924                 aros_default_wbheight=480
925                 if test "$aros_android_ndk" = "none"; then
926                     dnl Use standalone toolchain, don't adjust paths
927                     aros_kernel_cflags="-mandroid"
928                     aros_kernel_ldflags="-mandroid"
929                     CFLAGS="-mandroid"
930                 else
931                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
932                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
933                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
934                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
935                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
936                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
937                 fi
938                 need_x11=no
939                 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
940                 dnl in order not to fill mmakefiles with garbage
941                 x11_hidd_target=kernel-hidd-androidgfx-kobj
942                 # Disable implicit PIC mode
943                 aros_target_cflags="$aros_target_cflags -fno-pic"
944                 kernel_tool_prefix="$android_tool_prefix-"
945             ;;
946         esac
947     ;;
949     pc)
950         aros_target_arch="pc"
951         aros_shared_default="no"
952         target_bootloader="grub2"
953         case "$target_cpu" in
954             *i?86*)
955                 aros_target_cpu="i386"
957                 dnl If somebody hasn't already set the target object
958                 dnl format, then use this value. Mostly to support
959                 dnl FreeBSD cross-compilation.
960                 dnl TODO: Remove when we always use our compiler.
962                 if test "$aros_object_format" = "" ; then
963                     aros_object_format="elf_i386"
964                 fi
965                 aros_flavour="standalone"
966                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
967                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
968                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
969                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
970                 aros_config_ldflags="-m32 -march=i486"
971                 aros_kernel_ldflags="-melf_i386"
972                 aros_default_wbwidth=640
973                 aros_default_wbheight=480
974                 gcc_target_cpu="i386"
975                 ;;
976             *x86_64*)
977                 aros_target_cpu="x86_64"
978                 aros_serial_debug=1
979                 if test "$aros_object_format" = "" ; then
980                     aros_object_format="elf_x86_64"
981                 fi
982                 aros_flavour="standalone"
983                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
984                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
985                 aros_kernel_ldflags=""
986                 aros_default_wbwidth=640
987                 aros_default_wbheight=480
988                 ;;
989             *)
990                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
991                 ;;
992         esac
993         ;;
995     prep)
996         aros_target_arch="prep"
997         aros_shared_default="no"
998         aros_target_cpu="ppc"
999         aros_object_format="elf32ppc"
1000         aros_flavour="ppcnative"
1001         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1002         aros_kernel_ldflags=""
1003         aros_default_wbwidth=640
1004         aros_default_wbheight=480
1005         gcc_target_cpu="ppc"
1006         ;;
1008     freebsd*)
1009         aros_target_arch="freebsd"
1010         aros_target_family="unix"
1011         aros_target_cpu="i386"
1012         aros_flavour="emulation"
1013         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1014         gcc_target_cpu="i386"
1016         aros_target_strip_flags="-x"
1017         ;;
1019     darwin*)
1020         aros_target_arch="darwin"
1021         aros_target_family="unix"
1022         aros_flavour="emulation"
1023         case "$target_cpu" in
1024             *i?86*)
1025                 aros_ios_platform="iPhoneSimulator"
1026                 aros_target_cpu="i386"
1027                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1028                 aros_kernel_ldflags=""
1029                 aros_macosx_version="10.4"
1030                 aros_default_wbdepth=8
1031                 gcc_target_cpu="i386"
1032                 aros_object_format="elf_i386"
1033                 aros_kernel_ar_flags="-cr"
1034                 aros_target_strip_flags="-x"
1035                 kernel_tool_flags="-m32"
1036                 ;;
1037             *x86_64*)
1038                 aros_target_cpu="x86_64"
1039                 aros_object_format="elf_x86_64"
1040                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1041                 aros_macosx_version="10.6"
1042                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1043                 aros_kernel_cflags="-m64"
1044                 aros_kernel_ldflags="-m64"
1045                 aros_target_cflags="-mcmodel=large"
1046                 aros_default_wbdepth=8
1047                 aros_kernel_ar="ar"
1048                 aros_kernel_ar_flags="-cr"
1049                 aros_kernel_ld="ld"
1050                 aros_kernel_ranlib="ranlib"
1051                 ;;
1052             *ppc*)
1053                 aros_target_cpu="ppc"
1054                 aros_object_format="elf32ppc"
1055                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1056                 aros_kernel_ldflags=""
1057                 aros_macosx_version="10.0"
1058                 aros_default_wbdepth=8
1059                 gcc_target_cpu="ppc"
1060                 aros_kernel_ar="ar"
1061                 aros_kernel_ar_flags="-cr"
1062                 aros_kernel_ld="ld -arch ppc"
1063                 aros_kernel_ranlib="ranlib -arch ppc"
1064                 kernel_tool_prefix="powerpc-apple-darwin10-"
1065                 ;;
1066             *arm*)
1067                 aros_ios_platform="iPhoneOS"
1068                 aros_target_cpu="arm"
1069                 aros_object_format="armelf_linux_eabi"
1070                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1071                 aros_arch_libs="-laeabi"
1072                 aros_default_wbdepth=8
1073                 gcc_target_cpu="arm"
1074                 aros_kernel_ar="ar"
1075                 aros_kernel_ar_flags="-cr"
1076                 aros_kernel_ld="ld -arch arm"
1077                 aros_kernel_ranlib="ranlib -arch arm"
1078                 kernel_tool_prefix="arm-apple-darwin10-" 
1079                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1080                 ;;
1081             *)
1082                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1083                 ;;
1084         esac
1085         case "$aros_target_variant" in
1086             ios)
1087                 aros_ios_version="3.0"
1088                 aros_default_wbwidth=320
1089                 aros_default_wbheight=480
1090                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1091                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1092                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1093                 need_x11=no
1094                 # This is here because it may depend on iOS or SDK version
1095                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1096                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1097                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1098             ;;
1099             *)
1100                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1101                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1102             ;;
1103         esac
1104         ;;
1106     dragonfly*)
1107         aros_target_arch="dragonfly"
1108         aros_target_family="unix"
1109         aros_flavour="emulation"
1110         case "$target_cpu" in
1111             *i?86*)
1112                 aros_target_cpu="i386"
1113                 aros_object_format="elf_i386"
1114                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1115                 ;;
1116             *x86_64*)
1117                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1118                 aros_target_cpu="x86_64"
1119                 aros_object_format="elf_x86_64"
1120                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1121                 ;;
1122             *)
1123                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1124                 ;;
1125         esac
1126         ;;
1128     netbsd*)
1129         aros_target_arch="netbsd"
1130         aros_target_family="unix"
1131         case "$target_cpu" in
1132             *m68k*)
1133                 aros_target_cpu="m68k"
1134                 aros_object_format="m68kelf"
1135                 aros_flavour="emulcompat"
1136                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1137                 gcc_target_cpu="mc68000"
1138                 ;;
1139             *i?86*)
1140                 aros_target_cpu="i386"
1141                 aros_object_format="elf_i386"
1142                 aros_flavour="emulation"
1143                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1144                 aros_default_wbdepth=8
1145                 gcc_target_cpu="i386"
1146                 ;;
1147             *)
1148                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1149                 ;;
1150         esac
1151         aros_target_genmap="-Wl,-M -Xlinker >"
1152         aros_flavour="emulation"
1153         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1154         ;;   
1156     openbsd*)
1157         aros_target_arch="openbsd"
1158         aros_target_family="unix"
1159         case "$target_cpu" in
1160             *i?86*)
1161                 aros_target_cpu="i386"
1162                 aros_object_format="elf_i386"
1163                 aros_flavour="emulation"
1164                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1165                 gcc_target_cpu="i386"
1166                 ;;
1167             *)
1168                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1169                 ;;
1170         esac
1171         aros_target_genmap="-Wl,-M -Xlinker >"
1172         aros_target_nm_flags="-u"
1173         aros_flavour="emulation"
1174         ;;
1176     solaris*)
1177         aros_target_arch="solaris"
1178         aros_target_family="unix"
1179         case "$target_cpu" in
1180            *i?86*)
1181                aros_target_cpu="i386"
1182                aros_object_format="elf_i386"
1183                aros_flavour="emulation"
1184                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1185                aros_default_wbdepth=8
1186                gcc_target_cpu="i386"
1187                ;;
1188             *sparc*)
1189                 aros_target_cpu="sparc"
1190                 aros_object_format="elf_sparc"
1191                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1192                 gcc_target_cpu="sparc"
1193                 ;;
1194             *)
1195                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1196                 ;;
1197         esac
1198         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1199         aros_flavour="emulation"
1200         ;;
1202     morphos*)
1203         aros_target_arch="morphos"
1204         aros_shared_default="no"
1205         aros_target_cpu="ppc"
1206         aros_object_format="elf_ppc"
1207         aros_flavour="nativecompat"
1208         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1209         gcc_target_cpu="ppc"
1210         ;;
1212     sam440)
1213         aros_target_arch="sam440"
1214         aros_shared_default="no"
1215         aros_target_cpu="ppc"
1216         aros_object_format="elf32ppc"
1217         aros_flavour="ppcnative"
1218         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1219         aros_kernel_ldflags=""
1220         aros_default_wbwidth=1024
1221         aros_default_wbheight=768
1222         aros_default_wbdepth=24
1223         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1224         gcc_target_cpu="powerpc"
1225         ;;
1227     efika)
1228         aros_target_arch="efika"
1229         aros_shared_default="no"
1230         aros_target_cpu="arm"
1231         aros_object_format="armelf_linux_eabi"
1232         aros_flavour="standalone"
1233         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1234         aros_kernel_ldflags=""
1235         aros_default_wbwidth=1024
1236         aros_default_wbheight=600
1237         aros_arch_libs="-laeabi"
1238         gcc_default_cpu="armv7-a"
1239         gcc_default_fpu="vfpv3"
1240         gcc_default_float_abi="softfp"
1241         aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1242         aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1243         ;;
1244         
1245     chrp)
1246     aros_target_arch="chrp"
1247     aros_shared_default="no"
1248     aros_target_cpu="ppc"
1249     aros_object_format="elf32ppc"
1250     aros_flavour="ppcnative"
1251     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1252     aros_kernel_ldflags=""
1253     aros_default_wbwidth=640
1254     aros_default_wbheight=480
1255     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
1256     gcc_target_cpu="powerpc"
1257         case "$aros_target_variant" in
1258             efika)
1259             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1260             ;;
1261         esac
1262     ;;
1264     amiga*)
1265         aros_target_arch="amiga"
1266         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1267         aros_shared_default="no"
1269         case "$target_cpu" in
1270             *m68k*)
1271                 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")
1272                 aros_enable_mmu=no
1273                 aros_target_cpu="m68k"
1274                 aros_object_format="m68kelf"
1275                 aros_flavour="standcompat"
1276                 gcc_target_cpu="m68000"
1277                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -Os"
1278                 aros_config_aflags="$aros_config_aflags -${gcc_target_cpu}"
1279                 # Needed to get the correct multilib
1280                 aros_config_ldflags="-${gcc_target_cpu}"
1281                 aros_shared_ldflags="-${gcc_target_cpu}"
1282                 aros_kernel_ldflags="-${gcc_target_cpu}"
1283                 aros_target_nostdlib_ldflags="-${gcc_target_cpu}"
1284                 aros_target_strip_flags="-R.comment --strip-debug"
1285                 aros_default_wbwidth=640
1286                 aros_default_wbheight=256
1287                 aros_default_wbdepth=2
1288                 ;;
1289             *ppc*)
1290                 aros_cpu="ppc"
1291                 aros_flavour="native"
1292                 gcc_target_cpu="ppc"
1293                 ;;
1294             *)
1295                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1296                 ;;
1297         esac
1298         ;;
1300     mingw*)
1301         aros_target_arch="mingw32"
1302         aros_shared_default="no"
1303         aros_flavour="emulation"
1304         aros_shared_cflags=""
1305         need_crosstools="yes"
1306         need_dlopen="no"
1307         rescomp="windres"
1308         case "$target_cpu" in
1309             *i?86*)
1310                 aros_target_cpu="i386"
1311                 aros_object_format="elf_i386"
1312                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1313                 aros_default_wbdepth=8
1314                 gcc_target_cpu="i386"
1316                 kernel_tool_prefix="i386-mingw32-"
1317                 ;;
1318             *x86_64*)
1319                 aros_target_cpu="x86_64"
1320                 aros_object_format="elf_x86_64"
1321                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1322                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1323                 aros_default_wbdepth=8
1324                 kernel_tool_prefix="x86_64-w64-mingw32-"
1325                 ;;
1326             *arm*)
1327                 aros_target_cpu="arm"
1328                 aros_object_format="armelf_linux_eabi"
1329                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1330                 aros_arch_libs="-laeabi"
1331                 aros_default_wbdepth=8
1332                 gcc_target_cpu="arm"
1333                 gcc_default_float_abi="soft"
1334                 kernel_tool_prefix="arm-mingw32ce-"
1335                 aros_default_wbwidth=160
1336                 aros_default_wbheight=160
1337                 ;;
1338             *)
1339                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1340                 ;;
1341         esac
1342         if test $host_os = "cygwin"; then
1343                 aros_kernel_cflags="-mno-cygwin"
1344         fi
1345     ;;
1346     pp*)
1347         aros_target_arch="pp"
1348         aros_shared_default="no"
1349         case "$target_cpu" in
1350             *m68k*)
1351                 aros_target_cpu="m68k"
1352                 aros_object_format="m68kelf"
1353                 aros_flavour="palmnative"
1354                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1355                 aros_default_wbwidth=160
1356                 aros_default_wbheight=160
1357                 aros_default_wbdepth=1
1358                 aros_target_ar_flags="cru"
1359                 aros_compiler_libs="-lgcc1"
1360                 aros_shared_default=no
1361                 aros_shared_cflags="-fpic"
1362                 aros_shared_aflags=""
1363                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1364                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1365                 aros_debug_cflags="$aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
1366                 aros_debug_aflags=""
1367                 aros_debug_ldflags="$aros_symbols_debug"
1368                 aros_mungwall_debug="0"
1369                 aros_modules_debug="0"
1370                 gcc_target_cpu="mc68000"
1371                 ignore_undefined_symbols="-ius"
1372                 ;;
1373            *)
1374                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1375                 ;;
1376         esac
1377         ;;
1379     mac*)
1380         aros_target_arch="mac"
1381         aros_shared_default="no"
1382         case "$target_cpu" in
1383             *m68k*)
1384                 aros_target_cpu="m68k"
1385                 aros_object_format="m68kelf"
1386                 aros_flavour="mac68knative"
1387                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1388                 aros_default_wbwidth=512
1389                 aros_default_wbheight=384
1390                 aros_default_wbdepth=8
1391                 aros_target_ar_flags="cru"
1392                 aros_compiler_libs="-lgcc1"
1393                 aros_shared_default=no
1394                 aros_shared_cflags="-fpic"
1395                 aros_shared_aflags=""
1396                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1397                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1398                 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug -mc68000"
1399                 aros_debug_aflags=""
1400                 aros_debug_ldflags="$aros_symbols_debug"
1401                 aros_mungwall_debug="0"
1402                 aros_modules_debug="0"
1403                 gcc_target_cpu="mc68000"
1404                 ignore_undefined_symbols="-ius"
1405                 ;;
1406            *)
1407                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1408                 ;;
1409         esac
1410         ;;
1412     *)
1413         AC_MSG_ERROR([Unsupported target architecture $target])
1414         ;;
1415 esac
1417 #-----------------------------------------------------------------------------
1418 crosstools_guess=yes
1420 AC_MSG_CHECKING([Kernel toolchain prefix])
1421 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1422 AC_MSG_RESULT($kernel_tool_prefix)
1424 AC_MSG_CHECKING([ELF toolchain prefix])
1425 AC_ARG_WITH(elf-toolchain-prefix,AC_HELP_STRING([--with-elf-toolchain-prefix=...],[Specify crosscompile toolchain prefix to wrap for AROS objects]),[elf_tool_prefix="$withval"
1426                                                  crosstools_guess=no])
1427 AC_MSG_RESULT($elf_tool_prefix)
1429 AC_MSG_CHECKING([AROS toolchain prefix])
1430 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain]),[aros_tool_prefix="$withval"
1431                 crosstools_guess=no])
1432 if test "$aros_tool_prefix" = "yes" ; then
1433     aros_tool_prefix=$aros_target_cpu-aros-
1435 AC_MSG_RESULT($aros_tool_prefix)
1437 #-----------------------------------------------------------------------------
1438 #   Checking if we should build crosstools..
1439 AC_MSG_CHECKING([whether to build crosstools])
1440 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1441 AC_MSG_RESULT($crosstools)
1443 if test "${crosstools}" = "yes"; then
1444     if test "${crosstools_guess}" = "no"; then
1445         AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1446     fi
1448     AC_MSG_CHECKING([where to install the crosstools binaries])
1449     AC_ARG_WITH(aros-toolchain-install,AC_HELP_STRING([--with-aros-toolchain-install=DIR],[Where to install or search for cross tools binaries]),[aros_toolchain_install=$withval])
1450     if test "x$aros_toolchain_install" = "x"; then
1451         AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1452     else
1453         AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1454         PATH="$AROS_CROSSTOOLSDIR:$PATH"
1455     fi
1456     AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1460 # Now process extra architecture-specific options.
1461 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1462 # as well as floating-point ABI.
1463 case "$aros_target_cpu" in
1464 arm)
1465     dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1466     if test "$gcc_default_cpu" = ""; then
1467         gcc_default_cpu="armv6"
1468     fi
1469     if test "$gcc_default_fpu" = ""; then
1470         gcc_default_fpu="vfp"
1471     fi
1472     if test "$gcc_default_float_abi" = ""; then
1473         gcc_default_float_abi="softfp"
1474     fi
1476     AC_MSG_CHECKING([Which minimum CPU to use])
1477     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)
1478     AC_MSG_RESULT($aros_gcc_cpu)
1480     AC_MSG_CHECKING([Which minimum FPU to use])
1481     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)
1482     AC_MSG_RESULT($aros_gcc_fpu)
1484     AC_MSG_CHECKING([Which floating point ABI to use])
1485     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)
1486     AC_MSG_RESULT($aros_gcc_float_abi)
1488     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"
1489     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"
1490     ;;
1491 esac
1493 # Some formats need custom ELF specs.
1494 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1495 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1496     elf_specs_in=config/${aros_object_format}-specs.in
1497 else
1498     elf_specs_in=config/elf-specs.in
1501 AC_MSG_CHECKING([what specific AROS gcc version to use])
1502 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="")
1503 AC_MSG_RESULT($aros_gcc_version)
1505 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1506 # Since we override specs, we may need to put these defines there
1507 if test "$gcc_target_cpu" != ""; then
1508     gcc_target_cpu="-D__${gcc_target_cpu}__"
1511 AC_MSG_CHECKING([where to download sourcecode for external ports])
1512 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1513 if test "$with_portssrcdir" = "default"; then
1514     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1515 else
1516     AROS_PORTSSRCDIR="$with_portssrcdir"
1518 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1520 AC_MSG_CHECKING([which bootloader to use])
1521 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1522 if test "$target_bootloader" = "none"; then
1523     aros_target_bootloader=""
1524 else
1525     aros_target_bootloader="$target_bootloader"
1527 AC_MSG_RESULT($target_bootloader)
1529 AC_MSG_CHECKING([which icon-set to use])
1530 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1531 if test "$target_iconset" = "default"; then
1532     aros_target_iconset="Gorilla"
1533     target_iconset="default (Gorilla)"
1534 else
1535     aros_target_iconset="$target_iconset"
1537 AC_MSG_RESULT($target_iconset)
1539 AC_MSG_CHECKING([which GUI Theme to use])
1540 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1541 if test "$target_guitheme" = "default"; then
1542     aros_target_guitheme="Ice"
1543 else
1544     aros_target_guitheme="$target_guitheme"
1546 AC_MSG_RESULT($aros_target_guitheme)
1548 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1549 # for target code)
1550 cross_compiling=no
1552 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
1553 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1554     cross_compiling=yes
1557 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
1558 dnl The flag itself is given in per-target section, because some targets require to pass it
1559 dnl in a different manner, otherwise some tests fail.
1560 dnl TODO: Justify this.
1561 if test "$aros_host_cpu" == "x86_64" ; then
1562     if test "$aros_target_cpu" == "i386" ; then
1563         cross_compiling=no
1564     fi
1567 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1568     dnl For a hosted build we are cross-compiling if host OS differs from build OS.
1569     dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
1570     dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
1571     dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
1572     dnl used to build bootstrap for target arch in either case.
1573     dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
1574     dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
1575     dnl perhaps introducing aros_host_variant
1576     if test "$aros_host_arch" != "$aros_target_arch" ; then
1577         cross_compiling=yes
1578     fi
1579 else
1580     dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
1581     dnl it as kernel_cc. If not, (e. g. we are on Windows or Darwin), we need a crosscompiler.
1582     if test "$cross_compile_native" ; then
1583         cross_compiling=yes
1584     fi
1587 if test "$cross_compiling" = "no" ; then
1588     kernel_tool_prefix=""
1591 #######################################################################
1592 ## Compute what toolchains to use, and their paths                   ##
1593 #######################################################################
1595 # This takes, as input:
1596 #   crosstools             {yes,no}
1597 #   aros_gcc_version       {default,[version]}
1598 #   kernel_tool_prefix     {none,[some-arch-os-]}
1599 #   aros_tool_prefix       ${target_cpu}-aros-
1601 # The output is
1602 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1603 #        Where the 'kernel' binaries are located
1604 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1605 #        Where the 'target' binaries are located
1606 #        (not the symlink farm - that is aros_target_*!)
1608 # The rules are:
1609 #   if crosstools then
1610 #      if kernel_tools_prefix = "no-kernel-prefix-"
1611 #          aros_kernel_* = crosstools cc paths
1612 #          aros_kernel_cc = elf cc wrapper around crosstools cc
1613 #      else
1614 #          VALIDATE(${kernel_tools_prefix}*)
1615 #          aros_kernel_* = ${kernel_tools_prefix}*
1616 #          if ${kernel_tools_prefix}cc is an AROS gcc
1617 #              aros_kernel_cc = ${kernel_tools_prefix}cc
1618 #          else
1619 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1620 #          fi
1621 #      fi
1623 #      orig_target_* = aros built crosstools
1624 #      orig_target_cc = elf cc wrapper around crosstools cc
1625 #   else
1626 #      VALIDATE(${kernel_tools_prefix}*)
1628 #      orig_target_* = aros_kernel_*
1629 #      if aros_kernel_cc is an AROS gcc
1630 #          orig_target_cc = aros_kernel_cc
1631 #      else
1632 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
1633 #      fi
1634 #   fi
1636 target_tool_prefix="${target_cpu}-aros-"
1638 AC_MSG_CHECKING([which kernel tools])
1639 AC_MSG_RESULT([$kernel_tool_prefix]);
1641 if test "$kernel_tool_prefix" = "none" ; then
1642     dnl ELF wrapper can be used only for native bootstrap
1643     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1644         AC_MSG_ERROR([--with-kernel-tool-prefix= is required for this arch])
1645     fi
1646 else
1647     # Kernel tools required - find them
1648     # Note that 'normally', aros_kernel_* overrides will
1649     # empty, unless specified in the per-arch sections above.
1650     AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
1651     AROS_REQUIRED(cpp,$aros_kernel_cpp)
1652     if test "x$aros_kernel_cc" = "x"; then
1653         aros_kernel_cc=${kernel_tool_prefix}gcc
1654     fi
1655     AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${aros_gcc_version})
1656     AROS_REQUIRED(cc,$aros_kernel_cc)
1657     if test "x$aros_kernel_cxx" = "x"; then
1658         aros_kernel_cxx=${kernel_tool_prefix}g++
1659     fi
1660     AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${aros_gcc_version})
1661     # If it's set, make sure it's really there
1662     if test "x$aros_kernel_cxx" != "x" ; then
1663         AROS_REQUIRED(cxx,$aros_kernel_cxx)
1664     fi
1665     AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1666     AROS_REQUIRED(ld,$aros_kernel_ld)
1667     AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1668     AROS_REQUIRED(as,$aros_kernel_as)
1669     AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1670     AROS_REQUIRED(ar,$aros_kernel_ar)
1671     AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1672     AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1673     AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1674     AROS_REQUIRED(nm,$aros_kernel_nm)
1675     AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1676     AROS_REQUIRED(strip,$aros_kernel_strip)
1678     # Objcopy and objdump are not required for the kernel
1679     # toolchain on many architectures.
1680     # So we'll look for them, but not make them strictly required.
1681     AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1682     AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1683     if test "x${crosstools}" != "xyes" ; then
1684         AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1685         AROS_REQUIRED(objdump,$aros_kernel_objdump)
1686     fi
1689 AC_MSG_CHECKING([which target tools to use])
1690 if test "$crosstools" = "yes"; then
1691     AC_MSG_RESULT([$target_tool_prefix])
1692     # We are are building AROS crosstools
1693     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1694     orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1695     orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1696     orig_target_cpp="${tmp_tool_prefix}cpp"
1697     orig_target_ld="${tmp_tool_prefix}ld"
1698     orig_target_as="${tmp_tool_prefix}as"
1699     orig_target_ar="${tmp_tool_prefix}ar"
1700     orig_target_ranlib="${tmp_tool_prefix}ranlib"
1701     orig_target_nm="${tmp_tool_prefix}nm"
1702     orig_target_strip="${tmp_tool_prefix}strip"
1703     orig_target_objcopy="${tmp_tool_prefix}objcopy"
1704     orig_target_objdump="${tmp_tool_prefix}objdump"
1705 else
1706     # Determine whether AROS or ELF tools should be used
1707     if test "$aros_tool_prefix" = "none"; then
1708         aros_tool_prefix="${elf_tool_prefix}"
1709     fi
1711     AC_MSG_RESULT([$aros_tool_prefix])
1712     # We are *not* building AROS crosstools - use the AROS or ELF tools
1713     AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}cpp)
1714     AROS_REQUIRED(cpp,$orig_target_cpp)
1715     AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}gcc)
1716     AROS_REQUIRED(cc,$orig_target_cc)
1717     if test "x$orig_target_cxx" != "x" ; then
1718         AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}g++)
1719         AROS_REQUIRED(cxx,$orig_target_cxx)
1720     fi
1721     AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}ld)
1722     AROS_REQUIRED(ld,$orig_target_ld)
1723     AROS_TOOL_TARGET(orig_target_as,as,${aros_tool_prefix}as)
1724     AROS_REQUIRED(as,$orig_target_as)
1725     AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}ar)
1726     AROS_REQUIRED(ar,$orig_target_ar)
1727     AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}ranlib)
1728     AROS_REQUIRED(ranlib,$orig_target_ranlib)
1729     AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}nm)
1730     AROS_REQUIRED(nm,$orig_target_nm)
1731     AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}strip)
1732     AROS_REQUIRED(strip,$orig_target_strip)
1733     AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}objcopy)
1734     AROS_REQUIRED(objcopy,$orig_target_objcopy)
1735     AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}objdump)
1736     AROS_REQUIRED(objdump,$orig_target_objdump)
1739 if test "$kernel_tool_prefix" = "none" ; then
1740     # No kernel tools specified
1741     # Assume target tools == kernel tools with ELF wrapper
1742     aros_kernel_cc=$orig_target_cc
1743     aros_kernel_cxx=$orig_target_cxx
1744     aros_kernel_cpp=$orig_target_cpp
1745     aros_kernel_ld=$orig_target_ld
1746     aros_kernel_as=$orig_target_as
1747     aros_kernel_ar=$orig_target_ar
1748     aros_kernel_ranlib=$orig_target_ranlib
1749     aros_kernel_nm=$orig_target_nm
1750     aros_kernel_strip=$orig_target_strip
1751     aros_kernel_objcopy=$orig_target_objcopy
1752     aros_kernel_objdump=$orig_target_objdump
1753     use_kernel_cc_wrapper=yes
1756 # At this point, all aros_kernel_* and aros_target_* 
1757 # tools should be set up correctly
1759 CC="$aros_kernel_cc $kernel_tool_flags"
1760 CPP="$aros_kernel_cpp"
1762 #-----------------------------------------------------------------------------
1764 # Disable pointer-signedness warnings if the compiler recognises the option
1766 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1767 save_cflags="$CFLAGS"
1768 if test "$crosstools" != "yes" ; then
1769     CFLAGS="$CFLAGS -Wno-pointer-sign"
1770     AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1771 else
1772     # we do know it is supported for the smallest version of gcc we are going to build
1773     # we assume it's also supported by later versions
1774     use_no_sign_warning=yes
1776 AC_MSG_RESULT($use_no_sign_warning)
1777 if test "x-$use_no_sign_warning" = "x-yes" ; then
1778     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1780 CFLAGS="$save_cflags"
1782 #-----------------------------------------------------------------------------
1784 # Find all the tools we need to compile. This could be cross-compiling
1785 # though! If that is the case we use the GNU form of the target and
1786 # simply add this to the front of the binary name. This is rather simple,
1787 # but it should work under most circumstances.
1789 # The default tools are to use the same as the host, but only if the
1790 # host and target CPU are the same. With GCC this is normally enough.
1793 aros_cc_pre=""
1794 aros_shared_ld="$aros_host_ld"
1796 aros_target_mkdep="$aros_host_mkdep"
1798 # The default tools executables to be linked to.
1799 if test "$rescomp" != ""; then
1800     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
1801     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1804 # Set up the sources for the symlink farm
1805 if test "$crosstools" = "yes"; then
1806     crosstools_target=tools-crosstools
1807 else
1808     crosstools_cxx_target=tools-crosstools
1811 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1812 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1815 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1816 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1817 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1818 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1819 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1820 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1821 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1823 # aros_cc_pre is a variable that is added to the front of the compiler name
1824 # in the generated aros-gcc shell script. We need this to enable the cache
1825 # to work across cleaned builds. Also, support DISTCC using the correct
1826 # environment variable.
1829 if test "x${DISTCC}" != "x" ; then
1830     if test "x${CCACHE}" != "x" ; then
1831         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1832     else
1833         aros_cc_pre="${DISTCC} "
1834     fi
1835 else
1836     if test "x${CCACHE}" != "x" ; then
1837         aros_cc_pre="${CCACHE} "
1838     fi
1841 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1843 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1844 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1845 AC_SUBST(aros_target_nix_ldflags,-nix)
1846 AC_SUBST(aros_target_detach_ldflags,-detach)
1847 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1849 # Target tools
1850 if test "$crosstools" != "yes"; then
1851     if test "$GCC" = "yes"; then
1852         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1853     fi
1854 else
1855     # We do not know which gcc version we are going to build and what we need to know
1856     # here is different for different versions so this will be set later during the
1857     # build of crosstools.
1858     aros_target_cc_path=@aros_target_cc_path@
1860 aros_target_cpp="${prefix}cpp"
1861 aros_target_cc="${prefix}gcc"
1862 aros_target_cxx="${prefix}g++"
1863 aros_target_as="${prefix}as"
1864 aros_target_ld="${prefix}ld"
1865 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1866 aros_target_objcopy="${prefix}objcopy"
1867 aros_target_objdump="${prefix}objdump"
1868 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1869 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1870 aros_target_strip="${prefix}strip"
1871 aros_plain_nm="${prefix}nm"
1872 aros_plain_ar="${prefix}ar"
1874 AC_ARG_ENABLE(includes,
1875 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1876 [aros_target_incl=$enable_includes], [aros_target_incl="/usr/include"])
1878 if test "$aros_kernel_includes" = ""; then
1879     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1880         aros_kernel_includes="-isystem $aros_target_incl"
1881     fi
1884 if test "$aros_kernel_includes" != "" ; then
1885     dnl find out about the kernel cc's include path
1886     AC_MSG_CHECKING([for the kernel compiler's include path])
1887     if test "$aros_kernel_cc_includes" = "" ; then
1888         # Try to guess where the directory is.
1889         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1890         if test -d $aros_kernel_cc_includes; then
1891             # Check if there is also an include-fixed directory and add it
1892             # to kernel compiler's include path as it may contain some of
1893             # the headers we need.
1894             if test -d "$aros_kernel_cc_includes"-fixed; then
1895                 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1896             fi
1897             # Check for specific includes directory. Neede for Ubuntu 11.10
1898             if test -d "/usr/include/i386-linux-gnu"; then
1899                 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1900             fi
1901         else
1902             # The directory doesn't exist, we need to do some more work.
1903             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1905             # These are the headers we're looking for.
1906             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1907                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1908                      zutil.h stdint.h"
1910             dirs=
1911             for h in $headers; do
1912                 # Which other headers are needed by each of the above?
1913                 deps=$(echo "#include <$h>" | \
1914                        $aros_kernel_cc -E -M - 2>/dev/null | \
1915                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1917                 # Copy all the needed headers to a directory beneath gendir.
1918                 for d in $deps; do
1919                     h=$(basename $d)
1920                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1921                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1922                     ! test -d $dir && mkdir -p $dir
1923                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1924                 done
1925             done            
1926         fi
1927     fi
1928     AC_MSG_RESULT($aros_kernel_cc_includes)
1929     # Adding -nostdinc to kernel includes as they are always used together.
1930     aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1933 if test "$crosstools" != "yes"; then
1934     dnl find out about the target cc's include path
1935     AC_MSG_CHECKING([for the target compiler's include path])
1936     if test "$aros_target_cc_includes" = "" ; then
1937         #try to guess where the directory is
1938         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1939         if ! test -d $aros_target_cc_includes; then
1940             #the directory doesn't exist, we need to do some more work
1941             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1942         
1943             #these are the headers we're looking for
1944             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1945                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1946                     zutil.h"
1948             dirs=
1949             for h in $headers; do
1950                 #which other headers each of the above headers needs?
1951                 deps=$(echo "#include <$h>" | \
1952                     $orig_target_cc -E -M - 2>/dev/null | \
1953                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1954             
1955                 #copy all the needed headers to a directory beneath gendir
1956                 for d in $deps; do
1957                     h=$(basename $d)
1958                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1959                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1960                     ! test -d $dir && mkdir -p $dir
1961                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1962                 done
1963             done
1964         fi
1965     fi
1966     AC_MSG_RESULT($aros_target_cc_includes)
1967 else
1968     # We do not know which gcc version we are going to build and what we need to know
1969     # here is different for different versions so this will be set later during the
1970     # build of crosstools.
1971     aros_target_cc_includes=@aros_target_cc_includes@
1975 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1976 # On GCC >= 4.0 -iquote should be used
1979 save_cc="$CC"
1980 save_cflags="$CFLAGS"
1981 CFLAGS="-iquote."
1982 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1983 if test "x-$crosstools" != "x-yes"; then
1984     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1985 else
1986     # we do know it is supported for the smallest version of gcc we are going to build
1987     # we assume it's also supported by later versions
1988     has_iquote=yes
1990 AC_MSG_RESULT($has_iquote)
1991 if test "x-$has_iquote" = "x-yes" ; then
1992     host_cflags_iquote=-iquote
1993     host_cflags_iquote_end=
1994 else
1995     host_cflags_iquote=-I
1996     host_cflags_iquote_end=-I-
1998 kernel_cflags_iquote=$host_cflags_iquote
1999 kernel_cflags_iquote_end=$host_cflags_iquote_end
2000 if test "x-$cross_compiling" = "x-yes"; then
2001     CC="$aros_kernel_cc"
2002     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2003     if test "x-$crosstools" != "x-yes"; then
2004         AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2005     else
2006         # we do know it is supported for the smallest version of gcc we are going to build
2007         # we assume it's also supported by later versions
2008         use_no_stack_protector=yes
2009     fi
2010     AC_MSG_RESULT($use_no_stack_protector)
2011     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2012     if test "x-$crosstools" != "x-yes"; then
2013         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2014     else
2015         # we do know it is supported for the smallest version of gcc we are going to build
2016         # we assume it's also supported by later versions
2017         has_iquote=yes
2018     fi
2019     AC_MSG_RESULT($has_iquote)
2020     if test "x-$has_iquote" = "x-yes" ; then
2021         kernel_cflags_iquote=-iquote
2022         kernel_cflags_iquote_end=
2023     else
2024         kernel_cflags_iquote=-I
2025         kernel_cflags_iquote_end=-I-
2026     fi
2028 aros_cflags_iquote=$kernel_cflags_iquote
2029 aros_cflags_iquote_end=$kernel_cflags_iquote_end
2030 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2031     CC="$orig_target_cc"
2032     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2033     if test "x-$crosstools" != "x-yes"; then
2034         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2035     else
2036         # we do know it is supported for the smallest version of gcc we are going to build
2037         # we assume it's also supported by later versions
2038         has_iquote=yes
2039     fi
2040     AC_MSG_RESULT($has_iquote)
2041     if test "x-$has_iquote" = "x-yes" ; then
2042         aros_cflags_iquote=-iquote
2043         aros_cflags_iquote_end=
2044     else
2045         aros_cflags_iquote=-I
2046         aros_cflags_iquote_end=-I-
2047     fi
2049 if test "x-$use_no_stack_protector" = "x-yes" ; then
2050     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2054 #-----------------------------------------------------------------------------
2056 # Check if the target compiler supports some options used for delinting:
2057 #  -Wunused-but-set-variable
2058 #  -Warray-bounds
2059 #  -Wenum-compare
2060 #  -Wstrict-overflow
2061 #  -Wformat-security
2063 if test "x-$crosstools" != "x-yes"; then
2064     if test "$orig_target_cc" != "$aros_kernel_cc"; then
2065         CC="$orig_target_cc"
2066     fi
2067     AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2068     CFLAGS=-Wunused-but-set-variable
2069     AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2070     AC_MSG_RESULT($aros_unused_but_set_variable)
2071     if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2072         aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2073     fi
2075     AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2076     CFLAGS=-Warray-bounds
2077     AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2078     AC_MSG_RESULT($aros_array_bounds)
2079     if test "x-$aros_array_bounds" = "x-yes" ; then
2080         aros_cflags_array_bounds=-Wno-array-bounds
2081     fi
2083     AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2084     CFLAGS=-Wenum-compare
2085     AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2086     AC_MSG_RESULT($aros_enum_compare)
2087     if test "x-$aros_enum_compare" = "x-yes" ; then
2088         aros_cflags_enum_compare=-Wno-enum-compare
2089     fi
2091     AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2092     CFLAGS=-Wstrict-overflow
2093     AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2094     AC_MSG_RESULT($aros_strict_overflow)
2095     if test "x-$aros_strict_overflow" = "x-yes" ; then
2096         aros_cflags_strict_overflow=-Wno-strict-overflow
2097     fi
2099     AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2100     CFLAGS=-Wformat-security
2101     AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2102     AC_MSG_RESULT($aros_format_security)
2103     if test "x-$aros_format_security" = "x-yes" ; then
2104         aros_cflags_format_security=-Wno-format-security
2105     fi
2106 else
2107     # We do not know which gcc version we are going to build and what we need to know
2108     # here is different for different versions so this will be set later during the
2109     # build of crosstools.
2110     aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2111     aros_cflags_array_bounds=@aros_cflags_array_bounds@
2112     aros_cflags_enum_compare=@aros_cflags_enum_compare@
2113     aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2114     aros_cflags_format_security=@aros_cflags_format_security@
2117 #-----------------------------------------------------------------------------
2119 # Check if we can explicitly choose older version of symbol hashing
2121 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2122 CC="$aros_kernel_cc"
2123 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2124 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2125 AC_MSG_RESULT($use_hash_style)
2126 if test "x-$use_hash_style" = "x-yes" ; then
2127     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2129 CC="$save_cc"
2130 CFLAGS="$save_cflags"
2132 AC_SUBST(host_cflags_iquote)
2133 AC_SUBST(host_cflags_iquote_end)
2134 AC_SUBST(kernel_cflags_iquote)
2135 AC_SUBST(kernel_cflags_iquote_end)
2136 AC_SUBST(aros_cflags_iquote)
2137 AC_SUBST(aros_cflags_iquote_end)
2140 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2141 AC_MSG_CHECKING([for default resolution of WBScreen])
2142 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2143 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2144 if test "$resolution" = "yes" ; then
2145     resolution="none"
2147 if test "$resolution" = "no" ; then
2148     resolution="none"
2150 if test "$resolution" != "none" ; then
2151     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2152     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2153     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2155 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2156 aros_cv_default_wbwidth=$aros_default_wbwidth
2157 aros_cv_default_wbheight=$aros_default_wbheight
2158 aros_cv_default_wbdepth=$aros_default_wbdepth
2160 dnl See if the user wants the serial debug output for native flavour
2161 AC_MSG_CHECKING([if serial debug is enabled])
2162 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)
2163 if test "$aros_serial_debug" = 0 ; then
2164     serial_debug_forced=""
2165     if test "$serial_debug" = "yes" ; then
2166         serial_debug="1"
2167     fi
2168     if test "$serial_debug" = "no" ; then
2169         serial_debug="none"
2170     fi
2171 else
2172     serial_debug_forced="(forced)"
2173     serial_debug=$aros_serial_debug
2175 if test "$serial_debug" != "none" ; then
2176     aros_serial_debug=$serial_debug
2177     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2178 else
2179     AC_MSG_RESULT(no)
2182 dnl See if the user wants the palm debug output hack for palm native flavour
2183 AC_MSG_CHECKING([if palm debug hack is enabled])
2184 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")
2185 if test "$palm_debug_hack" = "yes" ; then
2186     aros_palm_debug_hack="1"
2188 AC_MSG_RESULT($palm_debug_hack)
2190 dnl See if the user wants nesting supervisor activated for unix flavour
2191 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2192 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")
2193 if test "$nesting_supervisor" = "yes" ; then
2194     aros_nesting_supervisor="1"
2196 AC_MSG_RESULT($nesting_supervisor)
2198 dnl See if the user wants to disable MMU support
2199 dnl This can be overriden on per-target basis,
2200 dnl set $aros_enable_mmu to "yes" or "no" to do this
2201 if test "$aros_enable_mmu" = "" ; then
2202     AC_MSG_CHECKING([if MMU support is enabled])
2203     dnl Enabled by default
2204     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2205     if test "$aros_enable_mmu" = "" ; then
2206         aros_enable_mmu="yes"
2207     fi
2208     AC_MSG_RESULT($aros_enable_mmu)
2210 if test "$aros_enable_mmu" = "no" ; then
2211     aros_enable_mmu="0"
2212 else
2213     aros_enable_mmu="1"
2215     
2217 dnl things specifically required for hosted flavours
2218 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2220     if test "x-$need_dlopen" != "x-no" ; then
2221       dnl some kind of dynamic library access system is required for hostlib.resource
2222       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2223       if test "x-$have_dl" = "x-no" ; then
2224           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2225                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2226                                     have_dl="no")
2227       fi
2228       if test "x-$have_dl" = "x-no" ; then
2229           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2230       fi
2231     fi
2234     dnl x11 hidd
2235     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2236                                            [build X11 hidd for hosted (default=auto)]),
2237                                            x11_hidd="$enableval",
2238                                            x11_hidd="$need_x11")
2239     case "x-$x11_hidd" in
2240         x-yes|x-no|x-auto)                 ;;
2241         *)                 x11_hidd="$need_x11" ;;
2242     esac
2244     ENABLE_X11=0
2246     dnl they want it
2247     if test "x-$x11_hidd" != "x-no" ; then
2249         dnl find x11 stuff
2250         AC_PATH_X
2252         x_cflags=
2253         for path in $x_libraries
2254         do
2255             x_cflags="$x_cflags -L$path"
2256         done
2258         for path in $x_includes
2259         do
2260             x_cflags="$x_cflags -I$path"
2261         done
2262         
2263         if test "x-$no_x" = "x-yes" ; then
2265             dnl didn't find it
2266             if test "x-$x11_hidd" != "x-auto" ; then
2267                 dnl and they explicitly asked for it, bail out
2268                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2269             fi
2270         
2271         else
2272             dnl found it, setup the metatarget
2273             x11_hidd_target=kernel-x11gfx-kobj
2274             ENABLE_X11=1
2276             dnl setup shared memory extensions
2277             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2278                                                   [use X11 shared memory (default=auto)]),
2279                                                   x11_hidd_shm="$enableval",
2280                                                   x11_hidd_shm="auto")
2281             case "x-$x11_hidd_shm" in
2282                 x-yes|x-no|x-auto)                     ;;
2283                 *)                 x11_hidd_shm="auto" ;;
2284             esac
2286             have_xshm=no
2288             dnl they want it
2289             if test "x-$x11_hidd_shm" != "x-no" ; then
2291                 dnl system shm headers
2292                 AC_CHECK_HEADERS(sys/ipc.h)
2293                 AC_CHECK_HEADERS(sys/shm.h)
2295                 dnl got them
2296                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2298                     dnl make sure X libs have shm functions
2299                     save_cflags="$CFLAGS"
2300                     CFLAGS="$CFLAGS $x_cflags"
2301                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2302                     CFLAGS="$save_cflags"
2303                 fi
2304             fi
2306             dnl detection done, prepare output
2307             if test "x-$have_xshm" = "x-yes" ; then
2308                 dnl we can do shm
2309                 DO_XSHM_SUPPORT="1"
2310             elif test "x-$x11_hidd_shm" = "x-yes" ; then
2311                 dnl they explicitly asked for it, but we can't do it
2312                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2313             else
2314                 dnl otherwise just disable it
2315                 DO_XSHM_SUPPORT="0"
2316             fi
2318             
2319             dnl setup vidmode (fullscreen) extensions
2320             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2321                                                       [use X11 vidmode extension (default=auto)]),
2322                                                       x11_hidd_vidmode="$enableval",
2323                                                       x11_hidd_vidmode="auto")
2324             case "x-$x11_hidd_vidmode" in
2325                 x-yes|x-no|x-auto)                         ;;
2326                 *)                 x11_hidd_vidmode="auto" ;;
2327             esac
2329             have_vidmode=no
2331             dnl they want it
2332             if test "x-$x11_hidd_vidmode" != "x-no" ; then
2334                 dnl make sure X libs have vidmode functions
2335                 save_cflags="$CFLAGS"
2336                 CFLAGS="$CFLAGS $x_cflags"
2337                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2338                 CFLAGS="$save_cflags"
2339             fi
2341             dnl detection done, prepare output
2342             if test "x-$have_vidmode" = "x-yes" ; then
2343                 dnl we can do vidmode
2344                 DO_VIDMODE_SUPPORT="1"
2345             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2346                 dnl they explicitly asked for it, but we can't do it
2347                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2348             else
2349                 dnl otherwise just disable it
2350                 DO_VIDMODE_SUPPORT="0"
2351             fi
2352         fi
2354         aros_host_x11_includes=$x_includes 
2355         aros_host_x11_libdirs=$x_libraries
2356     fi
2359     dnl sdl hidd
2360     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2361                                            [build SDL hidd for hosted (default=auto)]),
2362                                            sdl_hidd="$enableval",
2363                                            sdl_hidd="auto")
2364     case "x-$sdl_hidd" in
2365         x-yes|x-no|x-auto)                 ;;
2366         *)                 sdl_hidd="auto" ;;
2367     esac
2369     dnl they want it
2370     if test "x-$sdl_hidd" != "x-no" ; then
2372         dnl find sdl
2373         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2375         if test "x-$have_sdl" != "x-yes" ; then
2377             dnl didn't find it
2378             if test "x-$sdl_hidd" != "x-auto" ; then
2379                 dnl and they explicitly asked for it, bail out
2380                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2381             fi
2383         else
2384             dnl found it, set up the metatarget
2385             sdl_hidd_target=kernel-hidd-sdl
2386             aros_host_sdl_cflags=SDL_CFLAGS
2387             aros_host_sdl_libs=SDL_LIBS
2388         fi
2389     fi
2391     dnl oss.library
2392     AC_CHECK_HEADER(sys/soundcard.h)
2393     if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2394         oss_library_target=workbench-libs-oss-unix
2395     fi
2399 dnl See if the user wants dbus.library
2400 AC_MSG_CHECKING([if building of dbus.library is enabled])
2401 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2402 if test "$dbus" = "yes" ; then
2403     ENABLE_DBUS=1
2404     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2405     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2406     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2407     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2408 else
2409     ENABLE_DBUS=0
2411 AC_MSG_RESULT($dbus)
2413 if test "$use_kernel_cc_wrapper" = "yes" ; then
2414     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2417 if test "${crosstools}" != "yes" ; then
2418     aros_target_toolchain=no
2419 else
2420     aros_target_toolchain=yes
2423 dnl --------------------------------------------------------------------
2424 dnl Configuration Output Section
2425 dnl --------------------------------------------------------------------
2427 # Generic
2428 AC_SUBST(aros_arch)
2429 AC_SUBST(aros_cpu)
2430 AC_SUBST(aros_flavour)
2431 AC_SUBST(aros_flavour_uc)
2432 AC_SUBST(aros_target_toolchain)
2433 AC_SUBST(AROS_BUILDDIR)
2434 AC_SUBST(AROS_BUILDDIR_UNIX)
2435 AC_SUBST(SRCDIR)
2436 AC_SUBST(AROS_CROSSTOOLSDIR)
2437 AC_SUBST(AROS_PORTSSRCDIR)
2439 # Compatability with other Amiga-like operation systems
2440 AC_SUBST(aros_amigaos_compliance)
2442 # Host related
2443 AC_SUBST(aros_cc_pre)
2444 AC_SUBST(aros_host_strip)
2445 AC_SUBST(aros_host_arch)
2446 AC_SUBST(aros_host_cpu)
2447 AC_SUBST(aros_host_cpp)
2448 AC_SUBST(aros_host_cc)
2449 AC_SUBST(aros_host_cxx)
2450 AC_SUBST(aros_host_ar)
2451 AC_SUBST(aros_host_ranlib)
2452 AC_SUBST(aros_host_ld)
2453 AC_SUBST(aros_host_make)
2454 AC_SUBST(aros_host_cflags)
2455 AC_SUBST(aros_host_cxxflags)
2456 AC_SUBST(gnu89_inline)
2457 AC_SUBST(aros_host_ldflags)
2458 AC_SUBST(aros_host_debug)
2459 AC_SUBST(aros_host_mkdep)
2460 AC_SUBST(aros_host_mkargs)
2461 AC_SUBST(aros_host_exe_suffix)
2462 AC_SUBST(aros_host_lib_suffix)
2463 AC_SUBST(aros_tools_dir)
2464 AC_SUBST(aros_host_aclocal)
2465 AC_SUBST(aros_host_autoconf)
2466 AC_SUBST(aros_host_autoheader)
2467 AC_SUBST(aros_host_automake)
2468 AC_SUBST(ant)
2470 # Target Related
2471 AC_SUBST(aros_target_guitheme)
2472 AC_SUBST(aros_target_iconset)
2473 AC_SUBST(aros_target_bootloader)
2474 AC_SUBST(aros_target_arch)
2475 AC_SUBST(aros_target_family)
2476 AC_SUBST(aros_target_cpu)
2477 AC_SUBST(aros_target_variant)
2478 AC_SUBST(aros_target_suffix)
2479 AC_SUBST(aros_target_ar)
2480 AC_SUBST(aros_target_ranlib)
2481 AC_SUBST(aros_plain_nm)
2482 AC_SUBST(aros_plain_ar)
2483 AC_SUBST(aros_kernel_ar)
2484 AC_SUBST(aros_kernel_ranlib)
2485 AC_SUBST(orig_target_cc)
2486 AC_SUBST(aros_target_cc)
2487 AC_SUBST(aros_kernel_cc)
2488 AC_SUBST(orig_target_cxx)
2489 AC_SUBST(aros_target_cxx)
2490 AC_SUBST(aros_kernel_cxx)
2491 AC_SUBST(orig_target_cpp)
2492 AC_SUBST(aros_target_cpp)
2493 AC_SUBST(aros_kernel_cpp)
2494 AC_SUBST(orig_target_as)
2495 AC_SUBST(aros_target_as)
2496 AC_SUBST(aros_kernel_as)
2497 AC_SUBST(orig_target_ld)
2498 AC_SUBST(aros_target_ld)
2499 AC_SUBST(aros_kernel_ld)
2500 AC_SUBST(aros_target_cc_includes)
2501 AC_SUBST(aros_target_cc_path)
2502 AC_SUBST(aros_target_objdump)
2503 AC_SUBST(aros_target_objcopy)
2504 AC_SUBST(aros_target_strip)
2505 AC_SUBST(aros_target_nm)
2506 AC_SUBST(aros_kernel_rescomp)
2507 AC_SUBST(aros_shared_default)
2508 AC_SUBST(aros_shared_ld)
2509 AC_SUBST(aros_object_format)
2510 AC_SUBST(aros_compiler_libs)
2511 AC_SUBST(aros_arch_libs)
2513 AC_SUBST(aros_config_cflags)
2514 AC_SUBST(aros_config_aflags)
2515 AC_SUBST(aros_config_ldflags)
2517 AC_SUBST(aros_shared_cflags)
2518 AC_SUBST(aros_shared_aflags)
2519 AC_SUBST(aros_shared_ldflags)
2520 AC_SUBST(aros_kernel_cflags)
2521 AC_SUBST(aros_kernel_includes)
2522 AC_SUBST(aros_kernel_objcflags)
2523 AC_SUBST(aros_kernel_ldflags)
2524 AC_SUBST(aros_target_cflags)
2525 AC_SUBST(aros_debug_cflags)
2526 AC_SUBST(aros_debug_aflags)
2527 AC_SUBST(aros_debug_ldflags)
2528 AC_SUBST(aros_target_genmap)
2529 AC_SUBST(aros_target_strip_flags)
2531 AC_SUBST(crosstools_target)
2532 AC_SUBST(crosstools_cxx_target)
2534 # Delinting target compiler flags
2535 AC_SUBST(aros_cflags_unused_but_set_variable)
2536 AC_SUBST(aros_cflags_array_bounds)
2537 AC_SUBST(aros_cflags_enum_compare)
2538 AC_SUBST(aros_cflags_strict_overflow)
2539 AC_SUBST(aros_cflags_format_security)
2541 # Graphics Related
2542 AC_SUBST(x11_hidd_target)
2543 AC_SUBST(sdl_hidd_target)
2544 AC_SUBST(pci_hidd_target)
2545 AC_SUBST(oss_library_target)
2547 AC_SUBST(aros_default_wbwidth)
2548 AC_SUBST(aros_default_wbheight)
2549 AC_SUBST(aros_default_wbdepth)
2550 AC_SUBST(DO_XSHM_SUPPORT)
2551 AC_SUBST(DO_VIDMODE_SUPPORT)
2553 AC_SUBST(aros_host_x11_includes)
2554 AC_SUBST(aros_host_x11_libdirs)
2555 AC_SUBST(aros_host_sdl_cflags)
2556 AC_SUBST(aros_host_sdl_libs)
2558 # Native version related
2559 AC_SUBST(aros_serial_debug)
2561 # Palm native version related
2562 AC_SUBST(aros_palm_debug_hack)
2564 # Unix/Hosted version related
2565 AC_SUBST(aros_nesting_supervisor)
2567 # MMU related
2568 AC_SUBST(aros_enable_mmu)
2570 # Apple iOS related
2571 AC_SUBST(aros_ios_platform)
2572 AC_SUBST(aros_ios_version)
2573 AC_SUBST(aros_ios_sdk)
2575 # Android related
2576 AC_SUBST(android_tool)
2577 AC_SUBST(aros_android_level)
2579 # DBUS related
2580 AC_SUBST(ENABLE_DBUS)
2581 AC_SUBST(DBUS_CFLAGS)
2582 AC_SUBST(DBUS_LIBFLAGS)
2583 AC_SUBST(KERNEL_DBUS_KOBJ)
2584 AC_SUBST(KERNEL_DBUS_INCLUDES)
2586 #X11 related
2587 AC_SUBST(ENABLE_X11)
2589 # Debug related
2590 AC_SUBST(aros_debug)
2591 AC_SUBST(aros_mungwall_debug)
2592 AC_SUBST(aros_stack_debug)
2593 AC_SUBST(aros_modules_debug)
2595 # Collect-aros stuff: "-ius" to ignore undefined symbols
2596 AC_SUBST(ignore_undefined_symbols)
2598 # C compiler related
2599 AC_SUBST(gcc_target_cpu)
2601 dnl Prepare for output, make up all the generated patches
2602 case "$aros_flavour" in
2603 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2604                 aros_flavour="emulation" ;;
2605 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2606                 aros_flavour="emulation" ;;
2607 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2608                 aros_flavour="standalone";;
2609 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2610                 aros_flavour="standalone";;
2611 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2612                 aros_flavour="native" ;;
2613 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2614                 aros_flavour="native" ;;
2615 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2616                 aros_flavour="linklib" ;;
2617 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2618                 aros_flavour="palmnative" ;;
2619 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2620                 aros_flavour="mac68knative" ;;
2621 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2622                 aros_flavour="ppcnative" ;;
2623 esac
2625 if test ! -d ${aros_inc_dir} ; then
2626     ${MKDIR} ${aros_inc_dir}
2628 if test ! -d ${aros_geninc_dir} ; then
2629     ${MKDIR} ${aros_geninc_dir}
2631 if test ! -d ${aros_hostcfg_dir} ; then
2632     ${MKDIR} ${aros_hostcfg_dir}
2634 if test ! -d ${aros_targetcfg_dir} ; then
2635     ${MKDIR} ${aros_targetcfg_dir}
2637 if test ! -d ${aros_tools_dir} ; then
2638     ${MKDIR} ${aros_tools_dir}
2640 if test ! -d ${aros_scripts_dir} ; then
2641     ${MKDIR} ${aros_scripts_dir}
2644 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2646 AC_CONFIG_COMMANDS([compiler_executable],
2647     [
2648         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2649         mkdir -p $prefix
2650         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2651         prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2653         echo ${prefix2}
2654         echo ${prefix3}
2655         chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2657         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
2658         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
2659         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
2660         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
2661         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2662         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2663         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
2665         ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix3}-ld$aros_host_exe_suffix
2666     ],
2667     [
2668         aros_host_exe_suffix=${aros_host_exe_suffix}
2669         aros_tools_dir=${aros_tools_dir}
2670         aros_target_cpu=${aros_target_cpu}
2671         aros_target_arch=${aros_target_arch}
2672         aros_target_suffix=${aros_target_suffix}
2673         orig_target_nm=${orig_target_nm}
2674         orig_target_as=${orig_target_as}
2675         orig_target_ar=${orig_target_ar}
2676         orig_target_ranlib=${orig_target_ranlib}
2677         orig_target_objdump=${orig_target_objdump}
2678         orig_target_objcopy=${orig_target_objcopy}
2679         orig_target_strip=${orig_target_strip}
2680         aros_kernel_ld=${aros_kernel_ld}
2681     ]
2683 AC_CONFIG_COMMANDS([genmf_executable],
2684     [chmod a+x ${aros_tools_dir}/genmf.py],
2685     [aros_tools_dir=${aros_tools_dir}]
2688 AC_CONFIG_FILES(
2689     Makefile
2690     config/make.cfg
2691     ${aros_inc_dir}/config.h:config/config.h.in
2692     ${aros_geninc_dir}/config.h:config/config.h.in
2693     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2694     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2695     mmake.config
2696     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2697     ${aros_targetcfg_dir}/specs:config/specs.in
2698     ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2699     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2700     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2701     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2702     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2703     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2704     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2705     tools/collect-aros/env.h
2706     ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2709 AC_OUTPUT
2711 dnl This is in order to not define SHARED_CFLAGS sometimes
2712 dnl We don't always do aros_shared_ar, aros_shared_cflags
2714 #XXX compatability...
2715 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2717 if test -n "$aros_shared_cflags" ; then
2718     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2719     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg