64 bit fixes (NicJA).
[AROS.git] / configure.in
bloba0b5396aa74a5dcf6ef8f7a5e7c2842be3eb2733
1 dnl Copyright © 1997-2016, 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 # Default versions for the gnu tools we build
26 default_gcc_version="4.6.4"
27 default_binutils_version="2.23.2"
29 # The AROS target is slightly different to the normal GNU style
30 # format. We don't have the middle part, and we reverse the order
31 # of the $(CPU) and $(OS) bits.
33 # Don't strip the version of the target yet, it might be
34 # useful on some systems.
36 AC_MSG_CHECKING([for AROS style target])
38 if test "$target" = "NONE" ; then
39     target=$host_os-$host_cpu
40 else
41     if test "$target" = "" ; then
42         target=$host_os-$host_cpu
43     fi
45 AC_MSG_RESULT($target)
47 if test "$host_os" = "mingw32" ; then
48     PWDCMD="pwd -W"
51 # Don't know where else to put this...
52 AC_MSG_CHECKING([building AROS in])
53 AROS_BUILDDIR=`${PWDCMD-pwd}`
54 AROS_BUILDDIR_UNIX=${PWD}
55 AC_MSG_RESULT($AROS_BUILDDIR)
57 AC_MSG_CHECKING([AROS source in])
58 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
59 SRCDIR=${srcpwd}
60 AC_MSG_RESULT($SRCDIR)
62 # Parse the target field into something useful.
63 changequote(<<,>>)
64 target_os=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\1/'`
65 target_cpu=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\2/'`
66 changequote([,])
68 # Some debug output, to be removed again.
69 AC_MSG_CHECKING([for target system (debug output)])
70 AC_MSG_RESULT($target_os)
71 AC_MSG_CHECKING([for target cpu (debug output)])
72 AC_MSG_RESULT($target_cpu)
74 dnl --------------------------------------------------------------------
75 dnl Set the default Workbench resolution
76 dnl --------------------------------------------------------------------
77 aros_nominal_width=800
78 aros_nominal_height=600
79 aros_nominal_depth=4
81 dnl --------------------------------------------------------------------
82 dnl Host Configuration Section
83 dnl --------------------------------------------------------------------
84 dnl
85 dnl The idea here is to find out all the information we need about the
86 dnl host. This means things like tools for building directory structures,
87 dnl copying files around and the like.
89 default_c_compilers="gcc clang cc"
90 AC_ARG_WITH(c-compiler,AC_HELP_STRING([--with-c-compiler=VERSION],[Use specified c compiler for building AROS]),use_c_compiler="$withval",use_c_compiler="")
91 if test "$use_c_compiler" = ""; then
92     host_c_compilers="$default_c_compilers"
93 else
94     host_c_compilers="$use_c_compiler"
97 default_cxx_compilers="g++ clang++ c++"
98 AC_ARG_WITH(cxx-compiler,AC_HELP_STRING([--with-cxx-compiler=VERSION],[Use specified c++ compiler building AROS]),use_cxx_compiler="$withval",use_cxx_compiler="")
99 if test "$use_cxx_compiler" = ""; then
100         host_cxx_compilers="$default_cxx_compilers"
101 else
102     host_cxx_compilers="$use_cxx_compiler"
106 # The first step is to find the host binaries.
107 # Check for a compiler.
108 # Due to a bug in autoconf check for c++ compiler first.
109 # For mor info see, http://osdir.com/ml/bug-autoconf-gnu/2010-05/msg00001.html.
110 AC_PROG_CXX([${host_cxx_compilers}])
111 AC_PROG_CC([${host_c_compilers}])
112 aros_host_def_cc="$CC"
113 AC_PROG_CC_STDC
114 AC_PROG_CPP
116 # Check for a compatible awk
117 AC_CHECK_PROGS(AWK,[gawk nawk])
118 AROS_REQUIRED(gawk,$AWK)
119 AROS_PROG(MMAKE,mmake)
121 # Perform some default variable assignments. Note all of these will be
122 # Regenerated from the script, so there is no need to cache them.
124 aros_build_host=$host
125 aros_host_cpp="$CPP"
126 aros_host_cc="$CC"
127 aros_host_cxx="$CXX"
128 AROS_TOOL_CCPATH(aros_host_ld,ld)
129 AROS_REQUIRED(ld,$aros_host_ld)
130 aros_host_make="make"
131 aros_host_cflags="$CFLAGS"
132 aros_host_cxxflags="$CXXFLAGS"
133 aros_host_cppflags="$CPPFLAGS"
134 aros_host_ldflags="$LDFLAGS"
135 aros_host_debug="-g -O0"
136 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
137 aros_host_mkargs="--no-print-directory"
138 aros_host_exe_suffix="$EXEEXT"
139 aros_host_lib_suffix=""
141 # Ignore all compliance, AROS ROMs = 0
142 # KickStart v1.0 = 30
143 # KickStart v1.3 = 34
144 # KickStart v2.0 = 37
145 # KickStart v3.0 = 39
146 # KickStart v3.1 = 40
147 # AmigaOS   v3.5 = 44
148 aros_amigaos_compliance=0
150 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
151 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
152 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
153 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
155 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
156 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
158 case "$aros_host_cc" in
159     *clang*)
160         aros_host_cc_pipe=""
161         ;;
162     *gcc*)
163         aros_host_cc_pipe="-pipe"
164         ;;
165     icc)
166         aros_host_cc_pipe=""
167         ;;
168     *)
169         aros_host_cc_pipe=""
170         ;;
171 esac
173 aros_kernel_cc_includes=""
174 aros_target_cc_includes=""
175 host_cc_elf=yes
177 # ----------------------------------------------------------------------------------------
178 # Host-specific defaults
180 # This is the main host configuration section. It is where the host
181 # can change the values of any variables it needs to change. We do
182 # not look at anything that compiles to the target yet, we'll get
183 # to that later.
185 case "$host_os" in
186     aros*)
187         aros_host_arch="aros"
188         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
189         case "$host_cpu" in
190             *i?86*)
191                 aros_host_cpu="i386"
192                 ;;
193             *x86_64*)
194                 aros_host_cpu="x86_64"
195                 ;;
196             *powerpc*)
197                 aros_host_cpu="ppc"
198                 ;;
199             *)
200                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
201                 aros_host_cpu="$host_cpu"
202                 ;;
203         esac
204         ;;
206     linux*)
207         aros_host_arch="linux"
208         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
209         android_build_os="linux-x86"
210         android_tool="android"
211         default_android_sdk="/opt/android-sdk-linux_x86"
212         case "$host_cpu" in
213             *i?86*)
214                 aros_host_cpu="i386"
215                 ;;
216             *x86_64*)
217                 aros_host_cpu="x86_64"
218                 ;;
219             *m68k*)
220                 aros_host_cpu="m68k"
221                 ;;
222             *powerpc*)
223                 aros_host_cpu="ppc"
224                 ;;
225             *arm*)
226                 aros_host_cpu="arm"
227                 ;;
228             *)
229                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
230                 aros_host_cpu="$host_cpu"
231                 ;;
232         esac
233         ;;
235     freebsd*)
236         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe -I/usr/local/include"
237         aros_host_make="gmake"
238         aros_host_arch="freebsd"
239         aros_host_cpu="i386"
241         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
243         dnl FreeBSD 5.x (and later) has changed the default object format.
244         dnl The double [[]] is necessary to get around m4's quoting rules.
245         case $host_os in
246             freebsd[[234]]*)
247                 aros_object_format="elf_i386"
248                 ;;
250             *)
251                 aros_object_format="elf_i386_fbsd"
252                 ;;
253         esac
255         ;;
257     darwin*)
258         AC_CHECK_FILE(/usr/include/stddef.h,,
259                 AC_MSG_ERROR([XCode incorrectly configured!
260 please run 'xcode-select --install' before
261 re-running configure])
262         )
263         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
264         aros_host_arch="darwin"
265         host_cc_elf=no
266         if [[ -z ${SED+x} ]]; then SED="gsed"; fi
267         android_build_os="darwin-x86"
268         android_tool="android"
269         default_android_sdk="/android-sdk-mac_x86"
270         case "$host_cpu" in
271             *i?86*)
272                 aros_host_cpu="i386"
273                 ;;
274             *x86_64*)
275                 aros_host_cpu="x86_64"
276                 ;;
277             *powerpc*)
278                 aros_host_cpu="ppc"
279                 ;;
280             *)
281                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
282                 aros_host_cpu="$host_cpu"
283                 ;;
284         esac
286         aros_host_ldflags="$aros_host_ldflags -liconv"
288         ;;
290     dragonfly*)
291         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
292         aros_host_make="gmake"
293         aros_host_arch="dragonfly"
294         case $host_cpu in
295             *i?86*)
296                 aros_host_cpu="i386"
297                 ;;
298             *amd64*)
299                 aros_host_cpu="x86_64"
300                 ;;
301             *)
302                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
303                 aros_host_cpu="$host_cpu"
304                 ;;
305         esac
306         ;;
308     netbsd*)
309         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
310         aros_host_make="gmake"
311         aros_host_arch="netbsd"
312         case "$host_cpu" in
313             *i?86*)
314                 aros_host_cpu="i386"
315                 ;;
316             *m68k*)
317                 aros_host_cpu="m68k"
318                 ;;
319             *)
320                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
321                 aros_host_cpu="$host_cpu"
322                 ;;
323         esac    
324         aros_host_lib_suffix=".0.0"
325         ;;
327     openbsd*)
328         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
329         aros_host_make="gmake"
330         aros_host_arch="openbsd"
331         case "$host_cpu" in
332             *i?86*)
333                 aros_host_cpu="i386"
334                 ;;
335             *)
336                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
337                 aros_host_cpu="$host_cpu"
338                 ;;
339         esac
340         ;;
341         
342     solaris*)
343         aros_host_arch="solaris"
344         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
345         case "$host_cpu" in
346             *i?86*)
347                 aros_host_cpu="i386"
348                 ;;
349             *sparc*)
350                 aros_host_cpu="sparc"
351                 ;;
352             *)
353                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
354                 aros_host_cpu="$host_cpu"
355                 ;;
356         esac
357         ;;
359     morphos*)
360         aros_host_arch="morphos"
361         aros_host_cpu="ppc"
362         host_cc_elf=no
363         ;;
365     amiga*)
366         aros_host_arch="amiga"
367         host_cc_elf=no
368         SORT="/gg/bin/sort"
369         TEST="/gg/bin/test"
370         UNIQ="/gg/bin/uniq"
371         FOR="for"
372         TOUCH="/gg/bin/touch"
373         case "$host_cpu" in
374             *m68k*)
375                 aros_host_cpu="m68k"
376                 ;;
377             *powerpc*)
378                 aros_host_cpu="ppc"
379                 ;;
380             *)
381                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
382                 aros_host_cpu="$host_cpu"
383                 ;;
384         esac
385         ;;
387     cygwin*)
388         aros_host_arch="cygwin"
389         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
390         host_cc_elf=no
391         android_build_os="windows"
392         android_tool="android.bat"
393         default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
395         case "$host_cpu" in
396             *i?86*)
397                 aros_host_cpu="i386"
398                 ;;
399             *)
400                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
401                 aros_host_cpu="$host_cpu"
402                 ;;
403         esac
404         ;;
406     mingw32*)
407         aros_host_arch="mingw32"
408         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
409         host_cc_elf=no
410         android_build_os="windows"
411         android_tool="android.bat"
412         default_android_sdk="/c/android-sdk-windows-1.6_r1"
414         libpng_libextra="-lws2_32"
416         case "$host_cpu" in
417         *i?86*)
418             dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
419             dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
420             dnl Here we attempt to detect Windows home platform by asking gcc about its target.
421             dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
423             AC_MSG_CHECKING([for Windows native gcc target])
424             host_cpu=`gcc -dumpmachine`
425             AC_MSG_RESULT($host_cpu)
426             ;;
428         esac
430         case "$host_cpu" in
431         *i?86*)
432             aros_host_cpu="i386"
433             ;;
435         mingw32*)
436             dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
437             aros_host_cpu="i386"
438             ;;
440         *x86_64*)
441             aros_host_cpu="x86_64"
442             dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
443             dnl directory, so we have to add it explicitly here.
444             aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
445             ;;
447         *)
448             AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
449             aros_host_cpu="$host_cpu"
450             ;;
451         esac
452         ;;
453     *)
454         AC_MSG_ERROR([Unsupported host architecture $host])
455         ;;
456 esac
458 AROS_PROG(aros_host_ar,[ar],[cr])
459 AROS_REQUIRED(ar,$aros_host_ar)
460 AROS_PROG(aros_host_ranlib,ranlib)
461 AROS_REQUIRED(ranlib,$aros_host_ranlib)
462 AROS_PROG(aros_host_strip,strip)
463 AROS_REQUIRED(strip,$aros_host_strip)
465 AROS_PROG(RM,[rm],[-rf])
466 AROS_REQUIRED(rm,$RM)
467 AROS_PROG(CP,[cp])
468 AROS_REQUIRED(cp,$CP)
469 AROS_PROG(MV,[mv])
470 AROS_REQUIRED(mv,$MV)
471 AROS_PROG(ECHO,[echo])
472 AROS_REQUIRED(echo,$ECHO)
473 AROS_PROG(MKDIR,[mkdir],[-p])
474 AROS_REQUIRED(mkdir,$MKDIR)
475 AROS_PROG(TOUCH,[touch])
476 AROS_REQUIRED(touch,$TOUCH)
477 AROS_PROG(SORT,[sort])
478 AROS_REQUIRED(sort,$SORT)
479 AROS_PROG(UNIQ,[uniq])
480 AROS_REQUIRED(uniq,$UNIQ)
481 AROS_PROG(NOP,[true])
482 AROS_REQUIRED(true,$NOP)
483 AROS_PROG(CAT,[cat])
484 AROS_REQUIRED(cat,$CAT)
485 AROS_PROG(BISON,[bison])
486 AROS_REQUIRED(bison,$BISON)
487 AROS_PROG(FLEX,[flex])
488 AROS_REQUIRED(flex,$FLEX)
489 AROS_PROG(PNGTOPNM,[pngtopnm])
490 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
491 AROS_PROG(PPMTOILBM,[ppmtoilbm])
492 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
493 AROS_PROG(SED,[sed])
494 AROS_REQUIRED(sed,$SED)
495 AROS_PROG(CHMOD,[chmod])
496 AROS_REQUIRED(chmod,$CHMOD)
497 AROS_PROG(PATCH,[patch])
498 AROS_REQUIRED(patch,$PATCH)
500 AM_PATH_PYTHON(2.5)
502 AC_ARG_ENABLE([libpng-config], [--disable-libpng-config    disable libpng-config test and configuration])
503 if test "$enable_libpng_config" != "no"; then
504   AC_CHECK_PROG([arosconfig_use_libpngconfig],[libpng-config],[yes],[no])
506 if test "$arosconfig_use_libpngconfig" = "yes"; then
507     AC_MSG_CHECKING([libpng-config library])
508     libpng_incdir="`libpng-config --cflags`"
509     libpng_libextra="$libpng_libextra `libpng-config --ldflags`"
510     libpng="`libpng-config --libs`"
511     AC_MSG_RESULT($libpng)
512 else
513     AC_CHECK_LIB(png, png_read_png, [libpng="-lpng"], [libpng="no"])
514     if test "$libpng_libextra" != ""; then
515         if test "$libpng" != "no"; then
516             libpng_libextra="$libpng_libextra $libpng"
517         fi
518     fi
520 AROS_REQUIRED(libpng, $libpng)
521 AC_SUBST(libpng)
522 AC_SUBST(libpng_libextra)
523 AC_SUBST(libpng_incdir)
525 AC_SUBST(FOR, for)
526 AC_SUBST(IF, if)
527 AC_SUBST(TEST, test)
528 AC_SUBST(CMP, cmp)
530 dnl ---------------------------------------------------------------------------
531 dnl Look for things about the host system, good for hosted targets.
532 dnl ---------------------------------------------------------------------------
534 # Check for some includes for the X11 HIDD and the kernel
535 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
536     sys/mmap.h sys/mman.h sysexits.h \
537     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
540 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
542 AC_HEADER_DIRENT
543 AC_HEADER_STAT
544 AC_HEADER_STDC
545 AC_HEADER_SYS_WAIT
546 AC_HEADER_TIME
547 AC_STRUCT_ST_BLKSIZE
548 AC_STRUCT_ST_BLOCKS
549 AC_STRUCT_ST_RDEV
550 AC_STRUCT_TM
551 AC_STRUCT_TIMEZONE
552 AC_TYPE_OFF_T
553 AC_TYPE_PID_T
554 AC_TYPE_SIZE_T
555 AC_TYPE_UID_T
557 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
559 # Look for some functions
560 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
561     clone kse_create rfork_thread thr_create sa_register \
562     getcontext makecontext setcontext sigaltstack swapcontext])
564 AC_FUNC_MMAP
566 #-----------------------------------------------------------------------------
569 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
570 # it switched on by default, and we use the host compiler, so it compiles AROS
571 # code with this enabled resulting in link failures as we don't have support
572 # for it.
574 # We use two methods to disable it. For the host compiler (used to compile
575 # some hosted modules), we test to see if the compiler supports stack
576 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
577 # work on all platforms.
580 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
581 save_cflags="$CFLAGS"
582 CFLAGS="$CFLAGS -fno-stack-protector"
583 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
584 AC_MSG_RESULT($use_no_stack_protector)
585 if test "x-$use_no_stack_protector" = "x-yes" ; then
586     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
588 CFLAGS="$save_cflags"
590 #-----------------------------------------------------------------------------
592 # Disable pointer-signedness warnings if the compiler recognises the option
593 # (this only works for the host compiler at the moment)
595 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
596 save_cflags="$CFLAGS"
597 CFLAGS="$CFLAGS -Wno-pointer-sign"
598 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
599 AC_MSG_RESULT($use_no_sign_warning)
600 if test "x-$use_no_sign_warning" = "x-yes" ; then
601     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
603 CFLAGS="$save_cflags"
605 #-----------------------------------------------------------------------------
607 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
609 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
610 save_cflags="$CFLAGS"
611 CFLAGS="$CFLAGS -fgnu89-inline"
612 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
613 AC_MSG_RESULT($use_gnu89_inline)
614 if test "x-$use_gnu89_inline" = "x-yes" ; then
615     gnu89_inline="-fgnu89-inline"
617 CFLAGS="$save_cflags"
620 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
621 # On GCC >= 4.0 -iquote should be used
623 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
624 CFLAGS="$CFLAGS -iquote."
625 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
626 AC_MSG_RESULT($has_iquote)
627 if test "x-$has_iquote" = "x-yes" ; then
628     host_cflags_iquote=-iquote
629     host_cflags_iquote_end=
630 else
631     host_cflags_iquote=-I
632     host_cflags_iquote_end=-I-
635 AC_MSG_NOTICE([Performing target configuration...])
637 dnl --------------------------------------------------------------------
638 dnl Target Configuration Section
639 dnl --------------------------------------------------------------------
641 dnl The target configuration section is responsible for setting up all
642 dnl the paths for includes, and tools required to build AROS to some
643 dnl particular target.
645 aros_nowarn_flags="NOWARN_UNUSED_COMMAND_LINE_ARGUMENT NOWARN_UNKNOWN_WARNING_OPTION NOWARN_POINTER_SIGN NOWARN_PARENTHESES"
647 toolchain_needs_sysroot=no
649 aros_warn_flags=
650 aros_isa_flags=
651 aros_config_cppflags=
652 aros_config_cflags=
653 aros_config_cxxflags=
654 aros_config_aflags="-Wall -x assembler-with-cpp -c"
655 aros_config_ldflags=""
657 aros_shared_default=yes
659 aros_shared_cflags="-fPIC"
660 aros_shared_aflags=""
661 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
662 aros_kernel_ldflags="-Wl,-rpath,./lib"
664 aros_kernel_ar_flags="cr"
665 aros_target_ar_flags="cr"
666 aros_target_nm_flags="-C -ul"
667 aros_target_strip_flags="--strip-unneeded -R.comment"
669 aros_compiler_libs=
670 aros_arch_libs=
672 aros_target_genmap="-Wl,-Map -Xlinker"
674 # Native flavour stuff
675 aros_serial_debug="0"
677 # Palm native flavour stuff
678 aros_palm_debug_hack="0"
680 # Unix flavour stuff
681 aros_nesting_supervisor="0"
683 # Collect-aros stuff: "-ius" to ignore undefined symbols
684 ignore_undefined_symbols=""
686 # Check for X11 by default
687 need_x11="auto"
689 host_x_gfx=no
690 host_sdl_gfx=no
691 host_android_gfx=no
694 AC_MSG_CHECKING([Which toolchain family to use ...])
695 AC_ARG_WITH(toolchain,AC_HELP_STRING([--with-toolchain=family],[Which toolchain family to crosscompile with (defaults to gnu)]),aros_toolchain="$withval",aros_toolchain="gnu")
696 AC_MSG_RESULT($aros_toolchain)
699 AC_MSG_CHECKING([if we should enable link time optimizations (LTO)])
700 AC_ARG_ENABLE(lto,AC_HELP_STRING([--enable-lto=[yes|no]],[Enable link time optimizations if the target compiler supports them (default=no)]),
701  aros_config_lto="$enableval",aros_config_lto="no")
702 if test "$aros_config_lto" != "no"; then
703     aros_config_lto="yes"
705 AC_MSG_RESULT($aros_config_lto)
707 AC_MSG_CHECKING([if we should enable coverage instrumentation])
708 AC_ARG_ENABLE(coverage,AC_HELP_STRING([--enable-coverage=[yes|no]],[Enable coverage instrumentation if the target compiler supports it (default=no)]),
709  aros_config_coverage="$enableval",aros_config_coverage="no")
710 if test "$aros_config_coverage" != "no"; then
711     aros_config_coverage="yes"
713 AC_MSG_RESULT($aros_config_coverage)
715 use_ld_wrapper=yes
717 case "$aros_toolchain" in
718     *llvm*)
719         # toolchain_needs_sysroot=yes
720         toolchain_c_compiler="clang"
721         toolchain_cxx_compiler="clang++"
722         toolchain_cpp_preprocessor="clang -E"
723         toolchain_ld="ld.lld"
724         aros_ld="ld"
725         toolchain_as="llvm-as"
726         toolchain_ar="llvm-ar"
727         toolchain_ranlib="llvm-ranlib"
728         toolchain_nm="llvm-nm"
729         toolchain_strip="true"
730         toolchain_objcopy="llvm-objcopy"
731         toolchain_objdump="llvm-objdump"
732         ;;
733     *gnu*)
734         toolchain_c_compiler="gcc"
735         toolchain_cxx_compiler="g++"
736         toolchain_cpp_preprocessor="gcc -E"
737         toolchain_as="as"
738         aros_ld="ld"
739         if test "$aros_config_lto" != "yes"; then
740             toolchain_ld="ld"
741             toolchain_ar="ar"
742             toolchain_ranlib="ranlib"
743             toolchain_nm="nm"
744         else
745             toolchain_ld="ld.bfd"
746             toolchain_ar="gcc-ar"
747             toolchain_ranlib="gcc-ranlib"
748             toolchain_nm="gcc-nm"
749         fi
750         toolchain_strip="strip"
751         toolchain_objcopy="objcopy"
752         toolchain_objdump="objdump"
753         ;;
754     *)
755         AC_MSG_WARN("Unknown toolchain family!")
756         toolchain_c_compiler="cc"
757         toolchain_cxx_compiler="c++"
758         toolchain_cpp_preprocessor="cpp"
759         toolchain_ld="ld"
760         aros_ld="ld"
761         toolchain_as="as"
762         toolchain_ar="ar"
763         toolchain_ranlib="ranlib"
764         toolchain_nm="nm"
765         toolchain_strip="strip"
766         toolchain_objcopy="objcopy"
767         toolchain_objdump="objdump"
768         ;;
769 esac
771 #-----------------------------------------------------------------------------
773 AC_MSG_CHECKING([which type of build to do])
774 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")
776 if test "$build_type" = "nightly"; then
777     build_type_string="NIGHTLY"
778 elif test "$build_type" = "snapshot"; then
779     build_type_string="SNAPSHOT"
780 elif test "$build_type" = "milestone"; then
781     build_type_string="MILESTONE"
782 elif test "$build_type" = "release"; then
783     build_type_string="RELEASE"
784 else
785     build_type_string="PERSONAL"
786     build_type="personal"
789 aros_config_cppflags="$aros_config_cppflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
791 AC_MSG_RESULT($build_type)
793 #-----------------------------------------------------------------------------
794 all_debug_types="messages stack modules mungwall symbols"
796 AC_MSG_CHECKING([which debug types to enable])
797 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)]),
798  debug="$enableval",debug="")
800 if test "$debug" = "" -o "$debug" = "no"; then
801     debug="none"
802 elif test "$debug" = "yes"; then
803     debug="all"
806 if test "$debug" = "all" ; then
807     debug="messages stack modules symbols"
808     for d in $all_debug_types; do
809         export aros_${d}_debug="1"
810     done
811 else
812     for d in $all_debug_types; do
813         export aros_${d}_debug="0"
814     done
817 if test "$debug" != "none"; then
818     debug=`echo $debug | sed s/,/\ /g`
819     for d in $debug; do
820         found="0"
821         for d2 in $all_debug_types; do
822             if test "$d2" = "$d"; then
823                 found="1"
824                 break
825             fi
826         done
827         if test "$found" = "0"; then
828             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
829         fi
830         export aros_${d}_debug="1"
831     done
832     aros_debug="yes"
834 AC_MSG_RESULT($debug)
836 if test "$aros_messages_debug" = "1"; then
837     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
838 else
839     aros_messages_debug=""
841 if test "$aros_symbols_debug" = "1"; then
842     aros_symbols_debug="-g"
843 else
844     aros_symbols_debug=""
847 # These are the flags to pass when compiling debugged programs
848 aros_debug_cppflags="$aros_messages_debug"
849 aros_debug_cflags="$aros_symbols_debug"
850 aros_debug_cxxflags=
851 aros_debug_aflags=""
852 aros_debug_ldflags="$aros_symbols_debug"
854 #-----------------------------------------------------------------------------
855 #   Checking for distcc and ccache.
857 #   Always apply the transforms in this particular order. Basically you should
858 #   always run 'ccache distcc compiler' in that order for the best performance.
860 AC_MSG_CHECKING([whether to enable distcc])
861 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
862 if test "$distcc" != "" -a "$distcc" != "no"; then
863     # AC_CHECK_PROG will print out the result in this case
864     AC_PATH_PROG(DISTCC,[distcc],distcc,)
865 else
866     AC_MSG_RESULT(no)
869 AC_MSG_CHECKING([whether to enable ccache])
870 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
871 if test "$ccache" != "" -a "$ccache" != "no"; then
872     # AC_CHECK_PROG will print out the result in this case
873     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
874 else
875     AC_MSG_RESULT(no)
878 #-----------------------------------------------------------------------------
879 AC_MSG_CHECKING([what specific host gcc version to use])
880 AC_ARG_WITH(kernel-gcc-version,AC_HELP_STRING([--with-kernel-gcc-version=VERSION],[Use gcc-VERSION for building bootstrap]),kernel_tool_version="$withval",kernel_tool_version="")
881 if test "$kernel_tool_version" != "" ; then
882     msg_result=$kernel_tool_version
883 else
884     msg_result="default"
886 AC_MSG_RESULT($msg_result)
888 #-----------------------------------------------------------------------------
889 AC_MSG_CHECKING([what optimization flags to use])
890 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (e.g --with-optimization=-O2).]),optimization_level="$withval",optimization_level="unknown")
891 if test "$optimization_level" = "unknown"; then
892     dnl default is -O2 for normal builds, -O0 for debug builds
893     optimization="default"
894     if test "$debug" != "none"; then
895         optimization_level="-O0"
896     else
897         optimization_level="-O2"
898     fi
899 else
900     optimization="$optimization_level"
902 AC_MSG_RESULT($optimization)
904 paranoia_default=yes
905 #-----------------------------------------------------------------------------
906 AC_MSG_CHECKING([which paranoia flags to use])
907 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=(yes|no|FLAGS)],[Specific compiler warning FLAGS to enable for paranoia builds (default=-Wall -Werror)]),[paranoia_flags="$withval"],[paranoia_flags="$paranoia_default"])
908 if test "$paranoia_flags" = "no"; then
909         paranoia_flags="-Wall -Werror-implicit-function-declaration"
910         msg_result="none"
911 else
912     if test "$paranoia_flags" = "yes"; then
913         paranoia_flags="-Wall -Werror"
914     fi
915     msg_result="$paranoia_flags"
917 AC_MSG_RESULT($msg_result)
918 aros_warn_flags="$aros_warn_flags $paranoia_flags"
920 #-----------------------------------------------------------------------------
921 AC_MSG_CHECKING([what target variant to enable])
922 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant (default=none)]),target_variant=$enableval,target_variant="")
923 if test "$target_variant" = ""; then
924     aros_target_variant=""
925     aros_target_suffix=""
926     enableval="none"
927 else
928     aros_target_variant="$target_variant"
929     aros_target_suffix="-$target_variant"
931 AC_MSG_RESULT($enableval)
933 #-----------------------------------------------------------------------------
934 # Target-specific defaults. You can override then on a per-target basis.
936 # Bootloader name. Currently used by PC target.
937 target_bootloader="none"
938 PLATFORM_EXECSMP=
939 ENABLE_EXECSMP=
941 #-----------------------------------------------------------------------------
942 # Additional options for some specific targets
944 case "$aros_target_variant" in
945 ios)
946     AC_MSG_CHECKING([XCode path])
947     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")
948     AC_MSG_RESULT($aros_xcode_path)
950     AC_MSG_CHECKING([what iOS SDK version to use])
951     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")
952     AC_MSG_RESULT($aros_sdk_version)
954     ;;
956 "android")
957     AC_MSG_CHECKING([Android SDK path])
958     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)
959     AC_MSG_RESULT($aros_android_sdk)
961     AC_MSG_CHECKING([Android NDK path])
962     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
963     AC_MSG_RESULT($aros_android_ndk)
965     AC_MSG_CHECKING([what Android SDK version to use])
966     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")
967     AC_MSG_RESULT($aros_sdk_version)
969     aros_android_level=android-$aros_sdk_version
970     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
971         echo "Platform $aros_android_level is not installed in your SDK"
972         echo "Use --with-sdk-version=<API level number> to select another platform version"
973         echo "You can check what plaform versions are installed in your SDK"
974         echo "by examining contents of $aros_android_sdk/platforms directory"
975         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
976     fi
978     export PATH="$aros_android_sdk/tools:$PATH"
979     AC_PATH_PROG(android_tool, $android_tool)
980     AROS_REQUIRED(android,$android_tool)
982     if test "$aros_android_ndk" != "none"; then
983         AC_MSG_CHECKING([what Android NDK version to use])
984         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")
985         AC_MSG_RESULT($aros_ndk_version)
986     fi
988     AC_PATH_PROG(ant, ant)
989     if test "$ant" = ""; then
990         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
991     fi
993     AC_MSG_CHECKING([Build debug or release apk])
994     AC_ARG_WITH(apk-version,AC_HELP_STRING([--with-apk-version=(release|debug)],[Which version of AROSBootstrap.apk to compile. Release version needs key for signing, debug version will only run in emulator. (default=release)]),aros_android_antapk=$withval,aros_android_antapk=release)
995     if test $aros_android_antapk != release -a $aros_android_antapk != debug; then
996         AC_MSG_ERROR([apk-version has to be release or debug])
997     fi
998     AC_MSG_RESULT($aros_android_antapk)
1000     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
1001     if test "$host_os" = "mingw32"; then
1002         android_tool="cmd //c $android_tool"
1003     fi
1005     need_dlopen="no"
1007     ;;
1008 esac
1010 #-----------------------------------------------------------------------------
1011 # External toolchains
1012 kernel_tool_prefix="none"
1013 aros_tool_prefix="none"
1014 elf_tool_prefix="${target_cpu}-elf-"
1016 # This is the target configuration switch.
1017 case "$target_os" in
1018     linux*)
1019         aros_target_arch="linux"
1020         aros_target_family="unix"
1021         case "$target_cpu" in
1022             *m68k*)
1023                 aros_target_cpu="m68k"
1024                 aros_object_format="m68kelf"
1025                 aros_flavour="emulcompat"
1026                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
1027                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
1028                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
1029                 gcc_target_cpu="mc68000"
1030                 ;;
1031             *i?86*)
1032                 aros_target_cpu="i386"
1033                 aros_object_format="elf_i386"
1034                 aros_flavour="emulation"
1035                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
1036                 aros_kernel_ldflags="-Wl,-melf_i386"
1037                 aros_nominal_depth=8
1038                 gcc_target_cpu="i386"
1039                 pci_hidd_target="hidd-pci-linux"
1040                 android_tool_dir_prefix="x86"
1041                 android_tool_prefix="i686-android-linux"
1042                 android_ndk_arch="x86"
1043                 ;;
1044             *x86_64*)
1045                 aros_target_cpu="x86_64"
1046                 aros_object_format="elf_x86_64"
1047                 aros_flavour="emulation"
1048                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
1049                 aros_isa_flags="$aros_isa_flags -mcmodel=large -mno-red-zone"
1050                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1051                 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1052                 aros_nominal_depth=8
1053                 pci_hidd_target="hidd-pci-linux"
1054                 ;;
1055             *powerpc*)
1056                 aros_target_cpu="ppc"
1057                 aros_object_format="elf32ppc"
1058                 aros_flavour="emulation"
1059                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1060                 aros_nominal_depth=8
1061                 gcc_target_cpu="ppc"
1062                 ;;
1063 # TODO
1064 # Same as powerpc, but I need this for the nightly build to work again.
1065 # Actually, the nightly should be made working with powerpc target.
1066 # That just was too much work for the moment, another week or two.
1067             *ppc*)
1068                 aros_target_cpu="ppc"
1069                 aros_object_format="elf32ppc"
1070                 aros_flavour="emulation"
1071                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1072                 aros_nominal_depth=8
1073                 gcc_target_cpu="ppc"
1074                 ;;
1075             *aarch64*)
1076                 aros_target_cpu="aarch64"
1077                 target_cpu="aarch64"
1078                 aros_object_format="aarch64elf_aros"
1079                 aros_flavour="emulation"
1080                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1081                 gcc_target_cpu="aarch64"
1082                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1083                 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1084                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1085                 aros_arch_libs="-laeabi"
1086                 gcc_default_float_abi="hard"
1087                 kernel_tool_prefix="aarch64-linux-gnueabihf-"
1088                 ;;
1089             *armhf*)
1090                 aros_target_cpu="arm"
1091                 target_cpu="arm"
1092                 aros_object_format="armelf_aros"
1093                 aros_flavour="emulation"
1094                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1095                 gcc_target_cpu="arm"
1096                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1097                 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1098                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1099                 aros_arch_libs="-laeabi"
1100                 gcc_default_float_abi="hard"
1101                 android_tool_dir_prefix="arm-linux-androideabi"
1102                 android_tool_prefix="arm-linux-androideabi"
1103                 android_ndk_arch="arm"
1104                 kernel_tool_prefix="arm-linux-gnueabihf-"
1105                 ;;
1106             *arm*)
1107                 aros_target_cpu="arm"
1108                 aros_object_format="armelf_aros"
1109                 aros_flavour="emulation"
1110                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1111                 gcc_target_cpu="arm"
1112                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1113                 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1114                 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1115                 aros_arch_libs="-laeabi"
1116                 android_tool_dir_prefix="arm-linux-androideabi"
1117                 android_tool_prefix="arm-linux-androideabi"
1118                 android_ndk_arch="arm"
1119                 kernel_tool_prefix="arm-linux-gnueabi-"
1120                 ;;
1121             *)
1122                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
1123                 ;;
1124         esac
1125         case "$aros_target_variant" in
1126             android)
1128                 dnl Not all Linux CPUs are supported by Android
1129                 if test "$android_ndk_arch" = ""; then
1130                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
1131                 fi
1133                 aros_nominal_width=320
1134                 aros_nominal_height=480
1135                 if test "$aros_android_ndk" = "none"; then
1136                     dnl Use standalone toolchain, don't adjust paths
1137                     aros_kernel_cflags="-mandroid"
1138                     aros_kernel_ldflags="-mandroid"
1139                     CFLAGS="-mandroid"
1140                 else
1141                     dnl In Android NDK toolchains are placed in own directories,
1142                     dnl but tool names are not suffixed with version 
1143                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$kernel_tool_version/prebuilt/$android_build_os/bin:$PATH"
1144                     kernel_tool_version=""
1145                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
1146                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
1147                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
1148                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
1149                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
1150                 fi
1151                 need_x11=no
1152                 host_android_gfx=yes
1153                 # Disable implicit PIC mode
1154                 aros_config_cflags="$aros_config_cflags -fno-pic"
1155                 kernel_tool_prefix="$android_tool_prefix-"
1156             ;;
1157         esac
1158     ;;
1160     pc)
1161         aros_target_arch="pc"
1162         aros_shared_default="no"
1163         target_bootloader="grub2"
1164         case "$target_cpu" in
1165             *i?86*)
1166                 aros_target_cpu="i386"
1168                 dnl If somebody hasn't already set the target object
1169                 dnl format, then use this value. Mostly to support
1170                 dnl FreeBSD cross-compilation.
1171                 dnl TODO: Remove when we always use our compiler.
1173                 if test "$aros_object_format" = "" ; then
1174                     aros_object_format="elf_i386"
1175                 fi
1176                 aros_flavour="standalone"
1177                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1178                 aros_kernel_ldflags="-Wl,-melf_i386"
1179                 aros_nominal_width=640
1180                 aros_nominal_height=480
1181                 gcc_target_cpu="i386"
1182                 ;;
1183             *x86_64*)
1184                 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1185                 aros_target_cpu="x86_64"
1186                 aros_serial_debug=1
1187                 if test "$aros_object_format" = "" ; then
1188                     aros_object_format="elf_x86_64"
1189                 fi
1190                 aros_flavour="standalone"
1191                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1192                 aros_isa_flags="$aros_isa_flags -mcmodel=large  -mno-red-zone"
1193                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1194                 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1195                 aros_kernel_ldflags=""
1196                 aros_nominal_width=640
1197                 aros_nominal_height=480
1198                 case "$aros_target_variant" in
1199                     smp)
1200                         ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1201                     ;;
1202                 esac
1203                 ;;
1204             *)
1205                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1206                 ;;
1207         esac
1208         ;;
1210     prep)
1211         aros_target_arch="prep"
1212         aros_shared_default="no"
1213         aros_target_cpu="ppc"
1214         aros_object_format="elf32ppc"
1215         aros_flavour="ppcnative"
1216         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1217         aros_kernel_ldflags=""
1218         aros_nominal_width=640
1219         aros_nominal_height=480
1220         gcc_target_cpu="ppc"
1221         ;;
1223     freebsd*)
1224         aros_target_arch="freebsd"
1225         aros_target_family="unix"
1226         aros_target_cpu="i386"
1227         aros_flavour="emulation"
1228         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1229         gcc_target_cpu="i386"
1231         aros_target_strip_flags="-x"
1232         ;;
1234     darwin*)
1235         aros_target_arch="darwin"
1236         aros_target_family="unix"
1237         aros_flavour="emulation"
1238         case "$target_cpu" in
1239             *i?86*)
1240                 aros_ios_platform="iPhoneSimulator"
1241                 aros_target_cpu="i386"
1242                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1243                 aros_kernel_ldflags=""
1244                 aros_macosx_version="10.4"
1245                 aros_nominal_depth=8
1246                 gcc_target_cpu="i386"
1247                 aros_object_format="elf_i386"
1248                 aros_kernel_ar_flags="-cr"
1249                 aros_target_strip_flags="-x"
1250                 kernel_tool_flags="-m32"
1251                 ;;
1252             *x86_64*)
1253                 aros_target_cpu="x86_64"
1254                 aros_object_format="elf_x86_64"
1255                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1256                 aros_macosx_version="10.6"
1257                 aros_isa_flags="$aros_isa_flags -mcmodel=large"
1258                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1259                 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1260                 aros_kernel_cflags="-m64"
1261                 aros_kernel_ldflags="-m64"
1262                 aros_nominal_depth=8
1263                 aros_kernel_ar="ar"
1264                 aros_kernel_ar_flags="-cr"
1265                 aros_kernel_ld="ld"
1266                 aros_kernel_as="as"
1267                 aros_kernel_ranlib="ranlib"
1268                 aros_kernel_nm="nm"
1269                 aros_kernel_strip="strip"
1270                 kernel_tool_prefix="i686-apple-darwin10-"
1271                 ;;
1272             *ppc*)
1273                 aros_target_cpu="ppc"
1274                 aros_object_format="elf32ppc"
1275                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1276                 aros_kernel_ldflags=""
1277                 aros_macosx_version="10.0"
1278                 aros_nominal_depth=8
1279                 gcc_target_cpu="ppc"
1280                 aros_kernel_ar="ar"
1281                 aros_kernel_ar_flags="-cr"
1282                 aros_kernel_ld="ld -arch ppc"
1283                 aros_kernel_as="as -arch ppc"
1284                 aros_kernel_ranlib="ranlib -arch ppc"
1285                 aros_kernel_nm="nm -arch ppc"
1286                 aros_kernel_strip="strip -arch ppc"
1287                 kernel_tool_prefix="powerpc-apple-darwin10-"
1288                 ;;
1289             *arm*)
1290                 aros_ios_platform="iPhoneOS"
1291                 aros_target_cpu="arm"
1292                 aros_object_format="armelf_aros"
1293                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1294                 aros_arch_libs="-laeabi"
1295                 aros_nominal_depth=8
1296                 gcc_target_cpu="arm"
1297                 aros_kernel_ar="ar"
1298                 aros_kernel_ar_flags="-cr"
1299                 aros_kernel_ld="ld -arch arm"
1300                 aros_kernel_ranlib="ranlib -arch arm"
1301                 kernel_tool_prefix="arm-apple-darwin10-" 
1302                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1303                 ;;
1304             *)
1305                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1306                 ;;
1307         esac
1308         case "$aros_target_variant" in
1309             ios)
1310                 aros_ios_version="3.0"
1311                 aros_nominal_width=320
1312                 aros_nominal_height=480
1313                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1314                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1315                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1316                 need_x11=no
1317                 # This is here because it may depend on iOS or SDK version
1318                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1319                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1320                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1321             ;;
1322             *)
1323                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1324                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1325             ;;
1326         esac
1327         ;;
1329     dragonfly*)
1330         aros_target_arch="dragonfly"
1331         aros_target_family="unix"
1332         aros_flavour="emulation"
1333         case "$target_cpu" in
1334             *i?86*)
1335                 aros_target_cpu="i386"
1336                 aros_object_format="elf_i386"
1337                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1338                 ;;
1339             *x86_64*)
1340                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1341                 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1342                 aros_target_cpu="x86_64"
1343                 aros_object_format="elf_x86_64"
1344                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1345                 ;;
1346             *)
1347                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1348                 ;;
1349         esac
1350         ;;
1352     netbsd*)
1353         aros_target_arch="netbsd"
1354         aros_target_family="unix"
1355         case "$target_cpu" in
1356             *m68k*)
1357                 aros_target_cpu="m68k"
1358                 aros_object_format="m68kelf"
1359                 aros_flavour="emulcompat"
1360                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1361                 gcc_target_cpu="mc68000"
1362                 ;;
1363             *i?86*)
1364                 aros_target_cpu="i386"
1365                 aros_object_format="elf_i386"
1366                 aros_flavour="emulation"
1367                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1368                 aros_nominal_depth=8
1369                 gcc_target_cpu="i386"
1370                 ;;
1371             *)
1372                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1373                 ;;
1374         esac
1375         aros_target_genmap="-Wl,-M -Xlinker >"
1376         aros_flavour="emulation"
1377         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1378         ;;   
1380     openbsd*)
1381         aros_target_arch="openbsd"
1382         aros_target_family="unix"
1383         case "$target_cpu" in
1384             *i?86*)
1385                 aros_target_cpu="i386"
1386                 aros_object_format="elf_i386"
1387                 aros_flavour="emulation"
1388                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1389                 gcc_target_cpu="i386"
1390                 ;;
1391             *)
1392                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1393                 ;;
1394         esac
1395         aros_target_genmap="-Wl,-M -Xlinker >"
1396         aros_target_nm_flags="-u"
1397         aros_flavour="emulation"
1398         ;;
1400     solaris*)
1401         aros_target_arch="solaris"
1402         aros_target_family="unix"
1403         case "$target_cpu" in
1404            *i?86*)
1405                aros_target_cpu="i386"
1406                aros_object_format="elf_i386"
1407                aros_flavour="emulation"
1408                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1409                aros_nominal_depth=8
1410                gcc_target_cpu="i386"
1411                ;;
1412             *sparc*)
1413                 aros_target_cpu="sparc"
1414                 aros_object_format="elf_sparc"
1415                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1416                 gcc_target_cpu="sparc"
1417                 ;;
1418             *)
1419                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1420                 ;;
1421         esac
1422         aros_config_cppflags="$aros_config_cppflags -D$aros_target_cpu"
1423         aros_flavour="emulation"
1424         ;;
1426     morphos*)
1427         aros_target_arch="morphos"
1428         aros_shared_default="no"
1429         aros_target_cpu="ppc"
1430         aros_object_format="elf_ppc"
1431         aros_flavour="nativecompat"
1432         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1433         gcc_target_cpu="ppc"
1434         ;;
1436     sam440)
1437         aros_target_arch="sam440"
1438         aros_shared_default="no"
1439         aros_target_cpu="ppc"
1440         aros_object_format="elf32ppc"
1441         aros_flavour="ppcnative"
1442         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1443         aros_kernel_ldflags=""
1444         aros_nominal_width=1024
1445         aros_nominal_height=768
1446         aros_nominal_depth=24
1447         aros_isa_flags="$aros_isa_flags -mcpu=440fp -mno-toc"
1448         aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1449         aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1450         gcc_target_cpu="powerpc"
1451         ;;
1453     efika)
1454         aros_target_arch="efika"
1455         aros_shared_default="no"
1456         aros_target_cpu="arm"
1457         aros_object_format="armelf_aros"
1458         aros_flavour="standalone"
1459         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1460         aros_kernel_ldflags=""
1461         aros_nominal_width=1024
1462         aros_nominal_height=600
1463         aros_arch_libs="-laeabi"
1464         gcc_default_cpu="armv7-a"
1465         gcc_default_fpu="vfpv3"
1466         aros_isa_flags="$aros_isa_flags -mtune=cortex-a8"
1467         aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1468         aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1469         aros_config_aflags="$aros_config_aflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1470         if test "$optimization" = "default"; then
1471             optimization_level="-Os"
1472         fi
1473         case "$target_cpu" in
1474             *armhf*)
1475                 gcc_default_float_abi="hard"
1476                 target_cpu=arm
1477                 aros_target_cpu=arm
1478                 ;;
1479             *arm*)
1480                 gcc_default_float_abi="softfp"
1481                 ;;
1482             *)
1483                 AC_MSG_ERROR("Unknown CPU for EfikaMX $target_cpu")
1484                 ;;
1485         esac
1486         ;;
1487         
1488     chrp)
1489         aros_target_arch="chrp"
1490         aros_shared_default="no"
1491         aros_target_cpu="ppc"
1492         aros_object_format="elf32ppc"
1493         aros_flavour="ppcnative"
1494         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1495         aros_kernel_ldflags=""
1496         aros_nominal_width=640
1497         aros_nominal_height=480
1498         aros_isa_flags="$aros_isa_flags -mno-toc"
1499         aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1500         aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1501         gcc_target_cpu="powerpc"
1502         case "$aros_target_variant" in
1503             efika)
1504                 aros_isa_flags="$aros_isa_flags -mcpu=603e"
1505                 aros_config_cppflags="$aros_config_cppflags -DBIG_ENDIAN_OHCI=1"
1506             ;;
1507         esac
1508         ;;
1510     r*pi)
1511         PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1512         aros_flavour="standalone"
1513         aros_target_arch="raspi"
1515         aros_shared_default="no"
1517         aros_target_mkdep="$aros_target_mkdep -D__GNUC__"
1518         
1519         case "$target_cpu" in
1520             *aarch64*)
1521                 aros_target_cpu="aarch64"
1522                 gcc_default_cpu="aarch64"
1523                 aros_object_format="aarch64elf_aros"
1524                 ;;
1525             *armhf*)
1526                 aros_target_cpu="arm"
1527                 gcc_default_cpu="armv6zk"
1528                 gcc_default_cpu_tune="arm1176jzf-s"
1529                 aros_object_format="armelf_aros"
1530                 aros_isa_flags="$aros_isa_flags -marm"
1531                 aros_config_cflags="$aros_config_cflags"
1532                 aros_config_cxxflags="$aros_config_cxxflags"
1533                 aros_config_aflags="$aros_config_aflags -marm"
1534                 aros_kernel_cflags="$aros_kernel_cflags -marm"
1535                 aros_target_mkdep="$aros_target_mkdep -Darm"
1536                 aros_arch_libs="-laeabi"
1537                 ;;
1538             *arm*)
1539                 aros_target_cpu="arm"
1540                 gcc_default_cpu="armv6zk"
1541                 gcc_default_cpu_tune="arm1176jzf-s"
1542                 aros_object_format="armelf_aros"
1543                 aros_isa_flags="$aros_isa_flags -marm"
1544                 aros_config_cflags="$aros_config_cflags"
1545                 aros_config_cxxflags="$aros_config_cxxflags"
1546                 aros_config_aflags="$aros_config_aflags -marm"
1547                 aros_kernel_cflags="$aros_kernel_cflags -marm"
1548                 aros_target_mkdep="$aros_target_mkdep -Darm"
1549                 aros_arch_libs="-laeabi"
1550                 ;;
1551             *)
1552                 AC_MSG_ERROR("Unknown CPU for RasPi $target_cpu")
1553                 ;;
1554         esac
1556         aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1557         aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
1558         aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
1559         aros_kernel_cflags="$aros_kernel_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1561         case "$aros_target_variant" in
1562             smp)
1563                 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1564             ;;
1565         esac
1566         ;;
1568     stm32f7_discovery)
1569         aros_flavour="standalone"
1570         aros_target_arch="stm32f7_discovery"
1571         aros_target_cpu="arm"
1572         aros_target_cpu_mode="thumb2"
1573         aros_object_format="armelf_aros"
1574         aros_shared_default="no"
1576         gcc_default_cpu="armv7e-m"
1577         gcc_default_cpu_tune="cortex-m7"
1578         gcc_default_fpu="fpv5-sp-d16"
1579         gcc_default_float_abi="hard"
1581         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dthumb"
1582         ;;
1584     amiga*)
1585         aros_target_arch="amiga"
1586         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1587         aros_shared_default="no"
1589         case "$target_cpu" in
1590             *m68k*)
1591                 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")
1592                 aros_enable_mmu=no
1593                 aros_target_cpu="m68k"
1594                 aros_object_format="m68kelf"
1595                 aros_flavour="standcompat"
1596                 gcc_target_cpu="m68000"
1597                 aros_nowarn_flags="$aros_nowarn_flags NOWARN_VOLATILE_REGISTER_VAR"
1598                 aros_config_cppflags="$aros_config_cppflags -DNOLIBINLINE"
1599                 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1600                 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1601                 if test "$optimization" = "default"; then
1602                     optimization_level="-Os"
1603                 fi
1604                 aros_config_aflags="$aros_config_aflags"
1605                 aros_target_strip_flags="-R.comment --strip-debug"
1606                 aros_nominal_width=640
1607                 aros_nominal_height=256
1608                 aros_nominal_depth=2
1609                 ;;
1610             *ppc*)
1611                 aros_cpu="ppc"
1612                 aros_flavour="native"
1613                 gcc_target_cpu="ppc"
1614                 ;;
1615             *)
1616                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1617                 ;;
1618         esac
1619         ;;
1621     mingw*)
1622         aros_target_arch="mingw32"
1623         aros_shared_default="no"
1624         aros_flavour="emulation"
1625         aros_shared_cflags=""
1626         need_crosstools="yes"
1627         need_dlopen="no"
1628         rescomp="windres"
1629         case "$target_cpu" in
1630             *i?86*)
1631                 aros_target_cpu="i386"
1632                 aros_object_format="elf_i386"
1633                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1634                 aros_nominal_depth=8
1635                 gcc_target_cpu="i386"
1637                 kernel_tool_prefix="i386-mingw32-"
1638                 ;;
1639             *x86_64*)
1640                 aros_target_cpu="x86_64"
1641                 aros_object_format="elf_x86_64"
1642                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1643                 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1644                 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1645                 aros_nominal_depth=8
1646                 kernel_tool_prefix="x86_64-w64-mingw32-"
1647                 ;;
1648             *arm*)
1649                 aros_target_cpu="arm"
1650                 aros_object_format="armelf_aros"
1651                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1652                 aros_arch_libs="-laeabi"
1653                 aros_nominal_depth=8
1654                 gcc_target_cpu="arm"
1655                 gcc_default_float_abi="soft"
1656                 kernel_tool_prefix="arm-mingw32ce-"
1657                 aros_nominal_width=160
1658                 aros_nominal_height=160
1659                 ;;
1660             *)
1661                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1662                 ;;
1663         esac
1664         if test $host_os = "cygwin"; then
1665                 aros_kernel_cflags="-mno-cygwin"
1666         fi
1667     ;;
1668     pp*)
1669         aros_target_arch="pp"
1670         aros_shared_default="no"
1671         case "$target_cpu" in
1672             *m68k*)
1673                 aros_target_cpu="m68k"
1674                 aros_object_format="m68kelf"
1675                 aros_flavour="palmnative"
1676                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1677                 aros_nominal_width=160
1678                 aros_nominal_height=160
1679                 aros_nominal_depth=1
1680                 aros_target_ar_flags="cru"
1681                 aros_compiler_libs="-lgcc1"
1682                 aros_shared_default=no
1683                 aros_shared_cflags="-fpic"
1684                 aros_shared_aflags=""
1685                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1686                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1687                 aros_debug_cppflags="$aros_messages_debug"
1688                 aros_debug_cflags="$aros_symbols_debug"
1689                 aros_debug_aflags=""
1690                 aros_debug_ldflags="$aros_symbols_debug"
1691                 aros_mungwall_debug="0"
1692                 aros_modules_debug="0"
1693                 gcc_target_cpu="mc68000"
1694                 ignore_undefined_symbols="-ius"
1695                 ;;
1696            *)
1697                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1698                 ;;
1699         esac
1700         ;;
1702     mac*)
1703         aros_target_arch="mac"
1704         aros_shared_default="no"
1705         case "$target_cpu" in
1706             *m68k*)
1707                 aros_target_cpu="m68k"
1708                 aros_object_format="m68kelf"
1709                 aros_flavour="mac68knative"
1710                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1711                 aros_nominal_width=512
1712                 aros_nominal_height=384
1713                 aros_nominal_depth=8
1714                 aros_target_ar_flags="cru"
1715                 aros_compiler_libs="-lgcc1"
1716                 aros_shared_default=no
1717                 aros_shared_cflags="-fpic"
1718                 aros_shared_aflags=""
1719                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1720                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1721                 aros_debug_cppflags="$aros_messages_debug"
1722                 aros_debug_cflags="$aros_symbols_debug"
1723                 aros_debug_aflags=""
1724                 aros_debug_ldflags="$aros_symbols_debug"
1725                 aros_mungwall_debug="0"
1726                 aros_modules_debug="0"
1727                 gcc_target_cpu="mc68000"
1728                 ignore_undefined_symbols="-ius"
1729                 ;;
1730            *)
1731                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1732                 ;;
1733         esac
1734         ;;
1736     *)
1737         AC_MSG_ERROR([Unsupported target architecture $target])
1738         ;;
1739 esac
1741 #-----------------------------------------------------------------------------
1742 crosstools_guess="yes"
1743 aros_target_toolchain="no"
1744 aros_config_sysroot=""
1745 aros_kernel_sysroot=""
1747 AC_MSG_CHECKING([Kernel toolchain prefix])
1748 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1749 AC_MSG_RESULT($kernel_tool_prefix)
1751 AC_MSG_CHECKING([ELF toolchain prefix])
1752 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"
1753                                                  crosstools_guess="no"])
1754 AC_MSG_RESULT($elf_tool_prefix)
1756 AC_MSG_CHECKING([AROS toolchain prefix])
1757 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain. Use yes for default name]),[aros_tool_prefix="$withval"
1758                 crosstools_guess="no"])
1759 if test "$aros_tool_prefix" = "yes" ; then
1760     aros_tool_prefix=$aros_target_cpu-aros-
1762 AC_MSG_RESULT($aros_tool_prefix)
1764 #-----------------------------------------------------------------------------
1765 #   Checking if we should build crosstools..
1766 AC_MSG_CHECKING([whether to build crosstools])
1767 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1768 AC_MSG_RESULT($crosstools)
1770 if test "${crosstools}" = "yes"; then
1771     if test "${crosstools_guess}" = "no"; then
1772         AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1773     fi
1776 if test "${crosstools}" = "yes" || test "${crosstools_guess}" = "no"; then
1777     aros_target_toolchain="yes"
1780 AC_MSG_CHECKING([where to install the crosstools binaries])
1781 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])
1782 if test "x$aros_toolchain_install" = "x"; then
1783     AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1784 else
1785     AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1786     PATH="$AROS_CROSSTOOLSDIR:$PATH"
1787     if test "$crosstools_guess" = "no" ; then
1788         toolchain_needs_sysroot=yes
1790         if test "x-$aros_flavour" != "x-emulation" -a "x-$aros_flavour" != "x-emulcompat" ; then
1791             aros_kernel_sysroot = $aros_config_sysroot
1792         fi
1793     fi
1795 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1797 AC_MSG_CHECKING([If we need to use --sysroot])
1798 if test "$toolchain_needs_sysroot" = "yes" ; then
1799     aros_config_sysroot="--sysroot $AROS_BUILDDIR_UNIX/bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer"
1801 AC_MSG_RESULT($toolchain_needs_sysroot)
1803 #-----------------------------------------------------------------------------
1804 if test "$aros_toolchain" = "gnu" ; then
1805     AC_MSG_CHECKING([what specific target binutils version to use])
1807 AC_ARG_WITH(binutils-version,AC_HELP_STRING([--with-binutils-version=VERSION],[Use binutils-VERSION for building AROS]),use_binutils_version="$withval",use_binutils_version="")
1808 if test "$use_binutils_version" = ""; then
1809         target_binutils_version="$default_binutils_version"
1810 else
1811     target_binutils_version="$use_binutils_version"
1813 if test "$aros_toolchain" = "gnu" ; then
1814     AC_MSG_RESULT($target_binutils_version)
1818 # Helper to identify gcc version
1819 AC_DEFUN([CROSS_GCC_VERSION], [
1820   target_gcc_version=""
1821   AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
1822     ax_cv_gcc_version="`$AROS_CROSSTOOLSDIR/${aros_tool_prefix}${toolchain_cpp_preprocessor} -dumpversion`"
1823     AS_IF([test "x$ax_cv_gcc_version" = "x"],[
1824       ax_cv_gcc_version=""
1825     ])
1826   ])
1827   target_gcc_version=$ax_cv_gcc_version
1828   AC_SUBST([target_gcc_version])
1831 #-----------------------------------------------------------------------------
1832 if test "$aros_toolchain" = "gnu" ; then
1833     AC_MSG_CHECKING([what specific target gcc version to use])
1835 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Compile gcc-VERSION for AROS]),use_gcc_version="$withval",use_gcc_version="")
1836 if test "$use_gcc_version" = ""; then
1837     if test "${crosstools}" = "no"; then
1838       if test "x$aros_toolchain_install" != "x"; then
1839           CROSS_GCC_VERSION
1840       fi
1841     fi
1842     if test "$use_gcc_version" = ""; then
1843         target_gcc_version="$default_gcc_version"
1844     fi
1845 else
1846     target_gcc_version="$use_gcc_version"
1848 if test "$aros_toolchain" = "gnu" ; then
1849     AC_MSG_RESULT($target_gcc_version)
1851     GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1)
1852     GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2)
1853     GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3)
1855     gcc_fix_bitfields="false"
1856     if test "$GCC_VERSION_MAJOR" -gt "4" ; then
1857         gcc_fix_bitfields="true"
1858     else
1859         if test "$GCC_VERSION_MAJOR" -gt "3" ; then
1860             if test "$GCC_VERSION_MINOR" -gt "6" ; then
1861                 gcc_fix_bitfields="true"
1862             fi
1863         fi
1864     fi
1866     if test "$gcc_fix_bitfields" = "true" ; then
1867         case "$aros_target_cpu" in
1868         *x86_64*)
1869             aros_kernel_cflags="$aros_kernel_cflags -mno-ms-bitfields"
1870             aros_isa_flags="$aros_isa_flags -mno-ms-bitfields"
1871             ;;
1872         i386)
1873             aros_kernel_cflags="$aros_kernel_cflags -mno-ms-bitfields"
1874             aros_isa_flags="$aros_isa_flags -mno-ms-bitfields"
1875             ;;
1876         esac
1877     fi
1880 AC_MSG_CHECKING([whether to enable Objective-C suppport])
1881 AC_ARG_ENABLE(objc,AC_HELP_STRING([--enable-objc],[Enable Objectve-C support (default=no)]),objc="$enableval",objc="no")
1882 AC_MSG_RESULT($objc)
1883 if test "x$objc" = "xyes"; then
1884     objc_target="$objc"
1885 else
1886     objc_target="no-objc"
1889 AC_MSG_CHECKING([whether to enable Java suppport])
1890 AC_ARG_ENABLE(java,AC_HELP_STRING([--enable-java],[Enable Java support (default=no)]),java="$enableval",java="no")
1891 AC_MSG_RESULT($java)
1892 if test "x$java" != "xno"; then
1893     java_target="$java"
1894 else
1895     java_target="no-java"
1898 spec_obj_format="-m $aros_object_format"
1899 # Now process extra architecture-specific options.
1900 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1901 # as well as floating-point ABI.
1902 case "$aros_target_cpu" in
1903 *x86_64*)
1904     dnl x86_64 can build 32 or 64bit code
1905     spec_obj_format="%{!m32:-m elf_x86_64} %{m32:-m elf_i386}"
1906     ;;
1907 arm*)
1908     dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1909     if test "$gcc_default_cpu" = ""; then
1910         gcc_default_cpu="armv6"
1911     fi
1912     if test "$gcc_default_fpu" = ""; then
1913         gcc_default_fpu="vfp"
1914     fi
1915     if test "$gcc_default_float_abi" = ""; then
1916         if test "$target_cpu" = "armhf"; then
1917             gcc_default_float_abi="hard"
1918         else
1919             gcc_default_float_abi="softfp"
1920         fi
1921     fi
1923     AC_MSG_CHECKING([Which minimum CPU to use])
1924     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)
1925     AC_MSG_RESULT($aros_gcc_cpu)
1927     AC_MSG_CHECKING([Which minimum FPU to use])
1928     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)
1929     AC_MSG_RESULT($aros_gcc_fpu)
1931     AC_MSG_CHECKING([Which floating point ABI to use])
1932     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)
1933     AC_MSG_RESULT($aros_gcc_float_abi)
1935     AC_MSG_CHECKING([Which ARM mode to use])
1936     if test "$aros_target_cpu_mode" = ""; then
1937         aros_target_cpu_mode="arm32"
1938         AC_MSG_RESULT([Defaulting to $aros_target_cpu_mode])
1939     else
1940         AC_MSG_RESULT([$aros_target_cpu_mode])
1941     fi
1943     case "$aros_target_cpu_mode" in
1944     arm32)
1945         gcc_default_mode="arm"
1946         aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
1947     ;;
1948     arm64)
1949         AC_MSG_ERROR([ARM 64-bit mode is unsupported])
1950     ;;
1951     thumb)
1952         AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
1953     ;;
1954     thumb1)
1955         AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
1956     ;;
1957     thumb2)
1958         gcc_default_mode="thumb"
1959         # Do not specify -mthumb-interwork as it may add extra code to support arm/thumb interwork
1960         aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
1961     ;;
1962     *)
1963         AC_MSG_ERROR([Unsupported ARM mode specified $aros_target_cpu_mode])
1964     ;;
1965     esac
1967     aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1968     aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
1969     aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
1970     ;;
1971 i386)
1972     aros_isa_flags="$aros_isa_flags -m32 -march=i486"
1973     aros_kernel_cflags="$aros_kernel_cflags $aros_isa_flags"
1974     aros_kernel_ldflags="$aros_kernel_ldflags -m32" 
1975     ;;
1976 esac
1978 # Some architectures may need custom ELF specs.
1979 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1980     elf_specs_in=config/${aros_object_format}-specs.in
1981 else
1982     elf_specs_in=config/elf-specs.in
1985 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1986 # Since we override specs, we may need to put these defines there
1987 if test "$gcc_target_cpu" != ""; then
1988     gcc_target_cpu="-D__${gcc_target_cpu}__"
1991 AC_MSG_CHECKING([where to download sourcecode for external ports])
1992 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1993 if test "$with_portssrcdir" = "default"; then
1994     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1995 else
1996     AROS_PORTSSRCDIR="$with_portssrcdir"
1998 AC_MSG_RESULT($AROS_PORTSSRCDIR)
2000 AC_MSG_CHECKING([which bootloader to use])
2001 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
2002 if test "$target_bootloader" = "none"; then
2003     aros_target_bootloader=""
2004 else
2005     aros_target_bootloader="$target_bootloader"
2007 AC_MSG_RESULT($target_bootloader)
2009 AC_MSG_CHECKING([which icon-set to use])
2010 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
2011 if test "$target_iconset" = "default"; then
2012     aros_target_iconset="Gorilla"
2013     target_iconset="default (Gorilla)"
2014 else
2015     aros_target_iconset="$target_iconset"
2017 AC_MSG_RESULT($target_iconset)
2019 AC_MSG_CHECKING([which GUI Theme to use])
2020 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
2021 if test "$target_guitheme" = "default"; then
2022     aros_target_guitheme="Ice"
2023 else
2024     aros_target_guitheme="$target_guitheme"
2026 AC_MSG_RESULT($aros_target_guitheme)
2028 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
2029 # for target code)
2030 cross_compiling=no
2032 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
2033 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
2034     cross_compiling=yes
2037 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
2038 dnl The flag itself is given in per-target section, because some targets require to pass it
2039 dnl in a different manner, otherwise some tests fail.
2040 dnl TODO: Justify this.
2041 if test "$aros_host_cpu" == "x86_64" ; then
2042     if test "$aros_target_cpu" == "i386" ; then
2043         cross_compiling=no
2044     fi
2047 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2048     dnl For a hosted build we are cross-compiling if host OS differs from build OS.
2049     dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
2050     dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
2051     dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
2052     dnl used to build bootstrap for target arch in either case.
2053     dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
2054     dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
2055     dnl perhaps introducing aros_host_variant
2056     if test "$aros_host_arch" != "$aros_target_arch" ; then
2057         cross_compiling=yes
2058     fi
2059 else
2060     dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
2061     dnl it as kernel_cc. If not, (e.g. we are on Windows or Darwin), we need a crosscompiler.
2062     if test "$host_cc_elf" = "no" ; then
2063         cross_compiling=yes
2064     fi
2067 if test "$cross_compiling" = "no" ; then
2068     kernel_tool_prefix=""
2069     if test "$host_cc_elf" = "yes" ; then
2070         elf_tool_prefix=""
2071     fi
2074 if test "$kernel_tool_version" != ""; then
2075     kernel_tool_version="-$kernel_tool_version"
2078 #######################################################################
2079 ## Compute what toolchains to use, and their paths                   ##
2080 #######################################################################
2082 # This takes, as input:
2083 #   crosstools             {yes,no}
2084 #   kernel_tool_version    {"",[version]}
2085 #   target_tool_version    {"",[version]}
2086 #   kernel_tool_prefix     {none,[some-arch-os-]}
2087 #   gnu-toolchain -:
2088 #     target_tool_prefix     ${aros_target_cpu}-aros-
2089 #     aros_tool_prefix       ${aros_target_cpu}-aros-
2091 # The output is
2092 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2093 #        Where the 'kernel' binaries are located
2094 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2095 #        Where the 'target' binaries are located
2096 #        (not the symlink farm - that is aros_target_*!)
2098 # The rules are:
2099 #   if crosstools then
2100 #      if kernel_tools_prefix = "no-kernel-prefix-"
2101 #          aros_kernel_* = crosstools cc paths
2102 #          aros_kernel_cc = elf cc wrapper around crosstools cc
2103 #      else
2104 #          VALIDATE(${kernel_tools_prefix}*)
2105 #          aros_kernel_* = ${kernel_tools_prefix}*
2106 #          if ${kernel_tools_prefix}cc is an AROS gcc
2107 #              aros_kernel_cc = ${kernel_tools_prefix}cc
2108 #          else
2109 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
2110 #          fi
2111 #      fi
2113 #      orig_target_* = aros built crosstools
2114 #      orig_target_cc = elf cc wrapper around crosstools cc
2115 #   else
2116 #      VALIDATE(${kernel_tools_prefix}*)
2118 #      orig_target_* = aros_kernel_*
2119 #      if aros_kernel_cc is an AROS gcc
2120 #          orig_target_cc = aros_kernel_cc
2121 #      else
2122 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
2123 #      fi
2124 #   fi
2126 if test "$aros_toolchain" = "gnu" ; then
2127     target_tool_prefix="${aros_target_cpu}-aros-"
2128 elif test "$aros_toolchain" = "llvm" ; then
2129     target_tool_prefix="bin/"
2132 if test "$kernel_tool_prefix" != "" ; then
2133     AC_MSG_CHECKING([which kernel tools])
2134     AC_MSG_RESULT([$kernel_tool_prefix]);
2137 if test "$kernel_tool_prefix" = "none" ; then
2138     dnl ELF wrapper can be used only for native bootstrap
2139     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2140         AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
2141     fi
2142 else
2143     # Kernel tools required - find them
2144     # Note that 'normally', aros_kernel_* overrides will be
2145     # empty, unless specified in the per-arch sections above.
2146     if test "x$aros_kernel_cpp" = "x"; then
2147         aros_kernel_cpp=${kernel_tool_prefix}${CPP}
2148     fi
2149     AROS_BUILDCMD(aros_kernel_cpp,$aros_kernel_cpp,${kernel_tool_version})
2150     AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
2151     AROS_REQUIRED(cpp,$aros_kernel_cpp)
2153     if test "x$aros_kernel_cc" = "x"; then
2154         aros_kernel_cc=${kernel_tool_prefix}${CC}
2155     fi
2156     AROS_BUILDCMD(aros_kernel_cc,$aros_kernel_cc,${kernel_tool_version})
2157     AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc)
2158     AROS_REQUIRED(cc,$aros_kernel_cc)
2160     if test "x$aros_kernel_cxx" = "x"; then
2161         aros_kernel_cxx=${kernel_tool_prefix}${CXX}
2162     fi
2163     AROS_BUILDCMD(aros_kernel_cxx,$aros_kernel_cxx,${kernel_tool_version})
2164     AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx)
2165     # If it's set, make sure it's really there
2166     if test "x$aros_kernel_cxx" != "x" ; then
2167         AROS_REQUIRED(cxx,$aros_kernel_cxx)
2168     fi
2169     AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
2170     AROS_REQUIRED(ld,$aros_kernel_ld)
2171     AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
2172     AROS_REQUIRED(as,$aros_kernel_as)
2173     AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
2174     AROS_REQUIRED(ar,$aros_kernel_ar)
2175     AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
2176     AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
2177     AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
2178     AROS_REQUIRED(nm,$aros_kernel_nm)
2179     AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
2180     AROS_REQUIRED(strip,$aros_kernel_strip)
2182     # Objcopy and objdump are not required for the kernel
2183     # toolchain on many architectures.
2184     # So we'll look for them, but not make them strictly required.
2185     AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
2186     AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
2187     if test "x${crosstools}" != "xyes" ; then
2188         AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
2189         AROS_REQUIRED(objdump,$aros_kernel_objdump)
2190     fi
2193 AC_MSG_CHECKING([which target tools to use])
2194 if test "$aros_target_toolchain" = "yes"; then
2195     if test "$aros_toolchain" = "llvm" ; then
2196         msg_result="llvm"
2197     else
2198         msg_result=$target_tool_prefix
2199     fi
2200     AC_MSG_RESULT([$msg_result])
2201     # We are building AROS crosstools
2202     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
2203     orig_target_cc="${tmp_tool_prefix}${toolchain_c_compiler}${target_tool_version}"
2204     orig_target_cxx="${tmp_tool_prefix}${toolchain_cxx_compiler}${target_tool_version}"
2205     orig_target_cpp="${tmp_tool_prefix}${toolchain_cpp_preprocessor}"
2206     orig_target_ld="${tmp_tool_prefix}${toolchain_ld}"
2207     orig_target_as="${tmp_tool_prefix}${toolchain_as}"
2208     orig_target_ar="${tmp_tool_prefix}${toolchain_ar}"
2209     orig_target_ranlib="${tmp_tool_prefix}${toolchain_ranlib}"
2210     orig_target_nm="${tmp_tool_prefix}${toolchain_nm}"
2211     orig_target_strip="${tmp_tool_prefix}${toolchain_strip}"
2212     orig_target_objcopy="${tmp_tool_prefix}${toolchain_objcopy}"
2213     orig_target_objdump="${tmp_tool_prefix}${toolchain_objdump}"
2214 else
2215     # Determine whether AROS or ELF tools should be used
2216     if test "$aros_tool_prefix" = "none"; then
2217         aros_tool_prefix="${elf_tool_prefix}"
2218     fi
2220     AC_MSG_RESULT([$aros_tool_prefix])
2221     # We are *not* building AROS crosstools - use the AROS or ELF tools
2222     AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}${toolchain_cpp_preprocessor}${target_tool_version})
2223     AROS_REQUIRED(cpp,$orig_target_cpp)
2224     AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}${toolchain_c_compiler}${target_tool_version})
2225     AROS_REQUIRED(cc,$orig_target_cc)
2226     AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}${toolchain_cxx_compiler}${target_tool_version})
2227     AROS_REQUIRED(cxx,$orig_target_cxx)
2228     AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}${toolchain_ld})
2229     AROS_REQUIRED(ld,$orig_target_ld)
2230     AROS_TOOL_TARGET(orig_target_as,as,aros_tool_prefix}${toolchain_as})
2231     AROS_REQUIRED(as,$orig_target_as)
2232     AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}${toolchain_ar})
2233     AROS_REQUIRED(ar,$orig_target_ar)
2234     AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}${toolchain_ranlib})
2235     AROS_REQUIRED(ranlib,$orig_target_ranlib)
2236     AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}${toolchain_nm})
2237     AROS_REQUIRED(nm,$orig_target_nm)
2238     AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}${toolchain_strip})
2239     AROS_REQUIRED(strip,$orig_target_strip)
2240     AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}${toolchain_objcopy})
2241     AROS_REQUIRED(objcopy,$orig_target_objcopy)
2242     AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}${toolchain_objdump})
2243     AROS_REQUIRED(objdump,$orig_target_objdump)
2246 if test "$kernel_tool_prefix" = "none" ; then
2247     # No kernel tools specified
2248     # Assume target tools == kernel tools with ELF wrapper
2249     aros_kernel_cc=$orig_target_cc
2250     aros_kernel_cxx=$orig_target_cxx
2251     aros_kernel_cpp=$orig_target_cpp
2252     aros_kernel_ld=$orig_target_ld
2253     aros_kernel_as=$orig_target_as
2254     aros_kernel_ar=$orig_target_ar
2255     aros_kernel_ranlib=$orig_target_ranlib
2256     aros_kernel_nm=$orig_target_nm
2257     aros_kernel_strip=$orig_target_strip
2258     aros_kernel_objcopy=$orig_target_objcopy
2259     aros_kernel_objdump=$orig_target_objdump
2260     use_kernel_cc_wrapper=yes
2263 # At this point, all aros_kernel_* and aros_target_* 
2264 # tools should be set up correctly
2266 CC="$aros_kernel_cc $kernel_tool_flags"
2267 CPP="$aros_kernel_cpp"
2269 #-----------------------------------------------------------------------------
2271 # Find all the tools we need to compile. This could be cross-compiling
2272 # though! If that is the case we use the GNU form of the target and
2273 # simply add this to the front of the binary name. This is rather simple,
2274 # but it should work under most circumstances.
2276 # The default tools are to use the same as the host, but only if the
2277 # host and target CPU are the same. With GCC this is normally enough.
2280 aros_cc_pre=""
2281 aros_shared_ld="$aros_host_ld"
2283 aros_target_mkdep="$aros_host_mkdep"
2285 # The default tools executables to be linked to.
2286 if test "$rescomp" != ""; then
2287     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
2288     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
2291 # Set up the sources for the symlink farm
2292 if test "$crosstools" = "yes"; then
2293     crosstools_target=tools-crosstools
2296 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
2297 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
2299 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/host/config"
2300 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
2301 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer/include/aros"
2302 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
2303 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
2304 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
2305 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
2307 # aros_cc_pre is a variable that is added to the front of the compiler name
2308 # in the generated aros-gcc shell script. We need this to enable the cache
2309 # to work across cleaned builds. Also, support DISTCC using the correct
2310 # environment variable.
2313 if test "x${DISTCC}" != "x" ; then
2314     if test "x${CCACHE}" != "x" ; then
2315         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
2316     else
2317         aros_cc_pre="${DISTCC} "
2318     fi
2319 else
2320     if test "x${CCACHE}" != "x" ; then
2321         aros_cc_pre="${CCACHE} "
2322     fi
2325 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
2326 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
2327 AC_SUBST(aros_target_nix_ldflags,-nix)
2328 AC_SUBST(aros_target_detach_ldflags,-detach)
2329 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
2331 # Target tools
2332 AC_SUBST(aros_toolchain)
2333 if test "$aros_target_toolchain" != "yes"; then
2334     prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
2335     if test "$GCC" = "yes"; then
2336         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
2337     fi
2338 else
2339     # We do not know which c compiler version we are going to build and what we need to know
2340     # here is different for different versions so this will be set later during the
2341     # build of crosstools.
2342     if test "$aros_toolchain" = "gnu" ; then
2343         prefix="$AROS_CROSSTOOLSDIR/${aros_target_cpu}-aros-"
2344     elif test "$aros_toolchain" = "llvm" ; then
2345         prefix="$AROS_CROSSTOOLSDIR/bin/"
2346     fi
2347     aros_target_cc_path=@aros_target_cc_path@
2349 aros_target_cpp="${prefix}${toolchain_cpp_preprocessor}"
2350 aros_target_cc="${prefix}${toolchain_c_compiler}"
2351 aros_target_cxx="${prefix}${toolchain_cxx_compiler}"
2352 aros_target_as="${prefix}${toolchain_as}"
2353 if test "${use_ld_wrapper}" = "yes"; then
2354     aros_target_ld="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}"
2355 else
2356     aros_target_ld="${prefix}${toolchain_ld}"
2358 aros_toolchain_ld="${prefix}${toolchain_ld}"
2360 aros_target_ar="${prefix}${toolchain_ar} $aros_target_ar_flags"
2361 aros_target_objcopy="${prefix}${toolchain_objcopy}"
2362 aros_target_objdump="${prefix}${toolchain_objdump}"
2363 aros_target_ranlib="${prefix}${toolchain_ranlib} $aros_target_ranlib_flags"
2364 aros_target_nm="${prefix}${toolchain_nm} $aros_target_nm_flags"
2365 aros_target_strip="${prefix}${toolchain_strip}"
2366 aros_plain_nm="${prefix}${toolchain_nm}"
2367 aros_plain_ar="${prefix}${toolchain_ar}"
2369 AC_ARG_ENABLE(includes,
2370 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
2371 [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`])
2373 if test "$aros_kernel_includes" = ""; then
2374     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2375         aros_kernel_includes="-isystem $aros_target_incl"
2376     fi
2379 if test "$aros_kernel_includes" != "" ; then
2380     dnl find out about the kernel cc's include path
2381     AC_MSG_CHECKING([for the kernel compiler's include path])
2382     if test "$aros_kernel_cc_includes" = "" ; then
2383         # Try to guess where the directory is.
2384         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
2385         if test -d $aros_kernel_cc_includes; then
2386             # Check if there is also an include-fixed directory and add it
2387             # to kernel compiler's include path as it may contain some of
2388             # the headers we need.
2389             if test -d "$aros_kernel_cc_includes"-fixed; then
2390                 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
2391             fi
2392             # Check for specific includes directory. Needed for Ubuntu 11.10 and Debian
2393             if test -d "/usr/include/${aros_target_cpu}-linux-gnu"; then
2394                 aros_kernel_cc_includes+=" -isystem /usr/include/${aros_target_cpu}-linux-gnu"
2395             fi
2396         else
2397             # The directory doesn't exist, we need to do some more work.
2398             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
2400             # These are the headers we're looking for.
2401             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2402                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
2403                      zutil.h stdint.h"
2405             dirs=
2406             for h in $headers; do
2407                 # Which other headers are needed by each of the above?
2408                 deps=$(echo "#include <$h>" | \
2409                        $aros_kernel_cc -E -M - 2>/dev/null | \
2410                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2412                 # Copy all the needed headers to a directory beneath gendir.
2413                 for d in $deps; do
2414                     h=$(basename $d)
2415                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
2416                                                 sed -n "s,^.*/include\(/.*\),\1,p")
2417                     ! test -d $dir && mkdir -p $dir
2418                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2419                 done
2420             done            
2421         fi
2422     fi
2423     AC_MSG_RESULT($aros_kernel_cc_includes)
2424     # Adding -nostdinc to kernel includes as they are always used together.
2425     aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
2428 if test "$crosstools" != "yes"; then
2429     dnl find out about the target cc's include path
2430     AC_MSG_CHECKING([for the target compiler's include path])
2431     if test "$aros_target_cc_includes" = "" ; then
2432         #try to guess where the directory is
2433         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
2434         if ! test -d $aros_target_cc_includes; then
2435             #the directory doesn't exist, we need to do some more work
2436             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
2437         
2438             #these are the headers we're looking for
2439             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2440                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
2441                     zutil.h"
2443             dirs=
2444             for h in $headers; do
2445                 #which other headers each of the above headers needs?
2446                 deps=$(echo "#include <$h>" | \
2447                     $orig_target_cc -E -M - 2>/dev/null | \
2448                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2449             
2450                 #copy all the needed headers to a directory beneath gendir
2451                 for d in $deps; do
2452                     h=$(basename $d)
2453                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
2454                                                 sed -n "s,^.*/include\(/.*\),\1,p")
2455                     ! test -d $dir && mkdir -p $dir
2456                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2457                 done
2458             done
2459         fi
2460     fi
2461     AC_MSG_RESULT($aros_target_cc_includes)
2462 else
2463     # We do not know which c compiler version we are going to build and what we need to know
2464     # here is different for different versions so this will be set later during the
2465     # build of crosstools.
2466     aros_target_cc_includes=@aros_target_cc_includes@
2470 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
2471 # On GCC >= 4.0 -iquote should be used
2474 save_cc="$CC"
2475 save_cflags="$CFLAGS"
2476 CFLAGS="-iquote."
2477 kernel_cflags_iquote=$host_cflags_iquote
2478 kernel_cflags_iquote_end=$host_cflags_iquote_end
2479 if test "x-$cross_compiling" = "x-yes"; then
2480     CC="$aros_kernel_cc"
2481     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2482     if test "x-$crosstools" != "x-yes"; then
2483         AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2484     else
2485         # we do know it is supported for the smallest version of gcc we are going to build
2486         # we assume it's also supported by later versions
2487         use_no_stack_protector=yes
2488     fi
2489     AC_MSG_RESULT($use_no_stack_protector)
2490     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2491     if test "x-$crosstools" != "x-yes"; then
2492         AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2493     else
2494         # we do know it is supported for the smallest version of gcc we are going to build
2495         # we assume it's also supported by later versions
2496         has_iquote=yes
2497     fi
2498     AC_MSG_RESULT($has_iquote)
2499     if test "x-$has_iquote" = "x-yes" ; then
2500         kernel_cflags_iquote=-iquote
2501         kernel_cflags_iquote_end=
2502     else
2503         kernel_cflags_iquote=-I
2504         kernel_cflags_iquote_end=-I-
2505     fi
2507 if test "x-$use_no_stack_protector" = "x-yes" ; then
2508     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2511 #-----------------------------------------------------------------------------
2513 # Check if we can explicitly choose older version of symbol hashing
2515 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2516 CC="$aros_kernel_cc"
2517 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2518 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2519 AC_MSG_RESULT($use_hash_style)
2520 if test "x-$use_hash_style" = "x-yes" ; then
2521     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2523 CC="$save_cc"
2524 CFLAGS="$save_cflags"
2526 AC_SUBST(host_cflags_iquote)
2527 AC_SUBST(host_cflags_iquote_end)
2528 AC_SUBST(kernel_cflags_iquote)
2529 AC_SUBST(kernel_cflags_iquote_end)
2532 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2533 AC_MSG_CHECKING([for default resolution of WBScreen])
2534 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2535 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2536 if test "$resolution" = "yes" ; then
2537     resolution="none"
2539 if test "$resolution" = "no" ; then
2540     resolution="none"
2542 if test "$resolution" != "none" ; then
2543     aros_nominal_width=`echo $resolution | cut -d'x' -f1`
2544     aros_nominal_height=`echo $resolution | cut -d'x' -f2`
2545     aros_nominal_depth=`echo $resolution | cut -d'x' -f3`
2547 AC_MSG_RESULT($aros_nominal_width x $aros_nominal_height x $aros_nominal_depth)
2548 aros_cv_nominal_width=$aros_nominal_width
2549 aros_cv_nominal_height=$aros_nominal_height
2550 aros_cv_nominal_depth=$aros_nominal_depth
2552 dnl See if the user wants the serial debug output for native flavour
2553 AC_MSG_CHECKING([whether serial debug is enabled])
2554 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)
2555 if test "$aros_serial_debug" = 0 ; then
2556     serial_debug_forced=""
2557     if test "$serial_debug" = "yes" ; then
2558         serial_debug="1"
2559     fi
2560     if test "$serial_debug" = "no" ; then
2561         serial_debug="none"
2562     fi
2563 else
2564     serial_debug_forced="(forced)"
2565     serial_debug=$aros_serial_debug
2567 if test "$serial_debug" != "none" ; then
2568     aros_serial_debug=$serial_debug
2569     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2570 else
2571     AC_MSG_RESULT(no)
2574 dnl See if the user wants the palm debug output hack for palm native flavour
2575 AC_MSG_CHECKING([whether palm debug hack is enabled])
2576 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")
2577 if test "$palm_debug_hack" = "yes" ; then
2578     aros_palm_debug_hack="1"
2580 AC_MSG_RESULT($palm_debug_hack)
2582 dnl See if dev wants the usb3.0 code
2583 AC_MSG_CHECKING([whether usb3.0 code is enabled])
2584 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2585 if test "$usb30_code" = "yes" ; then
2586     aros_config_cppflags="$aros_config_cppflags -DAROS_USB30_CODE"
2587     aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2589 AC_MSG_RESULT($usb30_code)
2591 dnl See if the user wants nesting supervisor activated for unix flavour
2592 AC_MSG_CHECKING([whether nesting supervisor support is enabled])
2593 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")
2594 if test "$nesting_supervisor" = "yes" ; then
2595     aros_nesting_supervisor="1"
2597 AC_MSG_RESULT($nesting_supervisor)
2599 dnl See if the user wants to disable MMU support
2600 dnl This can be overriden on per-target basis,
2601 dnl set $aros_enable_mmu to "yes" or "no" to do this
2602 if test "$aros_enable_mmu" = "" ; then
2603     AC_MSG_CHECKING([whether MMU support is enabled])
2604     dnl Enabled by default
2605     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2606     if test "$aros_enable_mmu" = "" ; then
2607         aros_enable_mmu="yes"
2608     fi
2609     AC_MSG_RESULT($aros_enable_mmu)
2611 if test "$aros_enable_mmu" = "no" ; then
2612     aros_enable_mmu="0"
2613 else
2614     aros_enable_mmu="1"
2616     
2618 dnl things specifically required for hosted flavours
2619 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2621     if test "x-$need_dlopen" != "x-no" ; then
2622       save_libs="$LIBS"
2623       LIBS=""
2624       dnl some kind of dynamic library access system is required for hostlib.resource
2625       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2626       if test "x-$have_dl" = "x-no" ; then
2627           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2628                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2629                                     have_dl="no")
2630       fi
2631       if test "x-$have_dl" = "x-no" ; then
2632           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2633       fi
2634       LIBS="$save_libs"
2635     fi
2638     dnl x11 hidd
2639     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2640                                            [build X11 hidd for hosted (default=auto)]),
2641                                            x11_hidd="$enableval",
2642                                            x11_hidd="$need_x11")
2643     case "x-$x11_hidd" in
2644         x-yes|x-no|x-auto)                 ;;
2645         *)                 x11_hidd="$need_x11" ;;
2646     esac
2648     ENABLE_X11=0
2650     dnl they want it
2651     if test "x-$x11_hidd" != "x-no" ; then
2653         dnl find x11 stuff
2654         AC_PATH_X
2656         if test -n "$x_includes"; then
2657             X_CFLAGS="$X_CFLAGS -I$x_includes"
2658         fi
2660         if test -n "$x_libraries"; then
2661             X_LIBS="$X_LIBS -L$x_libraries"
2662         fi
2664         if test "x-$no_x" = "x-yes" ; then
2666             dnl didn't find it
2667             if test "x-$x11_hidd" != "x-auto" ; then
2668                 dnl and they explicitly asked for it, bail out
2669                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2670             fi
2671         
2672         else
2673             dnl found it, setup the metatarget
2674             host_x_gfx=yes
2675             ENABLE_X11=1
2677             aros_host_x11_cflags="$X_CFLAGS"
2678             aros_host_x11_ldflags="$X_LIBS  -lX11"
2680             dnl setup shared memory extensions
2681             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2682                                                   [use X11 shared memory (default=auto)]),
2683                                                   x11_hidd_shm="$enableval",
2684                                                   x11_hidd_shm="auto")
2685             case "x-$x11_hidd_shm" in
2686                 x-yes|x-no|x-auto)                     ;;
2687                 *)                 x11_hidd_shm="auto" ;;
2688             esac
2690             have_xshm=no
2692             dnl they want it
2693             if test "x-$x11_hidd_shm" != "x-no" ; then
2695                 dnl system shm headers
2696                 AC_CHECK_HEADERS(sys/ipc.h)
2697                 AC_CHECK_HEADERS(sys/shm.h)
2699                 dnl got them
2700                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2702                     dnl make sure X libs have shm functions
2703                     save_cflags="$CFLAGS"
2704                     save_ldflags="$LDFLAGS"
2705                     CFLAGS="$CFLAGS $X_CFLAGS"
2706                     LDFLAGS="$LDFLAGS $X_LIBS"
2707                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2708                     CFLAGS="$save_cflags"
2709                     LDFLAGS="$save_ldflags"
2710                 fi
2711             fi
2713             dnl detection done, prepare output
2714             if test "x-$have_xshm" = "x-yes" ; then
2715                 dnl we can do shm
2716                 DO_XSHM_SUPPORT="1"
2717             elif test "x-$x11_hidd_shm" = "x-yes" ; then
2718                 dnl they explicitly asked for it, but we can't do it
2719                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2720             else
2721                 dnl otherwise just disable it
2722                 DO_XSHM_SUPPORT="0"
2723             fi
2725             
2726             dnl setup vidmode (fullscreen) extensions
2727             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2728                                                       [use X11 vidmode extension (default=auto)]),
2729                                                       x11_hidd_vidmode="$enableval",
2730                                                       x11_hidd_vidmode="auto")
2731             case "x-$x11_hidd_vidmode" in
2732                 x-yes|x-no|x-auto)                         ;;
2733                 *)                 x11_hidd_vidmode="auto" ;;
2734             esac
2736             have_vidmode=no
2738             dnl they want it
2739             if test "x-$x11_hidd_vidmode" != "x-no" ; then
2741                 dnl make sure X libs have vidmode functions
2742                 save_cflags="$CFLAGS"
2743                 save_ldflags="$LDFLAGS"
2744                 CFLAGS="$CFLAGS $X_CFLAGS"
2745                 LDFLAGS="$LDFLAGS $X_LIBS"
2746                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2747                 CFLAGS="$save_cflags"
2748                 LDFLAGS="$save_ldflags"
2749             fi
2751             dnl detection done, prepare output
2752             if test "x-$have_vidmode" = "x-yes" ; then
2753                 dnl we can do vidmode
2754                 DO_VIDMODE_SUPPORT="1"
2755             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2756                 dnl they explicitly asked for it, but we can't do it
2757                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2758             else
2759                 dnl otherwise just disable it
2760                 DO_VIDMODE_SUPPORT="0"
2761             fi
2762         fi
2763     fi
2765     dnl sdl hidd
2766     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2767                                            [build SDL hidd for hosted (default=auto)]),
2768                                            sdl_hidd="$enableval",
2769                                            sdl_hidd="auto")
2770     case "x-$sdl_hidd" in
2771         x-yes|x-no|x-auto)                 ;;
2772         *)                 sdl_hidd="auto" ;;
2773     esac
2775     dnl they want it
2776     if test "x-$sdl_hidd" != "x-no" ; then
2778         dnl find sdl
2779         SDL_VERSION=1.2.5
2780         AM_PATH_SDL($SDL_VERSION, [have_sdl="yes"],
2781             [have_sdl="no"])
2783         if test "x-$have_sdl" != "x-yes" ; then
2785             dnl didn't find it
2786             if test "x-$sdl_hidd" != "x-auto" ; then
2787                 dnl and they explicitly asked for it, bail out
2788                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2789             fi
2791         else
2792             dnl found it, enable the build
2793             host_sdl_gfx=yes
2794             aros_host_sdl_cflags=$SDL_CFLAGS
2795             aros_host_sdl_libs=$SDL_LIBS
2796         fi
2797     fi
2802 dnl See if the user wants dbus.library
2803 AC_MSG_CHECKING([whether building of dbus.library is enabled])
2804 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2805 if test "$dbus" = "yes" ; then
2806     ENABLE_DBUS=1
2807     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2808     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2809     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2810     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2811 else
2812     ENABLE_DBUS=0
2814 AC_MSG_RESULT($dbus)
2816 if test "$use_kernel_cc_wrapper" = "yes" ; then
2817     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-${toolchain_c_compiler}"
2820 aros_kernel_cppflags=$aros_config_cppflags
2821 aros_optimization_cflags="$optimization_level"
2822 if test "$optimization" = "default"; then
2823 AC_MSG_CHECKING([default optimization level to use])
2824 AC_MSG_RESULT($optimization_level)
2827 dnl --------------------------------------------------------------------
2828 dnl Configuration Output Section
2829 dnl --------------------------------------------------------------------
2831 # Generic
2832 AC_SUBST(aros_arch)
2833 AC_SUBST(aros_cpu)
2834 AC_SUBST(aros_flavour)
2835 AC_SUBST(aros_flavour_uc)
2836 AC_SUBST(aros_target_toolchain)
2837 AC_SUBST(aros_toolchain_ld)
2838 AC_SUBST(aros_build_host)
2839 AC_SUBST(AROS_BUILDDIR)
2840 AC_SUBST(AROS_BUILDDIR_UNIX)
2841 AC_SUBST(SRCDIR)
2842 AC_SUBST(AROS_CROSSTOOLSDIR)
2843 AC_SUBST(AROS_PORTSSRCDIR)
2845 # Compatability with other Amiga-like operation systems
2846 AC_SUBST(aros_amigaos_compliance)
2848 # Host related
2849 AC_SUBST(aros_cc_pre)
2850 AC_SUBST(aros_host_strip)
2851 AC_SUBST(aros_host_arch)
2852 AC_SUBST(aros_host_cpu)
2853 AC_SUBST(aros_host_cpp)
2854 AC_SUBST(aros_host_def_cc)
2855 AC_SUBST(aros_host_cc)
2856 AC_SUBST(aros_host_cxx)
2857 AC_SUBST(aros_host_ar)
2858 AC_SUBST(aros_host_ranlib)
2859 AC_SUBST(aros_host_ld)
2860 AC_SUBST(aros_host_make)
2861 AC_SUBST(aros_host_cppflags)
2862 AC_SUBST(aros_host_cflags)
2863 AC_SUBST(aros_host_cxxflags)
2864 AC_SUBST(gnu89_inline)
2865 AC_SUBST(aros_host_ldflags)
2866 AC_SUBST(aros_host_debug)
2867 AC_SUBST(aros_host_mkdep)
2868 AC_SUBST(aros_host_mkargs)
2869 AC_SUBST(aros_host_exe_suffix)
2870 AC_SUBST(aros_host_lib_suffix)
2871 AC_SUBST(aros_tools_dir)
2872 AC_SUBST(aros_host_aclocal)
2873 AC_SUBST(aros_host_autoconf)
2874 AC_SUBST(aros_host_autoheader)
2875 AC_SUBST(aros_host_automake)
2876 AC_SUBST(ant)
2878 # Target Related
2879 AC_SUBST(aros_target_guitheme)
2880 AC_SUBST(aros_target_iconset)
2881 AC_SUBST(aros_target_bootloader)
2882 AC_SUBST(aros_target_arch)
2883 AC_SUBST(aros_target_family)
2884 AC_SUBST(aros_target_cpu)
2885 AC_SUBST(aros_target_cpu_mode)
2886 AC_SUBST(aros_target_variant)
2887 AC_SUBST(aros_target_suffix)
2888 AC_SUBST(aros_target_ar)
2889 AC_SUBST(aros_target_ranlib)
2890 AC_SUBST(aros_plain_nm)
2891 AC_SUBST(aros_plain_ar)
2892 AC_SUBST(aros_kernel_ar)
2893 AC_SUBST(aros_kernel_ranlib)
2894 AC_SUBST(orig_target_cc)
2895 AC_SUBST(aros_target_cc)
2896 AC_SUBST(aros_kernel_cc)
2897 AC_SUBST(orig_target_cxx)
2898 AC_SUBST(aros_target_cxx)
2899 AC_SUBST(aros_kernel_cxx)
2900 AC_SUBST(orig_target_cpp)
2901 AC_SUBST(aros_target_cpp)
2902 AC_SUBST(aros_kernel_cpp)
2903 AC_SUBST(orig_target_as)
2904 AC_SUBST(aros_target_as)
2905 AC_SUBST(aros_kernel_as)
2906 AC_SUBST(orig_target_ld)
2907 AC_SUBST(aros_target_ld)
2908 AC_SUBST(aros_kernel_ld)
2909 AC_SUBST(aros_target_cc_includes)
2910 AC_SUBST(aros_target_cc_path)
2911 AC_SUBST(aros_target_objdump)
2912 AC_SUBST(aros_target_objcopy)
2913 AC_SUBST(aros_target_strip)
2914 AC_SUBST(aros_target_nm)
2915 AC_SUBST(aros_kernel_rescomp)
2916 AC_SUBST(aros_shared_default)
2917 AC_SUBST(aros_shared_ld)
2918 AC_SUBST(aros_object_format)
2919 AC_SUBST(spec_obj_format)
2920 AC_SUBST(aros_compiler_libs)
2921 AC_SUBST(aros_arch_libs)
2923 AC_SUBST(aros_shared_cflags)
2924 AC_SUBST(aros_shared_aflags)
2925 AC_SUBST(aros_shared_ldflags)
2927 AC_SUBST(aros_config_sysroot)
2928 AC_SUBST(aros_warn_flags)
2929 AC_SUBST(aros_nowarn_flags)
2930 AC_SUBST(aros_config_cppflags)
2931 AC_SUBST(aros_config_cflags)
2932 AC_SUBST(aros_config_cxxflags)
2933 AC_SUBST(aros_config_aflags)
2934 AC_SUBST(aros_config_ldflags)
2936 AC_SUBST(aros_kernel_sysroot)
2937 AC_SUBST(aros_kernel_cppflags)
2938 AC_SUBST(aros_kernel_cflags)
2939 AC_SUBST(aros_kernel_includes)
2940 AC_SUBST(aros_kernel_objcflags)
2941 AC_SUBST(aros_kernel_ldflags)
2942 AC_SUBST(aros_debug_cppflags)
2943 AC_SUBST(aros_debug_cflags)
2944 AC_SUBST(aros_debug_cxxflags)
2945 AC_SUBST(aros_debug_aflags)
2946 AC_SUBST(aros_debug_ldflags)
2947 AC_SUBST(aros_target_genmap)
2948 AC_SUBST(aros_target_strip_flags)
2949 AC_SUBST(aros_config_lto)
2950 AC_SUBST(aros_config_coverage)
2951 AC_SUBST(aros_optimization_cflags)
2952 AC_SUBST(aros_isa_flags)
2954 AC_SUBST(crosstools_target)
2955 AC_SUBST(crosstools_cxx_target)
2957 # Hosted Graphics Related
2958 AC_SUBST(host_x_gfx)
2959 AC_SUBST(host_sdl_gfx)
2960 AC_SUBST(host_android_gfx)
2962 AC_SUBST(pci_hidd_target)
2964 AC_SUBST(aros_nominal_width)
2965 AC_SUBST(aros_nominal_height)
2966 AC_SUBST(aros_nominal_depth)
2967 AC_SUBST(DO_XSHM_SUPPORT)
2968 AC_SUBST(DO_VIDMODE_SUPPORT)
2970 AC_SUBST(aros_host_x11_cflags)
2971 AC_SUBST(aros_host_x11_ldflags)
2972 AC_SUBST(aros_host_sdl_cflags)
2973 AC_SUBST(aros_host_sdl_libs)
2975 # Native version related
2976 AC_SUBST(aros_serial_debug)
2977 AC_SUBST(PLATFORM_EXECSMP)
2978 AC_SUBST(ENABLE_EXECSMP)
2980 # Palm native version related
2981 AC_SUBST(aros_palm_debug_hack)
2983 # Unix/Hosted version related
2984 AC_SUBST(aros_nesting_supervisor)
2986 # MMU related
2987 AC_SUBST(aros_enable_mmu)
2989 # Apple iOS related
2990 AC_SUBST(aros_ios_platform)
2991 AC_SUBST(aros_ios_version)
2992 AC_SUBST(aros_ios_sdk)
2994 # ARM default GCC target related
2995 AC_SUBST(gcc_default_cpu)
2996 AC_SUBST(gcc_default_cpu_tune)
2997 AC_SUBST(gcc_default_fpu)
2998 AC_SUBST(gcc_default_float_abi)
2999 AC_SUBST(gcc_default_mode)
3001 # Android related
3002 AC_SUBST(android_tool)
3003 AC_SUBST(aros_android_level)
3004 AC_SUBST(aros_android_antapk)
3006 # DBUS related
3007 AC_SUBST(ENABLE_DBUS)
3008 AC_SUBST(DBUS_CFLAGS)
3009 AC_SUBST(DBUS_LIBFLAGS)
3010 AC_SUBST(KERNEL_DBUS_KOBJ)
3011 AC_SUBST(KERNEL_DBUS_INCLUDES)
3013 #X11 related
3014 AC_SUBST(ENABLE_X11)
3016 # Debug related
3017 AC_SUBST(aros_debug)
3018 AC_SUBST(aros_mungwall_debug)
3019 AC_SUBST(aros_stack_debug)
3020 AC_SUBST(aros_modules_debug)
3022 # Collect-aros stuff: "-ius" to ignore undefined symbols
3023 AC_SUBST(ignore_undefined_symbols)
3025 # C compiler related
3026 AC_SUBST(gcc_target_cpu)
3027 AC_SUBST(target_binutils_version)
3028 AC_SUBST(target_gcc_version)
3030 #ObjC compiler related
3031 AC_SUBST(objc_target)
3033 #Java related
3034 AC_SUBST(java_target)
3036 # USB3.0 code
3037 AC_SUBST(aros_usb30_code)
3039 dnl Prepare for output, make up all the generated patches
3040 case "$aros_flavour" in
3041 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
3042                 aros_flavour="emulation" ;;
3043 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
3044                 aros_flavour="emulation" ;;
3045 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
3046                 aros_flavour="standalone";;
3047 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3048                 aros_flavour="standalone";;
3049 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
3050                 aros_flavour="native" ;;
3051 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
3052                 aros_flavour="native" ;;
3053 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
3054                 aros_flavour="linklib" ;;
3055 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3056                 aros_flavour="palmnative" ;;
3057 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3058                 aros_flavour="mac68knative" ;;
3059 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3060                 aros_flavour="ppcnative" ;;
3061 esac
3063 if test ! -d ${aros_inc_dir} ; then
3064     ${MKDIR} ${aros_inc_dir}
3066 if test ! -d ${aros_geninc_dir} ; then
3067     ${MKDIR} ${aros_geninc_dir}
3069 if test ! -d ${aros_hostcfg_dir} ; then
3070     ${MKDIR} ${aros_hostcfg_dir}
3072 if test ! -d ${aros_targetcfg_dir} ; then
3073     ${MKDIR} ${aros_targetcfg_dir}
3075 if test ! -d ${aros_tools_dir} ; then
3076     ${MKDIR} ${aros_tools_dir}
3078 if test ! -d ${aros_scripts_dir} ; then
3079     ${MKDIR} ${aros_scripts_dir}
3082 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
3084 # Generic build tools (metamake, etc)
3085 AC_CONFIG_COMMANDS([genmf-executable-support],
3086     [
3087         chmod a+x ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname
3088         chmod a+x ${aros_tools_dir}/genmf.py
3089     ],
3090     [
3091         AROS_CROSSTOOLSDIR=${AROS_CROSSTOOLSDIR}
3092         aros_tools_dir=${aros_tools_dir}
3093     ]
3095 AC_CONFIG_FILES(
3096     Makefile
3097     config/make.cfg
3098     ${aros_inc_dir}/config.h:config/config.h.in
3099     ${aros_geninc_dir}/config.h:config/config.h.in
3100     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
3101     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
3102     ${aros_targetcfg_dir}/build.cfg:config/build.cfg.in
3103     mmake.config
3104     compiler/include/geninc.cfg:compiler/include/geninc.cfg.in
3105     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
3106     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
3107     ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname:scripts/uname.in
3108     tools/collect-aros/env.h
3111 # Binutils
3112 AC_CONFIG_COMMANDS([binutils-support],
3113     [
3114         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3115         mkdir -p $prefix
3116         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3118         chmod a+x ${prefix2}-ld
3120         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
3121         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
3122         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
3123         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
3124         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
3125         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
3126         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
3127     ],
3128     [
3129         aros_host_exe_suffix=${aros_host_exe_suffix}
3130         aros_tools_dir=${aros_tools_dir}
3131         aros_target_cpu=${aros_target_cpu}
3132         aros_target_arch=${aros_target_arch}
3133         aros_target_suffix=${aros_target_suffix}
3134         orig_target_nm=${orig_target_nm}
3135         orig_target_as=${orig_target_as}
3136         orig_target_ar=${orig_target_ar}
3137         orig_target_ranlib=${orig_target_ranlib}
3138         orig_target_objdump=${orig_target_objdump}
3139         orig_target_objcopy=${orig_target_objcopy}
3140         orig_target_strip=${orig_target_strip}
3141         aros_kernel_ld=${aros_kernel_ld}
3142     ]
3144 if test "${use_ld_wrapper}" = "yes"; then
3145     AC_CONFIG_FILES(
3146         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}:scripts/aros-ld.in
3147     )
3149 # Bare Elf support script and spec
3150 if test "${use_kernel_cc_wrapper}" = "yes"; then
3151     AC_CONFIG_COMMANDS([elf-compiler-support],
3152         [
3153             prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3154             mkdir -p $prefix
3155             prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
3157             chmod a+x ${prefix2}-gcc
3159             ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix2}-ld$aros_host_exe_suffix
3160         ],
3161         [
3162             aros_host_exe_suffix=${aros_host_exe_suffix}
3163             aros_tools_dir=${aros_tools_dir}
3164             aros_target_cpu=${aros_target_cpu}
3165             aros_target_arch=${aros_target_arch}
3166             aros_target_suffix=${aros_target_suffix}
3167             aros_kernel_ld=${aros_kernel_ld}
3168         ]
3169     )
3170     AC_CONFIG_FILES(
3171         ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
3172         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
3173     )
3176 # Host compiler support scripts and spec
3177 if test "${aros_target_toolchain}" = "no"; then
3178     AC_CONFIG_COMMANDS([host-compiler-wrapper-support],
3179         [
3180             prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3181             mkdir -p $prefix
3182             prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3184             chmod a+x ${prefix2}-${toolchain_c_compiler} ${prefix2}-${toolchain_cxx_compiler} ${prefix2}-${toolchain_cpp_preprocessor}
3185         ],
3186         [
3187             aros_host_exe_suffix=${aros_host_exe_suffix}
3188             aros_tools_dir=${aros_tools_dir}
3189             aros_target_cpu=${aros_target_cpu}
3190             aros_target_arch=${aros_target_arch}
3191             aros_target_suffix=${aros_target_suffix}
3192         ]
3193     )
3194     AC_CONFIG_FILES(
3195         ${aros_targetcfg_dir}/specs:config/specs.in
3196         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cpp_preprocessor}:scripts/aros-${toolchain_cpp_preprocessor}.in
3197         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_c_compiler}:scripts/aros-${toolchain_c_compiler}.in
3198         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cxx_compiler}:scripts/aros-${toolchain_cxx_compiler}.in
3199     )
3202 # Android support
3203 if test "$aros_target_variant" == "android"; then
3204     AC_CONFIG_FILES(${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in)
3207 # cmake helper
3208 AC_CONFIG_FILES(${aros_targetcfg_dir}/conf.cmake:config/conf.cmake.in)
3210 AC_OUTPUT
3212 dnl This is in order to not define SHARED_CFLAGS sometimes
3213 dnl We don't always do aros_shared_ar, aros_shared_cflags
3215 #XXX compatability...
3216 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
3218 if test -n "$aros_shared_cflags" ; then
3219     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
3220     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg