silence debug
[AROS.git] / configure.in
blobc588aa393448d7e012c8cab557991a12c36aab53
1 dnl Copyright (C) 1997-2019, 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_toolchain_family=`cat ${srcdir}/config/toolchain_def`
27 default_gcc_version=`cat ${srcdir}/config/gcc_def`
28 exp_gcc_version=`cat ${srcdir}/config/gcc_exp`
29 default_binutils_version=`cat ${srcdir}/config/binutils_def`
30 default_llvm_version=`cat ${srcdir}/config/llvm_def`
31 exp_binutils_version=`cat ${srcdir}/config/binutils_exp`
32 default_grub2_version="2.02"
33 target_grub2_version=$default_grub2_version
35 # The AROS target is slightly different to the normal GNU style
36 # format. We don't have the middle part, and we reverse the order
37 # of the $(CPU) and $(OS) bits.
39 # Don't strip the version of the target yet, it might be
40 # useful on some systems.
42 AC_MSG_CHECKING([for AROS style target])
44 if test "$target" = "NONE" ; then
45     target=$host_os-$host_cpu
46 else
47     if test "$target" = "" ; then
48         target=$host_os-$host_cpu
49     fi
51 AC_MSG_RESULT($target)
53 if test "$host_os" = "mingw32" ; then
54     PWDCMD="pwd -W"
57 # Don't know where else to put this...
58 AC_MSG_CHECKING([building AROS in])
59 AROS_BUILDDIR=`${PWDCMD-pwd}`
60 AROS_BUILDDIR_UNIX=${PWD}
61 AC_MSG_RESULT($AROS_BUILDDIR)
63 AC_MSG_CHECKING([AROS source in])
64 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
65 SRCDIR=${srcpwd}
66 AC_MSG_RESULT($SRCDIR)
68 # Parse the target field into something useful.
69 changequote(<<,>>)
70 target_os=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\1/'`
71 target_cpu=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\2/'`
72 changequote([,])
74 # Some debug output, to be removed again.
75 AC_MSG_CHECKING([for target system (debug output)])
76 AC_MSG_RESULT($target_os)
77 AC_MSG_CHECKING([for target cpu (debug output)])
78 AC_MSG_RESULT($target_cpu)
80 dnl --------------------------------------------------------------------
81 dnl Set the default Workbench resolution
82 dnl --------------------------------------------------------------------
83 aros_nominal_width=800
84 aros_nominal_height=600
85 aros_nominal_depth=4
87 dnl --------------------------------------------------------------------
88 dnl Host Configuration Section
89 dnl --------------------------------------------------------------------
90 dnl
91 dnl The idea here is to find out all the information we need about the
92 dnl host. This means things like tools for building directory structures,
93 dnl copying files around and the like.
95 HOST_WANTS_X11=
96 HOST_WANTS_GLX=
97 HOST_WANTS_SDL=
98 HOST_WANTS_DBUS=
99 HOST_WANTS_DLOPEN=
101 default_c_compilers="gcc clang cc"
102 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="")
103 if test "$use_c_compiler" = ""; then
104     host_c_compilers="$default_c_compilers"
105 else
106     host_c_compilers="$use_c_compiler"
107     CC=$use_c_compiler
110 default_cxx_compilers="g++ clang++ c++"
111 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="")
112 if test "$use_cxx_compiler" = ""; then
113         host_cxx_compilers="$default_cxx_compilers"
114 else
115     host_cxx_compilers="$use_cxx_compiler"
116     CXX=$use_cxx_compiler
120 # The first step is to find the host binaries.
121 # Check for a compiler.
122 # Due to a bug in autoconf check for c++ compiler first.
123 # For mor info see, http://osdir.com/ml/bug-autoconf-gnu/2010-05/msg00001.html.
124 AC_PROG_CXX([${host_cxx_compilers}])
125 CXX_BASE=$CXX
126 AC_PATH_PROG(CXX,$CXX)
127 AC_PROG_CC([${host_c_compilers}])
128 CC_BASE=$CC
129 AC_PROG_CPP
130 CPP_BASE=$CPP
131 AC_PATH_PROG(CC,$CC)
132 aros_host_def_cc="$CC"
133 AC_PROG_CC_STDC
134 AC_PROG_CPP
136 # detect the compiler version
137 AC_MSG_CHECKING([which toolchain family ${CC_BASE} belongs to])
138 HOST_COMPILER_VERSION=`"$CC" --version 2>/dev/null`
139 if test x"$HOST_COMPILER_VERSION" = "x"; then
140     HOST_COMPILER_VERSION=`"$CC" --qversion 2>/dev/null`
142 if test x"$HOST_COMPILER_VERSION" = "x"; then
143     HOST_COMPILER_VERSION=`"$CC" -V 2>/dev/null`
146 IS_SUN_COMPILER=`echo $HOST_COMPILER_VERSION | grep -i -c -E 'Sun C\+\+'`
147 if test "$IS_SUN_COMPILER" -ne "0"; then
148     HOST_TOOLCHAIN_PREFIX=
149     HOST_TOOLCHAIN_SUFFIX=
150     HOST_TOOLCHAIN_FAMILY=sun
152 IS_LLVM_COMPILER=`echo $HOST_COMPILER_VERSION | grep -i -c -E 'LLVM|clang'`
153 if test "$IS_LLVM_COMPILER" -ne "0"; then
154     if test "$CC_BASE" != "gcc"; then
155         HOST_TOOLCHAIN_PREFIX=llvm-
156         HOST_TOOLCHAIN_SUFFIX="`echo $CC_BASE | sed -e \"s|clang||g\"`"
157         HOST_TOOLCHAIN_FAMILY=llvm
158     else
159         IS_GNU_COMPILER=1
160     fi
162 if test "x$IS_GNU_COMPILER" = "x"; then
163     IS_GNU_COMPILER=`echo $HOST_COMPILER_VERSION | grep -i -c -E 'gcc'`
165 if test "$IS_GNU_COMPILER" -ne "0"; then
166     HOST_TOOLCHAIN_PREFIX=
167     HOST_TOOLCHAIN_SUFFIX=
168     HOST_TOOLCHAIN_FAMILY=gnu
170 if test x"$HOST_TOOLCHAIN_FAMILY" = "x"; then
171     HOST_TOOLCHAIN_FAMILY=unknown
173 AC_MSG_RESULT($HOST_TOOLCHAIN_FAMILY)
175 # Check for a compatible awk
176 AC_CHECK_PROGS(AWK,[gawk nawk])
177 AROS_REQUIRED(gawk,$AWK)
178 AROS_PROG(MMAKE,mmake)
180 # Perform some default variable assignments. Note all of these will be
181 # Regenerated from the script, so there is no need to cache them.
183 aros_build_host=$host
184 aros_host_cpp="$CPP"
185 aros_host_cc="$CC"
186 aros_host_cxx="$CXX"
187 base_ld_name=${HOST_TOOLCHAIN_PREFIX}ld${HOST_TOOLCHAIN_SUFFIX}
188 if test "$HOST_TOOLCHAIN_FAMILY" = "llvm"; then
189     AC_CHECK_PROGS(base_lld_name,[$base_ld_name ld.lld${HOST_TOOLCHAIN_SUFFIX} ld64.lld${HOST_TOOLCHAIN_SUFFIX} ld-link${HOST_TOOLCHAIN_SUFFIX}.exe ld${HOST_TOOLCHAIN_SUFFIX}])
190     LD_BASE=$base_lld_name
191 else
192     AC_CHECK_PROG(LD_BASE,$base_ld_name)
194 AROS_TOOL_CCPATH(aros_host_ld,ld,$LD_BASE)
195 AROS_REQUIRED(ld,$aros_host_ld)
196 aros_host_make="make"
197 aros_host_cflags="$CFLAGS"
198 aros_host_cxxflags="$CXXFLAGS"
199 aros_host_cppflags="$CPPFLAGS"
200 aros_host_ldflags="$LDFLAGS"
201 aros_host_debug="-g -O0"
202 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
203 aros_host_mkargs="--no-print-directory"
204 aros_host_exe_suffix="$EXEEXT"
205 aros_host_lib_suffix=""
207 # Ignore all compliance, AROS ROMs = 0
208 # KickStart v1.0 = 30
209 # KickStart v1.3 = 34
210 # KickStart v2.0 = 37
211 # KickStart v3.0 = 39
212 # KickStart v3.1 = 40
213 # AmigaOS   v3.5 = 44
214 aros_amigaos_compliance=0
216 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
217 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
218 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
219 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
221 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
222 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
224 case "$aros_host_cc" in
225     *clang*)
226         aros_host_cc_pipe=""
227         ;;
228     *gcc*)
229         aros_host_cc_pipe="-pipe"
230         ;;
231     icc)
232         aros_host_cc_pipe=""
233         ;;
234     *)
235         aros_host_cc_pipe=""
236         ;;
237 esac
239 aros_kernel_cc_includes=""
240 aros_target_cc_includes=""
241 host_cc_elf=yes
243 # ----------------------------------------------------------------------------------------
244 # Host-specific defaults
246 # This is the main host configuration section. It is where the host
247 # can change the values of any variables it needs to change. We do
248 # not look at anything that compiles to the target yet, we'll get
249 # to that later.
251 case "$host_os" in
252     aros*)
253         aros_host_arch="aros"
254         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
255         case "$host_cpu" in
256             *i?86*)
257                 aros_host_cpu="i386"
258                 ;;
259             *x86_64*)
260                 aros_host_cpu="x86_64"
261                 ;;
262             *powerpc*)
263                 aros_host_cpu="ppc"
264                 ;;
265             *)
266                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
267                 aros_host_cpu="$host_cpu"
268                 ;;
269         esac
270         ;;
272     linux*)
273         aros_host_arch="linux"
274         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
275         android_build_os="linux-x86"
276         android_tool="android"
277         default_android_sdk="/opt/android-sdk-linux_x86"
278         case "$host_cpu" in
279             *i?86*)
280                 aros_host_cpu="i386"
281                 ;;
282             *x86_64*)
283                 aros_host_cpu="x86_64"
284                 ;;
285             *m68k*)
286                 aros_host_cpu="m68k"
287                 ;;
288             *powerpc*)
289                 aros_host_cpu="ppc"
290                 ;;
291             *arm*)
292                 aros_host_cpu="arm"
293                 ;;
294             *)
295                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
296                 aros_host_cpu="$host_cpu"
297                 ;;
298         esac
299         ;;
301     freebsd*)
302         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe -I/usr/local/include"
303         aros_host_make="gmake"
304         aros_host_arch="freebsd"
305         aros_host_cpu="i386"
307         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
309         dnl FreeBSD 5.x (and later) has changed the default object format.
310         dnl The double [[]] is necessary to get around m4's quoting rules.
311         case $host_os in
312             freebsd[[234]]*)
313                 aros_object_format="elf_i386"
314                 ;;
316             *)
317                 aros_object_format="elf_i386_fbsd"
318                 ;;
319         esac
321         ;;
323     darwin*)
324         AC_MSG_CHECKING([for macOS SDK files])
325         LOC=$( xcode-select -p )
326         AS_IF([ test $? != 0],[AC_MSG_ERROR([XCode incorrectly configured!
327 please run 'xcode-select --install' before
328 re-running configure])])
329         AC_MSG_RESULT($LOC)
330         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
331         aros_host_arch="darwin"
332         host_cc_elf=no
333         if [[ -z ${SED+x} ]]; then SED="gsed"; fi
334         android_build_os="darwin-x86"
335         android_tool="android"
336         default_android_sdk="/android-sdk-mac_x86"
337         case "$host_cpu" in
338             *i?86*)
339                 aros_host_cpu="i386"
340                 ;;
341             *x86_64*)
342                 aros_host_cpu="x86_64"
343                 ;;
344             *powerpc*)
345                 aros_host_cpu="ppc"
346                 ;;
347             *)
348                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
349                 aros_host_cpu="$host_cpu"
350                 ;;
351         esac
353         aros_host_ldflags="$aros_host_ldflags -liconv"
355         ;;
357     dragonfly*)
358         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
359         aros_host_make="gmake"
360         aros_host_arch="dragonfly"
361         case $host_cpu in
362             *i?86*)
363                 aros_host_cpu="i386"
364                 ;;
365             *amd64*)
366                 aros_host_cpu="x86_64"
367                 ;;
368             *)
369                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
370                 aros_host_cpu="$host_cpu"
371                 ;;
372         esac
373         ;;
375     netbsd*)
376         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
377         aros_host_make="gmake"
378         aros_host_arch="netbsd"
379         case "$host_cpu" in
380             *i?86*)
381                 aros_host_cpu="i386"
382                 ;;
383             *m68k*)
384                 aros_host_cpu="m68k"
385                 ;;
386             *)
387                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
388                 aros_host_cpu="$host_cpu"
389                 ;;
390         esac    
391         aros_host_lib_suffix=".0.0"
392         ;;
394     openbsd*)
395         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
396         aros_host_make="gmake"
397         aros_host_arch="openbsd"
398         case "$host_cpu" in
399             *i?86*)
400                 aros_host_cpu="i386"
401                 ;;
402             *)
403                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
404                 aros_host_cpu="$host_cpu"
405                 ;;
406         esac
407         ;;
408         
409     solaris*)
410         aros_host_arch="solaris"
411         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
412         case "$host_cpu" in
413             *i?86*)
414                 aros_host_cpu="i386"
415                 ;;
416             *sparc*)
417                 aros_host_cpu="sparc"
418                 ;;
419             *)
420                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
421                 aros_host_cpu="$host_cpu"
422                 ;;
423         esac
424         ;;
426     morphos*)
427         aros_host_arch="morphos"
428         aros_host_cpu="ppc"
429         host_cc_elf=no
430         ;;
432     amiga*)
433         aros_host_arch="amiga"
434         host_cc_elf=no
435         SORT="/gg/bin/sort"
436         TEST="/gg/bin/test"
437         UNIQ="/gg/bin/uniq"
438         FOR="for"
439         TOUCH="/gg/bin/touch"
440         case "$host_cpu" in
441             *m68k*)
442                 aros_host_cpu="m68k"
443                 ;;
444             *powerpc*)
445                 aros_host_cpu="ppc"
446                 ;;
447             *)
448                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
449                 aros_host_cpu="$host_cpu"
450                 ;;
451         esac
452         ;;
454     cygwin*)
455         aros_host_arch="cygwin"
456         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
457         host_cc_elf=no
458         android_build_os="windows"
459         android_tool="android.bat"
460         default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
462         case "$host_cpu" in
463             *i?86*)
464                 aros_host_cpu="i386"
465                 ;;
466             *)
467                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
468                 aros_host_cpu="$host_cpu"
469                 ;;
470         esac
471         ;;
473     mingw32*)
474         aros_host_arch="mingw32"
475         aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
476         host_cc_elf=no
477         android_build_os="windows"
478         android_tool="android.bat"
479         default_android_sdk="/c/android-sdk-windows-1.6_r1"
481         libpng_libextra="-lws2_32"
483         case "$host_cpu" in
484         *i?86*)
485             dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
486             dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
487             dnl Here we attempt to detect Windows home platform by asking gcc about its target.
488             dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
490             AC_MSG_CHECKING([for Windows native gcc target])
491             host_cpu=`gcc -dumpmachine`
492             AC_MSG_RESULT($host_cpu)
493             ;;
495         esac
497         case "$host_cpu" in
498         *i?86*)
499             aros_host_cpu="i386"
500             ;;
502         mingw32*)
503             dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
504             aros_host_cpu="i386"
505             ;;
507         *x86_64*)
508             aros_host_cpu="x86_64"
509             dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
510             dnl directory, so we have to add it explicitly here.
511             aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
512             ;;
514         *)
515             AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
516             aros_host_cpu="$host_cpu"
517             ;;
518         esac
519         ;;
520     *)
521         AC_MSG_ERROR([Unsupported host architecture $host])
522         ;;
523 esac
525 base_ar_name=${HOST_TOOLCHAIN_PREFIX}ar${HOST_TOOLCHAIN_SUFFIX}
526 AROS_PROG(AR_BASE,$base_ar_name)
527 aros_host_ar_flags="cr"
528 aros_host_cmd_ar="$AR_BASE $aros_host_ar_flags"
529 AROS_PATH_PROG(aros_host_plain_ar,$aros_host_cmd_ar)
530 aros_host_ar=`echo $aros_host_cmd_ar | sed -e "s|$base_ar_name|$aros_host_plain_ar|g"`
531 AROS_REQUIRED(ar,$aros_host_ar)
532 base_ranlib_name=${HOST_TOOLCHAIN_PREFIX}ranlib${HOST_TOOLCHAIN_SUFFIX}
533 AROS_PROG(RANLIB_BASE,$base_ranlib_name)
534 AROS_PATH_PROG(aros_host_ranlib,$RANLIB_BASE)
535 AROS_REQUIRED(ranlib,$aros_host_ranlib)
536 AROS_PROG(aros_host_strip,strip)
537 AROS_REQUIRED(strip,$aros_host_strip)
539 AROS_PROG(RM,[rm],[-rf])
540 AROS_REQUIRED(rm,$RM)
541 AROS_PROG(CP,[cp])
542 AROS_REQUIRED(cp,$CP)
543 AROS_PROG(MV,[mv])
544 AROS_REQUIRED(mv,$MV)
545 AROS_PROG(ECHO,[echo])
546 AROS_REQUIRED(echo,$ECHO)
547 AROS_PROG(MKDIR,[mkdir],[-p])
548 AROS_REQUIRED(mkdir,$MKDIR)
549 AROS_PROG(TOUCH,[touch])
550 AROS_REQUIRED(touch,$TOUCH)
551 AROS_PROG(SORT,[sort])
552 AROS_REQUIRED(sort,$SORT)
553 AROS_PROG(UNIQ,[uniq])
554 AROS_REQUIRED(uniq,$UNIQ)
555 AROS_PROG(NOP,[true])
556 AROS_REQUIRED(true,$NOP)
557 AROS_PROG(CAT,[cat])
558 AROS_REQUIRED(cat,$CAT)
559 AROS_PROG(BISON,[bison])
560 AROS_REQUIRED(bison,$BISON)
561 AROS_PROG(FLEX,[flex])
562 AROS_REQUIRED(flex,$FLEX)
563 AC_MSG_CHECKING([version of $FLEX])
564 ax_cv_flex_version="`$FLEX --version | cut -d\" \" -f2`"
565 AC_MSG_RESULT($ax_cv_flex_version)
566 AROS_PROG(PNGTOPNM,[pngtopnm])
567 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
568 AROS_PROG(PPMTOILBM,[ppmtoilbm])
569 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
570 AROS_PROG(SED,[sed])
571 AROS_REQUIRED(sed,$SED)
572 AROS_PROG(CHMOD,[chmod])
573 AROS_REQUIRED(chmod,$CHMOD)
574 AROS_PROG(PATCH,[patch])
575 AROS_REQUIRED(patch,$PATCH)
577 AM_PATH_PYTHON(2.5)
579 AC_ARG_ENABLE([libpng-config], [--disable-libpng-config    disable libpng-config test and configuration])
580 if test "$enable_libpng_config" != "no"; then
581   AC_CHECK_PROG([arosconfig_use_libpngconfig],[libpng-config],[yes],[no])
583 if test "$arosconfig_use_libpngconfig" = "yes"; then
584     AC_MSG_CHECKING([libpng-config library])
585     libpng_incdir="`libpng-config --cflags`"
586     libpng_libextra="$libpng_libextra `libpng-config --ldflags`"
587     libpng="`libpng-config --libs`"
588     AC_MSG_RESULT($libpng)
589 else
590     AC_CHECK_LIB(png, png_read_png, [libpng="-lpng"], [libpng="no"])
591     if test "$libpng_libextra" != ""; then
592         if test "$libpng" != "no"; then
593             libpng_libextra="$libpng_libextra $libpng"
594         fi
595     fi
597 AROS_REQUIRED(libpng, $libpng)
598 AC_SUBST(libpng)
599 AC_SUBST(libpng_libextra)
600 AC_SUBST(libpng_incdir)
602 AC_SUBST(FOR, for)
603 AC_SUBST(IF, if)
604 AC_SUBST(TEST, test)
605 AC_SUBST(CMP, cmp)
607 dnl ---------------------------------------------------------------------------
608 dnl Look for things about the host system, good for hosted targets.
609 dnl ---------------------------------------------------------------------------
611 # Check for some includes for the X11 HIDD and the kernel
612 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
613     sys/mmap.h sys/mman.h sysexits.h \
614     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
617 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
618 AC_CHECK_HEADERS([GL/glx.h],[host_feature_glx=yes],[host_feature_glx=no],)
620 AC_MSG_CHECKING([if __unused conflicts with sys/stat.h])
621 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
622      [[
623      #define __unused __attribute__((unused))
624      #include <sys/stat.h>
625      ]])],
626      [host_stat_h__unused_used=no],
627      [host_stat_h__unused_used=yes])
628 AC_MSG_RESULT($host_stat_h__unused_used)
630 AC_HEADER_DIRENT
631 AC_HEADER_STAT
632 AC_HEADER_STDC
633 AC_HEADER_SYS_WAIT
634 AC_HEADER_TIME
635 AC_STRUCT_ST_BLKSIZE
636 AC_STRUCT_ST_BLOCKS
637 AC_STRUCT_ST_RDEV
638 AC_STRUCT_TM
639 AC_STRUCT_TIMEZONE
640 AC_TYPE_OFF_T
641 AC_TYPE_PID_T
642 AC_TYPE_SIZE_T
643 AC_TYPE_UID_T
645 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
647 # Look for some functions
648 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
649     clone kse_create rfork_thread thr_create sa_register \
650     getcontext makecontext setcontext sigaltstack swapcontext])
652 AC_FUNC_MMAP
654 #-----------------------------------------------------------------------------
657 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
658 # it switched on by default, and we use the host compiler, so it compiles AROS
659 # code with this enabled resulting in link failures as we don't have support
660 # for it.
662 # We use two methods to disable it. For the host compiler (used to compile
663 # some hosted modules), we test to see if the compiler supports stack
664 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
665 # work on all platforms.
668 AC_MSG_CHECKING([whether ${CC_BASE} accepts -fno-stack-protector])
669 save_cflags="$CFLAGS"
670 CFLAGS="$CFLAGS -fno-stack-protector"
671 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
672 AC_MSG_RESULT($use_no_stack_protector)
673 if test "x-$use_no_stack_protector" = "x-yes" ; then
674     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
676 CFLAGS="$save_cflags"
678 #-----------------------------------------------------------------------------
680 # Disable pointer-signedness warnings if the compiler recognises the option
681 # (this only works for the host compiler at the moment)
683 AC_MSG_CHECKING([whether ${CC_BASE} accepts -Wno-pointer-sign])
684 save_cflags="$CFLAGS"
685 CFLAGS="$CFLAGS -Wno-pointer-sign"
686 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
687 AC_MSG_RESULT($use_no_sign_warning)
688 if test "x-$use_no_sign_warning" = "x-yes" ; then
689     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
691 CFLAGS="$save_cflags"
693 #-----------------------------------------------------------------------------
695 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
697 AC_MSG_CHECKING([whether ${CC_BASE} accepts -fgnu89-inline])
698 save_cflags="$CFLAGS"
699 CFLAGS="$CFLAGS -fgnu89-inline"
700 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
701 AC_MSG_RESULT($use_gnu89_inline)
702 if test "x-$use_gnu89_inline" = "x-yes" ; then
703     gnu89_inline="-fgnu89-inline"
705 CFLAGS="$save_cflags"
708 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
709 # On GCC >= 4.0 -iquote should be used
711 AC_MSG_CHECKING([whether ${CC_BASE} accepts -iquote])
712 CFLAGS="$CFLAGS -iquote."
713 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
714 AC_MSG_RESULT($has_iquote)
715 if test "x-$has_iquote" = "x-yes" ; then
716     host_cflags_iquote=-iquote
717     host_cflags_iquote_end=
718 else
719     host_cflags_iquote=-I
720     host_cflags_iquote_end=-I-
723 AC_MSG_NOTICE([Performing target configuration...])
725 dnl --------------------------------------------------------------------
726 dnl Target Configuration Section
727 dnl --------------------------------------------------------------------
729 dnl The target configuration section is responsible for setting up all
730 dnl the paths for includes, and tools required to build AROS to some
731 dnl particular target.
733 test_kernel_cc=no
735 aros_nowarn_flags="NOWARN_UNUSED_COMMAND_LINE_ARGUMENT NOWARN_UNKNOWN_WARNING_OPTION NOWARN_POINTER_SIGN NOWARN_PARENTHESES"
736 export_newline="
739 aros_elf_translate=
740 aros_warn_flags=
741 aros_isa_extra=
742 aros_isa_flags=
743 aros_kernel_isaflags=
744 aros_config_cppflags=
745 aros_config_cflags=
746 aros_config_cxxflags=
747 aros_config_aflags="$""(WARN_ALL) -x assembler-with-cpp -c"
748 aros_config_ldflags=""
750 aros_shared_default=yes
752 aros_shared_cflags="-fPIC"
753 aros_shared_aflags=""
754 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
755 aros_kernel_ldflags="-Wl,-rpath,./lib"
757 aros_kernel_ar_flags="cr"
758 aros_target_ar_flags="cr"
759 aros_target_nm_flags="-C -ul"
760 aros_target_strip_flags="--strip-unneeded -R.comment"
762 aros_c_libs=
763 aros_cxx_libs=
765 aros_target_genmap="-Wl,-Map -Xlinker"
767 # Native flavour stuff
768 aros_serial_debug="0"
770 # Palm native flavour stuff
771 aros_palm_debug_hack="0"
773 # Unix flavour stuff
774 aros_nesting_supervisor="0"
776 # Collect-aros stuff: "-ius" to ignore undefined symbols
777 ignore_undefined_symbols=""
779 # Check for X11 by default
780 need_x11="auto"
782 AC_MSG_CHECKING([Which toolchain family to use ...])
783 AC_ARG_WITH(toolchain,AC_HELP_STRING([--with-toolchain=family],[Which toolchain family to crosscompile with (defaults to gnu)]),aros_toolchain="$withval",aros_toolchain="$default_toolchain_family")
784 AC_MSG_RESULT($aros_toolchain)
787 AC_MSG_CHECKING([if we should enable link time optimizations (LTO)])
788 AC_ARG_ENABLE(lto,AC_HELP_STRING([--enable-lto=[yes|no]],[Enable link time optimizations if the target compiler supports them (default=no)]),
789  aros_config_lto="$enableval",aros_config_lto="no")
790 if test "$aros_config_lto" != "no"; then
791     aros_config_lto="yes"
793 AC_MSG_RESULT($aros_config_lto)
795 AC_MSG_CHECKING([if we should enable coverage instrumentation])
796 AC_ARG_ENABLE(coverage,AC_HELP_STRING([--enable-coverage=[yes|no]],[Enable coverage instrumentation if the target compiler supports it (default=no)]),
797  aros_config_coverage="$enableval",aros_config_coverage="no")
798 if test "$aros_config_coverage" != "no"; then
799     aros_config_coverage="yes"
801 AC_MSG_RESULT($aros_config_coverage)
803 use_ld_wrapper=yes
805 case "$aros_toolchain" in
806     *llvm*)
807         toolchain_c_compiler="clang"
808         toolchain_cxx_compiler="clang++"
809         toolchain_cpp_preprocessor="clang"
810         toolchain_cpp_opts=" -E"
811         toolchain_ld="ld.lld"
812         aros_ld="ld"
813         toolchain_as="llvm-as"
814         toolchain_ar="llvm-ar"
815         toolchain_ranlib="llvm-ranlib"
816         toolchain_nm="llvm-nm"
817         toolchain_strip="true"
818         toolchain_objcopy="llvm-objcopy"
819         toolchain_objdump="llvm-objdump"
820         use_libatomic=yes
821         toolchain_def_opt_lvl="-O2"
822         toolchain_debug_opt_lvl="-O0"
823         toolchain_size_opt_lvl="-Os"
824         ;;
825     *gnu*)
826         toolchain_c_compiler="gcc"
827         toolchain_cxx_compiler="g++"
828         toolchain_cpp_preprocessor="gcc"
829         toolchain_cpp_opts=" -E"
830         toolchain_as="as"
831         aros_ld="ld"
832         if test "$aros_config_lto" != "yes"; then
833             toolchain_ld="ld"
834             toolchain_ar="ar"
835             toolchain_ranlib="ranlib"
836             toolchain_nm="nm"
837         else
838             toolchain_ld="ld.bfd"
839             toolchain_ar="gcc-ar"
840             toolchain_ranlib="gcc-ranlib"
841             toolchain_nm="gcc-nm"
842         fi
843         toolchain_strip="strip"
844         toolchain_objcopy="objcopy"
845         toolchain_objdump="objdump"
846         use_libatomic=yes
847         toolchain_def_opt_lvl="-O2"
848         toolchain_debug_opt_lvl="-O0"
849         toolchain_size_opt_lvl="-Os"
850         ;;
851     *)
852         AC_MSG_WARN("Unknown toolchain family!")
853         toolchain_c_compiler="cc"
854         toolchain_cxx_compiler="c++"
855         toolchain_cpp_preprocessor="cpp"
856         toolchain_cpp_opts=
857         toolchain_ld="ld"
858         aros_ld="ld"
859         toolchain_as="as"
860         toolchain_ar="ar"
861         toolchain_ranlib="ranlib"
862         toolchain_nm="nm"
863         toolchain_strip="strip"
864         toolchain_objcopy="objcopy"
865         toolchain_objdump="objdump"
866         ;;
867 esac
869 #-----------------------------------------------------------------------------
871 AC_MSG_CHECKING([which type of build to do])
872 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")
874 if test "$build_type" = "nightly"; then
875     build_type_string="NIGHTLY"
876 elif test "$build_type" = "snapshot"; then
877     build_type_string="SNAPSHOT"
878 elif test "$build_type" = "milestone"; then
879     build_type_string="MILESTONE"
880 elif test "$build_type" = "release"; then
881     build_type_string="RELEASE"
882 else
883     build_type_string="PERSONAL"
884     build_type="personal"
887 aros_config_cppflags="$aros_config_cppflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
889 AC_MSG_RESULT($build_type)
891 #-----------------------------------------------------------------------------
892 all_debug_types="messages stack modules mungwall symbols"
894 AC_MSG_CHECKING([which debug types to enable])
895 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)]),
896  debug="$enableval",debug="")
898 if test "$debug" = "" -o "$debug" = "no"; then
899     debug="none"
900 elif test "$debug" = "yes"; then
901     debug="all"
904 if test "$debug" = "all" ; then
905     debug="messages stack modules symbols"
906     for d in $all_debug_types; do
907         export aros_${d}_debug="1"
908     done
909 else
910     for d in $all_debug_types; do
911         export aros_${d}_debug="0"
912     done
915 if test "$debug" != "none"; then
916     debug=`echo $debug | sed s/,/\ /g`
917     for d in $debug; do
918         found="0"
919         for d2 in $all_debug_types; do
920             if test "$d2" = "$d"; then
921                 found="1"
922                 break
923             fi
924         done
925         if test "$found" = "0"; then
926             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
927         fi
928         export aros_${d}_debug="1"
929     done
930     aros_debug="yes"
932 AC_MSG_RESULT($debug)
934 if test "$aros_messages_debug" = "1"; then
935     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
936 else
937     aros_messages_debug=""
939 if test "$aros_symbols_debug" = "1"; then
940     aros_symbols_debug="-g"
941 else
942     aros_symbols_debug=""
945 # These are the flags to pass when compiling debugged programs
946 aros_debug_cppflags="$aros_messages_debug"
947 aros_debug_cflags="$aros_symbols_debug"
948 aros_debug_cxxflags=
949 aros_debug_aflags=""
950 aros_debug_ldflags="$aros_symbols_debug"
952 #-----------------------------------------------------------------------------
953 #   Checking for distcc and ccache.
955 #   Always apply the transforms in this particular order. Basically you should
956 #   always run 'ccache distcc compiler' in that order for the best performance.
958 AC_MSG_CHECKING([whether to enable distcc])
959 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
960 if test "$distcc" != "" -a "$distcc" != "no"; then
961     # AC_CHECK_PROG will print out the result in this case
962     AC_PATH_PROG(DISTCC,[distcc],distcc,)
963 else
964     AC_MSG_RESULT(no)
967 AC_MSG_CHECKING([whether to enable ccache])
968 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
969 if test "$ccache" != "" -a "$ccache" != "no"; then
970     # AC_CHECK_PROG will print out the result in this case
971     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
972 else
973     AC_MSG_RESULT(no)
976 #-----------------------------------------------------------------------------
977 AC_MSG_CHECKING([what specific host gcc version to use])
978 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="")
979 if test "$kernel_tool_version" != "" ; then
980     msg_result=$kernel_tool_version
981 else
982     msg_result="default"
984 AC_MSG_RESULT($msg_result)
986 #-----------------------------------------------------------------------------
987 AC_MSG_CHECKING([what optimization flags to use])
988 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")
989 if test "$optimization_level" = "unknown"; then
990     dnl use the toolchain defaults for normal and debug builds
991     optimization="default"
992     if test "$debug" != "none"; then
993         optimization_level=$toolchain_debug_opt_lvl
994     else
995         optimization_level=$toolchain_def_opt_lvl
996     fi
997 else
998     optimization="$optimization_level"
1000 AC_MSG_RESULT($optimization)
1002 paranoia_default=yes
1003 #-----------------------------------------------------------------------------
1004 AC_MSG_CHECKING([which paranoia flags to use])
1005 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"])
1006 if test "$paranoia_flags" = "no"; then
1007         paranoia_flags="$""(WARN_ALL) -Werror-implicit-function-declaration"
1008         msg_result="none"
1009 else
1010     if test "$paranoia_flags" = "yes"; then
1011         paranoia_flags="$""(WARN_ALL) $""(WARN_ERROR)"
1012     fi
1013     msg_result="$paranoia_flags"
1015 AC_MSG_RESULT($msg_result)
1016 aros_warn_flags="$aros_warn_flags $paranoia_flags"
1018 #-----------------------------------------------------------------------------
1019 AC_MSG_CHECKING([what target variant to enable])
1020 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant (default=none)]),target_variant=$enableval,target_variant="")
1021 if test "$target_variant" = ""; then
1022     aros_target_variant=""
1023     aros_target_suffix=""
1024     enableval="none"
1025 else
1026     aros_target_variant="$target_variant"
1027     aros_target_suffix="-$target_variant"
1029 AC_MSG_RESULT($enableval)
1031 #-----------------------------------------------------------------------------
1032 # Target-specific defaults. You can override then on a per-target basis.
1034 # Bootloader name. Currently used by PC target.
1035 target_bootloader="none"
1036 PLATFORM_EXECSMP=
1037 ENABLE_EXECSMP=
1039 #-----------------------------------------------------------------------------
1040 # Additional options for some specific targets
1042 case "$aros_target_variant" in
1043 ios)
1044     AC_MSG_CHECKING([XCode path])
1045     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")
1046     AC_MSG_RESULT($aros_xcode_path)
1048     AC_MSG_CHECKING([what iOS SDK version to use])
1049     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")
1050     AC_MSG_RESULT($aros_sdk_version)
1052     ;;
1054 "android")
1055     AC_MSG_CHECKING([Android SDK path])
1056     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)
1057     AC_MSG_RESULT($aros_android_sdk)
1059     AC_MSG_CHECKING([Android NDK path])
1060     AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
1061     AC_MSG_RESULT($aros_android_ndk)
1063     AC_MSG_CHECKING([what Android SDK version to use])
1064     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")
1065     AC_MSG_RESULT($aros_sdk_version)
1067     aros_android_level=android-$aros_sdk_version
1068     if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
1069         echo "Platform $aros_android_level is not installed in your SDK"
1070         echo "Use --with-sdk-version=<API level number> to select another platform version"
1071         echo "You can check what plaform versions are installed in your SDK"
1072         echo "by examining contents of $aros_android_sdk/platforms directory"
1073         AC_MSG_ERROR([Android platform $aros_android_level is not installed])
1074     fi
1076     export PATH="$aros_android_sdk/tools:$PATH"
1077     AC_PATH_PROG(android_tool, $android_tool)
1078     AROS_REQUIRED(android,$android_tool)
1080     if test "$aros_android_ndk" != "none"; then
1081         AC_MSG_CHECKING([what Android NDK version to use])
1082         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")
1083         AC_MSG_RESULT($aros_ndk_version)
1084     fi
1086     AC_PATH_PROG(ant, ant)
1087     if test "$ant" = ""; then
1088         AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
1089     fi
1091     AC_MSG_CHECKING([Build debug or release apk])
1092     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)
1093     if test $aros_android_antapk != release -a $aros_android_antapk != debug; then
1094         AC_MSG_ERROR([apk-version has to be release or debug])
1095     fi
1096     AC_MSG_RESULT($aros_android_antapk)
1098     target_extra_cfg+="$export_newline""# Android$export_newline""AROS_ANDROID_ANTAPK           := $aros_android_antapk$export_newline"
1099     host_extra_cfg+="$export_newline""# Android-specific$export_newline""ANDROID                       := $android_tool$export_newline""ANT                                   := $ant$export_newline"
1100     aros_target_options+="$export_newline""# Enable Android Gfx Driver$export_newline""OPT_HOST_ANDROIDGFX           := yes$export_newline"
1102     dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
1103     if test "$host_os" = "mingw32"; then
1104         android_tool="cmd //c $android_tool"
1105     fi
1107     need_dlopen="no"
1109     ;;
1110 esac
1112 #-----------------------------------------------------------------------------
1113 # External toolchains
1114 kernel_tool_prefix="none"
1115 aros_tool_prefix="none"
1116 elf_tool_prefix="${target_cpu}-elf-"
1118 # Base target cpu ISA configuration switch.
1119 case "$target_cpu" in
1120     *aarch64*)
1121         ;;
1122     *arm*)
1123         ;;
1124     *m68k*)
1125         m68k_isa_extra="ISA_MC68000_FLAGS             = -march=68000"
1126         m68k_020_isa_extra="ISA_MC68020_FLAGS             = -march=68020"
1127         m68k_030_isa_extra="ISA_MC68030_FLAGS             = -march=68030"
1128         m68k_040_isa_extra="ISA_MC68040_FLAGS             = -march=68040"
1129         m68k_060_isa_extra="ISA_MC68060_FLAGS             = -march=68060"
1130         m68k_ac080_isa_extra="ISA_AC68080_FLAGS             = -march=68040"
1131         m68k_020_ext="ISA_MC68020_EXT               :=020"
1132         m68k_030_ext="ISA_MC68030_EXT               :=030"
1133         m68k_040_ext="ISA_MC68040_EXT               :=040"
1134         m68k_060_ext="ISA_MC68060_EXT               :=060"
1135         m68k_020_cflags="ISA_MC68020_CFLAGS            ="
1136         m68k_030_cflags="ISA_MC68030_CFLAGS            ="
1137         m68k_040_cflags="ISA_MC68040_CFLAGS            ="
1138         m68k_060_cflags="ISA_MC68060_CFLAGS            ="
1139         m68k_020_cppflags="ISA_MC68020_CPPFLAGS          ="
1140         m68k_030_cppflags="ISA_MC68030_CPPFLAGS          ="
1141         m68k_040_cppflags="ISA_MC68040_CPPFLAGS          ="
1142         m68k_060_cppflags="ISA_MC68060_CPPFLAGS          ="
1143         m68k_020_ldflags="ISA_MC68020_LDFLAGS           ="
1144         m68k_030_ldflags="ISA_MC68030_LDFLAGS           ="
1145         m68k_040_ldflags="ISA_MC68040_LDFLAGS           ="
1146         m68k_060_ldflags="ISA_MC68060_LDFLAGS           ="
1147         ;;
1148     *x86_64* | *i?86*)
1149         x86_isa_extra="ISA_X86_FLAGS                 = -m32 -march=i486"
1150         x86_64_isa_extra="ISA_X8664_FLAGS               = -mcmodel=large"
1151         ;;
1152     *powerpc*)
1153         ;;
1154 esac
1156 # This is the target configuration switch.
1157 case "$target_os" in
1158     linux*)
1159         HOST_WANTS_X11=yes
1160         HOST_WANTS_GLX=yes
1161         HOST_WANTS_SDL=yes
1162         HOST_WANTS_DBUS=yes
1163         HOST_WANTS_DLOPEN=yes
1164         aros_target_arch="linux"
1165         aros_target_family="unix"
1166         case "$target_cpu" in
1167             *m68k*)
1168                 aros_target_cpu="m68k"
1169                 aros_object_format="m68kelf"
1170                 aros_flavour="emulcompat"
1171                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
1172                 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1173                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
1174                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
1175                 gcc_target_cpu="mc68000"
1176                 ;;
1177             *i?86*)
1178                 aros_target_cpu="i386"
1179                 aros_object_format="elf_i386"
1180                 aros_flavour="emulation"
1181                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
1182                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1183                 x86_64_isa_extra="$x86_64_isa_extra $""(CFLAGS_NO_RED_ZONE)"
1184                 aros_kernel_ldflags="-Wl,-melf_i386"
1185                 aros_nominal_depth=8
1186                 gcc_target_cpu="i386"
1187                 pci_hidd_target="hidd-pci-linux"
1188                 android_tool_dir_prefix="x86"
1189                 android_tool_prefix="i686-android-linux"
1190                 android_ndk_arch="x86"
1191                 ;;
1192             *x86_64*)
1193                 aros_target_cpu="x86_64"
1194                 aros_object_format="elf_x86_64"
1195                 aros_flavour="emulation"
1196                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
1197                 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1198                 x86_64_isa_extra="$x86_64_isa_extra $""(CFLAGS_NO_RED_ZONE)"
1199                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_OMIT_FP)"
1200                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_OMIT_FP)"
1201                 aros_nominal_depth=8
1202                 pci_hidd_target="hidd-pci-linux"
1203                 ;;
1204             *powerpc*)
1205                 aros_target_cpu="ppc"
1206                 aros_object_format="elf32ppc"
1207                 aros_flavour="emulation"
1208                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1209                 aros_nominal_depth=8
1210                 gcc_target_cpu="ppc"
1211                 ;;
1212 # TODO
1213 # Same as powerpc, but I need this for the nightly build to work again.
1214 # Actually, the nightly should be made working with powerpc target.
1215 # That just was too much work for the moment, another week or two.
1216             *ppc*)
1217                 aros_target_cpu="ppc"
1218                 aros_object_format="elf32ppc"
1219                 aros_flavour="emulation"
1220                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1221                 aros_nominal_depth=8
1222                 gcc_target_cpu="ppc"
1223                 ;;
1224             *aarch64*)
1225                 aros_target_cpu="aarch64"
1226                 target_cpu="aarch64"
1227                 aros_object_format="aarch64elf_aros"
1228                 aros_flavour="emulation"
1229                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1230                 gcc_target_cpu="aarch64"
1231                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1232                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1233                 aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_STRICT_ALIASING)"
1234                 aros_c_libs="$aros_c_libs -laeabi"
1235                 gcc_default_float_abi="hard"
1236                 kernel_tool_prefix="aarch64-linux-gnueabihf-"
1237                 ;;
1238             *armhf*)
1239                 aros_target_cpu="arm"
1240                 target_cpu="arm"
1241                 aros_object_format="armelf_aros"
1242                 aros_flavour="emulation"
1243                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1244                 gcc_target_cpu="arm"
1245                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1246                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1247                 aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_STRICT_ALIASING)"
1248                 aros_c_libs="$aros_c_libs -laeabi"
1249                 gcc_default_float_abi="hard"
1250                 android_tool_dir_prefix="arm-linux-androideabi"
1251                 android_tool_prefix="arm-linux-androideabi"
1252                 android_ndk_arch="arm"
1253                 kernel_tool_prefix="arm-linux-gnueabihf-"
1254                 ;;
1255             *arm*)
1256                 aros_target_cpu="arm"
1257                 aros_object_format="armelf_aros"
1258                 aros_flavour="emulation"
1259                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1260                 gcc_target_cpu="arm"
1261                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1262                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_OMIT_FP)"
1263                 aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_STRICT_ALIASING)"
1264                 aros_c_libs="$aros_c_libs -laeabi"
1265                 android_tool_dir_prefix="arm-linux-androideabi"
1266                 android_tool_prefix="arm-linux-androideabi"
1267                 android_ndk_arch="arm"
1268                 kernel_tool_prefix="arm-linux-gnueabi-"
1269                 ;;
1270             *)
1271                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
1272                 ;;
1273         esac
1274         case "$aros_target_variant" in
1275             android)
1277                 dnl Not all Linux CPUs are supported by Android
1278                 if test "$android_ndk_arch" = ""; then
1279                     AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
1280                 fi
1282                 aros_nominal_width=320
1283                 aros_nominal_height=480
1284                 if test "$aros_android_ndk" = "none"; then
1285                     dnl Use standalone toolchain, don't adjust paths
1286                     aros_kernel_cflags="-mandroid"
1287                     aros_kernel_ldflags="-mandroid"
1288                     CFLAGS="-mandroid"
1289                 else
1290                     dnl In Android NDK toolchains are placed in own directories,
1291                     dnl but tool names are not suffixed with version 
1292                     export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$kernel_tool_version/prebuilt/$android_build_os/bin:$PATH"
1293                     kernel_tool_version=""
1294                     aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
1295                     aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
1296                     aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
1297                     CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
1298                     aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
1299                 fi
1300                 need_x11=no
1301                 # Disable implicit PIC mode
1302                 aros_config_cflags="$aros_config_cflags -fno-pic"
1303                 kernel_tool_prefix="$android_tool_prefix-"
1304             ;;
1305         esac
1306     ;;
1308     pc)
1309         aros_target_arch="pc"
1310         aros_shared_default="no"
1311         target_bootloader="grub2"
1312         case "$target_cpu" in
1313             *i?86*)
1314                 aros_target_cpu="i386"
1316                 dnl If somebody hasn't already set the target object
1317                 dnl format, then use this value. Mostly to support
1318                 dnl FreeBSD cross-compilation.
1319                 dnl TODO: Remove when we always use our compiler.
1321                 if test "$aros_object_format" = "" ; then
1322                     aros_object_format="elf_i386"
1323                 fi
1324                 aros_flavour="standalone"
1325                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1326                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1327                 x86_64_isa_extra="$x86_64_isa_extra $""(CFLAGS_NO_RED_ZONE)"
1328                 aros_kernel_ldflags="-Wl,-melf_i386"
1329                 aros_nominal_width=640
1330                 aros_nominal_height=480
1331                 gcc_target_cpu="i386"
1332                 ;;
1333             *x86_64*)
1334                 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1335                 aros_target_cpu="x86_64"
1336                 aros_serial_debug=1
1337                 if test "$aros_object_format" = "" ; then
1338                     aros_object_format="elf_x86_64"
1339                 fi
1340                 aros_flavour="standalone"
1341                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1342                 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1343                 x86_64_isa_extra="$x86_64_isa_extra $""(CFLAGS_NO_RED_ZONE)"
1344                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_OMIT_FP)"
1345                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_OMIT_FP)"
1346                 aros_kernel_ldflags=""
1347                 aros_nominal_width=640
1348                 aros_nominal_height=480
1349                 case "$aros_target_variant" in
1350                     smp)
1351                         ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1352                     ;;
1353                 esac
1354                 ;;
1355             *)
1356                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1357                 ;;
1358         esac
1359         ;;
1361     prep)
1362         aros_target_arch="prep"
1363         aros_shared_default="no"
1364         aros_target_cpu="ppc"
1365         aros_object_format="elf32ppc"
1366         aros_flavour="ppcnative"
1367         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1368         aros_kernel_ldflags=""
1369         aros_nominal_width=640
1370         aros_nominal_height=480
1371         gcc_target_cpu="ppc"
1372         ;;
1374     freebsd*)
1375         HOST_WANTS_X11=yes
1376         HOST_WANTS_GLX=yes
1377         HOST_WANTS_SDL=yes
1378         HOST_WANTS_DBUS=yes
1379         HOST_WANTS_DLOPEN=yes
1380         aros_target_arch="freebsd"
1381         aros_target_family="unix"
1382         aros_target_cpu="i386"
1383         aros_flavour="emulation"
1384         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1385         gcc_target_cpu="i386"
1387         aros_target_strip_flags="-x"
1388         ;;
1390     darwin*)
1391         HOST_WANTS_X11=yes
1392         HOST_WANTS_GLX=yes
1393         HOST_WANTS_SDL=yes
1394         HOST_WANTS_DBUS=yes
1395         HOST_WANTS_DLOPEN=yes
1396         aros_target_arch="darwin"
1397         aros_target_family="unix"
1398         aros_flavour="emulation"
1399         case "$target_cpu" in
1400             *i?86*)
1401                 aros_ios_platform="iPhoneSimulator"
1402                 aros_target_cpu="i386"
1403                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1404                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1405                 aros_kernel_ldflags=""
1406                 aros_macosx_version="10.4"
1407                 aros_nominal_depth=8
1408                 gcc_target_cpu="i386"
1409                 aros_object_format="elf_i386"
1410                 aros_kernel_ar_flags="-cr"
1411                 aros_target_strip_flags="-x"
1412                 kernel_tool_flags="-m32"
1413                 ;;
1414             *x86_64*)
1415                 aros_target_cpu="x86_64"
1416                 aros_object_format="elf_x86_64"
1417                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1418                 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1419                 aros_macosx_version="10.6"
1420                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_OMIT_FP)"
1421                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_OMIT_FP)"
1422                 aros_kernel_cflags="-m64"
1423                 aros_kernel_ldflags="-m64"
1424                 aros_nominal_depth=8
1425                 aros_kernel_rs="$toolchain_ar"
1426                 aros_kernel_ar_flags="-cr"
1427                 aros_kernel_ld="$toolchain_ld"
1428                 aros_kernel_as="$toolchain_as"
1429                 aros_kernel_ranlib="$toolchain_ranlib"
1430                 aros_kernel_nm="$toolchain_nm"
1431                 aros_kernel_strip="strip"
1432                 kernel_tool_prefix="i686-apple-darwin10-"
1433                 ;;
1434             *ppc*)
1435                 aros_target_cpu="ppc"
1436                 aros_object_format="elf32ppc"
1437                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1438                 aros_kernel_ldflags=""
1439                 aros_macosx_version="10.0"
1440                 aros_nominal_depth=8
1441                 gcc_target_cpu="ppc"
1442                 aros_kernel_rs="$toolchain_ar"
1443                 aros_kernel_ar_flags="-cr"
1444                 aros_kernel_ld="$toolchain_ld -arch ppc"
1445                 aros_kernel_as="$toolchain_as -arch ppc"
1446                 aros_kernel_ranlib="$toolchain_ranlib -arch ppc"
1447                 aros_kernel_nm="$toolchain_nm -arch ppc"
1448                 aros_kernel_strip="strip -arch ppc"
1449                 kernel_tool_prefix="powerpc-apple-darwin10-"
1450                 ;;
1451             *arm*)
1452                 aros_ios_platform="iPhoneOS"
1453                 aros_target_cpu="arm"
1454                 aros_object_format="armelf_aros"
1455                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1456                 aros_c_libs="$aros_c_libs -laeabi"
1457                 aros_nominal_depth=8
1458                 gcc_target_cpu="arm"
1459                 aros_kernel_rs="$toolchain_ar"
1460                 aros_kernel_ar_flags="-cr"
1461                 aros_kernel_ld="$toolchain_ld -arch arm"
1462                 aros_kernel_ranlib="$toolchain_ranlib -arch arm"
1463                 kernel_tool_prefix="arm-apple-darwin10-" 
1464                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1465                 ;;
1466             *)
1467                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1468                 ;;
1469         esac
1470         case "$aros_target_variant" in
1471             ios)
1472                 make_extra_targetcfg="$export_newline""# Apple iOS stuff for gcc$export_newline""IOS_LDFLAGS  := -F$""(IOS_SDK_PATH)/System/Library/Frameworks$export_newline"
1473                 aros_ios_version="3.0"
1474                 aros_nominal_width=320
1475                 aros_nominal_height=480
1476                 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1477                 target_extra_cfg+="$export_newline""# Apple iOS specific$export_newline""IOS_PLATFORM            := $aros_ios_platform$export_newline""IOS_OS_VERSION          := $aros_ios_version$export_newline""IOS_SDK_PATH            := $aros_ios_sdk$export_newline"
1478                 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1479                 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1480                 need_x11=no
1481                 # This is here because it may depend on iOS or SDK version
1482                 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1483                 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1484                 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1485             ;;
1486             *)
1487                 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1488                 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1489             ;;
1490         esac
1491         ;;
1493     dragonfly*)
1494         HOST_WANTS_X11=yes
1495         HOST_WANTS_GLX=yes
1496         HOST_WANTS_SDL=yes
1497         HOST_WANTS_DBUS=yes
1498         HOST_WANTS_DLOPEN=yes
1499         aros_target_arch="dragonfly"
1500         aros_target_family="unix"
1501         aros_flavour="emulation"
1502         case "$target_cpu" in
1503             *i?86*)
1504                 aros_target_cpu="i386"
1505                 aros_object_format="elf_i386"
1506                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1507                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1508                 ;;
1509             *x86_64*)
1510                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_OMIT_FP)"
1511                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_OMIT_FP)"
1512                 aros_target_cpu="x86_64"
1513                 aros_object_format="elf_x86_64"
1514                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1515                 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1516                 ;;
1517             *)
1518                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1519                 ;;
1520         esac
1521         ;;
1523     netbsd*)
1524         HOST_WANTS_X11=yes
1525         HOST_WANTS_GLX=yes
1526         HOST_WANTS_SDL=yes
1527         HOST_WANTS_DBUS=yes
1528         HOST_WANTS_DLOPEN=yes
1529         aros_target_arch="netbsd"
1530         aros_target_family="unix"
1531         case "$target_cpu" in
1532             *m68k*)
1533                 aros_target_cpu="m68k"
1534                 aros_object_format="m68kelf"
1535                 aros_flavour="emulcompat"
1536                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1537                 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1538                 gcc_target_cpu="mc68000"
1539                 ;;
1540             *i?86*)
1541                 aros_target_cpu="i386"
1542                 aros_object_format="elf_i386"
1543                 aros_flavour="emulation"
1544                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1545                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1546                 aros_nominal_depth=8
1547                 gcc_target_cpu="i386"
1548                 ;;
1549             *)
1550                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1551                 ;;
1552         esac
1553         aros_target_genmap="-Wl,-M -Xlinker >"
1554         aros_flavour="emulation"
1555         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1556         ;;   
1558     openbsd*)
1559         HOST_WANTS_X11=yes
1560         HOST_WANTS_GLX=yes
1561         HOST_WANTS_SDL=yes
1562         HOST_WANTS_DBUS=yes
1563         HOST_WANTS_DLOPEN=yes
1564         aros_target_arch="openbsd"
1565         aros_target_family="unix"
1566         case "$target_cpu" in
1567             *i?86*)
1568                 aros_target_cpu="i386"
1569                 aros_object_format="elf_i386"
1570                 aros_flavour="emulation"
1571                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1572                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1573                 gcc_target_cpu="i386"
1574                 ;;
1575             *)
1576                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1577                 ;;
1578         esac
1579         aros_target_genmap="-Wl,-M -Xlinker >"
1580         aros_target_nm_flags="-u"
1581         aros_flavour="emulation"
1582         ;;
1584     solaris*)
1585         aros_target_arch="solaris"
1586         aros_target_family="unix"
1587         case "$target_cpu" in
1588            *i?86*)
1589                aros_target_cpu="i386"
1590                aros_object_format="elf_i386"
1591                aros_flavour="emulation"
1592                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1593                aros_isa_flags="$""(ISA_X86_FLAGS)"
1594                aros_nominal_depth=8
1595                gcc_target_cpu="i386"
1596                ;;
1597             *sparc*)
1598                 aros_target_cpu="sparc"
1599                 aros_object_format="elf_sparc"
1600                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1601                 gcc_target_cpu="sparc"
1602                 ;;
1603             *)
1604                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1605                 ;;
1606         esac
1607         aros_config_cppflags="$aros_config_cppflags -D$aros_target_cpu"
1608         aros_flavour="emulation"
1609         ;;
1611     morphos*)
1612         aros_target_arch="morphos"
1613         aros_shared_default="no"
1614         aros_target_cpu="ppc"
1615         aros_object_format="elf_ppc"
1616         aros_flavour="nativecompat"
1617         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1618         gcc_target_cpu="ppc"
1619         ;;
1621     sam440)
1622         aros_target_arch="sam440"
1623         aros_shared_default="no"
1624         aros_target_cpu="ppc"
1625         aros_object_format="elf32ppc"
1626         aros_flavour="ppcnative"
1627         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1628         aros_kernel_ldflags=""
1629         aros_nominal_width=1024
1630         aros_nominal_height=768
1631         aros_nominal_depth=24
1632         aros_isa_flags="$aros_isa_flags -mcpu=440fp -mno-toc"
1633         aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1634         aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1635         gcc_target_cpu="powerpc"
1636         ;;
1638     efika)
1639         aros_target_arch="efika"
1640         aros_shared_default="no"
1641         aros_target_cpu="arm"
1642         aros_object_format="armelf_aros"
1643         aros_flavour="standalone"
1644         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1645         aros_kernel_ldflags=""
1646         aros_nominal_width=1024
1647         aros_nominal_height=600
1648         aros_c_libs="$aros_c_libs -laeabi"
1649         gcc_default_cpu="armv7-a"
1650         gcc_default_fpu="vfpv3"
1651         aros_isa_flags="$aros_isa_flags -mtune=cortex-a8"
1652         aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1653         aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1654         aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1655         if test "$optimization" = "default"; then
1656             optimization_level=$toolchain_size_opt_lvl
1657         fi
1658         case "$target_cpu" in
1659             *armhf*)
1660                 gcc_default_float_abi="hard"
1661                 target_cpu=arm
1662                 aros_target_cpu=arm
1663                 ;;
1664             *arm*)
1665                 gcc_default_float_abi="softfp"
1666                 ;;
1667             *)
1668                 AC_MSG_ERROR("Unknown CPU for EfikaMX $target_cpu")
1669                 ;;
1670         esac
1671         ;;
1672         
1673     chrp)
1674         aros_target_arch="chrp"
1675         aros_shared_default="no"
1676         aros_target_cpu="ppc"
1677         aros_object_format="elf32ppc"
1678         aros_flavour="ppcnative"
1679         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1680         aros_kernel_ldflags=""
1681         aros_nominal_width=640
1682         aros_nominal_height=480
1683         aros_isa_flags="$aros_isa_flags -mno-toc"
1684         aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1685         aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES)"
1686         gcc_target_cpu="powerpc"
1687         case "$aros_target_variant" in
1688             efika)
1689                 aros_isa_flags="$aros_isa_flags -mcpu=603e"
1690                 aros_config_cppflags="$aros_config_cppflags -DBIG_ENDIAN_OHCI=1"
1691             ;;
1692         esac
1693         ;;
1695     r*pi)
1696         PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1697         aros_flavour="standalone"
1698         aros_target_arch="raspi"
1700         aros_shared_default="no"
1702         aros_target_mkdep="$aros_target_mkdep -D__GNUC__"
1703         
1704         case "$target_cpu" in
1705             *aarch64*)
1706                 aros_target_cpu="aarch64"
1707                 gcc_default_cpu="aarch64"
1708                 aros_object_format="aarch64elf_aros"
1709                 ;;
1710             *armhf*)
1711                 aros_target_cpu="arm"
1712                 gcc_default_cpu="armv6zk"
1713                 gcc_default_cpu_tune="arm1176jzf-s"
1714                 aros_object_format="armelf_aros"
1715                 aros_isa_flags="$aros_isa_flags -marm"
1716                 aros_config_cflags="$aros_config_cflags"
1717                 aros_config_cxxflags="$aros_config_cxxflags"
1718                 aros_config_aflags="$aros_config_aflags -marm"
1719                 aros_kernel_cflags="$aros_kernel_cflags -marm"
1720                 aros_target_mkdep="$aros_target_mkdep -Darm"
1721                 aros_c_libs="$aros_c_libs -laeabi"
1722                 ;;
1723             *armeb*)
1724                 aros_flavour="standcompat"
1725                 aros_target_cpu="armeb"
1726                 gcc_default_float_abi="hard"
1727                 gcc_default_cpu="armv7ve"
1728                 gcc_default_cpu_tune="cortex-a7"
1729                 aros_object_format="armelfb_aros"
1730                 aros_isa_flags="$aros_isa_flags -marm"
1731                 aros_config_cflags="$aros_config_cflags"
1732                 aros_config_cxxflags="$aros_config_cxxflags"
1733                 aros_config_aflags="$aros_config_aflags -marm"
1734                 aros_kernel_cflags="$aros_kernel_cflags -marm"
1735                 aros_target_mkdep="$aros_target_mkdep -Darm"
1736                 aros_c_libs="$aros_c_libs -laeabi"
1737                 ;;
1738             *arm*)
1739                 aros_target_cpu="arm"
1740                 gcc_default_cpu="armv6zk"
1741                 gcc_default_cpu_tune="arm1176jzf-s"
1742                 aros_object_format="armelf_aros"
1743                 aros_isa_flags="$aros_isa_flags -marm"
1744                 aros_config_cflags="$aros_config_cflags"
1745                 aros_config_cxxflags="$aros_config_cxxflags"
1746                 aros_config_aflags="$aros_config_aflags -marm"
1747                 aros_kernel_cflags="$aros_kernel_cflags -marm"
1748                 aros_target_mkdep="$aros_target_mkdep -Darm"
1749                 aros_c_libs="$aros_c_libs -laeabi"
1750                 ;;
1751             *)
1752                 AC_MSG_ERROR("Unknown CPU for RasPi $target_cpu")
1753                 ;;
1754         esac
1756         aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
1757         aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
1758         aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
1759         aros_kernel_cflags="$aros_kernel_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
1761         case "$aros_target_variant" in
1762             smp)
1763                 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1764             ;;
1765         esac
1766         ;;
1768     stm32f7_discovery)
1769         aros_flavour="standalone"
1770         aros_target_arch="stm32f7_discovery"
1771         aros_target_cpu="arm"
1772         aros_target_cpu_mode="thumb2"
1773         aros_object_format="armelf_aros"
1774         aros_shared_default="no"
1776         gcc_default_cpu="armv7e-m"
1777         gcc_default_cpu_tune="cortex-m7"
1778         gcc_default_fpu="fpv5-sp-d16"
1779         gcc_default_float_abi="hard"
1781         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dthumb"
1782         ;;
1784     amiga*)
1785         aros_elf_translate="$""(ELF2HUNK)"
1786         make_extra_commands="$export_newline""ELF2HUNK  := $""(TOOLDIR)/elf2hunk$""(HOST_EXE_SUFFIX)$export_newline"
1787         aros_target_arch="amiga"
1788         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1789         aros_shared_default="no"
1791         case "$target_cpu" in
1792             *m68k*)
1793                 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")
1794                 aros_enable_mmu=no
1795                 aros_target_cpu="m68k"
1796                 aros_object_format="m68kelf"
1797                 aros_flavour="standcompat"
1798                 gcc_target_cpu="m68000"
1799                 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1800                 aros_nowarn_flags="$aros_nowarn_flags NOWARN_VOLATILE_REGISTER_VAR"
1801                 aros_config_cppflags="$aros_config_cppflags -DNOLIBINLINE"
1802                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_FREESTANDING) $""(CFLAGS_OMIT_FP) $""(CFLAGS_BUILTIN)"
1803                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_STRICT_ALIASING) $""(CFLAGS_FREESTANDING) $""(CFLAGS_OMIT_FP) $""(CFLAGS_BUILTIN)"
1804                 if test "$optimization" = "default"; then
1805                     optimization_level=$toolchain_size_opt_lvl
1806                 fi
1807                 aros_config_aflags="$aros_config_aflags"
1808                 aros_target_strip_flags="-R.comment --strip-debug"
1809                 aros_nominal_width=640
1810                 aros_nominal_height=256
1811                 aros_nominal_depth=2
1812                 ;;
1813             *ppc*)
1814                 aros_cpu="ppc"
1815                 aros_flavour="native"
1816                 gcc_target_cpu="ppc"
1817                 ;;
1818             *)
1819                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1820                 ;;
1821         esac
1822         ;;
1824     mingw*)
1825         aros_target_arch="mingw32"
1826         aros_shared_default="no"
1827         aros_flavour="emulation"
1828         aros_shared_cflags=""
1829         need_crosstools="yes"
1830         need_dlopen="no"
1831         rescomp="windres"
1832         case "$target_cpu" in
1833             *i?86*)
1834                 aros_target_cpu="i386"
1835                 aros_object_format="elf_i386"
1836                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1837                 aros_isa_flags="$""(ISA_X86_FLAGS)"
1838                 aros_nominal_depth=8
1839                 gcc_target_cpu="i386"
1841                 kernel_tool_prefix="i386-mingw32-"
1842                 ;;
1843             *x86_64*)
1844                 aros_target_cpu="x86_64"
1845                 aros_object_format="elf_x86_64"
1846                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1847                 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1848                 aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_OMIT_FP)"
1849                 aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_OMIT_FP)"
1850                 aros_nominal_depth=8
1851                 kernel_tool_prefix="x86_64-w64-mingw32-"
1852                 ;;
1853             *arm*)
1854                 aros_target_cpu="arm"
1855                 aros_object_format="armelf_aros"
1856                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1857                 aros_c_libs="$aros_c_libs -laeabi"
1858                 aros_nominal_depth=8
1859                 gcc_target_cpu="arm"
1860                 gcc_default_float_abi="soft"
1861                 kernel_tool_prefix="arm-mingw32ce-"
1862                 aros_nominal_width=160
1863                 aros_nominal_height=160
1864                 ;;
1865             *)
1866                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1867                 ;;
1868         esac
1869         if test $host_os = "cygwin"; then
1870                 aros_kernel_cflags="-mno-cygwin"
1871         fi
1872     ;;
1873     pp*)
1874         aros_target_arch="pp"
1875         aros_shared_default="no"
1876         case "$target_cpu" in
1877             *m68k*)
1878                 aros_target_cpu="m68k"
1879                 aros_object_format="m68kelf"
1880                 aros_flavour="palmnative"
1881                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1882                 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1883                 aros_nominal_width=160
1884                 aros_nominal_height=160
1885                 aros_nominal_depth=1
1886                 aros_target_ar_flags="cru"
1887                 aros_c_libs="$aros_c_libs -lgcc1"
1888                 aros_shared_default=no
1889                 aros_shared_cflags="-fpic"
1890                 aros_shared_aflags=""
1891                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1892                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1893                 aros_debug_cppflags="$aros_messages_debug"
1894                 aros_debug_cflags="$aros_symbols_debug"
1895                 aros_debug_aflags=""
1896                 aros_debug_ldflags="$aros_symbols_debug"
1897                 aros_mungwall_debug="0"
1898                 aros_modules_debug="0"
1899                 gcc_target_cpu="mc68000"
1900                 ignore_undefined_symbols="-ius"
1901                 ;;
1902            *)
1903                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1904                 ;;
1905         esac
1906         ;;
1908     mac*)
1909         aros_target_arch="mac"
1910         aros_shared_default="no"
1911         case "$target_cpu" in
1912             *m68k*)
1913                 aros_target_cpu="m68k"
1914                 aros_object_format="m68kelf"
1915                 aros_flavour="mac68knative"
1916                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1917                 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1918                 aros_nominal_width=512
1919                 aros_nominal_height=384
1920                 aros_nominal_depth=8
1921                 aros_target_ar_flags="cru"
1922                 aros_c_libs="$aros_c_libs -lgcc1"
1923                 aros_shared_default=no
1924                 aros_shared_cflags="-fpic"
1925                 aros_shared_aflags=""
1926                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1927                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1928                 aros_debug_cppflags="$aros_messages_debug"
1929                 aros_debug_cflags="$aros_symbols_debug"
1930                 aros_debug_aflags=""
1931                 aros_debug_ldflags="$aros_symbols_debug"
1932                 aros_mungwall_debug="0"
1933                 aros_modules_debug="0"
1934                 gcc_target_cpu="mc68000"
1935                 ignore_undefined_symbols="-ius"
1936                 ;;
1937            *)
1938                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1939                 ;;
1940         esac
1941         ;;
1943     *)
1944         AC_MSG_ERROR([Unsupported target architecture $target])
1945         ;;
1946 esac
1948 #-----------------------------------------------------------------------------
1949 crosstools_guess="yes"
1950 aros_target_toolchain="no"
1951 aros_kernel_sysroot=""
1953 AC_MSG_CHECKING([Kernel toolchain prefix])
1954 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1955 AC_MSG_RESULT($kernel_tool_prefix)
1957 AC_MSG_CHECKING([ELF toolchain prefix])
1958 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"
1959                                                  crosstools_guess="no"])
1960 AC_MSG_RESULT($elf_tool_prefix)
1962 AC_MSG_CHECKING([AROS toolchain prefix])
1963 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"
1964                 crosstools_guess="no"])
1965 if test "$aros_tool_prefix" = "yes" ; then
1966     aros_tool_prefix=$aros_target_cpu-aros-
1968 AC_MSG_RESULT($aros_tool_prefix)
1970 #-----------------------------------------------------------------------------
1971 #   Checking if we should build crosstools..
1972 AC_MSG_CHECKING([whether to build crosstools])
1973 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1974 AC_MSG_RESULT($crosstools)
1976 if test "${crosstools}" = "yes"; then
1977     if test "${crosstools_guess}" = "no"; then
1978         AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1979     fi
1982 if test "${crosstools}" = "yes" || test "${crosstools_guess}" = "no"; then
1983     aros_target_toolchain="yes"
1986 AC_MSG_CHECKING([where to install the crosstools binaries])
1987 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])
1988 if test "x$aros_toolchain_install" = "x"; then
1989     AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1990 else
1991     AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1992     PATH="$AROS_CROSSTOOLSDIR:$PATH"
1993     if test "$crosstools_guess" = "no" ; then
1994         if test "x-$aros_flavour" != "x-emulation" -a "x-$aros_flavour" != "x-emulcompat" ; then
1995             aros_kernel_sysroot="$""(TARGET_SYSROOT)"
1996         fi
1997     fi
1999 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
2001 #-----------------------------------------------------------------------------
2002 if test "$aros_toolchain" = "gnu" ; then
2003     AC_MSG_CHECKING([what specific target binutils version to use])
2005 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="")
2006 if test "$use_binutils_version" = ""; then
2007         target_binutils_version="$default_binutils_version"
2008 else
2009     target_binutils_version="$use_binutils_version"
2011 if test "$aros_toolchain" = "gnu" ; then
2012     AC_MSG_RESULT($target_binutils_version)
2016 # Helper to identify gcc version
2017 AC_DEFUN([CROSS_GCC_VERSION], [
2018   target_gcc_version=""
2019   AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
2020     ax_cv_gcc_version="`$AROS_CROSSTOOLSDIR/${aros_tool_prefix}${toolchain_cpp_preprocessor}$(toolchain_cpp_opts) -dumpversion`"
2021     AS_IF([test "x$ax_cv_gcc_version" = "x"],[
2022       ax_cv_gcc_version=""
2023     ])
2024   ])
2025   target_gcc_version=$ax_cv_gcc_version
2026   AC_SUBST([target_gcc_version])
2029 #-----------------------------------------------------------------------------
2030 if test "$aros_toolchain" = "gnu" ; then
2031     AC_MSG_CHECKING([what specific target gcc version to use])
2033 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Compile gcc-VERSION for AROS]),use_gcc_version="$withval",use_gcc_version="")
2034 if test "$use_gcc_version" = ""; then
2035     if test "${crosstools}" = "no"; then
2036       if test "x$aros_toolchain_install" != "x"; then
2037           CROSS_GCC_VERSION
2038       fi
2039     fi
2040     if test "$use_gcc_version" = ""; then
2041         target_gcc_version="$default_gcc_version"
2042     fi
2043 else
2044     target_gcc_version="$use_gcc_version"
2046 if test "$aros_toolchain" = "gnu" ; then
2047     AC_MSG_RESULT($target_gcc_version)
2049     AC_MSG_CHECKING([version string style])
2050     if test "${target_gcc_version#*$'-'}" != "$target_gcc_version" ; then
2051         AC_MSG_RESULT(snapshot)
2052         GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'-' -f1)
2053         GCC_VERSION_MINOR=-1
2054         GCC_VERSION_PATCH=-1
2055     else
2056         AC_MSG_RESULT(release)
2057         GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1)
2058         GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2)
2059         GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3)
2060     fi
2062     gcc_fix_bitfields="false"
2063     if test "$GCC_VERSION_MAJOR" -gt "4" ; then
2064         gcc_fix_bitfields="true"
2065     else
2066         if test "$GCC_VERSION_MAJOR" -gt "3" ; then
2067             if test "$GCC_VERSION_MINOR" -gt "6" ; then
2068                 gcc_fix_bitfields="true"
2069             fi
2070         fi
2071     fi
2073     if test "$gcc_fix_bitfields" = "true" ; then
2074         case "$aros_target_cpu" in
2075         *x86_64* | *i?86*)
2076             x86_isa_extra="$x86_isa_extra $""(CFLAGS_NO_MS_BITFIELDS)"
2077             x86_64_isa_extra="$x86_64_isa_extra $""(CFLAGS_NO_MS_BITFIELDS)"
2078             ;;
2079         esac
2080     fi
2083 # Helper to identify llvm version
2084 AC_DEFUN([CROSS_LLVM_VERSION], [
2085   target_llvm_version=""
2086   AC_CACHE_CHECK([llvm version],[ax_cv_llvm_version],[
2087     ax_cv_llvm_version="`$AROS_CROSSTOOLSDIR/${aros_tool_prefix}${toolchain_cpp_preprocessor}$(toolchain_cpp_opts) -dumpversion`"
2088     AS_IF([test "x$ax_cv_llvm_version" = "x"],[
2089       ax_cv_llvm_version=""
2090     ])
2091   ])
2092   target_llvm_version=$ax_cv_llvm_version
2093   AC_SUBST([target_llvm_version])
2096 if test "$aros_toolchain" = "llvm" ; then
2097     AC_MSG_CHECKING([what specific target llvm version to use])
2099 AC_ARG_WITH(llvm-version,AC_HELP_STRING([--with-llvm-version=VERSION],[Compile llvm-VERSION for AROS]),use_llvm_version="$withval",use_llvm_version="")
2100 if test "$use_llvm_version" = ""; then
2101     if test "${crosstools}" = "no"; then
2102       if test "x$aros_toolchain_install" != "x"; then
2103           CROSS_LLVM_VERSION
2104       fi
2105     fi
2106     if test "$use_llvm_version" = ""; then
2107         target_llvm_version="$default_llvm_version"
2108     fi
2109 else
2110     target_llvm_version="$use_llvm_version"
2112 if test "$aros_toolchain" = "llvm" ; then
2113     AC_MSG_RESULT($target_llvm_version)
2116 AC_MSG_CHECKING([whether to enable Objective-C suppport])
2117 AC_ARG_ENABLE(objc,AC_HELP_STRING([--enable-objc],[Enable Objectve-C support (default=no)]),objc="$enableval",objc="no")
2118 AC_MSG_RESULT($objc)
2119 if test "x$objc" = "xyes"; then
2120     objc_target="$objc"
2121 else
2122     objc_target="no-objc"
2125 AC_MSG_CHECKING([whether to enable Java suppport])
2126 AC_ARG_ENABLE(java,AC_HELP_STRING([--enable-java],[Enable Java support (default=no)]),java="$enableval",java="no")
2127 AC_MSG_RESULT($java)
2128 if test "x$java" != "xno"; then
2129     java_target="$java"
2130 else
2131     java_target="no-java"
2134 spec_obj_format="-m $aros_object_format"
2135 # Now process extra architecture-specific options.
2136 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
2137 # as well as floating-point ABI.
2138 case "$aros_target_cpu" in
2139     *m68k*)
2140         aros_isa_targets="M68K_ISA_TARGETS              :=MC68020 MC68040"
2141         aros_isa_extra="$aros_isa_extra$export_newline$aros_isa_targets$export_newline"
2142         aros_isa_extra="$aros_isa_extra$m68k_isa_extra$export_newline$m68k_020_isa_extra$export_newline$m68k_030_isa_extra$export_newline$m68k_040_isa_extra$export_newline$m68k_060_isa_extra$export_newline$m68k_ac080_isa_extra$export_newline"
2143         aros_isa_extra="$aros_isa_extra$m68k_020_cppflags$export_newline$m68k_030_cppflags$export_newline$m68k_040_cppflags$export_newline$m68k_060_cppflags$export_newline"
2144         aros_isa_extra="$aros_isa_extra$m68k_020_cflags$export_newline$m68k_030_cflags$export_newline$m68k_040_cflags$export_newline$m68k_060_cflags$export_newline"
2145         aros_isa_extra="$aros_isa_extra$m68k_020_ldflags$export_newline$m68k_030_ldflags$export_newline$m68k_040_ldflags$export_newline$m68k_060_ldflags$export_newline"
2146         aros_isa_extra="$aros_isa_extra$m68k_020_ext$export_newline$m68k_030_ext$export_newline$m68k_040_ext$export_newline$m68k_060_ext$export_newline"
2147         ;;
2148     *x86_64*)
2149         aros_isa_extra="$export_newline$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
2150         dnl x86_64 can build 32 or 64bit code
2151         spec_obj_format="%{!m32:-m elf_x86_64} %{m32:-m elf_i386}"
2152         ;;
2153     arm*)
2154         dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
2155         if test "$gcc_default_cpu" = ""; then
2156             gcc_default_cpu="armv6"
2157         fi
2158         if test "$gcc_default_fpu" = ""; then
2159             gcc_default_fpu="vfp"
2160         fi
2161         if test "$gcc_default_endian" = ""; then
2162             if test "$target_cpu" = "armeb"; then
2163                 gcc_default_endian="big-endian"
2164             else
2165                 gcc_default_endian="little-endian"
2166             fi
2167         fi
2168         if test "$gcc_default_float_abi" = ""; then
2169             if test "$target_cpu" = "armhf"; then
2170                 gcc_default_float_abi="hard"
2171             else
2172                 gcc_default_float_abi="softfp"
2173             fi
2174         fi
2176         AC_MSG_CHECKING([Which minimum CPU to use])
2177         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)
2178         AC_MSG_RESULT($aros_gcc_cpu)
2180         AC_MSG_CHECKING([Which minimum FPU to use])
2181         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)
2182         AC_MSG_RESULT($aros_gcc_fpu)
2184         AC_MSG_CHECKING([Which floating point ABI to use])
2185         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)
2186         AC_MSG_RESULT($aros_gcc_float_abi)
2188         AC_MSG_CHECKING([Which ARM mode to use])
2189         if test "$aros_target_cpu_mode" = ""; then
2190             aros_target_cpu_mode="arm32"
2191             AC_MSG_RESULT([Defaulting to $aros_target_cpu_mode])
2192         else
2193             AC_MSG_RESULT([$aros_target_cpu_mode])
2194         fi
2196         case "$aros_target_cpu_mode" in
2197         arm32)
2198             gcc_default_mode="arm"
2199             aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -m$gcc_default_endian -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
2200         ;;
2201         arm64)
2202             AC_MSG_ERROR([ARM 64-bit mode is unsupported])
2203         ;;
2204         thumb)
2205             AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
2206         ;;
2207         thumb1)
2208             AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
2209         ;;
2210         thumb2)
2211             gcc_default_mode="thumb"
2212             # Do not specify -mthumb-interwork as it may add extra code to support arm/thumb interwork
2213             aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -$gcc_default_endian -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
2214         ;;
2215         *)
2216             AC_MSG_ERROR([Unsupported ARM mode specified $aros_target_cpu_mode])
2217         ;;
2218         esac
2220         aros_config_cflags="$aros_config_cflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
2221         aros_config_cxxflags="$aros_config_cxxflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
2222         aros_config_aflags="$aros_config_aflags $""(CFLAGS_NO_ASYNCHRONOUS_UNWIND_TABLES) $""(CFLAGS_NO_EXCEPTIONS)"
2223         ;;
2224     i386)
2225         aros_isa_extra="$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
2226         aros_kernel_ldflags="$aros_kernel_ldflags -m32" 
2227         ;;
2228 esac
2230 # Some architectures may need custom ELF specs.
2231 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
2232     elf_specs_in=config/${aros_object_format}-specs.in
2233 else
2234     elf_specs_in=config/elf-specs.in
2237 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
2238 # Since we override specs, we may need to put these defines there
2239 if test "$gcc_target_cpu" != ""; then
2240     gcc_target_cpu="-D__${gcc_target_cpu}__"
2243 AC_MSG_CHECKING([where to download sourcecode for external ports])
2244 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
2245 if test "$with_portssrcdir" = "default"; then
2246     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
2247 else
2248     AROS_PORTSSRCDIR="$with_portssrcdir"
2250 AC_MSG_RESULT($AROS_PORTSSRCDIR)
2252 AC_MSG_CHECKING([which bootloader to use])
2253 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
2254 if test "$target_bootloader" = "none"; then
2255     aros_target_bootloader=""
2256 else
2257     aros_target_bootloader="$target_bootloader"
2259 AC_MSG_RESULT($target_bootloader)
2261 AC_MSG_CHECKING([which icon-set to use])
2262 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
2263 if test "$target_iconset" = "default"; then
2264     aros_target_iconset="Gorilla"
2265     target_iconset="default (Gorilla)"
2266 else
2267     aros_target_iconset="$target_iconset"
2269 AC_MSG_RESULT($target_iconset)
2271 AC_MSG_CHECKING([which GUI Theme to use])
2272 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
2273 if test "$target_guitheme" = "default"; then
2274     aros_target_guitheme="Ice"
2275 else
2276     aros_target_guitheme="$target_guitheme"
2278 AC_MSG_RESULT($aros_target_guitheme)
2280 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
2281 # for target code)
2282 cross_compiling=no
2284 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
2285 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
2286     cross_compiling=yes
2289 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
2290 dnl The flag itself is given in per-target section, because some targets require to pass it
2291 dnl in a different manner, otherwise some tests fail.
2292 dnl TODO: Justify this.
2293 if test "$aros_host_cpu" == "x86_64" ; then
2294     if test "$aros_target_cpu" == "i386" ; then
2295         cross_compiling=no
2296     fi
2299 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2300     dnl For a hosted build we are cross-compiling if host OS differs from build OS.
2301     dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
2302     dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
2303     dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
2304     dnl used to build bootstrap for target arch in either case.
2305     dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
2306     dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
2307     dnl perhaps introducing aros_host_variant
2308     if test "$aros_host_arch" != "$aros_target_arch" ; then
2309         cross_compiling=yes
2310     fi
2311 else
2312     dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
2313     dnl it as kernel_cc. If not, (e.g. we are on Windows or Darwin), we need a crosscompiler.
2314     dnl if test "$host_cc_elf" = "no" ; then
2315         cross_compiling=yes
2316     dnl fi
2319 if test "$cross_compiling" = "no" ; then
2320     kernel_tool_prefix=""
2321     if test "$host_cc_elf" = "yes" ; then
2322         elf_tool_prefix=""
2323     fi
2326 if test "$kernel_tool_version" != ""; then
2327     kernel_tool_version="-$kernel_tool_version"
2330 #######################################################################
2331 ## Compute what toolchains to use, and their paths                   ##
2332 #######################################################################
2334 # This takes, as input:
2335 #   crosstools             {yes,no}
2336 #   kernel_tool_version    {"",[version]}
2337 #   target_tool_version    {"",[version]}
2338 #   kernel_tool_prefix     {none,[some-arch-os-]}
2339 #   gnu-toolchain -:
2340 #     target_tool_prefix     ${aros_target_cpu}-aros-
2341 #     aros_tool_prefix       ${aros_target_cpu}-aros-
2343 # The output is
2344 #   aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2345 #        Where the 'kernel' binaries are located
2346 #   orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2347 #        Where the 'target' binaries are located
2348 #        (not the symlink farm - that is aros_target_*!)
2350 # The rules are:
2351 #   if crosstools then
2352 #      if kernel_tools_prefix = "no-kernel-prefix-"
2353 #          aros_kernel_* = crosstools cc paths
2354 #          aros_kernel_cc = elf cc wrapper around crosstools cc
2355 #      else
2356 #          VALIDATE(${kernel_tools_prefix}*)
2357 #          aros_kernel_* = ${kernel_tools_prefix}*
2358 #          if ${kernel_tools_prefix}cc is an AROS gcc
2359 #              aros_kernel_cc = ${kernel_tools_prefix}cc
2360 #          else
2361 #              aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
2362 #          fi
2363 #      fi
2365 #      orig_target_* = aros built crosstools
2366 #      orig_target_cc = elf cc wrapper around crosstools cc
2367 #   else
2368 #      VALIDATE(${kernel_tools_prefix}*)
2370 #      orig_target_* = aros_kernel_*
2371 #      if aros_kernel_cc is an AROS gcc
2372 #          orig_target_cc = aros_kernel_cc
2373 #      else
2374 #          orig_target_cc = aros cc wrapper around aros_kernel_cc
2375 #      fi
2376 #   fi
2378 if test "$aros_toolchain" = "gnu" ; then
2379     target_tool_prefix="${aros_target_cpu}-aros-"
2380 elif test "$aros_toolchain" = "llvm" ; then
2381     target_tool_prefix="bin/"
2384 if test "$kernel_tool_prefix" != "" ; then
2385     AC_MSG_CHECKING([which kernel tools])
2386     AC_MSG_RESULT([$kernel_tool_prefix]);
2389 if test "$kernel_tool_prefix" = "none" ; then
2390     dnl ELF wrapper can be used only for native bootstrap
2391     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2392         AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
2393     fi
2394 else
2395     if test "x-$aros_flavour" != "x-standalone" -o "x-$aros_flavour" != "x-standcompat" ; then
2396         # Kernel tools required - find them
2397         # Note that 'normally', aros_kernel_* overrides will be
2398         # empty, unless specified in the per-arch sections above.
2399         test_kernel_cc=yes
2400         if test "x$aros_kernel_cpp" = "x"; then
2401             aros_kernel_cpp=${kernel_tool_prefix}${CPP_BASE}
2402         fi
2403         AROS_BUILDCMD(aros_kernel_cpp,$aros_kernel_cpp,${kernel_tool_version})
2404         AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
2405         AROS_REQUIRED(cpp,$aros_kernel_cpp)
2407         if test "x$aros_kernel_cc" = "x"; then
2408             aros_kernel_cc=${kernel_tool_prefix}${CC_BASE}
2409         fi
2410         AROS_BUILDCMD(aros_kernel_cc,$aros_kernel_cc,${kernel_tool_version})
2411         AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc)
2412         AROS_REQUIRED(cc,$aros_kernel_cc)
2414         if test "x$aros_kernel_cxx" = "x"; then
2415             aros_kernel_cxx=${kernel_tool_prefix}${CXX_BASE}
2416         fi
2417         AROS_BUILDCMD(aros_kernel_cxx,$aros_kernel_cxx,${kernel_tool_version})
2418         AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx)
2419         # If it's set, make sure it's really there
2420         if test "x$aros_kernel_cxx" != "x" ; then
2421             AROS_REQUIRED(cxx,$aros_kernel_cxx)
2422         fi
2423         if test "x$aros_kernel_ld" = "x"; then
2424             aros_kernel_ld=${kernel_tool_prefix}${LD_BASE}
2425         fi
2426         AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
2427         AROS_REQUIRED(ld,$aros_kernel_ld)
2428         if test "x$aros_kernel_as" = "x"; then
2429             aros_kernel_as=$aros_host_as
2430             if test "x$aros_kernel_as" = "x"; then
2431                 aros_kernel_as=${HOST_TOOLCHAIN_PREFIX}as${HOST_TOOLCHAIN_SUFFIX}
2432             fi
2433         fi
2434         AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
2435         AROS_REQUIRED(as,$aros_kernel_as)
2437         if test "x$aros_kernel_ar" = "x"; then
2438             aros_kernel_ar="${kernel_tool_prefix}${AR_BASE}"
2439         fi
2440         AROS_BUILDCMD(aros_kernel_ar,$aros_kernel_ar,${kernel_tool_version})
2441         AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
2442         AROS_REQUIRED(ar,$aros_kernel_ar)
2443         if test "x$aros_kernel_ranlib" = "x"; then
2444             aros_kernel_ranlib=${kernel_tool_prefix}${RANLIB_BASE}
2445         fi
2446         AROS_BUILDCMD(aros_kernel_ranlib,$aros_kernel_ranlib,${kernel_tool_version})
2447         AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
2448         AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
2449         if test "x$aros_kernel_nm" = "x"; then
2450             aros_kernel_nm=$aros_host_nm
2451             if test "x$aros_kernel_nm" = "x"; then
2452                 aros_kernel_nm=${HOST_TOOLCHAIN_PREFIX}nm${HOST_TOOLCHAIN_SUFFIX}
2453             fi
2454         fi
2455         AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
2456         AROS_REQUIRED(nm,$aros_kernel_nm)
2457         AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
2458         AROS_REQUIRED(strip,$aros_kernel_strip)
2460         # Objcopy and objdump are not required for the kernel
2461         # toolchain on many architectures.
2462         # So we'll look for them, but not make them strictly required.
2463         if test "x$aros_kernel_objcopy" = "x"; then
2464             aros_kernel_objcopy=$aros_host_objcopy
2465             if test "x$aros_kernel_objcopy" = "x"; then
2466                 aros_kernel_objcopy=${HOST_TOOLCHAIN_PREFIX}objcopy${HOST_TOOLCHAIN_SUFFIX}
2467             fi
2468         fi
2469         AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
2470         if test "x$aros_kernel_objdump" = "x"; then
2471             aros_kernel_objdump=$aros_host_objdump
2472             if test "x$aros_kernel_objdump" = "x"; then
2473                 aros_kernel_objdump=${HOST_TOOLCHAIN_PREFIX}objdump${HOST_TOOLCHAIN_SUFFIX}
2474             fi
2475         fi
2476         AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
2477         if test "x${crosstools}" != "xyes" ; then
2478             AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
2479             AROS_REQUIRED(objdump,$aros_kernel_objdump)
2480         fi
2481     fi
2484 AC_MSG_CHECKING([which target tools to use])
2485 if test "$aros_target_toolchain" = "yes"; then
2486     if test "$aros_toolchain" = "llvm" ; then
2487         msg_result="llvm"
2488     else
2489         msg_result=$target_tool_prefix
2490     fi
2491     AC_MSG_RESULT([$msg_result])
2492     # We are building AROS crosstools
2493     tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
2494     orig_target_cc="${tmp_tool_prefix}${toolchain_c_compiler}${target_tool_version}"
2495     orig_target_cxx="${tmp_tool_prefix}${toolchain_cxx_compiler}${target_tool_version}"
2496     orig_target_cpp="${tmp_tool_prefix}${toolchain_cpp_preprocessor}${toolchain_cpp_opts}"
2497     orig_target_ld="${tmp_tool_prefix}${toolchain_ld}"
2498     orig_target_as="${tmp_tool_prefix}${toolchain_as}"
2499     orig_target_ar="${tmp_tool_prefix}${toolchain_ar}"
2500     orig_target_ranlib="${tmp_tool_prefix}${toolchain_ranlib}"
2501     orig_target_nm="${tmp_tool_prefix}${toolchain_nm}"
2502     orig_target_strip="${tmp_tool_prefix}${toolchain_strip}"
2503     orig_target_objcopy="${tmp_tool_prefix}${toolchain_objcopy}"
2504     orig_target_objdump="${tmp_tool_prefix}${toolchain_objdump}"
2505 else
2506     # Determine whether AROS or ELF tools should be used
2507     if test "$aros_tool_prefix" = "none"; then
2508         aros_tool_prefix="${elf_tool_prefix}"
2509     fi
2511     AC_MSG_RESULT([$aros_tool_prefix])
2512     # We are *not* building AROS crosstools - use the AROS or ELF tools
2513     AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}${toolchain_cpp_preprocessor}${target_tool_version}${toolchain_cpp_opts})
2514     AROS_REQUIRED(cpp,$orig_target_cpp)
2515     AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}${toolchain_c_compiler}${target_tool_version})
2516     AROS_REQUIRED(cc,$orig_target_cc)
2517     AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}${toolchain_cxx_compiler}${target_tool_version})
2518     AROS_REQUIRED(cxx,$orig_target_cxx)
2519     AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}${toolchain_ld})
2520     AROS_REQUIRED(ld,$orig_target_ld)
2521     AROS_TOOL_TARGET(orig_target_as,as,aros_tool_prefix}${toolchain_as})
2522     AROS_REQUIRED(as,$orig_target_as)
2523     AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}${toolchain_ar})
2524     AROS_REQUIRED(ar,$orig_target_ar)
2525     AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}${toolchain_ranlib})
2526     AROS_REQUIRED(ranlib,$orig_target_ranlib)
2527     AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}${toolchain_nm})
2528     AROS_REQUIRED(nm,$orig_target_nm)
2529     AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}${toolchain_strip})
2530     AROS_REQUIRED(strip,$orig_target_strip)
2531     AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}${toolchain_objcopy})
2532     AROS_REQUIRED(objcopy,$orig_target_objcopy)
2533     AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}${toolchain_objdump})
2534     AROS_REQUIRED(objdump,$orig_target_objdump)
2537 if test "$kernel_tool_prefix" = "none" ; then
2538     # No kernel tools specified
2539     # Assume kernel tools == target tools with ELF wrapper
2540     aros_kernel_cc=$orig_target_cc
2541     aros_kernel_cxx=$orig_target_cxx
2542     aros_kernel_cpp="$orig_target_cpp"
2543     aros_kernel_ld=$orig_target_ld
2544     aros_kernel_as=$orig_target_as
2545     aros_kernel_ar=$orig_target_ar
2546     aros_kernel_ranlib=$orig_target_ranlib
2547     aros_kernel_nm=$orig_target_nm
2548     aros_kernel_strip=$orig_target_strip
2549     aros_kernel_objcopy=$orig_target_objcopy
2550     aros_kernel_objdump=$orig_target_objdump
2551     aros_kernel_isa_flags=$aros_isa_flags
2552     use_kernel_cc_wrapper=yes
2555 # At this point, all aros_kernel_* and aros_target_* 
2556 # tools should be set up correctly
2558 CC="$aros_kernel_cc $kernel_tool_flags"
2559 CPP="$aros_kernel_cpp"
2561 #-----------------------------------------------------------------------------
2563 # Find all the tools we need to compile. This could be cross-compiling
2564 # though! If that is the case we use the GNU form of the target and
2565 # simply add this to the front of the binary name. This is rather simple,
2566 # but it should work under most circumstances.
2568 # The default tools are to use the same as the host, but only if the
2569 # host and target CPU are the same. With GCC this is normally enough.
2572 aros_cc_pre=""
2573 aros_shared_ld="$aros_host_ld"
2575 aros_target_mkdep="$aros_host_mkdep"
2577 # The default tools executables to be linked to.
2578 if test "$rescomp" != ""; then
2579     AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
2580     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
2583 # Set up the sources for the symlink farm
2584 if test "$crosstools" = "yes"; then
2585     crosstools_target=tools-crosstools
2588 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
2589 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
2591 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/host/config"
2592 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
2593 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer/include/aros"
2594 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
2595 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
2596 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
2597 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
2599 # aros_cc_pre is a variable that is added to the front of the compiler name
2600 # in the generated aros-gcc shell script. We need this to enable the cache
2601 # to work across cleaned builds. Also, support DISTCC using the correct
2602 # environment variable.
2605 if test "x${DISTCC}" != "x" ; then
2606     if test "x${CCACHE}" != "x" ; then
2607         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
2608     else
2609         aros_cc_pre="${DISTCC} "
2610     fi
2611 else
2612     if test "x${CCACHE}" != "x" ; then
2613         aros_cc_pre="${CCACHE} "
2614     fi
2617 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
2618 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
2619 AC_SUBST(aros_target_nix_ldflags,-nix)
2620 AC_SUBST(aros_target_detach_ldflags,-detach)
2621 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
2623 aros_target_cc_path=
2625 # Target tools
2626 AC_SUBST(aros_toolchain)
2627 if test "$aros_target_toolchain" != "yes"; then
2628     prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
2629     if test "$GCC" = "yes"; then
2630         aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
2631     fi
2632 else
2633     # We do not know which c compiler version we are going to build and what we need to know
2634     # here is different for different versions so this will be set later during the
2635     # build of crosstools.
2636     if test "$aros_toolchain" = "gnu" ; then
2637         prefix="$AROS_CROSSTOOLSDIR/${aros_target_cpu}-aros-"
2638     elif test "$aros_toolchain" = "llvm" ; then
2639         prefix="$AROS_CROSSTOOLSDIR/bin/"
2640     fi
2641     aros_target_cc_path=@aros_target_cc_path@
2643 aros_target_cpp="${prefix}${toolchain_cpp_preprocessor}${toolchain_cpp_opts}"
2644 aros_target_cc="${prefix}${toolchain_c_compiler}"
2645 aros_target_cxx="${prefix}${toolchain_cxx_compiler}"
2646 aros_target_as="${prefix}${toolchain_as}"
2647 if test "${use_ld_wrapper}" = "yes"; then
2648     aros_target_ld="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}"
2649 else
2650     aros_target_ld="${prefix}${toolchain_ld}"
2652 aros_toolchain_ld="${prefix}${toolchain_ld}"
2654 aros_target_ar="${prefix}${toolchain_ar} $aros_target_ar_flags"
2655 aros_target_objcopy="${prefix}${toolchain_objcopy}"
2656 aros_target_objdump="${prefix}${toolchain_objdump}"
2657 aros_target_ranlib="${prefix}${toolchain_ranlib} $aros_target_ranlib_flags"
2658 aros_target_nm="${prefix}${toolchain_nm} $aros_target_nm_flags"
2659 aros_target_strip="${prefix}${toolchain_strip}"
2660 aros_plain_nm="${prefix}${toolchain_nm}"
2661 aros_plain_ar="${prefix}${toolchain_ar}"
2663 AC_ARG_ENABLE(includes,
2664 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
2665 [aros_target_incl=$enable_includes], [aros_target_incl=no])
2667 if test "x$aros_target_incl" = "xno"; then
2668     if test "x$test_kernel_cc" != "xno"; then
2669         aros_target_incl=`$aros_kernel_cc -print-sysroot 2>/dev/null`/`$aros_kernel_cc --print-sysroot-headers-suffix 2>/dev/null || echo usr/include`
2670     else
2671         aros_target_incl=
2672     fi
2675 if test "x$aros_kernel_includes" = "x"; then
2676     if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2677         if test "x$aros_target_incl" != "x"; then
2678             aros_kernel_includes="-isystem $aros_target_incl"
2679         fi
2680     fi
2683 if test "x$test_kernel_cc" != "xno"; then
2684     if test "$aros_kernel_includes" != "" ; then
2685         dnl find out about the kernel cc's include path
2686         AC_MSG_CHECKING([for the kernel compiler's include path])
2687         if test "$aros_kernel_cc_includes" = "" ; then
2688             # Try to guess where the directory is.
2689             aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
2690             if test -d $aros_kernel_cc_includes; then
2691                 # Check if there is also an include-fixed directory and add it
2692                 # to kernel compiler's include path as it may contain some of
2693                 # the headers we need.
2694                 if test -d "$aros_kernel_cc_includes"-fixed; then
2695                     aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
2696                 fi
2697                 # Check for specific includes directory. Needed for Ubuntu 11.10 and Debian
2698                 if test -d "/usr/include/${aros_target_cpu}-linux-gnu"; then
2699                     aros_kernel_cc_includes+=" -isystem /usr/include/${aros_target_cpu}-linux-gnu"
2700                 fi
2701             else
2702                 # The directory doesn't exist, we need to do some more work.
2703                 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
2705                 # These are the headers we're looking for.
2706                 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2707                          stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
2708                          zutil.h stdint.h"
2710                 dirs=
2711                 for h in $headers; do
2712                     # Which other headers are needed by each of the above?
2713                     deps=$(echo "#include <$h>" | \
2714                            $aros_kernel_cc -E -M - 2>/dev/null | \
2715                            sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2717                     # Copy all the needed headers to a directory beneath gendir.
2718                     for d in $deps; do
2719                         h=$(basename $d)
2720                         dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
2721                                                 sed -n "s,^.*/include\(/.*\),\1,p")
2722                         ! test -d $dir && mkdir -p $dir
2723                         ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2724                     done
2725                 done            
2726             fi
2727         fi
2728         AC_MSG_RESULT($aros_kernel_cc_includes)
2729         # Adding -nostdinc to kernel includes as they are always used together.
2730         aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
2731     fi
2734 if test "$crosstools" != "yes"; then
2735     dnl find out about the target cc's include path
2736     AC_MSG_CHECKING([for the target compiler's include path])
2737     if test "$aros_target_cc_includes" = "" ; then
2738         #try to guess where the directory is
2739         aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
2740         if ! test -d $aros_target_cc_includes; then
2741             #the directory doesn't exist, we need to do some more work
2742             aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
2743         
2744             #these are the headers we're looking for
2745             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2746                     stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
2747                     zutil.h"
2749             dirs=
2750             for h in $headers; do
2751                 #which other headers each of the above headers needs?
2752                 deps=$(echo "#include <$h>" | \
2753                     $orig_target_cc -E -M - 2>/dev/null | \
2754                     sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2755             
2756                 #copy all the needed headers to a directory beneath gendir
2757                 for d in $deps; do
2758                     h=$(basename $d)
2759                     dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
2760                                                 sed -n "s,^.*/include\(/.*\),\1,p")
2761                     ! test -d $dir && mkdir -p $dir
2762                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2763                 done
2764             done
2765         fi
2766     fi
2767     AC_MSG_RESULT($aros_target_cc_includes)
2768 else
2769     # We do not know which c compiler version we are going to build and what we need to know
2770     # here is different for different versions so this will be set later during the
2771     # build of crosstools.
2772     aros_target_cc_includes=@aros_target_cc_includes@
2776 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
2777 # On GCC >= 4.0 -iquote should be used
2780 save_cc="$CC"
2781 save_cflags="$CFLAGS"
2782 if test "x$test_kernel_cc" != "xno"; then
2783     CFLAGS="-iquote."
2784     kernel_cflags_iquote=$host_cflags_iquote
2785     kernel_cflags_iquote_end=$host_cflags_iquote_end
2786     if test "x-$cross_compiling" = "x-yes"; then
2787         CC="$aros_kernel_cc"
2788         AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2789         if test "x-$crosstools" != "x-yes"; then
2790             AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2791         else
2792             # we do know it is supported for the smallest version of gcc we are going to build
2793             # we assume it's also supported by later versions
2794             use_no_stack_protector=yes
2795         fi
2796         AC_MSG_RESULT($use_no_stack_protector)
2797         AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2798         if test "x-$crosstools" != "x-yes"; then
2799             AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2800         else
2801             # we do know it is supported for the smallest version of gcc we are going to build
2802             # we assume it's also supported by later versions
2803             has_iquote=yes
2804         fi
2805         AC_MSG_RESULT($has_iquote)
2806         if test "x-$has_iquote" = "x-yes" ; then
2807             kernel_cflags_iquote=-iquote
2808             kernel_cflags_iquote_end=
2809         else
2810             kernel_cflags_iquote=-I
2811             kernel_cflags_iquote_end=-I-
2812         fi
2813     fi
2814     if test "x-$use_no_stack_protector" = "x-yes" ; then
2815         aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2816     fi
2818     #-----------------------------------------------------------------------------
2820     # Check if we can explicitly choose older version of symbol hashing
2822     CFLAGS="$save_cflags -Wl,--hash-style=sysv"
2823     CC="$aros_kernel_cc"
2824     AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2825     AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2826     AC_MSG_RESULT($use_hash_style)
2827     if test "x-$use_hash_style" = "x-yes" ; then
2828         aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2829     fi
2830 else
2831     kernel_cflags_iquote="$""(CFLAGS_IQUOTE)"
2832     kernel_cflags_iquote_end="$""(CFLAGS_IQUOTE_END)"
2834 CC="$save_cc"
2835 CFLAGS="$save_cflags"
2837 AC_SUBST(host_cflags_iquote)
2838 AC_SUBST(host_cflags_iquote_end)
2839 AC_SUBST(kernel_cflags_iquote)
2840 AC_SUBST(kernel_cflags_iquote_end)
2843 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2844 AC_MSG_CHECKING([for default resolution of WBScreen])
2845 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2846 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2847 if test "$resolution" = "yes" ; then
2848     resolution="none"
2850 if test "$resolution" = "no" ; then
2851     resolution="none"
2853 if test "$resolution" != "none" ; then
2854     aros_nominal_width=`echo $resolution | cut -d'x' -f1`
2855     aros_nominal_height=`echo $resolution | cut -d'x' -f2`
2856     aros_nominal_depth=`echo $resolution | cut -d'x' -f3`
2858 AC_MSG_RESULT($aros_nominal_width x $aros_nominal_height x $aros_nominal_depth)
2859 aros_cv_nominal_width=$aros_nominal_width
2860 aros_cv_nominal_height=$aros_nominal_height
2861 aros_cv_nominal_depth=$aros_nominal_depth
2863 dnl See if the user wants the serial debug output for native flavour
2864 AC_MSG_CHECKING([whether serial debug is enabled])
2865 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)
2866 if test "$aros_serial_debug" = 0 ; then
2867     serial_debug_forced=""
2868     if test "$serial_debug" = "yes" ; then
2869         serial_debug="1"
2870     fi
2871     if test "$serial_debug" = "no" ; then
2872         serial_debug="none"
2873     fi
2874 else
2875     serial_debug_forced="(forced)"
2876     serial_debug=$aros_serial_debug
2878 if test "$serial_debug" != "none" ; then
2879     aros_serial_debug=$serial_debug
2880     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2881 else
2882     AC_MSG_RESULT(no)
2885 dnl See if the user wants the palm debug output hack for palm native flavour
2886 AC_MSG_CHECKING([whether palm debug hack is enabled])
2887 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")
2888 if test "$palm_debug_hack" = "yes" ; then
2889     aros_palm_debug_hack="1"
2891 AC_MSG_RESULT($palm_debug_hack)
2893 dnl See if dev wants the usb3.0 code
2894 AC_MSG_CHECKING([whether usb3.0 code is enabled])
2895 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2896 if test "$usb30_code" = "yes" ; then
2897     aros_config_cppflags="$aros_config_cppflags -DAROS_USB30_CODE"
2898     aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2900 AC_MSG_RESULT($usb30_code)
2902 dnl See if the user wants nesting supervisor activated for unix flavour
2903 AC_MSG_CHECKING([whether nesting supervisor support is enabled])
2904 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")
2905 if test "$nesting_supervisor" = "yes" ; then
2906     aros_nesting_supervisor="1"
2908 AC_MSG_RESULT($nesting_supervisor)
2910 dnl See if the user wants to disable MMU support
2911 dnl This can be overriden on per-target basis,
2912 dnl set $aros_enable_mmu to "yes" or "no" to do this
2913 if test "$aros_enable_mmu" = "" ; then
2914     AC_MSG_CHECKING([whether MMU support is enabled])
2915     dnl Enabled by default
2916     AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2917     if test "$aros_enable_mmu" = "" ; then
2918         aros_enable_mmu="yes"
2919     fi
2920     AC_MSG_RESULT($aros_enable_mmu)
2922 if test "$aros_enable_mmu" = "no" ; then
2923     aros_enable_mmu="0"
2924 else
2925     aros_enable_mmu="1"
2927     
2929 dnl things specifically required for hosted flavours
2930 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2932     if test "x-$need_dlopen" != "x-no" ; then
2933       save_libs="$LIBS"
2934       LIBS=""
2935       dnl some kind of dynamic library access system is required for hostlib.resource
2936       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2937       if test "x-$have_dl" = "x-no" ; then
2938           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2939                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
2940                                     have_dl="no")
2941       fi
2942       if test "x-$have_dl" = "x-no" ; then
2943           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2944       fi
2945       LIBS="$save_libs"
2946     fi
2949     dnl x11 hidd
2950     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2951                                            [build X11 hidd for hosted (default=auto)]),
2952                                            x11_hidd="$enableval",
2953                                            x11_hidd="$need_x11")
2954     case "x-$x11_hidd" in
2955         x-yes|x-no|x-auto)                 ;;
2956         *)                 x11_hidd="$need_x11" ;;
2957     esac
2959     ENABLE_X11=0
2961     dnl they want it
2962     if test "x-$x11_hidd" != "x-no" ; then
2964         dnl find x11 stuff
2965         AC_PATH_X
2967         if test -n "$x_includes"; then
2968             X_CFLAGS="$X_CFLAGS -I$x_includes"
2969         fi
2971         if test -n "$x_libraries"; then
2972             X_LIBS="$X_LIBS -L$x_libraries"
2973         fi
2975         if test "x-$no_x" = "x-yes" ; then
2977             dnl didn't find it
2978             if test "x-$x11_hidd" != "x-auto" ; then
2979                 dnl and they explicitly asked for it, bail out
2980                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2981             fi
2982         
2983         else
2984             dnl found it, setup the metatarget
2985             aros_target_options+="$export_newline""# Enable X11 Gfx Driver$export_newline""OPT_HOST_X11GFX               := yes$export_newline"
2986             if test "x-$host_feature_glx" != "x-no" ; then
2987                 aros_target_options+="$export_newline""# Enable X11 HostGL 3D Passthrough$export_newline""OPT_HOST_X11_HOSTGL           := yes$export_newline"
2988             fi
2989             ENABLE_X11=1
2991             aros_host_x11_cflags="$X_CFLAGS"
2992             aros_host_x11_ldflags="$X_LIBS  -lX11"
2994             dnl setup shared memory extensions
2995             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2996                                                   [use X11 shared memory (default=auto)]),
2997                                                   x11_hidd_shm="$enableval",
2998                                                   x11_hidd_shm="auto")
2999             case "x-$x11_hidd_shm" in
3000                 x-yes|x-no|x-auto)                     ;;
3001                 *)                 x11_hidd_shm="auto" ;;
3002             esac
3004             have_xshm=no
3006             dnl they want it
3007             if test "x-$x11_hidd_shm" != "x-no" ; then
3009                 dnl system shm headers
3010                 AC_CHECK_HEADERS(sys/ipc.h)
3011                 AC_CHECK_HEADERS(sys/shm.h)
3013                 dnl got them
3014                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
3016                     dnl make sure X libs have shm functions
3017                     save_cflags="$CFLAGS"
3018                     save_ldflags="$LDFLAGS"
3019                     CFLAGS="$CFLAGS $X_CFLAGS"
3020                     LDFLAGS="$LDFLAGS $X_LIBS"
3021                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
3022                     CFLAGS="$save_cflags"
3023                     LDFLAGS="$save_ldflags"
3024                 fi
3025             fi
3027             dnl detection done, prepare output
3028             if test "x-$have_xshm" = "x-yes" ; then
3029                 dnl we can do shm
3030                 DO_XSHM_SUPPORT="1"
3031             elif test "x-$x11_hidd_shm" = "x-yes" ; then
3032                 dnl they explicitly asked for it, but we can't do it
3033                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
3034             else
3035                 dnl otherwise just disable it
3036                 DO_XSHM_SUPPORT="0"
3037             fi
3039             
3040             dnl setup vidmode (fullscreen) extensions
3041             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
3042                                                       [use X11 vidmode extension (default=auto)]),
3043                                                       x11_hidd_vidmode="$enableval",
3044                                                       x11_hidd_vidmode="auto")
3045             case "x-$x11_hidd_vidmode" in
3046                 x-yes|x-no|x-auto)                         ;;
3047                 *)                 x11_hidd_vidmode="auto" ;;
3048             esac
3050             have_vidmode=no
3052             dnl they want it
3053             if test "x-$x11_hidd_vidmode" != "x-no" ; then
3055                 dnl make sure X libs have vidmode functions
3056                 save_cflags="$CFLAGS"
3057                 save_ldflags="$LDFLAGS"
3058                 CFLAGS="$CFLAGS $X_CFLAGS"
3059                 LDFLAGS="$LDFLAGS $X_LIBS"
3060                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
3061                 CFLAGS="$save_cflags"
3062                 LDFLAGS="$save_ldflags"
3063             fi
3065             dnl detection done, prepare output
3066             if test "x-$have_vidmode" = "x-yes" ; then
3067                 dnl we can do vidmode
3068                 DO_VIDMODE_SUPPORT="1"
3069             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
3070                 dnl they explicitly asked for it, but we can't do it
3071                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
3072             else
3073                 dnl otherwise just disable it
3074                 DO_VIDMODE_SUPPORT="0"
3075             fi
3076         fi
3077     fi
3079     dnl sdl hidd
3080     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
3081                                            [build SDL hidd for hosted (default=auto)]),
3082                                            sdl_hidd="$enableval",
3083                                            sdl_hidd="auto")
3084     case "x-$sdl_hidd" in
3085         x-yes|x-no|x-auto)                 ;;
3086         *)                 sdl_hidd="auto" ;;
3087     esac
3089     dnl they want it
3090     if test "x-$sdl_hidd" != "x-no" ; then
3092         dnl find sdl
3093         SDL_VERSION=1.2.5
3094         AM_PATH_SDL($SDL_VERSION, [have_sdl="yes"],
3095             [have_sdl="no"])
3097         if test "x-$have_sdl" != "x-yes" ; then
3099             dnl didn't find it
3100             if test "x-$sdl_hidd" != "x-auto" ; then
3101                 dnl and they explicitly asked for it, bail out
3102                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
3103             fi
3105         else
3106             dnl found it, enable the build
3107             aros_target_options+="$export_newline""# Enable SDL Gfx Driver$export_newline""OPT_HOST_SDLGFX               := yes$export_newline"
3108             aros_host_sdl_cflags=$SDL_CFLAGS
3109             aros_host_sdl_libs=$SDL_LIBS
3110         fi
3111     fi
3116 dnl See if the user wants dbus.library
3117 AC_MSG_CHECKING([whether building of dbus.library is enabled])
3118 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
3119 if test "$dbus" = "yes" ; then
3120     ENABLE_DBUS=1
3121     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
3122     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
3123     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
3124     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
3125 else
3126     ENABLE_DBUS=0
3128 AC_MSG_RESULT($dbus)
3130 if test "$use_kernel_cc_wrapper" = "yes" ; then
3131     aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-${toolchain_c_compiler}"
3134 aros_kernel_cppflags=$aros_config_cppflags
3135 aros_optimization_cflags="$optimization_level"
3136 if test "$optimization" = "default"; then
3137 AC_MSG_CHECKING([default optimization level to use])
3138 AC_MSG_RESULT($optimization_level)
3141 if ! test "$gcc_default_cpu" = "" ; then
3142     target_extra_cfg+="$export_newline""# ARM gcc default target$export_newline""GCC_DEFAULT_CPU         := $gcc_default_cpu$export_newline""GCC_DEFAULT_FPU         := $gcc_default_fpu$export_newline""GCC_DEFAULT_FLOAT_ABI   := $gcc_default_float_abi$export_newline""GCC_DEFAULT_MODE        := $gcc_default_mode$export_newline"
3145 if test "$use_libatomic" = "yes" ; then
3146     aros_cxx_libs="$aros_cxx_libs  -latomic"
3149 aros_target_options+="$export_newline""# Enable Nouveau Gfx Driver$export_newline""OPT_GFX_NOUVEAU               := no$export_newline"
3151 dnl --------------------------------------------------------------------
3152 dnl Configuration Output Section
3153 dnl --------------------------------------------------------------------
3155 dnl strip trailing spaces ...
3156 CC=m4_normalize($CC)
3157 CFLAGS=m4_normalize($CFLAGS)
3158 CHMOD=m4_normalize($CHMOD)
3159 CP=m4_normalize($CP)
3160 ECHO=m4_normalize($ECHO)
3161 FLEX=m4_normalize($FLEX)
3162 MV=m4_normalize($MV)
3163 NOP=m4_normalize($NOP)
3164 PATCH=m4_normalize($PATCH)
3165 PNGTOPNM=m4_normalize($PNGTOPNM)
3166 PPMTOILBM=m4_normalize($PPMTOILBM)
3167 SED=m4_normalize($SED)
3168 SORT=m4_normalize($SORT)
3169 TOUCH=m4_normalize($TOUCH)
3170 UNIQ=m4_normalize($UNIQ)
3172 aros_config_cflags=m4_normalize($aros_config_cflags)
3173 aros_config_cppflags=m4_normalize($aros_config_cppflags)
3174 aros_config_cxxflags=m4_normalize($aros_config_cxxflags)
3176 aros_c_libs=m4_normalize($aros_c_libs)
3177 aros_cxx_libs=m4_normalize($aros_cxx_libs)
3179 aros_host_ldflags=m4_normalize($aros_host_ldflags)
3180 aros_host_strip=m4_normalize($aros_host_strip)
3181 aros_host_x11_ldflags=m4_normalize($aros_host_x11_ldflags)
3183 aros_kernel_ar=m4_normalize($aros_kernel_ar)
3184 aros_kernel_as=m4_normalize($aros_kernel_as)
3185 aros_kernel_cc=m4_normalize($aros_kernel_cc)
3186 aros_kernel_cflags=m4_normalize($aros_kernel_cflags)
3187 aros_kernel_cppflags=m4_normalize($aros_kernel_cppflags)
3188 aros_kernel_cxx=m4_normalize($aros_kernel_cxx)
3189 aros_kernel_nm=m4_normalize($aros_kernel_nm)
3190 aros_kernel_objcopy=m4_normalize($aros_kernel_objcopy)
3191 aros_kernel_objdump=m4_normalize($aros_kernel_objdump)
3192 aros_kernel_ranlib=m4_normalize($aros_kernel_ranlib)
3194 # Generic
3195 AC_SUBST(aros_arch)
3196 AC_SUBST(aros_cpu)
3197 AC_SUBST(aros_flavour)
3198 AC_SUBST(aros_flavour_uc)
3199 AC_SUBST(aros_target_toolchain)
3200 AC_SUBST(aros_toolchain_ld)
3201 AC_SUBST(aros_build_host)
3202 AC_SUBST(AROS_BUILDDIR)
3203 AC_SUBST(AROS_BUILDDIR_UNIX)
3204 AC_SUBST(SRCDIR)
3205 AC_SUBST(AROS_CROSSTOOLSDIR)
3206 AC_SUBST(AROS_PORTSSRCDIR)
3208 # Compatability with other Amiga-like operating systems
3209 AC_SUBST(aros_amigaos_compliance)
3211 # Host Related ###########################
3212 AC_SUBST(host_stat_h__unused_used)
3213 AC_SUBST(ax_cv_flex_version)
3214 AC_SUBST(host_extra_cfg)
3215 AC_SUBST(aros_cc_pre)
3216 AC_SUBST(aros_host_strip)
3217 AC_SUBST(aros_host_arch)
3218 AC_SUBST(aros_host_cpu)
3219 AC_SUBST(aros_host_cpp)
3220 AC_SUBST(aros_host_def_cc)
3221 AC_SUBST(aros_host_cc)
3222 AC_SUBST(aros_host_cxx)
3223 AC_SUBST(aros_host_ar)
3224 AC_SUBST(aros_host_ranlib)
3225 AC_SUBST(aros_host_ld)
3226 AC_SUBST(aros_host_make)
3227 AC_SUBST(aros_host_cppflags)
3228 AC_SUBST(aros_host_cflags)
3229 AC_SUBST(aros_host_cxxflags)
3230 AC_SUBST(gnu89_inline)
3231 AC_SUBST(aros_host_ldflags)
3232 AC_SUBST(aros_host_debug)
3233 AC_SUBST(aros_host_mkdep)
3234 AC_SUBST(aros_host_mkargs)
3235 AC_SUBST(aros_host_exe_suffix)
3236 AC_SUBST(aros_host_lib_suffix)
3237 AC_SUBST(aros_tools_dir)
3238 AC_SUBST(aros_host_aclocal)
3239 AC_SUBST(aros_host_autoconf)
3240 AC_SUBST(aros_host_autoheader)
3241 AC_SUBST(aros_host_automake)
3243 # Target Related #########################
3244 AC_SUBST(aros_elf_translate)
3245 AC_SUBST(make_extra_commands)
3246 AC_SUBST(make_extra_targetcfg)
3247 AC_SUBST(target_extra_cfg)
3248 AC_SUBST(aros_target_options)
3250 AC_SUBST(aros_target_guitheme)
3251 AC_SUBST(aros_target_iconset)
3252 AC_SUBST(aros_target_bootloader)
3253 AC_SUBST(aros_target_arch)
3254 AC_SUBST(aros_target_family)
3255 AC_SUBST(aros_target_cpu)
3256 AC_SUBST(aros_target_cpu_mode)
3257 AC_SUBST(aros_target_variant)
3258 AC_SUBST(aros_target_suffix)
3259 AC_SUBST(aros_target_ar)
3260 AC_SUBST(aros_target_ranlib)
3261 AC_SUBST(aros_plain_nm)
3262 AC_SUBST(aros_plain_ar)
3263 AC_SUBST(aros_kernel_ar)
3264 AC_SUBST(aros_kernel_ranlib)
3265 AC_SUBST(orig_target_cc)
3266 AC_SUBST(aros_target_cc)
3267 AC_SUBST(aros_kernel_cc)
3268 AC_SUBST(orig_target_cxx)
3269 AC_SUBST(aros_target_cxx)
3270 AC_SUBST(aros_kernel_cxx)
3271 AC_SUBST(orig_target_cpp)
3272 AC_SUBST(aros_target_cpp)
3273 AC_SUBST(aros_kernel_cpp)
3274 AC_SUBST(orig_target_as)
3275 AC_SUBST(aros_target_as)
3276 AC_SUBST(aros_kernel_as)
3277 AC_SUBST(orig_target_ld)
3278 AC_SUBST(aros_target_ld)
3279 AC_SUBST(aros_kernel_ld)
3280 AC_SUBST(aros_target_cc_includes)
3281 AC_SUBST(aros_target_cc_path)
3282 AC_SUBST(aros_target_objdump)
3283 AC_SUBST(aros_target_objcopy)
3284 AC_SUBST(aros_target_strip)
3285 AC_SUBST(aros_target_nm)
3286 AC_SUBST(aros_kernel_rescomp)
3287 AC_SUBST(aros_shared_default)
3288 AC_SUBST(aros_shared_ld)
3289 AC_SUBST(aros_object_format)
3290 AC_SUBST(spec_obj_format)
3291 AC_SUBST(aros_c_libs)
3292 AC_SUBST(aros_cxx_libs)
3294 AC_SUBST(aros_shared_cflags)
3295 AC_SUBST(aros_shared_aflags)
3296 AC_SUBST(aros_shared_ldflags)
3298 AC_SUBST(aros_warn_flags)
3299 AC_SUBST(aros_nowarn_flags)
3300 AC_SUBST(aros_config_cppflags)
3301 AC_SUBST(aros_config_cflags)
3302 AC_SUBST(aros_config_cxxflags)
3303 AC_SUBST(aros_config_aflags)
3304 AC_SUBST(aros_config_ldflags)
3306 AC_SUBST(aros_kernel_sysroot)
3307 AC_SUBST(aros_kernel_cppflags)
3308 AC_SUBST(aros_kernel_cflags)
3309 AC_SUBST(aros_kernel_includes)
3310 AC_SUBST(aros_kernel_objcflags)
3311 AC_SUBST(aros_kernel_ldflags)
3312 AC_SUBST(aros_debug_cppflags)
3313 AC_SUBST(aros_debug_cflags)
3314 AC_SUBST(aros_debug_cxxflags)
3315 AC_SUBST(aros_debug_aflags)
3316 AC_SUBST(aros_debug_ldflags)
3317 AC_SUBST(aros_target_genmap)
3318 AC_SUBST(aros_target_strip_flags)
3319 AC_SUBST(aros_config_lto)
3320 AC_SUBST(aros_config_coverage)
3321 AC_SUBST(aros_optimization_cflags)
3322 AC_SUBST(aros_kernel_isa_flags)
3323 AC_SUBST(aros_isa_extra)
3324 AC_SUBST(aros_isa_flags)
3326 AC_SUBST(crosstools_target)
3327 AC_SUBST(crosstools_cxx_target)
3329 AC_SUBST(use_libatomic)
3331 AC_SUBST(pci_hidd_target)
3333 AC_SUBST(aros_nominal_width)
3334 AC_SUBST(aros_nominal_height)
3335 AC_SUBST(aros_nominal_depth)
3337 # Native version related
3338 AC_SUBST(aros_serial_debug)
3339 AC_SUBST(PLATFORM_EXECSMP)
3340 AC_SUBST(ENABLE_EXECSMP)
3342 # MMU related
3343 AC_SUBST(aros_enable_mmu)
3345 # Bootloader related
3346 AC_SUBST(target_grub2_version)
3348 # Unix/Hosted version related
3349 AC_SUBST(aros_nesting_supervisor)
3351 # ARM default GCC target related
3352 AC_SUBST(gcc_default_cpu)
3353 AC_SUBST(gcc_default_cpu_tune)
3354 AC_SUBST(gcc_default_fpu)
3355 AC_SUBST(gcc_default_float_abi)
3356 AC_SUBST(gcc_default_mode)
3358 # Palm native version related
3359 AC_SUBST(aros_palm_debug_hack)
3361 # Apple iOS related
3362 AC_SUBST(aros_ios_platform)
3363 AC_SUBST(aros_ios_version)
3364 AC_SUBST(aros_ios_sdk)
3366 # Android related
3367 AC_SUBST(ant)
3368 AC_SUBST(android_tool)
3369 AC_SUBST(aros_android_level)
3370 AC_SUBST(aros_android_antapk)
3372 # Debug related
3373 AC_SUBST(aros_debug)
3374 AC_SUBST(aros_mungwall_debug)
3375 AC_SUBST(aros_stack_debug)
3376 AC_SUBST(aros_modules_debug)
3378 # Collect-aros stuff: "-ius" to ignore undefined symbols
3379 AC_SUBST(ignore_undefined_symbols)
3381 # C compiler related
3382 AC_SUBST(gcc_target_cpu)
3383 AC_SUBST(target_binutils_version)
3384 AC_SUBST(target_gcc_version)
3385 AC_SUBST(target_llvm_version)
3387 #ObjC compiler related
3388 AC_SUBST(objc_target)
3390 #Java related
3391 AC_SUBST(java_target)
3393 # DBUS related
3394 AC_SUBST(ENABLE_DBUS)
3395 AC_SUBST(DBUS_CFLAGS)
3396 AC_SUBST(DBUS_LIBFLAGS)
3397 AC_SUBST(KERNEL_DBUS_KOBJ)
3398 AC_SUBST(KERNEL_DBUS_INCLUDES)
3400 #X11 related
3401 AC_SUBST(ENABLE_X11)
3402 AC_SUBST(DO_XSHM_SUPPORT)
3403 AC_SUBST(DO_VIDMODE_SUPPORT)
3405 AC_SUBST(aros_host_x11_cflags)
3406 AC_SUBST(aros_host_x11_ldflags)
3408 #SDL related
3409 AC_SUBST(aros_host_sdl_cflags)
3410 AC_SUBST(aros_host_sdl_libs)
3412 # USB3.0 code
3413 AC_SUBST(aros_usb30_code)
3415 dnl Prepare for output, make up all the generated patches
3416 case "$aros_flavour" in
3417 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
3418                 aros_flavour="emulation" ;;
3419 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
3420                 aros_flavour="emulation" ;;
3421 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
3422                 aros_flavour="standalone";;
3423 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3424                 aros_flavour="standalone";;
3425 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
3426                 aros_flavour="native" ;;
3427 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
3428                 aros_flavour="native" ;;
3429 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
3430                 aros_flavour="linklib" ;;
3431 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3432                 aros_flavour="palmnative" ;;
3433 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3434                 aros_flavour="mac68knative" ;;
3435 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3436                 aros_flavour="ppcnative" ;;
3437 esac
3439 if test ! -d ${aros_inc_dir} ; then
3440     ${MKDIR} ${aros_inc_dir}
3442 if test ! -d ${aros_geninc_dir} ; then
3443     ${MKDIR} ${aros_geninc_dir}
3445 if test ! -d ${aros_hostcfg_dir} ; then
3446     ${MKDIR} ${aros_hostcfg_dir}
3448 if test ! -d ${aros_targetcfg_dir} ; then
3449     ${MKDIR} ${aros_targetcfg_dir}
3451 if test ! -d ${aros_tools_dir} ; then
3452     ${MKDIR} ${aros_tools_dir}
3454 if test ! -d ${aros_scripts_dir} ; then
3455     ${MKDIR} ${aros_scripts_dir}
3458 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
3460 # Generic build tools (metamake, etc)
3461 AC_CONFIG_COMMANDS([genmf-executable-support],
3462     [
3463         chmod a+x ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname
3464         chmod a+x ${aros_tools_dir}/genmf.py
3465     ],
3466     [
3467         AROS_CROSSTOOLSDIR=${AROS_CROSSTOOLSDIR}
3468         aros_tools_dir=${aros_tools_dir}
3469     ]
3471 AC_CONFIG_FILES(
3472     Makefile
3473     config/make.cfg
3474     ${aros_inc_dir}/config.h:config/config.h.in
3475     ${aros_geninc_dir}/config.h:config/config.h.in
3476     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
3477     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
3478     ${aros_targetcfg_dir}/build.cfg:config/build.cfg.in
3479     mmake.config
3480     compiler/include/geninc.cfg:compiler/include/geninc.cfg.in
3481     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
3482     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
3483     ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname:scripts/uname.in
3484     tools/collect-aros/env.h
3487 # Binutils
3488 AC_CONFIG_COMMANDS([binutils-support],
3489     [
3490         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3491         mkdir -p $prefix
3492         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3494         chmod a+x ${prefix2}-ld
3496         ln -sf $orig_target_as$aros_host_exe_suffix      ${prefix2}-as$aros_host_exe_suffix
3497         ln -sf $orig_target_nm$aros_host_exe_suffix      ${prefix2}-nm$aros_host_exe_suffix
3498         ln -sf $orig_target_ar$aros_host_exe_suffix      ${prefix2}-ar$aros_host_exe_suffix
3499         ln -sf $orig_target_ranlib$aros_host_exe_suffix  ${prefix2}-ranlib$aros_host_exe_suffix
3500         ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
3501         ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
3502         ln -sf $orig_target_strip$aros_host_exe_suffix   ${prefix2}-strip$aros_host_exe_suffix
3503     ],
3504     [
3505         aros_host_exe_suffix=${aros_host_exe_suffix}
3506         aros_tools_dir=${aros_tools_dir}
3507         aros_target_cpu=${aros_target_cpu}
3508         aros_target_arch=${aros_target_arch}
3509         aros_target_suffix=${aros_target_suffix}
3510         orig_target_nm=${orig_target_nm}
3511         orig_target_as=${orig_target_as}
3512         orig_target_ar=${orig_target_ar}
3513         orig_target_ranlib=${orig_target_ranlib}
3514         orig_target_objdump=${orig_target_objdump}
3515         orig_target_objcopy=${orig_target_objcopy}
3516         orig_target_strip=${orig_target_strip}
3517         aros_kernel_ld=${aros_kernel_ld}
3518     ]
3520 if test "${use_ld_wrapper}" = "yes"; then
3521     AC_CONFIG_FILES(
3522         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}:scripts/aros-ld.in
3523     )
3525 # Bare Elf support script and spec
3526 if test "${use_kernel_cc_wrapper}" = "yes"; then
3527     AC_CONFIG_COMMANDS([elf-compiler-support],
3528         [
3529             prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3530             mkdir -p $prefix
3531             prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
3533             chmod a+x ${prefix2}-gcc
3535             ln -sf $aros_kernel_ld$aros_host_exe_suffix         ${prefix2}-ld$aros_host_exe_suffix
3536         ],
3537         [
3538             aros_host_exe_suffix=${aros_host_exe_suffix}
3539             aros_tools_dir=${aros_tools_dir}
3540             aros_target_cpu=${aros_target_cpu}
3541             aros_target_arch=${aros_target_arch}
3542             aros_target_suffix=${aros_target_suffix}
3543             aros_kernel_ld=${aros_kernel_ld}
3544         ]
3545     )
3546     AC_CONFIG_FILES(
3547         ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
3548         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
3549     )
3552 # Host compiler support scripts and spec
3553 if test "${aros_target_toolchain}" = "no"; then
3554     AC_CONFIG_COMMANDS([host-compiler-wrapper-support],
3555         [
3556             prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3557             mkdir -p $prefix
3558             prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3560             chmod a+x ${prefix2}-${toolchain_c_compiler} ${prefix2}-${toolchain_cxx_compiler} ${prefix2}-${toolchain_cpp_preprocessor}
3561         ],
3562         [
3563             aros_host_exe_suffix=${aros_host_exe_suffix}
3564             aros_tools_dir=${aros_tools_dir}
3565             aros_target_cpu=${aros_target_cpu}
3566             aros_target_arch=${aros_target_arch}
3567             aros_target_suffix=${aros_target_suffix}
3568         ]
3569     )
3570     AC_CONFIG_FILES(
3571         ${aros_targetcfg_dir}/specs:config/specs.in
3572         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cpp_preprocessor}:scripts/aros-${toolchain_cpp_preprocessor}.in
3573         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_c_compiler}:scripts/aros-${toolchain_c_compiler}.in
3574         ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cxx_compiler}:scripts/aros-${toolchain_cxx_compiler}.in
3575     )
3578 # Android support
3579 if test "$aros_target_variant" == "android"; then
3580     AC_CONFIG_FILES(${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in)
3583 # cmake helper
3584 AC_CONFIG_FILES(${aros_targetcfg_dir}/conf.cmake:config/conf.cmake.in)
3586 AC_OUTPUT
3588 dnl This is in order to not define SHARED_CFLAGS sometimes
3589 dnl We don't always do aros_shared_ar, aros_shared_cflags
3591 #XXX compatability...
3592 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
3594 if test -n "$aros_shared_cflags" ; then
3595     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
3596     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg