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