Removed warning flags not understood by build machine's gcc.
[AROS.git] / configure.in
blob4d0bb2f70fe17763dcf158616f59c36a6086b100
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=""
146 host_cc_elf=yes
148 # ----------------------------------------------------------------------------------------
149 # Host-specific defaults
151 # This is the main host configuration section. It is where the host
152 # can change the values of any variables it needs to change. We do
153 # not look at anything that compiles to the target yet, we'll get
154 # to that later.
156 case "$host_os" in
157     aros*)
158         aros_host_arch="aros"
159         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
160         case "$host_cpu" in
161             *i?86*)
162                 aros_host_cpu="i386"
163                 ;;
164             *x86_64*)
165                 aros_host_cpu="x86_64"
166                 ;;
167             *powerpc*)
168                 aros_host_cpu="ppc"
169                 ;;
170             *)
171                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
172                 aros_host_cpu="$host_cpu"
173                 ;;
174         esac
175         ;;
177     linux*)
178         aros_host_arch="linux"
179         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
180         android_build_os="linux-x86"
181         android_tool="android"
182         default_android_sdk="/opt/android-sdk-linux_x86"
183         case "$host_cpu" in
184             *i?86*)
185                 aros_host_cpu="i386"
186                 ;;
187             *x86_64*)
188                 aros_host_cpu="x86_64"
189                 ;;
190             *m68k*)
191                 aros_host_cpu="m68k"
192                 ;;
193             *powerpc*)
194                 aros_host_cpu="ppc"
195                 ;;
196             *arm*)
197                 aros_host_cpu="arm"
198                 ;;
199             *)
200                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
201                 aros_host_cpu="$host_cpu"
202                 ;;
203         esac
204         ;;
206     freebsd*)
207         aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
208         aros_host_make="gmake"
209         aros_host_arch="freebsd"
210         aros_host_cpu="i386"
212         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
214         dnl FreeBSD 5.x (and later) has changed the default object format.
215         dnl The double [[]] is necessary to get around m4's quoting rules.
216         case $host_os in
217             freebsd[[234]]*)
218                 aros_object_format="elf_i386"
219                 ;;
221             *)
222                 aros_object_format="elf_i386_fbsd"
223                 ;;
224         esac
226         ;;
228     darwin*)
229         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
230         aros_host_arch="darwin"
231         host_cc_elf=no
232         android_build_os="darwin-x86"
233         android_tool="android"
234         default_android_sdk="/android-sdk-mac_x86"
235         case "$host_cpu" in
236             *i?86*)
237                 aros_host_cpu="i386"
238                 ;;
239             *x86_64*)
240                 aros_host_cpu="x86_64"
241                 ;;
242             *powerpc*)
243                 aros_host_cpu="ppc"
244                 ;;
245             *)
246                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
247                 aros_host_cpu="$host_cpu"
248                 ;;
249         esac
251         aros_host_ldflags="$aros_host_ldflags -liconv"
253         ;;
255     dragonfly*)
256         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
257         aros_host_make="gmake"
258         aros_host_arch="dragonfly"
259         case $host_cpu in
260             *i?86*)
261                 aros_host_cpu="i386"
262                 ;;
263             *amd64*)
264                 aros_host_cpu="x86_64"
265                 ;;
266             *)
267                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
268                 aros_host_cpu="$host_cpu"
269                 ;;
270         esac
271         ;;
273     netbsd*)
274         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
275         aros_host_make="gmake"
276         aros_host_arch="netbsd"
277         case "$host_cpu" in
278             *i?86*)
279                 aros_host_cpu="i386"
280                 ;;
281             *m68k*)
282                 aros_host_cpu="m68k"
283                 ;;
284             *)
285                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
286                 aros_host_cpu="$host_cpu"
287                 ;;
288         esac    
289         aros_host_lib_suffix=".0.0"
290         ;;
292     openbsd*)
293         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
294         aros_host_make="gmake"
295         aros_host_arch="openbsd"
296         case "$host_cpu" in
297             *i?86*)
298                 aros_host_cpu="i386"
299                 ;;
300             *)
301                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
302                 aros_host_cpu="$host_cpu"
303                 ;;
304         esac
305         ;;
306         
307     solaris*)
308         aros_host_arch="solaris"
309         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
310         case "$host_cpu" in
311             *i?86*)
312                 aros_host_cpu="i386"
313                 ;;
314             *sparc*)
315                 aros_host_cpu="sparc"
316                 ;;
317             *)
318                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
319                 aros_host_cpu="$host_cpu"
320                 ;;
321         esac
322         ;;
324     morphos*)
325         aros_host_arch="morphos"
326         aros_host_cpu="ppc"
327         host_cc_elf=no
328         ;;
330     amiga*)
331         aros_host_arch="amiga"
332         host_cc_elf=no
333         SORT="/gg/bin/sort"
334         TEST="/gg/bin/test"
335         UNIQ="/gg/bin/uniq"
336         FOR="for"
337         TOUCH="/gg/bin/touch"
338         case "$host_cpu" in
339             *m68k*)
340                 aros_host_cpu="m68k"
341                 ;;
342             *powerpc*)
343                 aros_host_cpu="ppc"
344                 ;;
345             *)
346                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
347                 aros_host_cpu="$host_cpu"
348                 ;;
349         esac
350         ;;
352     cygwin*)
353         aros_host_arch="cygwin"
354         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
355         host_cc_elf=no
356         android_build_os="windows"
357         android_tool="android.bat"
358         default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
360         case "$host_cpu" in
361             *i?86*)
362                 aros_host_cpu="i386"
363                 ;;
364             *)
365                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
366                 aros_host_cpu="$host_cpu"
367                 ;;
368         esac
369         ;;
371     mingw32*)
372         aros_host_arch="mingw32"
373         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
374         host_cc_elf=no
375         android_build_os="windows"
376         android_tool="android.bat"
377         default_android_sdk="/c/android-sdk-windows-1.6_r1"
379         case "$host_cpu" in
380         *i?86*)
381             dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
382             dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
383             dnl Here we attempt to detect Windows home platform by asking gcc about its target.
384             dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
386             AC_MSG_CHECKING([for Windows native gcc target])
387             host_cpu=`gcc -dumpmachine`
388             AC_MSG_RESULT($host_cpu)
389             ;;
391         esac
393         case "$host_cpu" in
394         *i?86*)
395             aros_host_cpu="i386"
396             ;;
398         mingw32*)
399             dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
400             aros_host_cpu="i386"
401             ;;
403         *x86_64*)
404             aros_host_cpu="x86_64"
405             dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
406             dnl directory, so we have to add it explicitly here.
407             aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
408             ;;
410         *)
411             AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
412             aros_host_cpu="$host_cpu"
413             ;;
414         esac
415         ;;
416     *)
417         AC_MSG_ERROR([Unsupported host architecture $host])
418         ;;
419 esac
421 AROS_PROG(aros_host_ar,[ar],[cr])
422 AROS_REQUIRED(ar,$aros_host_ar)
423 AROS_PROG(aros_host_ranlib,ranlib)
424 AROS_REQUIRED(ranlib,$aros_host_ranlib)
425 AROS_PROG(aros_host_strip,strip)
426 AROS_REQUIRED(strip,$aros_host_strip)
428 AROS_PROG(RM,[rm],[-rf])
429 AROS_REQUIRED(rm,$RM)
430 AROS_PROG(CP,[cp])
431 AROS_REQUIRED(cp,$CP)
432 AROS_PROG(MV,[mv])
433 AROS_REQUIRED(mv,$MV)
434 AROS_PROG(ECHO,[echo])
435 AROS_REQUIRED(echo,$ECHO)
436 AROS_PROG(MKDIR,[mkdir],[-p])
437 AROS_REQUIRED(mkdir,$MKDIR)
438 AROS_PROG(TOUCH,[touch])
439 AROS_REQUIRED(touch,$TOUCH)
440 AROS_PROG(SORT,[sort])
441 AROS_REQUIRED(sort,$SORT)
442 AROS_PROG(UNIQ,[uniq])
443 AROS_REQUIRED(uniq,$UNIQ)
444 AROS_PROG(NOP,[true])
445 AROS_REQUIRED(true,$NOP)
446 AROS_PROG(CAT,[cat])
447 AROS_REQUIRED(cat,$CAT)
448 AROS_PROG(BISON,[bison])
449 AROS_REQUIRED(bison,$BISON)
450 AROS_PROG(FLEX,[flex])
451 AROS_REQUIRED(flex,$FLEX)
452 AROS_PROG(PNGTOPNM,[pngtopnm])
453 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
454 AROS_PROG(PPMTOILBM,[ppmtoilbm])
455 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
456 AROS_PROG(SED,[sed])
457 AROS_REQUIRED(sed,$SED)
458 AROS_PROG(CHMOD,[chmod])
459 AROS_REQUIRED(chmod,$CHMOD)
460 AROS_PROG(PATCH,[patch])
461 AROS_REQUIRED(patch,$PATCH)
463 AM_PATH_PYTHON(2.5)
465 AC_CHECK_LIB(png, png_read_png)
466 AROS_REQUIRED(libpng, $ac_cv_lib_png_png_read_png)
468 AC_SUBST(FOR, for)
469 AC_SUBST(IF, if)
470 AC_SUBST(TEST, test)
471 AC_SUBST(CMP, cmp)
473 dnl ---------------------------------------------------------------------------
474 dnl Look for things about the host system, good for hosted targets.
475 dnl ---------------------------------------------------------------------------
477 # Check for some includes for the X11 HIDD and the kernel
478 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
479     sys/mmap.h sys/mman.h sysexits.h \
480     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
483 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
485 AC_HEADER_DIRENT
486 AC_HEADER_STAT
487 AC_HEADER_STDC
488 AC_HEADER_SYS_WAIT
489 AC_HEADER_TIME
490 AC_STRUCT_ST_BLKSIZE
491 AC_STRUCT_ST_BLOCKS
492 AC_STRUCT_ST_RDEV
493 AC_STRUCT_TM
494 AC_STRUCT_TIMEZONE
495 AC_TYPE_OFF_T
496 AC_TYPE_PID_T
497 AC_TYPE_SIZE_T
498 AC_TYPE_UID_T
500 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
502 # Look for some functions
503 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
504     clone kse_create rfork_thread thr_create sa_register \
505     getcontext makecontext setcontext sigaltstack swapcontext])
507 AC_FUNC_MMAP
510 dnl --------------------------------------------------------------------
511 dnl Target Configuration Section
512 dnl --------------------------------------------------------------------
514 dnl The target configuration section is responsible for setting up all
515 dnl the paths for includes, and tools required to build AROS to some
516 dnl particular target.
518 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
519 aros_config_aflags="-Wall -x assembler-with-cpp -c"
520 aros_config_ldflags=""
522 aros_shared_default=yes
524 aros_shared_cflags="-fPIC"
525 aros_shared_aflags=""
526 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
527 aros_kernel_ldflags="-Wl,-rpath,./lib"
529 aros_kernel_ar_flags="cr"
530 aros_target_ar_flags="cr"
531 aros_target_nm_flags="-C -ul"
532 aros_target_strip_flags="--strip-unneeded -R.comment"
534 aros_compiler_libs=
535 aros_arch_libs=
537 aros_target_genmap="-Wl,-Map -Xlinker"
539 # Native flavour stuff
540 aros_serial_debug="0"
542 # Palm native flavour stuff
543 aros_palm_debug_hack="0"
545 # Unix flavour stuff
546 aros_nesting_supervisor="0"
548 # Collect-aros stuff: "-ius" to ignore undefined symbols
549 ignore_undefined_symbols=""
551 # Check for X11 by default
552 need_x11="auto"
554 #-----------------------------------------------------------------------------
557 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
558 # it switched on by default, and we use the host compiler, so it compiles AROS
559 # code with this enabled resulting in link failures as we don't have support
560 # for it.
562 # We use two methods to disable it. For the host compiler (used to compile
563 # some hosted modules), we test to see if the compiler supports stack
564 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
565 # work on all platforms.
567 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
568 # (this is done unconditionally, as it should have no effect on compilers
569 # without the stack protection feature). This may be specific to the way that
570 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
571 # strong enough to disable it in a generic way though, so we'll live with it
572 # until another vendor ships GCC with it enabled in a different way, and deal
573 # with it then.
576 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
577 save_cflags="$CFLAGS"
578 CFLAGS="$CFLAGS -fno-stack-protector"
579 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
580 AC_MSG_RESULT($use_no_stack_protector)
581 if test "x-$use_no_stack_protector" = "x-yes" ; then
582     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
584 CFLAGS="$save_cflags"
586 #-----------------------------------------------------------------------------
588 # Disable pointer-signedness warnings if the compiler recognises the option
589 # (this only works for the host compiler at the moment)
591 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
592 save_cflags="$CFLAGS"
593 CFLAGS="$CFLAGS -Wno-pointer-sign"
594 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
595 AC_MSG_RESULT($use_no_sign_warning)
596 if test "x-$use_no_sign_warning" = "x-yes" ; then
597     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
599 CFLAGS="$save_cflags"
601 #-----------------------------------------------------------------------------
603 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
605 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
606 save_cflags="$CFLAGS"
607 CFLAGS="$CFLAGS -fgnu89-inline"
608 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
609 AC_MSG_RESULT($use_gnu89_inline)
610 if test "x-$use_gnu89_inline" = "x-yes" ; then
611     gnu89_inline="-fgnu89-inline"
613 CFLAGS="$save_cflags"
615 #-----------------------------------------------------------------------------
617 AC_MSG_CHECKING([for type of build])
618 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")
620 if test "$build_type" = "nightly"; then
621     build_type_string="NIGHTLY"
622 elif test "$build_type" = "snapshot"; then
623     build_type_string="SNAPSHOT"
624 elif test "$build_type" = "milestone"; then
625     build_type_string="MILESTONE"
626 elif test "$build_type" = "release"; then
627     build_type_string="RELEASE"
628 else
629     build_type_string="PERSONAL"
630     build_type="personal"
633 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
635 AC_MSG_RESULT($build_type)
637 #-----------------------------------------------------------------------------
638 all_debug_types="messages stack modules mungwall symbols"
640 AC_MSG_CHECKING([which debug types to enable])
641 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)]),
642  debug="$enableval",debug="")
644 if test "$debug" = "" -o "$debug" = "no"; then
645     debug="none"
646 elif test "$debug" = "yes"; then
647     debug="all"
650 if test "$debug" = "all" ; then
651     debug="messages stack modules symbols"
652     for d in $all_debug_types; do
653         export aros_${d}_debug="1"
654     done
655 else
656     for d in $all_debug_types; do
657         export aros_${d}_debug="0"
658     done
661 if test "$debug" != "none"; then
662     debug=`echo $debug | sed s/,/\ /g`
663     for d in $debug; do
664         found="0"
665         for d2 in $all_debug_types; do
666             if test "$d2" = "$d"; then
667                 found="1"
668                 break
669             fi
670         done
671         if test "$found" = "0"; then
672             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
673         fi
674         export aros_${d}_debug="1"
675     done
676     aros_debug="yes"
678 AC_MSG_RESULT($debug)
680 if test "$aros_messages_debug" = "1"; then
681     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
682 else
683     aros_messages_debug=""
685 if test "$aros_symbols_debug" = "1"; then
686     aros_symbols_debug="-g"
687 else
688     aros_symbols_debug=""
691 # These are the flags to pass when compiling debugged programs
692 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
693 aros_debug_aflags=""
694 aros_debug_ldflags="$aros_symbols_debug"
696 #-----------------------------------------------------------------------------
697 #   Checking for distcc and ccache.
699 #   Always apply the transforms in this particular order. Basically you should
700 #   always run 'ccache distcc compiler' in that order for the best performance.
702 AC_MSG_CHECKING([whether to enable distcc])
703 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
704 if test "$distcc" != "" -a "$distcc" != "no"; then
705     # AC_CHECK_PROG will print out the result in this case
706     AC_PATH_PROG(DISTCC,[distcc],distcc,)
707 else
708     AC_MSG_RESULT(no)
711 AC_MSG_CHECKING([whether to enable ccache])
712 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
713 if test "$ccache" != "" -a "$ccache" != "no"; then
714     # AC_CHECK_PROG will print out the result in this case
715     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
716 else
717     AC_MSG_RESULT(no)
720 #-----------------------------------------------------------------------------
721 AC_MSG_CHECKING([what specific host gcc version to use])
722 AC_ARG_WITH(kernel-gcc-version,AC_HELP_STRING([--with-kernel-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),kernel_tool_version="-$withval",kernel_tool_version="")
723 AC_MSG_RESULT($kernel_tool_version)
725 #-----------------------------------------------------------------------------
726 AC_MSG_CHECKING([what specific target gcc version to use])
727 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),target_tool_version="$withval",target_tool_version="default")
728 AC_MSG_RESULT($target_tool_version)
730 #-----------------------------------------------------------------------------
731 AC_MSG_CHECKING([what optimization flags to use])
732 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
733 if test "$optimization" = "unknown"; then
734     dnl default is -O2 for normal builds, -O0 for debug builds
735     if test "$debug" != "none"; then
736         optimization="-O0"
737     else
738         optimization="-O2"
739     fi
741 aros_config_cflags="$aros_config_cflags $optimization"
742 AC_MSG_RESULT($optimization)
744 #-----------------------------------------------------------------------------
745 AC_MSG_CHECKING([what paranoia flags to use])
746 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
747 if test "$paranoia_flags" = "default"; then
748         paranoia_flags=""
749 else if test "$paranoia_flags" = "yes"; then
750         paranoia_flags="-Wall -Werror"
751 fi fi
752 AC_MSG_RESULT($paranoia_flags)
753 aros_config_cflags="$aros_config_cflags $paranoia_flags"
755 #-----------------------------------------------------------------------------
756 AC_MSG_CHECKING([what target variant to enable])
757 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
758 if test "$target_variant" = ""; then
759     aros_target_variant=""
760     aros_target_suffix=""
761     enableval="none"
762 else
763     aros_target_variant="$target_variant"
764     aros_target_suffix="-$target_variant"
766 AC_MSG_RESULT($enableval)
768 #-----------------------------------------------------------------------------
769 # Target-specific defaults. You can override then on a per-target basis.
771 # Bootloader name. Currently used by PC target.
772 target_bootloader="none"
774 #-----------------------------------------------------------------------------
775 # Additional options for some specific targets
777 case "$aros_target_variant" in
778 ios)
779     AC_MSG_CHECKING([XCode path])
780     AC_ARG_WITH(xcode,AC_HELP_STRING([--with-xcode=PATH],[Specify XCode path for iOS targets (default=/Developer).]),aros_xcode_path="$withval",aros_xcode_path="/Developer")
781     AC_MSG_RESULT($aros_xcode_path)
783     AC_MSG_CHECKING([what iOS SDK version to use])
784     AC_ARG_WITH(sdk-version,AC_HELP_STRING([--with-sdk-version=VERSION],[Use iOS SDK version VERSION (default=4.1).]),aros_sdk_version="$withval",aros_sdk_version="4.1")
785     AC_MSG_RESULT($aros_sdk_version)
787     ;;
789 "android")
790     AC_MSG_CHECKING([Android SDK path])
791     AC_ARG_WITH(sdk,AC_HELP_STRING([--with-sdk=PATH],[Specify Android SDK path (default=$default_android_sdk).]),aros_android_sdk="$withval",aros_android_sdk=$default_android_sdk)
792     AC_MSG_RESULT($aros_android_sdk)
794     AC_MSG_CHECKING([Android NDK path])
795     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
796     AC_MSG_RESULT($aros_android_ndk)
798     AC_MSG_CHECKING([what Android SDK version to use])
799     AC_ARG_WITH(sdk-version,AC_HELP_STRING([--with-sdk-version=LEVEL],[Use Android SDK for API LEVEL (default=12).]),aros_sdk_version="$withval",aros_sdk_version="12")
800     AC_MSG_RESULT($aros_sdk_version)
802     if test "$aros_android_ndk" != "none"; then
803         AC_MSG_CHECKING([what Android NDK version to use])
804         AC_ARG_WITH(ndk-version,AC_HELP_STRING([--with-ndk-version=LEVEL],[Use Android NDK for API LEVEL (default=9).]),aros_ndk_version="$withval",aros_ndk_version="9")
805         AC_MSG_RESULT($aros_ndk_version)
806     fi
808     export PATH="$aros_android_sdk/tools:$PATH"
809     AC_PATH_PROG(android_tool, $android_tool)
810     AROS_REQUIRED(android,$android_tool)
812     aros_android_level=android-$aros_sdk_version
813     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
814         echo "Platform $aros_android_level is not installed in your SDK"
815         echo "Use --with-sdk-version=<API level number> to select another platform version"
816         echo "You can check what plaform versions are installed in your SDK"
817         echo "by examining contents of $aros_android_sdk/platforms directory"
818         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
819     fi
821     AC_PATH_PROG(ant, ant)
822     if test "$ant" = ""; then
823         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
824     fi
826     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
827     if test "$host_os" = "mingw32"; then
828         android_tool="cmd //c $android_tool"
829     fi
831     ;;
832 esac
834 #-----------------------------------------------------------------------------
835 # External toolchains
836 kernel_tool_prefix="none"
837 aros_tool_prefix="none"
838 elf_tool_prefix="${target_cpu}-elf-"
840 # This is the target configuration switch.
841 case "$target_os" in
842     linux*)
843         aros_target_arch="linux"
844         aros_target_family="unix"
845         case "$target_cpu" in
846             *m68k*)
847                 aros_target_cpu="m68k"
848                 aros_object_format="m68kelf"
849                 aros_flavour="emulcompat"
850                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
851                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
852                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
853                 gcc_target_cpu="mc68000"
854                 ;;
855             *i?86*)
856                 aros_target_cpu="i386"
857                 aros_object_format="elf_i386"
858                 aros_flavour="emulation"
859                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
860                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
861                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
862                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
863                 aros_config_ldflags="-m32 -march=i486"
864                 aros_kernel_ldflags="-melf_i386"
865                 aros_default_wbdepth=8
866                 gcc_target_cpu="i386"
867                 pci_hidd_target="hidd-pci-linux"
868                 android_tool_dir_prefix="x86"
869                 android_tool_prefix="i686-android-linux"
870                 android_ndk_arch="x86"
871                 ;;
872             *x86_64*)
873                 aros_target_cpu="x86_64"
874                 aros_object_format="elf_x86_64"
875                 aros_flavour="emulation"
876                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
877                 aros_config_cflags="$aros_config_cflags -mno-red-zone -fno-omit-frame-pointer"
878                 aros_default_wbdepth=8
879                 pci_hidd_target="hidd-pci-linux"
880                 ;;
881             *powerpc*)
882                 aros_target_cpu="ppc"
883                 aros_object_format="elf32ppc"
884                 aros_flavour="emulation"
885                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
886                 aros_default_wbdepth=8
887                 gcc_target_cpu="ppc"
888                 ;;
889 # TODO
890 # Same as powerpc, but I need this for the nightly build to work again.
891 # Actually, the nightly should be made working with powerpc target.
892 # That just was too much work for the moment, another week or two.
893             *ppc*)
894                 aros_target_cpu="ppc"
895                 aros_object_format="elf32ppc"
896                 aros_flavour="emulation"
897                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
898                 aros_default_wbdepth=8
899                 gcc_target_cpu="ppc"
900                 ;;
901             *armhf*)
902                 aros_target_cpu="arm"
903                 target_cpu="arm"
904                 aros_object_format="armelf_linux_eabi"
905                 aros_flavour="emulation"
906                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
907                 gcc_target_cpu="arm"
908                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
909                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
910                 aros_arch_libs="-laeabi"
911                 gcc_default_fpu="vfpv3-d16"
912                 gcc_default_float_abi="hard"
913                 android_tool_dir_prefix="arm-linux-androideabi"
914                 android_tool_prefix="arm-linux-androideabi"
915                 android_ndk_arch="arm"
916                 kernel_tool_prefix="arm-linux-gnueabihf-"
917                 ;;
918             *arm*)
919                 aros_target_cpu="arm"
920                 aros_object_format="armelf_linux_eabi"
921                 aros_flavour="emulation"
922                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
923                 gcc_target_cpu="arm"
924                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
925                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
926                 aros_arch_libs="-laeabi"
927                 android_tool_dir_prefix="arm-linux-androideabi"
928                 android_tool_prefix="arm-linux-androideabi"
929                 android_ndk_arch="arm"
930                 kernel_tool_prefix="arm-linux-gnueabi-"
931                 ;;
932             *)
933                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
934                 ;;
935         esac
936         case "$aros_target_variant" in
937             android)
939                 dnl Not all Linux CPUs are supported by Android
940                 if test "$android_ndk_arch" = ""; then
941                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
942                 fi
944                 aros_default_wbwidth=320
945                 aros_default_wbheight=480
946                 if test "$aros_android_ndk" = "none"; then
947                     dnl Use standalone toolchain, don't adjust paths
948                     aros_kernel_cflags="-mandroid"
949                     aros_kernel_ldflags="-mandroid"
950                     CFLAGS="-mandroid"
951                 else
952                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
953                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
954                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
955                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
956                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
957                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
958                 fi
959                 need_x11=no
960                 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
961                 dnl in order not to fill mmakefiles with garbage
962                 x11_hidd_target=kernel-hidd-androidgfx-kobj
963                 # Disable implicit PIC mode
964                 aros_target_cflags="$aros_target_cflags -fno-pic"
965                 kernel_tool_prefix="$android_tool_prefix-"
966             ;;
967         esac
968     ;;
970     pc)
971         aros_target_arch="pc"
972         aros_shared_default="no"
973         target_bootloader="grub2"
974         case "$target_cpu" in
975             *i?86*)
976                 aros_target_cpu="i386"
978                 dnl If somebody hasn't already set the target object
979                 dnl format, then use this value. Mostly to support
980                 dnl FreeBSD cross-compilation.
981                 dnl TODO: Remove when we always use our compiler.
983                 if test "$aros_object_format" = "" ; then
984                     aros_object_format="elf_i386"
985                 fi
986                 aros_flavour="standalone"
987                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
988                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
989                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
990                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
991                 aros_config_ldflags="-m32 -march=i486"
992                 aros_kernel_ldflags="-melf_i386"
993                 aros_default_wbwidth=640
994                 aros_default_wbheight=480
995                 gcc_target_cpu="i386"
996                 ;;
997             *x86_64*)
998                 aros_target_cpu="x86_64"
999                 aros_serial_debug=1
1000                 if test "$aros_object_format" = "" ; then
1001                     aros_object_format="elf_x86_64"
1002                 fi
1003                 aros_flavour="standalone"
1004                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1005                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
1006                 aros_kernel_ldflags=""
1007                 aros_default_wbwidth=640
1008                 aros_default_wbheight=480
1009                 ;;
1010             *)
1011                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1012                 ;;
1013         esac
1014         ;;
1016     prep)
1017         aros_target_arch="prep"
1018         aros_shared_default="no"
1019         aros_target_cpu="ppc"
1020         aros_object_format="elf32ppc"
1021         aros_flavour="ppcnative"
1022         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1023         aros_kernel_ldflags=""
1024         aros_default_wbwidth=640
1025         aros_default_wbheight=480
1026         gcc_target_cpu="ppc"
1027         ;;
1029     freebsd*)
1030         aros_target_arch="freebsd"
1031         aros_target_family="unix"
1032         aros_target_cpu="i386"
1033         aros_flavour="emulation"
1034         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1035         gcc_target_cpu="i386"
1037         aros_target_strip_flags="-x"
1038         ;;
1040     darwin*)
1041         aros_target_arch="darwin"
1042         aros_target_family="unix"
1043         aros_flavour="emulation"
1044         case "$target_cpu" in
1045             *i?86*)
1046                 aros_ios_platform="iPhoneSimulator"
1047                 aros_target_cpu="i386"
1048                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1049                 aros_kernel_ldflags=""
1050                 aros_macosx_version="10.4"
1051                 aros_default_wbdepth=8
1052                 gcc_target_cpu="i386"
1053                 aros_object_format="elf_i386"
1054                 aros_kernel_ar_flags="-cr"
1055                 aros_target_strip_flags="-x"
1056                 kernel_tool_flags="-m32"
1057                 ;;
1058             *x86_64*)
1059                 aros_target_cpu="x86_64"
1060                 aros_object_format="elf_x86_64"
1061                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1062                 aros_macosx_version="10.6"
1063                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1064                 aros_kernel_cflags="-m64"
1065                 aros_kernel_ldflags="-m64"
1066                 aros_target_cflags="-mcmodel=large"
1067                 aros_default_wbdepth=8
1068                 aros_kernel_ar="ar"
1069                 aros_kernel_ar_flags="-cr"
1070                 aros_kernel_ld="ld"
1071                 aros_kernel_ranlib="ranlib"
1072                 ;;
1073             *ppc*)
1074                 aros_target_cpu="ppc"
1075                 aros_object_format="elf32ppc"
1076                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1077                 aros_kernel_ldflags=""
1078                 aros_macosx_version="10.0"
1079                 aros_default_wbdepth=8
1080                 gcc_target_cpu="ppc"
1081                 aros_kernel_ar="ar"
1082                 aros_kernel_ar_flags="-cr"
1083                 aros_kernel_ld="ld -arch ppc"
1084                 aros_kernel_as="as -arch ppc"
1085                 aros_kernel_ranlib="ranlib -arch ppc"
1086                 aros_kernel_nm="nm -arch ppc"
1087                 aros_kernel_strip="strip -arch ppc"
1088                 kernel_tool_prefix="powerpc-apple-darwin10-"
1089                 ;;
1090             *arm*)
1091                 aros_ios_platform="iPhoneOS"
1092                 aros_target_cpu="arm"
1093                 aros_object_format="armelf_linux_eabi"
1094                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1095                 aros_arch_libs="-laeabi"
1096                 aros_default_wbdepth=8
1097                 gcc_target_cpu="arm"
1098                 aros_kernel_ar="ar"
1099                 aros_kernel_ar_flags="-cr"
1100                 aros_kernel_ld="ld -arch arm"
1101                 aros_kernel_ranlib="ranlib -arch arm"
1102                 kernel_tool_prefix="arm-apple-darwin10-" 
1103                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1104                 ;;
1105             *)
1106                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1107                 ;;
1108         esac
1109         case "$aros_target_variant" in
1110             ios)
1111                 aros_ios_version="3.0"
1112                 aros_default_wbwidth=320
1113                 aros_default_wbheight=480
1114                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1115                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1116                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1117                 need_x11=no
1118                 # This is here because it may depend on iOS or SDK version
1119                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1120                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1121                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1122             ;;
1123             *)
1124                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1125                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1126             ;;
1127         esac
1128         ;;
1130     dragonfly*)
1131         aros_target_arch="dragonfly"
1132         aros_target_family="unix"
1133         aros_flavour="emulation"
1134         case "$target_cpu" in
1135             *i?86*)
1136                 aros_target_cpu="i386"
1137                 aros_object_format="elf_i386"
1138                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1139                 ;;
1140             *x86_64*)
1141                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1142                 aros_target_cpu="x86_64"
1143                 aros_object_format="elf_x86_64"
1144                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1145                 ;;
1146             *)
1147                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1148                 ;;
1149         esac
1150         ;;
1152     netbsd*)
1153         aros_target_arch="netbsd"
1154         aros_target_family="unix"
1155         case "$target_cpu" in
1156             *m68k*)
1157                 aros_target_cpu="m68k"
1158                 aros_object_format="m68kelf"
1159                 aros_flavour="emulcompat"
1160                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1161                 gcc_target_cpu="mc68000"
1162                 ;;
1163             *i?86*)
1164                 aros_target_cpu="i386"
1165                 aros_object_format="elf_i386"
1166                 aros_flavour="emulation"
1167                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1168                 aros_default_wbdepth=8
1169                 gcc_target_cpu="i386"
1170                 ;;
1171             *)
1172                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1173                 ;;
1174         esac
1175         aros_target_genmap="-Wl,-M -Xlinker >"
1176         aros_flavour="emulation"
1177         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1178         ;;   
1180     openbsd*)
1181         aros_target_arch="openbsd"
1182         aros_target_family="unix"
1183         case "$target_cpu" in
1184             *i?86*)
1185                 aros_target_cpu="i386"
1186                 aros_object_format="elf_i386"
1187                 aros_flavour="emulation"
1188                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1189                 gcc_target_cpu="i386"
1190                 ;;
1191             *)
1192                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1193                 ;;
1194         esac
1195         aros_target_genmap="-Wl,-M -Xlinker >"
1196         aros_target_nm_flags="-u"
1197         aros_flavour="emulation"
1198         ;;
1200     solaris*)
1201         aros_target_arch="solaris"
1202         aros_target_family="unix"
1203         case "$target_cpu" in
1204            *i?86*)
1205                aros_target_cpu="i386"
1206                aros_object_format="elf_i386"
1207                aros_flavour="emulation"
1208                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1209                aros_default_wbdepth=8
1210                gcc_target_cpu="i386"
1211                ;;
1212             *sparc*)
1213                 aros_target_cpu="sparc"
1214                 aros_object_format="elf_sparc"
1215                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1216                 gcc_target_cpu="sparc"
1217                 ;;
1218             *)
1219                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1220                 ;;
1221         esac
1222         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1223         aros_flavour="emulation"
1224         ;;
1226     morphos*)
1227         aros_target_arch="morphos"
1228         aros_shared_default="no"
1229         aros_target_cpu="ppc"
1230         aros_object_format="elf_ppc"
1231         aros_flavour="nativecompat"
1232         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1233         gcc_target_cpu="ppc"
1234         ;;
1236     sam440)
1237         aros_target_arch="sam440"
1238         aros_shared_default="no"
1239         aros_target_cpu="ppc"
1240         aros_object_format="elf32ppc"
1241         aros_flavour="ppcnative"
1242         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1243         aros_kernel_ldflags=""
1244         aros_default_wbwidth=1024
1245         aros_default_wbheight=768
1246         aros_default_wbdepth=24
1247         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1248         gcc_target_cpu="powerpc"
1249         ;;
1251     efika)
1252         aros_target_arch="efika"
1253         aros_shared_default="no"
1254         aros_target_cpu="arm"
1255         aros_object_format="armelf_linux_eabi"
1256         aros_flavour="standalone"
1257         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1258         aros_kernel_ldflags=""
1259         aros_default_wbwidth=1024
1260         aros_default_wbheight=600
1261         aros_arch_libs="-laeabi"
1262         gcc_default_cpu="armv7-a"
1263         gcc_default_fpu="vfpv3"
1264         gcc_default_float_abi="softfp"
1265         aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1266         aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1267         ;;
1268         
1269     chrp)
1270     aros_target_arch="chrp"
1271     aros_shared_default="no"
1272     aros_target_cpu="ppc"
1273     aros_object_format="elf32ppc"
1274     aros_flavour="ppcnative"
1275     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1276     aros_kernel_ldflags=""
1277     aros_default_wbwidth=640
1278     aros_default_wbheight=480
1279     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
1280     gcc_target_cpu="powerpc"
1281         case "$aros_target_variant" in
1282             efika)
1283             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1284             ;;
1285         esac
1286     ;;
1288     amiga*)
1289         aros_target_arch="amiga"
1290         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1291         aros_shared_default="no"
1293         case "$target_cpu" in
1294             *m68k*)
1295                 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")
1296                 aros_enable_mmu=no
1297                 aros_target_cpu="m68k"
1298                 aros_object_format="m68kelf"
1299                 aros_flavour="standcompat"
1300                 gcc_target_cpu="m68000"
1301                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin -Wno-volatile-register-var -Os -DNOLIBINLINE"
1302                 aros_config_aflags="$aros_config_aflags"
1303                 aros_target_strip_flags="-R.comment --strip-debug"
1304                 aros_default_wbwidth=640
1305                 aros_default_wbheight=256
1306                 aros_default_wbdepth=2
1307                 ;;
1308             *ppc*)
1309                 aros_cpu="ppc"
1310                 aros_flavour="native"
1311                 gcc_target_cpu="ppc"
1312                 ;;
1313             *)
1314                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1315                 ;;
1316         esac
1317         ;;
1319     mingw*)
1320         aros_target_arch="mingw32"
1321         aros_shared_default="no"
1322         aros_flavour="emulation"
1323         aros_shared_cflags=""
1324         need_crosstools="yes"
1325         need_dlopen="no"
1326         rescomp="windres"
1327         case "$target_cpu" in
1328             *i?86*)
1329                 aros_target_cpu="i386"
1330                 aros_object_format="elf_i386"
1331                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1332                 aros_default_wbdepth=8
1333                 gcc_target_cpu="i386"
1335                 kernel_tool_prefix="i386-mingw32-"
1336                 ;;
1337             *x86_64*)
1338                 aros_target_cpu="x86_64"
1339                 aros_object_format="elf_x86_64"
1340                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1341                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1342                 aros_default_wbdepth=8
1343                 kernel_tool_prefix="x86_64-w64-mingw32-"
1344                 ;;
1345             *arm*)
1346                 aros_target_cpu="arm"
1347                 aros_object_format="armelf_linux_eabi"
1348                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1349                 aros_arch_libs="-laeabi"
1350                 aros_default_wbdepth=8
1351                 gcc_target_cpu="arm"
1352                 gcc_default_float_abi="soft"
1353                 kernel_tool_prefix="arm-mingw32ce-"
1354                 aros_default_wbwidth=160
1355                 aros_default_wbheight=160
1356                 ;;
1357             *)
1358                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1359                 ;;
1360         esac
1361         if test $host_os = "cygwin"; then
1362                 aros_kernel_cflags="-mno-cygwin"
1363         fi
1364     ;;
1365     pp*)
1366         aros_target_arch="pp"
1367         aros_shared_default="no"
1368         case "$target_cpu" in
1369             *m68k*)
1370                 aros_target_cpu="m68k"
1371                 aros_object_format="m68kelf"
1372                 aros_flavour="palmnative"
1373                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1374                 aros_default_wbwidth=160
1375                 aros_default_wbheight=160
1376                 aros_default_wbdepth=1
1377                 aros_target_ar_flags="cru"
1378                 aros_compiler_libs="-lgcc1"
1379                 aros_shared_default=no
1380                 aros_shared_cflags="-fpic"
1381                 aros_shared_aflags=""
1382                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1383                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1384                 aros_debug_cflags="$aros_symbols_debug  $aros_messages_debug"
1385                 aros_debug_aflags=""
1386                 aros_debug_ldflags="$aros_symbols_debug"
1387                 aros_mungwall_debug="0"
1388                 aros_modules_debug="0"
1389                 gcc_target_cpu="mc68000"
1390                 ignore_undefined_symbols="-ius"
1391                 ;;
1392            *)
1393                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1394                 ;;
1395         esac
1396         ;;
1398     mac*)
1399         aros_target_arch="mac"
1400         aros_shared_default="no"
1401         case "$target_cpu" in
1402             *m68k*)
1403                 aros_target_cpu="m68k"
1404                 aros_object_format="m68kelf"
1405                 aros_flavour="mac68knative"
1406                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1407                 aros_default_wbwidth=512
1408                 aros_default_wbheight=384
1409                 aros_default_wbdepth=8
1410                 aros_target_ar_flags="cru"
1411                 aros_compiler_libs="-lgcc1"
1412                 aros_shared_default=no
1413                 aros_shared_cflags="-fpic"
1414                 aros_shared_aflags=""
1415                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1416                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1417                 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
1418                 aros_debug_aflags=""
1419                 aros_debug_ldflags="$aros_symbols_debug"
1420                 aros_mungwall_debug="0"
1421                 aros_modules_debug="0"
1422                 gcc_target_cpu="mc68000"
1423                 ignore_undefined_symbols="-ius"
1424                 ;;
1425            *)
1426                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1427                 ;;
1428         esac
1429         ;;
1431     *)
1432         AC_MSG_ERROR([Unsupported target architecture $target])
1433         ;;
1434 esac
1436 #-----------------------------------------------------------------------------
1437 crosstools_guess=yes
1439 AC_MSG_CHECKING([Kernel toolchain prefix])
1440 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1441 AC_MSG_RESULT($kernel_tool_prefix)
1443 AC_MSG_CHECKING([ELF toolchain prefix])
1444 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"
1445                                                  crosstools_guess=no])
1446 AC_MSG_RESULT($elf_tool_prefix)
1448 AC_MSG_CHECKING([AROS toolchain prefix])
1449 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain]),[aros_tool_prefix="$withval"
1450                 crosstools_guess=no])
1451 if test "$aros_tool_prefix" = "yes" ; then
1452     aros_tool_prefix=$aros_target_cpu-aros-
1454 AC_MSG_RESULT($aros_tool_prefix)
1456 #-----------------------------------------------------------------------------
1457 #   Checking if we should build crosstools..
1458 AC_MSG_CHECKING([whether to build crosstools])
1459 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1460 AC_MSG_RESULT($crosstools)
1462 if test "${crosstools}" = "yes"; then
1463     if test "${crosstools_guess}" = "no"; then
1464         AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1465     fi
1468 AC_MSG_CHECKING([where to install the crosstools binaries])
1469 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])
1470 if test "x$aros_toolchain_install" = "x"; then
1471     AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1472 else
1473     AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1474     PATH="$AROS_CROSSTOOLSDIR:$PATH"
1476 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1479 # Now process extra architecture-specific options.
1480 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1481 # as well as floating-point ABI.
1482 case "$aros_target_cpu" in
1483 arm)
1484     dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1485     if test "$gcc_default_cpu" = ""; then
1486         gcc_default_cpu="armv6"
1487     fi
1488     if test "$gcc_default_fpu" = ""; then
1489         gcc_default_fpu="vfp"
1490     fi
1491     if test "$gcc_default_float_abi" = ""; then
1492         gcc_default_float_abi="softfp"
1493     fi
1495     AC_MSG_CHECKING([Which minimum CPU to use])
1496     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)
1497     AC_MSG_RESULT($aros_gcc_cpu)
1499     AC_MSG_CHECKING([Which minimum FPU to use])
1500     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)
1501     AC_MSG_RESULT($aros_gcc_fpu)
1503     AC_MSG_CHECKING([Which floating point ABI to use])
1504     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)
1505     AC_MSG_RESULT($aros_gcc_float_abi)
1507     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"
1508     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"
1509     ;;
1510 esac
1512 # Some formats need custom ELF specs.
1513 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1514 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1515     elf_specs_in=config/${aros_object_format}-specs.in
1516 else
1517     elf_specs_in=config/elf-specs.in
1520 AC_MSG_CHECKING([what specific AROS gcc version to use])
1521 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="")
1522 AC_MSG_RESULT($aros_gcc_version)
1524 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1525 # Since we override specs, we may need to put these defines there
1526 if test "$gcc_target_cpu" != ""; then
1527     gcc_target_cpu="-D__${gcc_target_cpu}__"
1530 AC_MSG_CHECKING([where to download sourcecode for external ports])
1531 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1532 if test "$with_portssrcdir" = "default"; then
1533     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1534 else
1535     AROS_PORTSSRCDIR="$with_portssrcdir"
1537 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1539 AC_MSG_CHECKING([which bootloader to use])
1540 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1541 if test "$target_bootloader" = "none"; then
1542     aros_target_bootloader=""
1543 else
1544     aros_target_bootloader="$target_bootloader"
1546 AC_MSG_RESULT($target_bootloader)
1548 AC_MSG_CHECKING([which icon-set to use])
1549 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1550 if test "$target_iconset" = "default"; then
1551     aros_target_iconset="Gorilla"
1552     target_iconset="default (Gorilla)"
1553 else
1554     aros_target_iconset="$target_iconset"
1556 AC_MSG_RESULT($target_iconset)
1558 AC_MSG_CHECKING([which GUI Theme to use])
1559 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1560 if test "$target_guitheme" = "default"; then
1561     aros_target_guitheme="Ice"
1562 else
1563     aros_target_guitheme="$target_guitheme"
1565 AC_MSG_RESULT($aros_target_guitheme)
1567 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1568 # for target code)
1569 cross_compiling=no
1571 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
1572 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1573     cross_compiling=yes
1576 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
1577 dnl The flag itself is given in per-target section, because some targets require to pass it
1578 dnl in a different manner, otherwise some tests fail.
1579 dnl TODO: Justify this.
1580 if test "$aros_host_cpu" == "x86_64" ; then
1581     if test "$aros_target_cpu" == "i386" ; then
1582         cross_compiling=no
1583     fi
1586 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1587     dnl For a hosted build we are cross-compiling if host OS differs from build OS.
1588     dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
1589     dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
1590     dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
1591     dnl used to build bootstrap for target arch in either case.
1592     dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
1593     dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
1594     dnl perhaps introducing aros_host_variant
1595     if test "$aros_host_arch" != "$aros_target_arch" ; then
1596         cross_compiling=yes
1597     fi
1598 else
1599     dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
1600     dnl it as kernel_cc. If not, (e. g. we are on Windows or Darwin), we need a crosscompiler.
1601     if test "$host_cc_elf" = "no" ; then
1602         cross_compiling=yes
1603     fi
1606 if test "$cross_compiling" = "no" ; then
1607     kernel_tool_prefix=""
1608     if test "$host_cc_elf" = "yes" ; then
1609         elf_tool_prefix=""
1610     fi
1613 #######################################################################
1614 ## Compute what toolchains to use, and their paths                   ##
1615 #######################################################################
1617 # This takes, as input:
1618 #   crosstools             {yes,no}
1619 #   kernel_tool_version    {"",[version]}
1620 #   aros_gcc_version       {"",[version]}
1621 #   kernel_tool_prefix     {none,[some-arch-os-]}
1622 #   aros_tool_prefix       ${target_cpu}-aros-
1624 # The output is
1625 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1626 #        Where the 'kernel' binaries are located
1627 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1628 #        Where the 'target' binaries are located
1629 #        (not the symlink farm - that is aros_target_*!)
1631 # The rules are:
1632 #   if crosstools then
1633 #      if kernel_tools_prefix = "no-kernel-prefix-"
1634 #          aros_kernel_* = crosstools cc paths
1635 #          aros_kernel_cc = elf cc wrapper around crosstools cc
1636 #      else
1637 #          VALIDATE(${kernel_tools_prefix}*)
1638 #          aros_kernel_* = ${kernel_tools_prefix}*
1639 #          if ${kernel_tools_prefix}cc is an AROS gcc
1640 #              aros_kernel_cc = ${kernel_tools_prefix}cc
1641 #          else
1642 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1643 #          fi
1644 #      fi
1646 #      orig_target_* = aros built crosstools
1647 #      orig_target_cc = elf cc wrapper around crosstools cc
1648 #   else
1649 #      VALIDATE(${kernel_tools_prefix}*)
1651 #      orig_target_* = aros_kernel_*
1652 #      if aros_kernel_cc is an AROS gcc
1653 #          orig_target_cc = aros_kernel_cc
1654 #      else
1655 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
1656 #      fi
1657 #   fi
1659 target_tool_prefix="${target_cpu}-aros-"
1661 AC_MSG_CHECKING([which kernel tools])
1662 AC_MSG_RESULT([$kernel_tool_prefix]);
1664 if test "$kernel_tool_prefix" = "none" ; then
1665     dnl ELF wrapper can be used only for native bootstrap
1666     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1667         AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
1668     fi
1669 else
1670     # Kernel tools required - find them
1671     # Note that 'normally', aros_kernel_* overrides will
1672     # empty, unless specified in the per-arch sections above.
1673     if test "x$aros_kernel_cpp" = "x"; then
1674         aros_kernel_cpp=${kernel_tool_prefix}cpp
1675     fi
1676     AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp${kernel_tool_version})
1677     AROS_REQUIRED(cpp,$aros_kernel_cpp)
1678     if test "x$aros_kernel_cc" = "x"; then
1679         aros_kernel_cc=${kernel_tool_prefix}gcc
1680     fi
1681     AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${kernel_tool_version})
1682     AROS_REQUIRED(cc,$aros_kernel_cc)
1683     if test "x$aros_kernel_cxx" = "x"; then
1684         aros_kernel_cxx=${kernel_tool_prefix}g++
1685     fi
1686     AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${kernel_tool_version})
1687     # If it's set, make sure it's really there
1688     if test "x$aros_kernel_cxx" != "x" ; then
1689         AROS_REQUIRED(cxx,$aros_kernel_cxx)
1690     fi
1691     AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1692     AROS_REQUIRED(ld,$aros_kernel_ld)
1693     AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1694     AROS_REQUIRED(as,$aros_kernel_as)
1695     AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1696     AROS_REQUIRED(ar,$aros_kernel_ar)
1697     AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1698     AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1699     AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1700     AROS_REQUIRED(nm,$aros_kernel_nm)
1701     AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1702     AROS_REQUIRED(strip,$aros_kernel_strip)
1704     # Objcopy and objdump are not required for the kernel
1705     # toolchain on many architectures.
1706     # So we'll look for them, but not make them strictly required.
1707     AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1708     AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1709     if test "x${crosstools}" != "xyes" ; then
1710         AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1711         AROS_REQUIRED(objdump,$aros_kernel_objdump)
1712     fi
1715 AC_MSG_CHECKING([which target tools to use])
1716 if test "$crosstools" = "yes"; then
1717     AC_MSG_RESULT([$target_tool_prefix])
1718     # We are are building AROS crosstools
1719     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1720     orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1721     orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1722     orig_target_cpp="${tmp_tool_prefix}cpp"
1723     orig_target_ld="${tmp_tool_prefix}ld"
1724     orig_target_as="${tmp_tool_prefix}as"
1725     orig_target_ar="${tmp_tool_prefix}ar"
1726     orig_target_ranlib="${tmp_tool_prefix}ranlib"
1727     orig_target_nm="${tmp_tool_prefix}nm"
1728     orig_target_strip="${tmp_tool_prefix}strip"
1729     orig_target_objcopy="${tmp_tool_prefix}objcopy"
1730     orig_target_objdump="${tmp_tool_prefix}objdump"
1731 else
1732     # Determine whether AROS or ELF tools should be used
1733     if test "$aros_tool_prefix" = "none"; then
1734         aros_tool_prefix="${elf_tool_prefix}"
1735         crosstools_cxx_target=tools-crosstools
1736     fi
1738     AC_MSG_RESULT([$aros_tool_prefix])
1739     # We are *not* building AROS crosstools - use the AROS or ELF tools
1740     AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}cpp)
1741     AROS_REQUIRED(cpp,$orig_target_cpp)
1742     AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}gcc)
1743     AROS_REQUIRED(cc,$orig_target_cc)
1744     if test "x${crosstools_cxx_target}" = "x" ; then
1745         AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}g++)
1746         AROS_REQUIRED(cxx,$orig_target_cxx)
1747     fi
1748     AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}ld)
1749     AROS_REQUIRED(ld,$orig_target_ld)
1750     AROS_TOOL_TARGET(orig_target_as,as,${aros_tool_prefix}as)
1751     AROS_REQUIRED(as,$orig_target_as)
1752     AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}ar)
1753     AROS_REQUIRED(ar,$orig_target_ar)
1754     AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}ranlib)
1755     AROS_REQUIRED(ranlib,$orig_target_ranlib)
1756     AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}nm)
1757     AROS_REQUIRED(nm,$orig_target_nm)
1758     AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}strip)
1759     AROS_REQUIRED(strip,$orig_target_strip)
1760     AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}objcopy)
1761     AROS_REQUIRED(objcopy,$orig_target_objcopy)
1762     AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}objdump)
1763     AROS_REQUIRED(objdump,$orig_target_objdump)
1766 if test "$kernel_tool_prefix" = "none" ; then
1767     # No kernel tools specified
1768     # Assume target tools == kernel tools with ELF wrapper
1769     aros_kernel_cc=$orig_target_cc
1770     aros_kernel_cxx=$orig_target_cxx
1771     aros_kernel_cpp=$orig_target_cpp
1772     aros_kernel_ld=$orig_target_ld
1773     aros_kernel_as=$orig_target_as
1774     aros_kernel_ar=$orig_target_ar
1775     aros_kernel_ranlib=$orig_target_ranlib
1776     aros_kernel_nm=$orig_target_nm
1777     aros_kernel_strip=$orig_target_strip
1778     aros_kernel_objcopy=$orig_target_objcopy
1779     aros_kernel_objdump=$orig_target_objdump
1780     use_kernel_cc_wrapper=yes
1783 # At this point, all aros_kernel_* and aros_target_* 
1784 # tools should be set up correctly
1786 CC="$aros_kernel_cc $kernel_tool_flags"
1787 CPP="$aros_kernel_cpp"
1789 #-----------------------------------------------------------------------------
1791 # Disable pointer-signedness warnings if the compiler recognises the option
1793 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1794 save_cflags="$CFLAGS"
1795 if test "$crosstools" != "yes" ; then
1796     CFLAGS="$CFLAGS -Wno-pointer-sign"
1797     AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1798 else
1799     # we do know it is supported for the smallest version of gcc we are going to build
1800     # we assume it's also supported by later versions
1801     use_no_sign_warning=yes
1803 AC_MSG_RESULT($use_no_sign_warning)
1804 if test "x-$use_no_sign_warning" = "x-yes" ; then
1805     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1807 CFLAGS="$save_cflags"
1809 #-----------------------------------------------------------------------------
1811 # Find all the tools we need to compile. This could be cross-compiling
1812 # though! If that is the case we use the GNU form of the target and
1813 # simply add this to the front of the binary name. This is rather simple,
1814 # but it should work under most circumstances.
1816 # The default tools are to use the same as the host, but only if the
1817 # host and target CPU are the same. With GCC this is normally enough.
1820 aros_cc_pre=""
1821 aros_shared_ld="$aros_host_ld"
1823 aros_target_mkdep="$aros_host_mkdep"
1825 # The default tools executables to be linked to.
1826 if test "$rescomp" != ""; then
1827     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
1828     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1831 # Set up the sources for the symlink farm
1832 if test "$crosstools" = "yes"; then
1833     crosstools_target=tools-crosstools
1836 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1837 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1840 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1841 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1842 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1843 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1844 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1845 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1846 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1848 # aros_cc_pre is a variable that is added to the front of the compiler name
1849 # in the generated aros-gcc shell script. We need this to enable the cache
1850 # to work across cleaned builds. Also, support DISTCC using the correct
1851 # environment variable.
1854 if test "x${DISTCC}" != "x" ; then
1855     if test "x${CCACHE}" != "x" ; then
1856         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1857     else
1858         aros_cc_pre="${DISTCC} "
1859     fi
1860 else
1861     if test "x${CCACHE}" != "x" ; then
1862         aros_cc_pre="${CCACHE} "
1863     fi
1866 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1868 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1869 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1870 AC_SUBST(aros_target_nix_ldflags,-nix)
1871 AC_SUBST(aros_target_detach_ldflags,-detach)
1872 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1874 # Target tools
1875 if test "$crosstools" != "yes"; then
1876     if test "$GCC" = "yes"; then
1877         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1878     fi
1879 else
1880     # We do not know which gcc version we are going to build and what we need to know
1881     # here is different for different versions so this will be set later during the
1882     # build of crosstools.
1883     aros_target_cc_path=@aros_target_cc_path@
1885 aros_target_cpp="${prefix}cpp"
1886 aros_target_cc="${prefix}gcc"
1887 aros_target_cxx="${prefix}g++"
1888 aros_target_as="${prefix}as"
1889 aros_target_ld="${prefix}ld"
1890 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1891 aros_target_objcopy="${prefix}objcopy"
1892 aros_target_objdump="${prefix}objdump"
1893 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1894 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1895 aros_target_strip="${prefix}strip"
1896 aros_plain_nm="${prefix}nm"
1897 aros_plain_ar="${prefix}ar"
1899 AC_ARG_ENABLE(includes,
1900 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1901 [aros_target_incl=$enable_includes], [aros_target_incl=`$aros_kernel_cc -print-sysroot`/`$aros_kernel_cc --print-sysroot-headers-suffix 2>/dev/null || echo usr/include`])
1903 if test "$aros_kernel_includes" = ""; then
1904     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1905         aros_kernel_includes="-isystem $aros_target_incl"
1906     fi
1909 if test "$aros_kernel_includes" != "" ; then
1910     dnl find out about the kernel cc's include path
1911     AC_MSG_CHECKING([for the kernel compiler's include path])
1912     if test "$aros_kernel_cc_includes" = "" ; then
1913         # Try to guess where the directory is.
1914         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1915         if test -d $aros_kernel_cc_includes; then
1916             # Check if there is also an include-fixed directory and add it
1917             # to kernel compiler's include path as it may contain some of
1918             # the headers we need.
1919             if test -d "$aros_kernel_cc_includes"-fixed; then
1920                 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1921             fi
1922             # Check for specific includes directory. Neede for Ubuntu 11.10
1923             if test -d "/usr/include/i386-linux-gnu"; then
1924                 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1925             fi
1926         else
1927             # The directory doesn't exist, we need to do some more work.
1928             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1930             # These are the headers we're looking for.
1931             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1932                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1933                      zutil.h stdint.h"
1935             dirs=
1936             for h in $headers; do
1937                 # Which other headers are needed by each of the above?
1938                 deps=$(echo "#include <$h>" | \
1939                        $aros_kernel_cc -E -M - 2>/dev/null | \
1940                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1942                 # Copy all the needed headers to a directory beneath gendir.
1943                 for d in $deps; do
1944                     h=$(basename $d)
1945                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1946                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1947                     ! test -d $dir && mkdir -p $dir
1948                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1949                 done
1950             done            
1951         fi
1952     fi
1953     AC_MSG_RESULT($aros_kernel_cc_includes)
1954     # Adding -nostdinc to kernel includes as they are always used together.
1955     aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1958 if test "$crosstools" != "yes"; then
1959     dnl find out about the target cc's include path
1960     AC_MSG_CHECKING([for the target compiler's include path])
1961     if test "$aros_target_cc_includes" = "" ; then
1962         #try to guess where the directory is
1963         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1964         if ! test -d $aros_target_cc_includes; then
1965             #the directory doesn't exist, we need to do some more work
1966             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1967         
1968             #these are the headers we're looking for
1969             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1970                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1971                     zutil.h"
1973             dirs=
1974             for h in $headers; do
1975                 #which other headers each of the above headers needs?
1976                 deps=$(echo "#include <$h>" | \
1977                     $orig_target_cc -E -M - 2>/dev/null | \
1978                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1979             
1980                 #copy all the needed headers to a directory beneath gendir
1981                 for d in $deps; do
1982                     h=$(basename $d)
1983                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1984                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1985                     ! test -d $dir && mkdir -p $dir
1986                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1987                 done
1988             done
1989         fi
1990     fi
1991     AC_MSG_RESULT($aros_target_cc_includes)
1992 else
1993     # We do not know which gcc version we are going to build and what we need to know
1994     # here is different for different versions so this will be set later during the
1995     # build of crosstools.
1996     aros_target_cc_includes=@aros_target_cc_includes@
2000 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
2001 # On GCC >= 4.0 -iquote should be used
2004 save_cc="$CC"
2005 save_cflags="$CFLAGS"
2006 CFLAGS="-iquote."
2007 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2008 if test "x-$crosstools" != "x-yes"; then
2009     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2010 else
2011     # we do know it is supported for the smallest version of gcc we are going to build
2012     # we assume it's also supported by later versions
2013     has_iquote=yes
2015 AC_MSG_RESULT($has_iquote)
2016 if test "x-$has_iquote" = "x-yes" ; then
2017     host_cflags_iquote=-iquote
2018     host_cflags_iquote_end=
2019 else
2020     host_cflags_iquote=-I
2021     host_cflags_iquote_end=-I-
2023 kernel_cflags_iquote=$host_cflags_iquote
2024 kernel_cflags_iquote_end=$host_cflags_iquote_end
2025 if test "x-$cross_compiling" = "x-yes"; then
2026     CC="$aros_kernel_cc"
2027     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2028     if test "x-$crosstools" != "x-yes"; then
2029         AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2030     else
2031         # we do know it is supported for the smallest version of gcc we are going to build
2032         # we assume it's also supported by later versions
2033         use_no_stack_protector=yes
2034     fi
2035     AC_MSG_RESULT($use_no_stack_protector)
2036     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2037     if test "x-$crosstools" != "x-yes"; then
2038         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2039     else
2040         # we do know it is supported for the smallest version of gcc we are going to build
2041         # we assume it's also supported by later versions
2042         has_iquote=yes
2043     fi
2044     AC_MSG_RESULT($has_iquote)
2045     if test "x-$has_iquote" = "x-yes" ; then
2046         kernel_cflags_iquote=-iquote
2047         kernel_cflags_iquote_end=
2048     else
2049         kernel_cflags_iquote=-I
2050         kernel_cflags_iquote_end=-I-
2051     fi
2053 aros_cflags_iquote=$kernel_cflags_iquote
2054 aros_cflags_iquote_end=$kernel_cflags_iquote_end
2055 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2056     CC="$orig_target_cc"
2057     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2058     if test "x-$crosstools" != "x-yes"; then
2059         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2060     else
2061         # we do know it is supported for the smallest version of gcc we are going to build
2062         # we assume it's also supported by later versions
2063         has_iquote=yes
2064     fi
2065     AC_MSG_RESULT($has_iquote)
2066     if test "x-$has_iquote" = "x-yes" ; then
2067         aros_cflags_iquote=-iquote
2068         aros_cflags_iquote_end=
2069     else
2070         aros_cflags_iquote=-I
2071         aros_cflags_iquote_end=-I-
2072     fi
2074 if test "x-$use_no_stack_protector" = "x-yes" ; then
2075     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2079 #-----------------------------------------------------------------------------
2081 # Check if the target compiler supports some options used for delinting:
2082 #  -Wunused-but-set-variable
2083 #  -Warray-bounds
2084 #  -Wenum-compare
2085 #  -Wstrict-overflow
2086 #  -Wformat-security
2088 if test "x-$crosstools" != "x-yes"; then
2089     if test "$orig_target_cc" != "$aros_kernel_cc"; then
2090         CC="$orig_target_cc"
2091     fi
2092     AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2093     CFLAGS=-Wunused-but-set-variable
2094     AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2095     AC_MSG_RESULT($aros_unused_but_set_variable)
2096     if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2097         aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2098     fi
2100     AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2101     CFLAGS=-Warray-bounds
2102     AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2103     AC_MSG_RESULT($aros_array_bounds)
2104     if test "x-$aros_array_bounds" = "x-yes" ; then
2105         aros_cflags_array_bounds=-Wno-array-bounds
2106     fi
2108     AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2109     CFLAGS=-Wenum-compare
2110     AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2111     AC_MSG_RESULT($aros_enum_compare)
2112     if test "x-$aros_enum_compare" = "x-yes" ; then
2113         aros_cflags_enum_compare=-Wno-enum-compare
2114     fi
2116     AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2117     CFLAGS=-Wstrict-overflow
2118     AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2119     AC_MSG_RESULT($aros_strict_overflow)
2120     if test "x-$aros_strict_overflow" = "x-yes" ; then
2121         aros_cflags_strict_overflow=-Wno-strict-overflow
2122     fi
2124     AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2125     CFLAGS=-Wformat-security
2126     AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2127     AC_MSG_RESULT($aros_format_security)
2128     if test "x-$aros_format_security" = "x-yes" ; then
2129         aros_cflags_format_security=-Wno-format-security
2130     fi
2131 else
2132     # We do not know which gcc version we are going to build and what we need to know
2133     # here is different for different versions so this will be set later during the
2134     # build of crosstools.
2135     aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2136     aros_cflags_array_bounds=@aros_cflags_array_bounds@
2137     aros_cflags_enum_compare=@aros_cflags_enum_compare@
2138     aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2139     aros_cflags_format_security=@aros_cflags_format_security@
2142 #-----------------------------------------------------------------------------
2144 # Check if we can explicitly choose older version of symbol hashing
2146 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2147 CC="$aros_kernel_cc"
2148 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2149 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2150 AC_MSG_RESULT($use_hash_style)
2151 if test "x-$use_hash_style" = "x-yes" ; then
2152     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2154 CC="$save_cc"
2155 CFLAGS="$save_cflags"
2157 AC_SUBST(host_cflags_iquote)
2158 AC_SUBST(host_cflags_iquote_end)
2159 AC_SUBST(kernel_cflags_iquote)
2160 AC_SUBST(kernel_cflags_iquote_end)
2161 AC_SUBST(aros_cflags_iquote)
2162 AC_SUBST(aros_cflags_iquote_end)
2165 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2166 AC_MSG_CHECKING([for default resolution of WBScreen])
2167 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2168 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2169 if test "$resolution" = "yes" ; then
2170     resolution="none"
2172 if test "$resolution" = "no" ; then
2173     resolution="none"
2175 if test "$resolution" != "none" ; then
2176     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2177     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2178     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2180 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2181 aros_cv_default_wbwidth=$aros_default_wbwidth
2182 aros_cv_default_wbheight=$aros_default_wbheight
2183 aros_cv_default_wbdepth=$aros_default_wbdepth
2185 dnl See if the user wants the serial debug output for native flavour
2186 AC_MSG_CHECKING([if serial debug is enabled])
2187 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)
2188 if test "$aros_serial_debug" = 0 ; then
2189     serial_debug_forced=""
2190     if test "$serial_debug" = "yes" ; then
2191         serial_debug="1"
2192     fi
2193     if test "$serial_debug" = "no" ; then
2194         serial_debug="none"
2195     fi
2196 else
2197     serial_debug_forced="(forced)"
2198     serial_debug=$aros_serial_debug
2200 if test "$serial_debug" != "none" ; then
2201     aros_serial_debug=$serial_debug
2202     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2203 else
2204     AC_MSG_RESULT(no)
2207 dnl See if the user wants the palm debug output hack for palm native flavour
2208 AC_MSG_CHECKING([if palm debug hack is enabled])
2209 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")
2210 if test "$palm_debug_hack" = "yes" ; then
2211     aros_palm_debug_hack="1"
2213 AC_MSG_RESULT($palm_debug_hack)
2215 dnl See if the user wants nesting supervisor activated for unix flavour
2216 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2217 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")
2218 if test "$nesting_supervisor" = "yes" ; then
2219     aros_nesting_supervisor="1"
2221 AC_MSG_RESULT($nesting_supervisor)
2223 dnl See if the user wants to disable MMU support
2224 dnl This can be overriden on per-target basis,
2225 dnl set $aros_enable_mmu to "yes" or "no" to do this
2226 if test "$aros_enable_mmu" = "" ; then
2227     AC_MSG_CHECKING([if MMU support is enabled])
2228     dnl Enabled by default
2229     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2230     if test "$aros_enable_mmu" = "" ; then
2231         aros_enable_mmu="yes"
2232     fi
2233     AC_MSG_RESULT($aros_enable_mmu)
2235 if test "$aros_enable_mmu" = "no" ; then
2236     aros_enable_mmu="0"
2237 else
2238     aros_enable_mmu="1"
2240     
2242 dnl things specifically required for hosted flavours
2243 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2245     if test "x-$need_dlopen" != "x-no" ; then
2246       save_libs="$LIBS"
2247       LIBS=""
2248       dnl some kind of dynamic library access system is required for hostlib.resource
2249       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2250       if test "x-$have_dl" = "x-no" ; then
2251           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2252                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2253                                     have_dl="no")
2254       fi
2255       if test "x-$have_dl" = "x-no" ; then
2256           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2257       fi
2258       LIBS="$save_libs"
2259     fi
2262     dnl x11 hidd
2263     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2264                                            [build X11 hidd for hosted (default=auto)]),
2265                                            x11_hidd="$enableval",
2266                                            x11_hidd="$need_x11")
2267     case "x-$x11_hidd" in
2268         x-yes|x-no|x-auto)                 ;;
2269         *)                 x11_hidd="$need_x11" ;;
2270     esac
2272     ENABLE_X11=0
2274     dnl they want it
2275     if test "x-$x11_hidd" != "x-no" ; then
2277         dnl find x11 stuff
2278         AC_PATH_X
2280         x_cflags=
2281         for path in $x_libraries
2282         do
2283             x_cflags="$x_cflags -L$path"
2284         done
2286         for path in $x_includes
2287         do
2288             x_cflags="$x_cflags -I$path"
2289         done
2290         
2291         if test "x-$no_x" = "x-yes" ; then
2293             dnl didn't find it
2294             if test "x-$x11_hidd" != "x-auto" ; then
2295                 dnl and they explicitly asked for it, bail out
2296                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2297             fi
2298         
2299         else
2300             dnl found it, setup the metatarget
2301             x11_hidd_target=kernel-x11gfx-kobj
2302             ENABLE_X11=1
2304             dnl setup shared memory extensions
2305             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2306                                                   [use X11 shared memory (default=auto)]),
2307                                                   x11_hidd_shm="$enableval",
2308                                                   x11_hidd_shm="auto")
2309             case "x-$x11_hidd_shm" in
2310                 x-yes|x-no|x-auto)                     ;;
2311                 *)                 x11_hidd_shm="auto" ;;
2312             esac
2314             have_xshm=no
2316             dnl they want it
2317             if test "x-$x11_hidd_shm" != "x-no" ; then
2319                 dnl system shm headers
2320                 AC_CHECK_HEADERS(sys/ipc.h)
2321                 AC_CHECK_HEADERS(sys/shm.h)
2323                 dnl got them
2324                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2326                     dnl make sure X libs have shm functions
2327                     save_cflags="$CFLAGS"
2328                     CFLAGS="$CFLAGS $x_cflags"
2329                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2330                     CFLAGS="$save_cflags"
2331                 fi
2332             fi
2334             dnl detection done, prepare output
2335             if test "x-$have_xshm" = "x-yes" ; then
2336                 dnl we can do shm
2337                 DO_XSHM_SUPPORT="1"
2338             elif test "x-$x11_hidd_shm" = "x-yes" ; then
2339                 dnl they explicitly asked for it, but we can't do it
2340                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2341             else
2342                 dnl otherwise just disable it
2343                 DO_XSHM_SUPPORT="0"
2344             fi
2346             
2347             dnl setup vidmode (fullscreen) extensions
2348             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2349                                                       [use X11 vidmode extension (default=auto)]),
2350                                                       x11_hidd_vidmode="$enableval",
2351                                                       x11_hidd_vidmode="auto")
2352             case "x-$x11_hidd_vidmode" in
2353                 x-yes|x-no|x-auto)                         ;;
2354                 *)                 x11_hidd_vidmode="auto" ;;
2355             esac
2357             have_vidmode=no
2359             dnl they want it
2360             if test "x-$x11_hidd_vidmode" != "x-no" ; then
2362                 dnl make sure X libs have vidmode functions
2363                 save_cflags="$CFLAGS"
2364                 CFLAGS="$CFLAGS $x_cflags"
2365                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2366                 CFLAGS="$save_cflags"
2367             fi
2369             dnl detection done, prepare output
2370             if test "x-$have_vidmode" = "x-yes" ; then
2371                 dnl we can do vidmode
2372                 DO_VIDMODE_SUPPORT="1"
2373             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2374                 dnl they explicitly asked for it, but we can't do it
2375                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2376             else
2377                 dnl otherwise just disable it
2378                 DO_VIDMODE_SUPPORT="0"
2379             fi
2380         fi
2382         aros_host_x11_includes=$x_includes 
2383         aros_host_x11_libdirs=$x_libraries
2384     fi
2387     dnl sdl hidd
2388     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2389                                            [build SDL hidd for hosted (default=auto)]),
2390                                            sdl_hidd="$enableval",
2391                                            sdl_hidd="auto")
2392     case "x-$sdl_hidd" in
2393         x-yes|x-no|x-auto)                 ;;
2394         *)                 sdl_hidd="auto" ;;
2395     esac
2397     dnl they want it
2398     if test "x-$sdl_hidd" != "x-no" ; then
2400         dnl find sdl
2401         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2403         if test "x-$have_sdl" != "x-yes" ; then
2405             dnl didn't find it
2406             if test "x-$sdl_hidd" != "x-auto" ; then
2407                 dnl and they explicitly asked for it, bail out
2408                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2409             fi
2411         else
2412             dnl found it, set up the metatarget
2413             sdl_hidd_target=kernel-hidd-sdl
2414             aros_host_sdl_cflags=SDL_CFLAGS
2415             aros_host_sdl_libs=SDL_LIBS
2416         fi
2417     fi
2419     dnl oss.library
2420     AC_CHECK_HEADER(sys/soundcard.h)
2421     if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2422         oss_library_target=workbench-libs-oss-unix
2423     fi
2427 dnl See if the user wants dbus.library
2428 AC_MSG_CHECKING([if building of dbus.library is enabled])
2429 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2430 if test "$dbus" = "yes" ; then
2431     ENABLE_DBUS=1
2432     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2433     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2434     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2435     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2436 else
2437     ENABLE_DBUS=0
2439 AC_MSG_RESULT($dbus)
2441 if test "$use_kernel_cc_wrapper" = "yes" ; then
2442     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2445 if test "${crosstools}" != "yes" ; then
2446     aros_target_toolchain=no
2447 else
2448     aros_target_toolchain=yes
2451 dnl --------------------------------------------------------------------
2452 dnl Configuration Output Section
2453 dnl --------------------------------------------------------------------
2455 # Generic
2456 AC_SUBST(aros_arch)
2457 AC_SUBST(aros_cpu)
2458 AC_SUBST(aros_flavour)
2459 AC_SUBST(aros_flavour_uc)
2460 AC_SUBST(aros_target_toolchain)
2461 AC_SUBST(AROS_BUILDDIR)
2462 AC_SUBST(AROS_BUILDDIR_UNIX)
2463 AC_SUBST(SRCDIR)
2464 AC_SUBST(AROS_CROSSTOOLSDIR)
2465 AC_SUBST(AROS_PORTSSRCDIR)
2467 # Compatability with other Amiga-like operation systems
2468 AC_SUBST(aros_amigaos_compliance)
2470 # Host related
2471 AC_SUBST(aros_cc_pre)
2472 AC_SUBST(aros_host_strip)
2473 AC_SUBST(aros_host_arch)
2474 AC_SUBST(aros_host_cpu)
2475 AC_SUBST(aros_host_cpp)
2476 AC_SUBST(aros_host_cc)
2477 AC_SUBST(aros_host_cxx)
2478 AC_SUBST(aros_host_ar)
2479 AC_SUBST(aros_host_ranlib)
2480 AC_SUBST(aros_host_ld)
2481 AC_SUBST(aros_host_make)
2482 AC_SUBST(aros_host_cflags)
2483 AC_SUBST(aros_host_cxxflags)
2484 AC_SUBST(gnu89_inline)
2485 AC_SUBST(aros_host_ldflags)
2486 AC_SUBST(aros_host_debug)
2487 AC_SUBST(aros_host_mkdep)
2488 AC_SUBST(aros_host_mkargs)
2489 AC_SUBST(aros_host_exe_suffix)
2490 AC_SUBST(aros_host_lib_suffix)
2491 AC_SUBST(aros_tools_dir)
2492 AC_SUBST(aros_host_aclocal)
2493 AC_SUBST(aros_host_autoconf)
2494 AC_SUBST(aros_host_autoheader)
2495 AC_SUBST(aros_host_automake)
2496 AC_SUBST(ant)
2498 # Target Related
2499 AC_SUBST(aros_target_guitheme)
2500 AC_SUBST(aros_target_iconset)
2501 AC_SUBST(aros_target_bootloader)
2502 AC_SUBST(aros_target_arch)
2503 AC_SUBST(aros_target_family)
2504 AC_SUBST(aros_target_cpu)
2505 AC_SUBST(aros_target_variant)
2506 AC_SUBST(aros_target_suffix)
2507 AC_SUBST(aros_target_ar)
2508 AC_SUBST(aros_target_ranlib)
2509 AC_SUBST(aros_plain_nm)
2510 AC_SUBST(aros_plain_ar)
2511 AC_SUBST(aros_kernel_ar)
2512 AC_SUBST(aros_kernel_ranlib)
2513 AC_SUBST(orig_target_cc)
2514 AC_SUBST(aros_target_cc)
2515 AC_SUBST(aros_kernel_cc)
2516 AC_SUBST(orig_target_cxx)
2517 AC_SUBST(aros_target_cxx)
2518 AC_SUBST(aros_kernel_cxx)
2519 AC_SUBST(orig_target_cpp)
2520 AC_SUBST(aros_target_cpp)
2521 AC_SUBST(aros_kernel_cpp)
2522 AC_SUBST(orig_target_as)
2523 AC_SUBST(aros_target_as)
2524 AC_SUBST(aros_kernel_as)
2525 AC_SUBST(orig_target_ld)
2526 AC_SUBST(aros_target_ld)
2527 AC_SUBST(aros_kernel_ld)
2528 AC_SUBST(aros_target_cc_includes)
2529 AC_SUBST(aros_target_cc_path)
2530 AC_SUBST(aros_target_objdump)
2531 AC_SUBST(aros_target_objcopy)
2532 AC_SUBST(aros_target_strip)
2533 AC_SUBST(aros_target_nm)
2534 AC_SUBST(aros_kernel_rescomp)
2535 AC_SUBST(aros_shared_default)
2536 AC_SUBST(aros_shared_ld)
2537 AC_SUBST(aros_object_format)
2538 AC_SUBST(aros_compiler_libs)
2539 AC_SUBST(aros_arch_libs)
2541 AC_SUBST(aros_config_cflags)
2542 AC_SUBST(aros_config_aflags)
2543 AC_SUBST(aros_config_ldflags)
2545 AC_SUBST(aros_shared_cflags)
2546 AC_SUBST(aros_shared_aflags)
2547 AC_SUBST(aros_shared_ldflags)
2548 AC_SUBST(aros_kernel_cflags)
2549 AC_SUBST(aros_kernel_includes)
2550 AC_SUBST(aros_kernel_objcflags)
2551 AC_SUBST(aros_kernel_ldflags)
2552 AC_SUBST(aros_target_cflags)
2553 AC_SUBST(aros_debug_cflags)
2554 AC_SUBST(aros_debug_aflags)
2555 AC_SUBST(aros_debug_ldflags)
2556 AC_SUBST(aros_target_genmap)
2557 AC_SUBST(aros_target_strip_flags)
2559 AC_SUBST(crosstools_target)
2560 AC_SUBST(crosstools_cxx_target)
2562 # Delinting target compiler flags
2563 AC_SUBST(aros_cflags_unused_but_set_variable)
2564 AC_SUBST(aros_cflags_array_bounds)
2565 AC_SUBST(aros_cflags_enum_compare)
2566 AC_SUBST(aros_cflags_strict_overflow)
2567 AC_SUBST(aros_cflags_format_security)
2569 # Graphics Related
2570 AC_SUBST(x11_hidd_target)
2571 AC_SUBST(sdl_hidd_target)
2572 AC_SUBST(pci_hidd_target)
2573 AC_SUBST(oss_library_target)
2575 AC_SUBST(aros_default_wbwidth)
2576 AC_SUBST(aros_default_wbheight)
2577 AC_SUBST(aros_default_wbdepth)
2578 AC_SUBST(DO_XSHM_SUPPORT)
2579 AC_SUBST(DO_VIDMODE_SUPPORT)
2581 AC_SUBST(aros_host_x11_includes)
2582 AC_SUBST(aros_host_x11_libdirs)
2583 AC_SUBST(aros_host_sdl_cflags)
2584 AC_SUBST(aros_host_sdl_libs)
2586 # Native version related
2587 AC_SUBST(aros_serial_debug)
2589 # Palm native version related
2590 AC_SUBST(aros_palm_debug_hack)
2592 # Unix/Hosted version related
2593 AC_SUBST(aros_nesting_supervisor)
2595 # MMU related
2596 AC_SUBST(aros_enable_mmu)
2598 # Apple iOS related
2599 AC_SUBST(aros_ios_platform)
2600 AC_SUBST(aros_ios_version)
2601 AC_SUBST(aros_ios_sdk)
2603 # ARM default GCC target related
2604 AC_SUBST(gcc_default_cpu)
2605 AC_SUBST(gcc_default_fpu)
2606 AC_SUBST(gcc_default_float_abi)
2608 # Android related
2609 AC_SUBST(android_tool)
2610 AC_SUBST(aros_android_level)
2612 # DBUS related
2613 AC_SUBST(ENABLE_DBUS)
2614 AC_SUBST(DBUS_CFLAGS)
2615 AC_SUBST(DBUS_LIBFLAGS)
2616 AC_SUBST(KERNEL_DBUS_KOBJ)
2617 AC_SUBST(KERNEL_DBUS_INCLUDES)
2619 #X11 related
2620 AC_SUBST(ENABLE_X11)
2622 # Debug related
2623 AC_SUBST(aros_debug)
2624 AC_SUBST(aros_mungwall_debug)
2625 AC_SUBST(aros_stack_debug)
2626 AC_SUBST(aros_modules_debug)
2628 # Collect-aros stuff: "-ius" to ignore undefined symbols
2629 AC_SUBST(ignore_undefined_symbols)
2631 # C compiler related
2632 AC_SUBST(gcc_target_cpu)
2634 dnl Prepare for output, make up all the generated patches
2635 case "$aros_flavour" in
2636 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2637                 aros_flavour="emulation" ;;
2638 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2639                 aros_flavour="emulation" ;;
2640 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2641                 aros_flavour="standalone";;
2642 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2643                 aros_flavour="standalone";;
2644 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2645                 aros_flavour="native" ;;
2646 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2647                 aros_flavour="native" ;;
2648 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2649                 aros_flavour="linklib" ;;
2650 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2651                 aros_flavour="palmnative" ;;
2652 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2653                 aros_flavour="mac68knative" ;;
2654 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2655                 aros_flavour="ppcnative" ;;
2656 esac
2658 if test ! -d ${aros_inc_dir} ; then
2659     ${MKDIR} ${aros_inc_dir}
2661 if test ! -d ${aros_geninc_dir} ; then
2662     ${MKDIR} ${aros_geninc_dir}
2664 if test ! -d ${aros_hostcfg_dir} ; then
2665     ${MKDIR} ${aros_hostcfg_dir}
2667 if test ! -d ${aros_targetcfg_dir} ; then
2668     ${MKDIR} ${aros_targetcfg_dir}
2670 if test ! -d ${aros_tools_dir} ; then
2671     ${MKDIR} ${aros_tools_dir}
2673 if test ! -d ${aros_scripts_dir} ; then
2674     ${MKDIR} ${aros_scripts_dir}
2677 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2679 AC_CONFIG_COMMANDS([compiler_executable],
2680     [
2681         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2682         mkdir -p $prefix
2683         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2684         prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2686         echo ${prefix2}
2687         echo ${prefix3}
2688         chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2690         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
2691         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
2692         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
2693         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
2694         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2695         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2696         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
2698         ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix3}-ld$aros_host_exe_suffix
2699     ],
2700     [
2701         aros_host_exe_suffix=${aros_host_exe_suffix}
2702         aros_tools_dir=${aros_tools_dir}
2703         aros_target_cpu=${aros_target_cpu}
2704         aros_target_arch=${aros_target_arch}
2705         aros_target_suffix=${aros_target_suffix}
2706         orig_target_nm=${orig_target_nm}
2707         orig_target_as=${orig_target_as}
2708         orig_target_ar=${orig_target_ar}
2709         orig_target_ranlib=${orig_target_ranlib}
2710         orig_target_objdump=${orig_target_objdump}
2711         orig_target_objcopy=${orig_target_objcopy}
2712         orig_target_strip=${orig_target_strip}
2713         aros_kernel_ld=${aros_kernel_ld}
2714     ]
2716 AC_CONFIG_COMMANDS([genmf_executable],
2717     [chmod a+x ${aros_tools_dir}/genmf.py],
2718     [aros_tools_dir=${aros_tools_dir}]
2721 AC_CONFIG_FILES(
2722     Makefile
2723     config/make.cfg
2724     ${aros_inc_dir}/config.h:config/config.h.in
2725     ${aros_geninc_dir}/config.h:config/config.h.in
2726     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2727     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2728     mmake.config
2729     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2730     ${aros_targetcfg_dir}/specs:config/specs.in
2731     ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2732     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2733     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2734     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2735     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2736     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2737     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2738     tools/collect-aros/env.h
2739     ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2742 AC_OUTPUT
2744 dnl This is in order to not define SHARED_CFLAGS sometimes
2745 dnl We don't always do aros_shared_ar, aros_shared_cflags
2747 #XXX compatability...
2748 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2750 if test -n "$aros_shared_cflags" ; then
2751     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2752     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg