1 dnl Copyright © 1997-2011, The AROS Development Team. All rights reserved.
4 dnl Desc: Autoconf source for configuration file
7 # Note: After file changes, generate configure anew and commit _both_ files.
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 # ------------------------------------------------------------------------
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.
25 # The AROS target is slightly different to the normal GNU style
26 # format. We don't have the middle part, and we reverse the order
27 # of the $(CPU) and $(OS) bits.
29 # Don't strip the version of the target yet, it might be
30 # useful on some systems.
32 AC_MSG_CHECKING([for AROS style target])
34 if test "$target" = "NONE" ; then
35 target=$host_os-$host_cpu
37 if test "$target" = "" ; then
38 target=$host_os-$host_cpu
41 AC_MSG_RESULT($target)
43 if test "$host_os" = "mingw32" ; then
47 #don't know where else to put this...
48 AC_MSG_CHECKING([building AROS in])
49 AROS_BUILDDIR=`${PWDCMD-pwd}`
50 AROS_BUILDDIR_UNIX=${PWD}
51 AC_MSG_RESULT($AROS_BUILDDIR)
53 AC_MSG_CHECKING([AROS source in])
54 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
56 AC_MSG_RESULT($SRCDIR)
58 # Parse the target field into something useful.
60 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
61 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
64 dnl --------------------------------------------------------------------
65 dnl Set the default Workbench resolution
66 dnl --------------------------------------------------------------------
67 aros_default_wbwidth=800
68 aros_default_wbheight=600
69 aros_default_wbdepth=4
71 dnl --------------------------------------------------------------------
72 dnl Host Configuration Section
73 dnl --------------------------------------------------------------------
75 dnl The idea here is to find out all the information we need about the
76 dnl host. This means things like tools for building directory structures,
77 dnl copying files around and the like.
79 # The first step is to find the host binaries.
80 # Check for a compiler.
86 # Check for a compatible awk
87 AC_CHECK_PROGS(AWK,[gawk nawk])
88 AROS_REQUIRED(gawk,$AWK)
89 AROS_PROG(MMAKE,mmake)
91 # Perform some default variable assignments. Note all of these will be
92 # Regenerated from the script, so there is no need to cache them.
97 AROS_TOOL_CCPATH(aros_host_ld,ld)
98 AROS_REQUIRED(ld,$aros_host_ld)
100 aros_host_cflags=$CFLAGS
101 aros_host_cxxflags=$CXXFLAGS
102 aros_host_ldflags=$LDFLAGS
103 aros_host_debug="-g -O0"
104 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
105 aros_host_mkargs="--no-print-directory"
106 aros_host_exe_suffix="$EXEEXT"
107 aros_host_lib_suffix=""
109 # Ignore all compliance, AROS ROMs = 0
110 # KickStart v1.0 = 30
111 # KickStart v1.3 = 34
112 # KickStart v2.0 = 37
113 # KickStart v3.0 = 39
114 # KickStart v3.1 = 40
116 aros_amigaos_compliance=0
118 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
119 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
120 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
121 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
123 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
124 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
126 case "$aros_host_cc" in
128 aros_host_cc_pipe="-pipe"
138 aros_kernel_cc_includes=""
139 aros_target_cc_includes=""
141 # ----------------------------------------------------------------------------------------
142 # Host-specific defaults
144 # This is the main host configuration section. It is where the host
145 # can change the values of any variables it needs to change. We do
146 # not look at anything that compiles to the target yet, we'll get
151 aros_host_arch="aros"
152 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
158 aros_host_cpu="x86_64"
164 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
165 aros_host_cpu="$host_cpu"
171 aros_host_arch="linux"
172 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
173 android_build_os="linux-x86"
174 android_tool="android"
175 default_android_sdk="/opt/android-sdk-linux_x86"
181 aros_host_cpu="x86_64"
193 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
194 aros_host_cpu="$host_cpu"
200 aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
201 aros_host_make="gmake"
202 aros_host_arch="freebsd"
205 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
207 dnl FreeBSD 5.x (and later) has changed the default object format.
208 dnl The double [[]] is necessary to get around m4's quoting rules.
211 aros_object_format="elf_i386"
215 aros_object_format="elf_i386_fbsd"
222 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
223 aros_host_arch="darwin"
224 android_build_os="darwin-x86"
225 android_tool="android"
226 default_android_sdk="/android-sdk-mac_x86"
232 aros_host_cpu="x86_64"
238 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
239 aros_host_cpu="$host_cpu"
243 aros_host_ldflags="$aros_host_ldflags -liconv"
248 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
249 aros_host_make="gmake"
250 aros_host_arch="dragonfly"
256 aros_host_cpu="x86_64"
259 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
260 aros_host_cpu="$host_cpu"
266 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
267 aros_host_make="gmake"
268 aros_host_arch="netbsd"
277 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
278 aros_host_cpu="$host_cpu"
281 aros_host_lib_suffix=".0.0"
285 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
286 aros_host_make="gmake"
287 aros_host_arch="openbsd"
293 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
294 aros_host_cpu="$host_cpu"
300 aros_host_arch="solaris"
301 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
307 aros_host_cpu="sparc"
310 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
311 aros_host_cpu="$host_cpu"
317 aros_host_arch="morphos"
322 aros_host_arch="amiga"
327 TOUCH="/gg/bin/touch"
336 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
337 aros_host_cpu="$host_cpu"
343 aros_host_arch="cygwin"
344 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
345 android_build_os="windows"
346 android_tool="android.bat"
347 default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
354 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
355 aros_host_cpu="$host_cpu"
361 aros_host_arch="mingw32"
362 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
363 android_build_os="windows"
364 android_tool="android.bat"
365 default_android_sdk="/c/android-sdk-windows-1.6_r1"
369 dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
370 dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
371 dnl Here we attempt to detect Windows home platform by asking gcc about its target.
372 dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
374 AC_MSG_CHECKING([for Windows native gcc target])
375 host_cpu=`gcc -dumpmachine`
376 AC_MSG_RESULT($host_cpu)
387 aros_host_cpu="x86_64"
388 dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
389 dnl directory, so we have to add it explicitly here.
390 aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
394 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
395 aros_host_cpu="$host_cpu"
400 AC_MSG_ERROR([Unsupported host architecture $host])
404 AROS_PROG(aros_host_ar,[ar],[cr])
405 AROS_REQUIRED(ar,$aros_host_ar)
406 AROS_PROG(aros_host_ranlib,ranlib)
407 AROS_REQUIRED(ranlib,$aros_host_ranlib)
408 AROS_PROG(aros_host_strip,strip)
409 AROS_REQUIRED(strip,$aros_host_strip)
411 AROS_PROG(RM,[rm],[-rf])
412 AROS_REQUIRED(rm,$RM)
414 AROS_REQUIRED(cp,$CP)
416 AROS_REQUIRED(mv,$MV)
417 AROS_PROG(ECHO,[echo])
418 AROS_REQUIRED(echo,$ECHO)
419 AROS_PROG(MKDIR,[mkdir],[-p])
420 AROS_REQUIRED(mkdir,$MKDIR)
421 AROS_PROG(TOUCH,[touch])
422 AROS_REQUIRED(touch,$TOUCH)
423 AROS_PROG(SORT,[sort])
424 AROS_REQUIRED(sort,$SORT)
425 AROS_PROG(UNIQ,[uniq])
426 AROS_REQUIRED(uniq,$UNIQ)
427 AROS_PROG(NOP,[true])
428 AROS_REQUIRED(true,$NOP)
430 AROS_REQUIRED(cat,$CAT)
431 AROS_PROG(BISON,[bison])
432 AROS_REQUIRED(bison,$BISON)
433 AROS_PROG(FLEX,[flex])
434 AROS_REQUIRED(flex,$FLEX)
435 AROS_PROG(PNGTOPNM,[pngtopnm])
436 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
437 AROS_PROG(PPMTOILBM,[ppmtoilbm])
438 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
440 AROS_REQUIRED(sed,$SED)
441 AROS_PROG(CHMOD,[chmod])
442 AROS_REQUIRED(chmod,$CHMOD)
443 AROS_PROG(PATCH,[patch])
444 AROS_REQUIRED(patch,$PATCH)
453 dnl ---------------------------------------------------------------------------
454 dnl Look for things about the host system, good for hosted targets.
455 dnl ---------------------------------------------------------------------------
457 # Check for some includes for the X11 HIDD and the kernel
458 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
459 sys/mmap.h sys/mman.h sysexits.h \
460 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
463 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
480 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
482 # Look for some functions
483 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
484 clone kse_create rfork_thread thr_create sa_register \
485 getcontext makecontext setcontext sigaltstack swapcontext])
490 dnl --------------------------------------------------------------------
491 dnl Target Configuration Section
492 dnl --------------------------------------------------------------------
494 dnl The target configuration section is responsible for setting up all
495 dnl the paths for includes, and tools required to build AROS to some
496 dnl particular target.
498 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
499 aros_config_aflags="-Wall -x assembler-with-cpp -c"
500 aros_config_ldflags=""
502 aros_shared_default=yes
504 aros_shared_cflags="-fPIC"
505 aros_shared_aflags=""
506 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
507 aros_kernel_ldflags="-Wl,-rpath,./lib"
509 aros_kernel_ar_flags="cr"
510 aros_target_ar_flags="cr"
511 aros_target_nm_flags="-C -ul"
512 aros_target_strip_flags="--strip-unneeded -R.comment"
517 aros_target_genmap="-Wl,-Map -Xlinker"
519 # Native flavour stuff
520 aros_serial_debug="0"
522 # Palm native flavour stuff
523 aros_palm_debug_hack="0"
526 aros_nesting_supervisor="0"
528 # Collect-aros stuff: "-ius" to ignore undefined symbols
529 ignore_undefined_symbols=""
531 # Check for X11 by default
534 # Leave at 'none' for no external toolchain
535 kernel_tool_prefix="none"
537 #-----------------------------------------------------------------------------
540 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
541 # it switched on by default, and we use the host compiler, so it compiles AROS
542 # code with this enabled resulting in link failures as we don't have support
545 # We use two methods to disable it. For the host compiler (used to compile
546 # some hosted modules), we test to see if the compiler supports stack
547 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
548 # work on all platforms.
550 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
551 # (this is done unconditionally, as it should have no effect on compilers
552 # without the stack protection feature). This may be specific to the way that
553 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
554 # strong enough to disable it in a generic way though, so we'll live with it
555 # until another vendor ships GCC with it enabled in a different way, and deal
559 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
560 save_cflags="$CFLAGS"
561 CFLAGS="$CFLAGS -fno-stack-protector"
562 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
563 AC_MSG_RESULT($use_no_stack_protector)
564 if test "x-$use_no_stack_protector" = "x-yes" ; then
565 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
567 CFLAGS="$save_cflags"
569 #-----------------------------------------------------------------------------
571 # Disable pointer-signedness warnings if the compiler recognises the option
572 # (this only works for the host compiler at the moment)
574 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
575 save_cflags="$CFLAGS"
576 CFLAGS="$CFLAGS -Wno-pointer-sign"
577 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
578 AC_MSG_RESULT($use_no_sign_warning)
579 if test "x-$use_no_sign_warning" = "x-yes" ; then
580 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
582 CFLAGS="$save_cflags"
584 #-----------------------------------------------------------------------------
586 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
588 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
589 save_cflags="$CFLAGS"
590 CFLAGS="$CFLAGS -fgnu89-inline"
591 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
592 AC_MSG_RESULT($use_gnu89_inline)
593 if test "x-$use_gnu89_inline" = "x-yes" ; then
594 gnu89_inline="-fgnu89-inline"
596 CFLAGS="$save_cflags"
598 #-----------------------------------------------------------------------------
600 AC_MSG_CHECKING([for type of build])
601 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")
603 if test "$build_type" = "nightly"; then
604 build_type_string="NIGHTLY"
605 elif test "$build_type" = "snapshot"; then
606 build_type_string="SNAPSHOT"
607 elif test "$build_type" = "milestone"; then
608 build_type_string="MILESTONE"
609 elif test "$build_type" = "release"; then
610 build_type_string="RELEASE"
612 build_type_string="PERSONAL"
613 build_type="personal"
616 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
618 AC_MSG_RESULT($build_type)
620 #-----------------------------------------------------------------------------
621 all_debug_types="messages stack modules mungwall symbols"
623 AC_MSG_CHECKING([which debug types to enable])
624 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)]),
625 debug="$enableval",debug="")
627 if test "$debug" = "" -o "$debug" = "no"; then
629 elif test "$debug" = "yes"; then
633 if test "$debug" = "all" ; then
634 debug="messages stack modules symbols"
635 for d in $all_debug_types; do
636 export aros_${d}_debug="1"
639 for d in $all_debug_types; do
640 export aros_${d}_debug="0"
644 if test "$debug" != "none"; then
645 debug=`echo $debug | sed s/,/\ /g`
648 for d2 in $all_debug_types; do
649 if test "$d2" = "$d"; then
654 if test "$found" = "0"; then
655 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
657 export aros_${d}_debug="1"
661 AC_MSG_RESULT($debug)
663 if test "$aros_messages_debug" = "1"; then
664 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
666 aros_messages_debug=""
668 if test "$aros_symbols_debug" = "1"; then
669 aros_symbols_debug="-g"
671 aros_symbols_debug=""
674 # These are the flags to pass when compiling debugged programs
675 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
677 aros_debug_ldflags="$aros_symbols_debug"
679 #-----------------------------------------------------------------------------
680 # Checking if we should build crosstools..
681 AC_MSG_CHECKING([whether to build crosstools])
682 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="yes")
683 AC_MSG_RESULT($crosstools)
685 #-----------------------------------------------------------------------------
686 # Checking for distcc and ccache.
688 # Always apply the transforms in this particular order. Basically you should
689 # always run 'ccache distcc compiler' in that order for the best performance.
691 AC_MSG_CHECKING([whether to enable distcc])
692 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
693 if test "$distcc" != "" -a "$distcc" != "no"; then
694 # AC_CHECK_PROG will print out the result in this case
695 AC_PATH_PROG(DISTCC,[distcc],distcc,)
700 AC_MSG_CHECKING([whether to enable ccache])
701 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
702 if test "$ccache" != "" -a "$ccache" != "no"; then
703 # AC_CHECK_PROG will print out the result in this case
704 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
709 #-----------------------------------------------------------------------------
710 AC_MSG_CHECKING([what specific host gcc version to use])
711 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-kernel-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),kernel_tool_version="$withval",kernel_tool_version="default")
712 AC_MSG_RESULT($kernel_tool_version)
714 #-----------------------------------------------------------------------------
715 AC_MSG_CHECKING([what specific target gcc version to use])
716 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Use host gcc-VERSION for building AROS]),target_tool_version="$withval",target_tool_version="default")
717 AC_MSG_RESULT($target_tool_version)
719 #-----------------------------------------------------------------------------
720 AC_MSG_CHECKING([what optimization flags to use])
721 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
722 if test "$optimization" = "unknown"; then
723 dnl default is -O2 for normal builds, -O0 for debug builds
724 if test "$debug" != "none"; then
730 aros_config_cflags="$aros_config_cflags $optimization"
731 AC_MSG_RESULT($optimization)
733 #-----------------------------------------------------------------------------
734 AC_MSG_CHECKING([what paranoia flags to use])
735 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
736 if test "$paranoia_flags" = "default"; then
738 else if test "$paranoia_flags" = "yes"; then
739 paranoia_flags="-Wall -Werror"
741 AC_MSG_RESULT($paranoia_flags)
742 aros_config_cflags="$aros_config_cflags $paranoia_flags"
744 #-----------------------------------------------------------------------------
745 AC_MSG_CHECKING([what target variant to enable])
746 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
747 if test "$target_variant" = ""; then
748 aros_target_variant=""
749 aros_target_suffix=""
752 aros_target_variant="$target_variant"
753 aros_target_suffix="-$target_variant"
755 AC_MSG_RESULT($enableval)
757 #-----------------------------------------------------------------------------
758 # Target-specific defaults. You can override then on a per-target basis.
760 # Bootloader name. Currently used by PC target.
761 target_bootloader="none"
763 #-----------------------------------------------------------------------------
764 # Additional options for some specific targets
766 case "$aros_target_variant" in
768 AC_MSG_CHECKING([XCode path])
769 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")
770 AC_MSG_RESULT($aros_xcode_path)
772 AC_MSG_CHECKING([what iOS SDK version to use])
773 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")
774 AC_MSG_RESULT($aros_sdk_version)
779 AC_MSG_CHECKING([Android SDK path])
780 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)
781 AC_MSG_RESULT($aros_android_sdk)
783 AC_MSG_CHECKING([Android NDK path])
784 AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
785 AC_MSG_RESULT($aros_android_ndk)
787 AC_MSG_CHECKING([what Android SDK version to use])
788 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")
789 AC_MSG_RESULT($aros_sdk_version)
791 if test "$aros_android_ndk" != "none"; then
792 AC_MSG_CHECKING([what Android NDK version to use])
793 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")
794 AC_MSG_RESULT($aros_ndk_version)
797 export PATH="$aros_android_sdk/tools:$PATH"
798 AC_PATH_PROG(android_tool, $android_tool)
799 AROS_REQUIRED(android,$android_tool)
801 aros_android_level=android-$aros_sdk_version
802 if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
803 echo "Platform $aros_android_level is not installed in your SDK"
804 echo "Use --with-sdk-version=<API level number> to select another platform version"
805 echo "You can check what plaform versions are installed in your SDK"
806 echo "by examining contents of $aros_android_sdk/platforms directory"
807 AC_MSG_ERROR([Android platform $aros_android_level is not installed])
810 AC_PATH_PROG(ant, ant)
811 if test "$ant" = ""; then
812 AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
815 dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
816 if test "$host_os" = "mingw32"; then
817 android_tool="cmd //c $android_tool"
823 #-----------------------------------------------------------------------------
825 # This is the target configuration switch.
828 aros_target_arch="linux"
829 aros_target_family="unix"
830 case "$target_cpu" in
832 aros_target_cpu="m68k"
833 aros_object_format="m68kelf"
834 aros_flavour="emulcompat"
835 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
836 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
837 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
838 gcc_target_cpu="mc68000"
841 aros_target_cpu="i386"
842 aros_object_format="elf_i386"
843 aros_flavour="emulation"
844 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
845 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
846 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
847 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
848 aros_config_ldflags="-m32 -march=i486"
849 aros_kernel_ldflags="-melf_i386"
850 aros_default_wbdepth=8
851 gcc_target_cpu="i386"
852 pci_hidd_target="hidd-pci-linux"
853 android_tool_dir_prefix="x86"
854 android_tool_prefix="i686-android-linux"
855 android_ndk_arch="x86"
858 aros_target_cpu="x86_64"
859 aros_object_format="elf_x86_64"
860 aros_flavour="emulation"
861 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
862 aros_config_cflags="$aros_config_cflags -mno-red-zone -fno-omit-frame-pointer"
863 aros_default_wbdepth=8
864 pci_hidd_target="hidd-pci-linux"
867 aros_target_cpu="ppc"
868 aros_object_format="elf32ppc"
869 aros_flavour="emulation"
870 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
871 aros_default_wbdepth=8
875 # Same as powerpc, but I need this for the nightly build to work again.
876 # Actually, the nightly should be made working with powerpc target.
877 # That just was too much work for the moment, another week or two.
879 aros_target_cpu="ppc"
880 aros_object_format="elf32ppc"
881 aros_flavour="emulation"
882 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
883 aros_default_wbdepth=8
887 aros_target_cpu="arm"
888 aros_object_format="armelf_linux_eabi"
889 aros_flavour="emulation"
890 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
892 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
893 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
894 aros_arch_libs="-laeabi"
895 android_tool_dir_prefix="arm-linux-androideabi"
896 android_tool_prefix="arm-linux-androideabi"
897 android_ndk_arch="arm"
900 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
903 case "$aros_target_variant" in
906 dnl Not all Linux CPUs are supported by Android
907 if test "$android_ndk_arch" = ""; then
908 AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
911 aros_default_wbwidth=320
912 aros_default_wbheight=480
913 if test "$aros_android_ndk" = "none"; then
914 dnl Use standalone toolchain, don't adjust paths
915 aros_kernel_cflags="-mandroid"
916 aros_kernel_ldflags="-mandroid"
919 export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
920 aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
921 aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
922 aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
923 CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
924 aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
927 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
928 dnl in order not to fill mmakefiles with garbage
929 x11_hidd_target=kernel-hidd-androidgfx-kobj
930 # Disable implicit PIC mode
931 aros_kernel_cflags="$aros_kernel_cflags -fno-pic"
932 aros_target_cflags="$aros_target_cflags -fno-pic"
933 kernel_tool_prefix="$android_tool_prefix-"
939 aros_target_arch="pc"
940 aros_shared_default="no"
941 target_bootloader="grub2"
942 case "$target_cpu" in
944 aros_target_cpu="i386"
946 dnl If somebody hasn't already set the target object
947 dnl format, then use this value. Mostly to support
948 dnl FreeBSD cross-compilation.
949 dnl TODO: Remove when we always use our compiler.
951 if test "$aros_object_format" = "" ; then
952 aros_object_format="elf_i386"
954 aros_flavour="standalone"
955 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
956 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
957 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
958 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
959 aros_config_ldflags="-m32 -march=i486"
960 aros_kernel_ldflags="-melf_i386"
961 aros_default_wbwidth=640
962 aros_default_wbheight=480
963 gcc_target_cpu="i386"
966 aros_target_cpu="x86_64"
968 if test "$aros_object_format" = "" ; then
969 aros_object_format="elf_x86_64"
971 aros_flavour="standalone"
972 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
973 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
974 aros_kernel_ldflags=""
975 aros_default_wbwidth=640
976 aros_default_wbheight=480
979 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
985 aros_target_arch="prep"
986 aros_shared_default="no"
987 aros_target_cpu="ppc"
988 aros_object_format="elf32ppc"
989 aros_flavour="ppcnative"
990 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
991 aros_kernel_ldflags=""
992 aros_default_wbwidth=640
993 aros_default_wbheight=480
998 aros_target_arch="freebsd"
999 aros_target_family="unix"
1000 aros_target_cpu="i386"
1001 aros_flavour="emulation"
1002 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1003 gcc_target_cpu="i386"
1005 aros_target_strip_flags="-x"
1009 aros_target_arch="darwin"
1010 aros_target_family="unix"
1011 aros_flavour="emulation"
1012 case "$target_cpu" in
1014 aros_ios_platform="iPhoneSimulator"
1015 aros_target_cpu="i386"
1016 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1017 aros_kernel_ldflags=""
1018 aros_macosx_version="10.4"
1019 aros_default_wbdepth=8
1020 gcc_target_cpu="i386"
1021 aros_object_format="elf_i386"
1022 aros_kernel_ar_flags="-cr"
1023 aros_target_strip_flags="-x"
1024 kernel_tool_flags="-m32"
1027 aros_target_cpu="x86_64"
1028 aros_object_format="elf_x86_64"
1029 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1030 aros_macosx_version="10.6"
1031 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1032 aros_kernel_cflags="-m64"
1033 aros_kernel_ldflags="-m64"
1034 aros_target_cflags="-mcmodel=large"
1035 aros_default_wbdepth=8
1037 aros_kernel_ar_flags="-cr"
1039 aros_kernel_ranlib="ranlib"
1042 aros_target_cpu="ppc"
1043 aros_object_format="elf32ppc"
1044 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1045 aros_kernel_ldflags=""
1046 aros_macosx_version="10.0"
1047 aros_default_wbdepth=8
1048 gcc_target_cpu="ppc"
1050 aros_kernel_ar_flags="-cr"
1051 aros_kernel_ld="ld -arch ppc"
1052 aros_kernel_ranlib="ranlib -arch ppc"
1053 kernel_tool_prefix="powerpc-apple-darwin10-"
1056 aros_ios_platform="iPhoneOS"
1057 aros_target_cpu="arm"
1058 aros_object_format="armelf_linux_eabi"
1059 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1060 aros_arch_libs="-laeabi"
1061 aros_default_wbdepth=8
1062 gcc_target_cpu="arm"
1064 aros_kernel_ar_flags="-cr"
1065 aros_kernel_ld="ld -arch arm"
1066 aros_kernel_ranlib="ranlib -arch arm"
1067 kernel_tool_prefix="arm-apple-darwin10-"
1068 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1071 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1074 case "$aros_target_variant" in
1076 aros_ios_version="3.0"
1077 aros_default_wbwidth=320
1078 aros_default_wbheight=480
1079 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1080 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1081 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1083 # This is here because it may depend on iOS or SDK version
1084 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1085 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1086 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1089 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1090 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1096 aros_target_arch="dragonfly"
1097 aros_target_family="unix"
1098 aros_flavour="emulation"
1099 case "$target_cpu" in
1101 aros_target_cpu="i386"
1102 aros_object_format="elf_i386"
1103 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1106 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1107 aros_target_cpu="x86_64"
1108 aros_object_format="elf_x86_64"
1109 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1112 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1118 aros_target_arch="netbsd"
1119 aros_target_family="unix"
1120 case "$target_cpu" in
1122 aros_target_cpu="m68k"
1123 aros_object_format="m68kelf"
1124 aros_flavour="emulcompat"
1125 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1126 gcc_target_cpu="mc68000"
1129 aros_target_cpu="i386"
1130 aros_object_format="elf_i386"
1131 aros_flavour="emulation"
1132 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1133 aros_default_wbdepth=8
1134 gcc_target_cpu="i386"
1137 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1140 aros_target_genmap="-Wl,-M -Xlinker >"
1141 aros_flavour="emulation"
1142 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1146 aros_target_arch="openbsd"
1147 aros_target_family="unix"
1148 case "$target_cpu" in
1150 aros_target_cpu="i386"
1151 aros_object_format="elf_i386"
1152 aros_flavour="emulation"
1153 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1154 gcc_target_cpu="i386"
1157 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1160 aros_target_genmap="-Wl,-M -Xlinker >"
1161 aros_target_nm_flags="-u"
1162 aros_flavour="emulation"
1166 aros_target_arch="solaris"
1167 aros_target_family="unix"
1168 case "$target_cpu" in
1170 aros_target_cpu="i386"
1171 aros_object_format="elf_i386"
1172 aros_flavour="emulation"
1173 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1174 aros_default_wbdepth=8
1175 gcc_target_cpu="i386"
1178 aros_target_cpu="sparc"
1179 aros_object_format="elf_sparc"
1180 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1181 gcc_target_cpu="sparc"
1184 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1187 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1188 aros_flavour="emulation"
1192 aros_target_arch="morphos"
1193 aros_shared_default="no"
1194 aros_target_cpu="ppc"
1195 aros_object_format="elf_ppc"
1196 aros_flavour="nativecompat"
1197 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1198 gcc_target_cpu="ppc"
1202 aros_target_arch="sam440"
1203 aros_shared_default="no"
1204 aros_target_cpu="ppc"
1205 aros_object_format="elf32ppc"
1206 aros_flavour="ppcnative"
1207 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1208 aros_kernel_ldflags=""
1209 aros_default_wbwidth=1024
1210 aros_default_wbheight=768
1211 aros_default_wbdepth=24
1212 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1213 gcc_target_cpu="powerpc"
1217 aros_target_arch="efika"
1218 aros_shared_default="no"
1219 aros_target_cpu="arm"
1220 aros_object_format="armelf_linux_eabi"
1221 aros_flavour="standalone"
1222 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1223 aros_kernel_ldflags=""
1224 aros_default_wbwidth=1024
1225 aros_default_wbheight=600
1226 aros_arch_libs="-laeabi"
1227 gcc_default_cpu="armv7-a"
1228 gcc_default_fpu="vfpv3"
1229 gcc_default_float_abi="softfp"
1230 aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1231 aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1235 aros_target_arch="chrp"
1236 aros_shared_default="no"
1237 aros_target_cpu="ppc"
1238 aros_object_format="elf32ppc"
1239 aros_flavour="ppcnative"
1240 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1241 aros_kernel_ldflags=""
1242 aros_default_wbwidth=640
1243 aros_default_wbheight=480
1244 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1245 gcc_target_cpu="powerpc"
1246 case "$aros_target_variant" in
1248 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1254 aros_target_arch="amiga"
1255 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1256 aros_shared_default="no"
1258 case "$target_cpu" in
1260 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")
1262 aros_target_cpu="m68k"
1263 aros_object_format="m68kelf"
1264 aros_flavour="standcompat"
1265 gcc_target_cpu="m68000"
1266 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -Os"
1267 aros_config_aflags="$aros_config_aflags -${gcc_target_cpu}"
1268 # Needed to get the correct multilib
1269 aros_config_ldflags="-${gcc_target_cpu}"
1270 aros_shared_ldflags="-${gcc_target_cpu}"
1271 aros_kernel_ldflags="-${gcc_target_cpu}"
1272 aros_target_nostdlib_ldflags="-${gcc_target_cpu}"
1273 aros_target_strip_flags="-R.comment --strip-debug"
1274 aros_default_wbwidth=640
1275 aros_default_wbheight=256
1276 aros_default_wbdepth=2
1280 aros_flavour="native"
1281 gcc_target_cpu="ppc"
1284 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1290 aros_target_arch="mingw32"
1291 aros_shared_default="no"
1292 aros_flavour="emulation"
1293 aros_shared_cflags=""
1296 case "$target_cpu" in
1298 aros_target_cpu="i386"
1299 aros_object_format="elf_i386"
1300 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1301 aros_default_wbdepth=8
1302 gcc_target_cpu="i386"
1304 kernel_tool_prefix="i386-mingw32-"
1307 aros_target_cpu="x86_64"
1308 aros_object_format="elf_x86_64"
1309 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1310 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1311 aros_default_wbdepth=8
1312 kernel_tool_prefix="x86_64-w64-mingw32-"
1315 aros_target_cpu="arm"
1316 aros_object_format="armelf_linux_eabi"
1317 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1318 aros_arch_libs="-laeabi"
1319 aros_default_wbdepth=8
1320 gcc_target_cpu="arm"
1321 gcc_default_float_abi="soft"
1322 kernel_tool_prefix="arm-mingw32ce-"
1323 aros_default_wbwidth=160
1324 aros_default_wbheight=160
1327 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1330 if test $host_os = "cygwin"; then
1331 aros_kernel_cflags="-mno-cygwin"
1335 aros_target_arch="pp"
1336 aros_shared_default="no"
1337 case "$target_cpu" in
1339 aros_target_cpu="m68k"
1340 aros_object_format="m68kelf"
1341 aros_flavour="palmnative"
1342 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1343 aros_default_wbwidth=160
1344 aros_default_wbheight=160
1345 aros_default_wbdepth=1
1346 aros_target_ar_flags="cru"
1347 aros_compiler_libs="-lgcc1"
1348 aros_shared_default=no
1349 aros_shared_cflags="-fpic"
1350 aros_shared_aflags=""
1351 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1352 aros_kernel_ldflags="-Wl,-rpath,./lib"
1353 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1354 aros_debug_aflags=""
1355 aros_debug_ldflags="$aros_symbols_debug"
1356 aros_mungwall_debug="0"
1357 aros_modules_debug="0"
1358 gcc_target_cpu="mc68000"
1359 ignore_undefined_symbols="-ius"
1362 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1368 aros_target_arch="mac"
1369 aros_shared_default="no"
1370 case "$target_cpu" in
1372 aros_target_cpu="m68k"
1373 aros_object_format="m68kelf"
1374 aros_flavour="mac68knative"
1375 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1376 aros_default_wbwidth=512
1377 aros_default_wbheight=384
1378 aros_default_wbdepth=8
1379 aros_target_ar_flags="cru"
1380 aros_compiler_libs="-lgcc1"
1381 aros_shared_default=no
1382 aros_shared_cflags="-fpic"
1383 aros_shared_aflags=""
1384 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1385 aros_kernel_ldflags="-Wl,-rpath,./lib"
1386 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug -mc68000"
1387 aros_debug_aflags=""
1388 aros_debug_ldflags="$aros_symbols_debug"
1389 aros_mungwall_debug="0"
1390 aros_modules_debug="0"
1391 gcc_target_cpu="mc68000"
1392 ignore_undefined_symbols="-ius"
1395 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1401 AC_MSG_ERROR([Unsupported target architecture $target])
1405 #-----------------------------------------------------------------------------
1406 AC_MSG_CHECKING([where to install or search for cross tools binaries])
1407 AC_ARG_WITH(crosstools,AC_HELP_STRING([--with-crosstools=DIR],[Where to install or search for cross tools binaries]),with_crosstools=$withval,with_crosstools="default")
1408 if test "$with_crosstools" = "default"; then
1409 AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1411 # Disable building crosstools if we are using an external set - otherwise
1412 # we may attempt to overwrite them if the tools-crosstools target is made!
1414 AROS_CROSSTOOLSDIR="$with_crosstools"
1415 PATH="$AROS_CROSSTOOLSDIR:$PATH"
1417 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1419 AC_MSG_CHECKING([Kernel tool prefix])
1420 AC_ARG_WITH(kernel-tool-prefix,AC_HELP_STRING([--with-kernel-tool-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"],[kernel_tool_prefix="$kernel_tool_prefix"])
1421 AC_MSG_RESULT($kernel_tool_prefix)
1423 target_tool_prefix=${target_cpu}-aros-
1425 # Now process extra architecture-specific options.
1426 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1427 # as well as floating-point ABI.
1428 case "$aros_target_cpu" in
1430 dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1431 if test "$gcc_default_cpu" = ""; then
1432 gcc_default_cpu="armv6"
1434 if test "$gcc_default_fpu" = ""; then
1435 gcc_default_fpu="vfp"
1437 if test "$gcc_default_float_abi" = ""; then
1438 gcc_default_float_abi="softfp"
1441 AC_MSG_CHECKING([Which minimum CPU to use])
1442 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)
1443 AC_MSG_RESULT($aros_gcc_cpu)
1445 AC_MSG_CHECKING([Which minimum FPU to use])
1446 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)
1447 AC_MSG_RESULT($aros_gcc_fpu)
1449 AC_MSG_CHECKING([Which floating point ABI to use])
1450 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)
1451 AC_MSG_RESULT($aros_gcc_float_abi)
1453 aros_config_cflags="$aros_config_cflags -marm -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi -fno-asynchronous-unwind-tables -fno-exceptions"
1454 aros_config_aflags="$aros_config_aflags -marm -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi -fno-asynchronous-unwind-tables -fno-exceptions"
1458 # Some formats need custom ELF specs.
1459 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1460 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1461 elf_specs_in=config/${aros_object_format}-specs.in
1463 elf_specs_in=config/elf-specs.in
1466 AC_MSG_CHECKING([what specific AROS gcc version to use])
1467 AC_ARG_WITH(aros-gcc,AC_HELP_STRING([--with-aros-gcc=VERSION],[Use aros-gcc-VERSION for building AROS]),aros_gcc_version="-$withval",aros_gcc_version="")
1468 AC_MSG_RESULT($aros_gcc_version)
1470 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1471 # Since we override specs, we may need to put these defines there
1472 if test "$gcc_target_cpu" != ""; then
1473 gcc_target_cpu="-D__${gcc_target_cpu}__"
1476 AC_MSG_CHECKING([where to download sourcecode for external ports])
1477 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1478 if test "$with_portssrcdir" = "default"; then
1479 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1481 AROS_PORTSSRCDIR="$with_portssrcdir"
1483 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1485 AC_MSG_CHECKING([which bootloader to use])
1486 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1487 if test "$target_bootloader" = "none"; then
1488 aros_target_bootloader=""
1490 aros_target_bootloader="$target_bootloader"
1492 AC_MSG_RESULT($target_bootloader)
1494 AC_MSG_CHECKING([which icon-set to use])
1495 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1496 if test "$target_iconset" = "default"; then
1497 aros_target_iconset="Gorilla"
1498 target_iconset="default (Gorilla)"
1500 aros_target_iconset="$target_iconset"
1502 AC_MSG_RESULT($target_iconset)
1504 AC_MSG_CHECKING([which GUI Theme to use])
1505 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1506 if test "$target_guitheme" = "default"; then
1507 aros_target_guitheme="Ice"
1509 aros_target_guitheme="$target_guitheme"
1511 AC_MSG_RESULT($aros_target_guitheme)
1513 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1516 if test "$aros_host_cpu" = "$aros_target_cpu" ; then
1517 # If host = target CPU, let's try to use the
1518 # host's toolchains if no others were requested
1519 if test "$kernel_tool_prefix" = "none" ; then
1520 kernel_tool_prefix=""
1526 dnl Native x86-64 Linux toolchain can also produce i386 binaries, given -m32 flag.
1527 if test "$aros_host_cpu" == "x86_64" ; then
1528 if test "$aros_target_cpu" == "i386" ; then
1529 if test "$aros_target_arch" != "mingw32"; then
1531 kernel_tool_prefix=""
1536 dnl Enforce cross-compile if we are on Darwin, but our target is not Darwin.
1537 dnl If target is Darwin disable cross-compiling otherwise kernel
1538 dnl not setup correctly.
1539 if test "$aros_host_arch" == "darwin" ; then
1540 if test "$aros_target_arch" != "darwin" ; then
1544 kernel_tool_prefix=""
1548 dnl The same for MinGW
1549 if test "$aros_host_arch" == "mingw32" ; then
1550 if test "$aros_target_arch" != "mingw32" ; then
1555 #######################################################################
1556 ## Compute what toolchains to use, and their paths ##
1557 #######################################################################
1559 # This takes, as input:
1560 # crosstools {yes,no}
1561 # aros_gcc_version {default,[version]}
1562 # kernel_tool_prefix {none,[some-arch-os-]}
1563 # target_tool_prefix ${target_cpu}-aros-
1566 # aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1567 # Where the 'kernel' binaries are located
1568 # orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1569 # Where the 'target' binaries are located
1570 # (not the symlink farm - that is aros_target_*!)
1573 # if crosstools then
1574 # if kernel_tools_prefix = "no-kernel-prefix-"
1575 # aros_kernel_* = crosstools cc paths
1576 # aros_kernel_cc = elf cc wrapper around crosstools cc
1578 # VALIDATE(${kernel_tools_prefix}*)
1579 # aros_kernel_* = ${kernel_tools_prefix}*
1580 # if ${kernel_tools_prefix}cc is an AROS gcc
1581 # aros_kernel_cc = ${kernel_tools_prefix}cc
1583 # aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1587 # orig_target_* = aros built crosstools
1588 # orig_target_cc = elf cc wrapper around crosstools cc
1590 # VALIDATE(${kernel_tools_prefix}*)
1592 # orig_target_* = aros_kernel_*
1593 # if aros_kernel_cc is an AROS gcc
1594 # orig_target_cc = aros_kernel_cc
1596 # orig_target_cc = aros cc wrapper around aros_kernel_cc
1601 AC_MSG_CHECKING([whether to use external toolchain])
1602 if test "$kernel_tool_prefix" = "none" ; then
1603 AC_MSG_RESULT([no]);
1604 if test "$crosstools" != "yes"; then
1605 AC_MSG_ERROR([--disable-crosstools requires --with-kernel-tool-prefix= for this arch])
1607 # We are building AROS crosstools, and no kernel
1608 # tools specified - assume target tools == kernel tools
1609 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1610 aros_kernel_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1611 aros_kernel_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1612 aros_kernel_cpp="${tmp_tool_prefix}cpp"
1613 aros_kernel_ld="${tmp_tool_prefix}ld"
1614 aros_kernel_as="${tmp_tool_prefix}as"
1615 aros_kernel_ar="${tmp_tool_prefix}ar"
1616 aros_kernel_ranlib="${tmp_tool_prefix}ranlib"
1617 aros_kernel_nm="${tmp_tool_prefix}nm"
1618 aros_kernel_strip="${tmp_tool_prefix}strip"
1619 aros_kernel_objcopy="${tmp_tool_prefix}objcopy"
1620 aros_kernel_objdump="${tmp_tool_prefix}objdump"
1622 AC_MSG_RESULT([yes]);
1623 # Kernel tools specified - find them
1624 # Note that 'normally', aros_kernel_* overrides will
1625 # empty, unless specified in the per-arch sections above.
1627 AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
1628 AROS_REQUIRED(cpp,$aros_kernel_cpp)
1629 if test "x$aros_kernel_cc" = "x"; then
1630 aros_kernel_cc=${kernel_tool_prefix}gcc
1632 AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${aros_gcc_version})
1633 AROS_REQUIRED(cc,$aros_kernel_cc)
1634 if test "x$aros_kernel_cxx" = "x"; then
1635 aros_kernel_cxx=${kernel_tool_prefix}g++
1637 AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${aros_gcc_version})
1638 # If it's set, make sure it's really there
1639 if test "x$aros_kernel_cxx" != "x" ; then
1640 AROS_REQUIRED(cxx,$aros_kernel_cxx)
1642 AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1643 AROS_REQUIRED(ld,$aros_kernel_ld)
1644 AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1645 AROS_REQUIRED(as,$aros_kernel_as)
1646 AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1647 AROS_REQUIRED(ar,$aros_kernel_ar)
1648 AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1649 AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1650 AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1651 AROS_REQUIRED(nm,$aros_kernel_nm)
1652 AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1653 AROS_REQUIRED(strip,$aros_kernel_strip)
1654 AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1655 AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1656 AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1657 AROS_REQUIRED(objdump,$aros_kernel_objdump)
1660 AC_MSG_CHECKING([which target tools])
1661 if test "$crosstools" = "yes"; then
1662 AC_MSG_RESULT([$target_tool_prefix])
1663 # We are are building AROS crosstools
1664 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1665 orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1666 orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1667 orig_target_cpp="${tmp_tool_prefix}cpp"
1668 orig_target_ld="${tmp_tool_prefix}ld"
1669 orig_target_as="${tmp_tool_prefix}as"
1670 orig_target_ar="${tmp_tool_prefix}ar"
1671 orig_target_ranlib="${tmp_tool_prefix}ranlib"
1672 orig_target_nm="${tmp_tool_prefix}nm"
1673 orig_target_strip="${tmp_tool_prefix}strip"
1674 orig_target_objcopy="${tmp_tool_prefix}objcopy"
1675 orig_target_objdump="${tmp_tool_prefix}objdump"
1677 AC_MSG_RESULT([$kernel_tool_prefix])
1678 # We are *not* building AROS crosstools - use the kernel tools
1679 orig_target_cpp="${aros_kernel_cpp}"
1680 AROS_REQUIRED(cpp,$orig_target_cpp)
1681 orig_target_cc="${aros_kernel_cc}"
1682 AROS_REQUIRED(cc,$orig_target_cc)
1683 orig_target_cxx="${aros_kernel_cxx}"
1684 if test "x$orig_target_cxx" != "x" ; then
1685 AROS_REQUIRED(cxx,$orig_target_cxx)
1687 orig_target_ld="${aros_kernel_ld}"
1688 AROS_REQUIRED(ld,$orig_target_ld)
1689 orig_target_as="${aros_kernel_as}"
1690 AROS_REQUIRED(as,$orig_target_as)
1691 orig_target_ar="${aros_kernel_ar}"
1692 AROS_REQUIRED(ar,$orig_target_ar)
1693 orig_target_ranlib="${aros_kernel_ranlib}"
1694 AROS_REQUIRED(ranlib,$orig_target_ranlib)
1695 orig_target_nm="${aros_kernel_nm}"
1696 AROS_REQUIRED(nm,$orig_target_nm)
1697 orig_target_strip="${aros_kernel_strip}"
1698 AROS_REQUIRED(strip,$orig_target_strip)
1699 orig_target_objcopy="${aros_kernel_objcopy}"
1700 AROS_REQUIRED(objcopy,$orig_target_objcopy)
1701 orig_target_objdump="${aros_kernel_objdump}"
1702 AROS_REQUIRED(objdump,$orig_target_objdump)
1705 # At this point, all aros_kernel_* and aros_target_*
1706 # tools should be set up correctly
1708 CC="$aros_kernel_cc $kernel_tool_flags"
1709 CPP="$aros_kernel_cpp"
1711 #-----------------------------------------------------------------------------
1713 # Disable pointer-signedness warnings if the compiler recognises the option
1715 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1716 save_cflags="$CFLAGS"
1717 if test "$crosstools" != "yes" ; then
1718 CFLAGS="$CFLAGS -Wno-pointer-sign"
1719 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1721 # we do know it is supported for the smallest version of gcc we are going to build
1722 # we assume it's also supported by later versions
1723 use_no_sign_warning=yes
1725 AC_MSG_RESULT($use_no_sign_warning)
1726 if test "x-$use_no_sign_warning" = "x-yes" ; then
1727 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1729 CFLAGS="$save_cflags"
1731 #-----------------------------------------------------------------------------
1733 # Find all the tools we need to compile. This could be cross-compiling
1734 # though! If that is the case we use the GNU form of the target and
1735 # simply add this to the front of the binary name. This is rather simple,
1736 # but it should work under most circumstances.
1738 # The default tools are to use the same as the host, but only if the
1739 # host and target CPU are the same. With GCC this is normally enough.
1743 aros_shared_ld="$aros_host_ld"
1745 aros_target_mkdep="$aros_host_mkdep"
1747 # The default tools executables to be linked to.
1748 if test "$rescomp" != ""; then
1749 AROS_TOOL_KERNEL(aros_kernel_rescomp,$rescomp)
1750 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1753 # Set up the sources for the symlink farm
1754 if test "$crosstools" = "yes"; then
1755 crosstools_target=tools-crosstools
1757 crosstools_cxx_target=tools-crosstools
1760 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1761 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1764 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1765 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1766 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1767 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1768 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1769 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1770 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1772 # aros_cc_pre is a variable that is added to the front of the compiler name
1773 # in the generated aros-gcc shell script. We need this to enable the cache
1774 # to work across cleaned builds. Also, support DISTCC using the correct
1775 # environment variable.
1778 if test "x${DISTCC}" != "x" ; then
1779 if test "x${CCACHE}" != "x" ; then
1780 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1782 aros_cc_pre="${DISTCC} "
1785 if test "x${CCACHE}" != "x" ; then
1786 aros_cc_pre="${CCACHE} "
1790 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1792 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1793 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1794 AC_SUBST(aros_target_nix_ldflags,-nix)
1795 AC_SUBST(aros_target_detach_ldflags,-detach)
1796 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1799 if test "$crosstools" != "yes"; then
1800 if test "$GCC" = "yes"; then
1801 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1804 # We do not know which gcc version we are going to build and what we need to know
1805 # here is different for different versions so this will be set later during the
1806 # build of crosstools.
1807 aros_target_cc_path=@aros_target_cc_path@
1809 aros_target_cpp="${prefix}cpp"
1810 aros_target_cc="${prefix}gcc"
1811 aros_target_cxx="${prefix}g++"
1812 aros_target_as="${prefix}as"
1813 aros_target_ld="${prefix}ld"
1814 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1815 aros_target_objcopy="${prefix}objcopy"
1816 aros_target_objdump="${prefix}objdump"
1817 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1818 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1819 aros_target_strip="${prefix}strip"
1820 aros_plain_nm="${prefix}nm"
1821 aros_plain_ar="${prefix}ar"
1823 if test "$aros_kernel_includes" != "" ; then
1824 dnl find out about the kernel cc's include path
1825 AC_MSG_CHECKING([for the kernel compiler's include path])
1826 if test "$aros_kernel_cc_includes" = "" ; then
1827 # Try to guess where the directory is.
1828 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1829 if test -d $aros_kernel_cc_includes; then
1830 # Check if there is also an include-fixed directory and add it
1831 # to kernel compiler's include path as it may contain some of
1832 # the headers we need.
1833 if test -d "$aros_kernel_cc_includes"-fixed; then
1834 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1836 # Check for specific includes directory. Neede for Ubuntu 11.10
1837 if test -d "/usr/include/i386-linux-gnu"; then
1838 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1841 # The directory doesn't exist, we need to do some more work.
1842 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1844 # These are the headers we're looking for.
1845 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1846 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1850 for h in $headers; do
1851 # Which other headers are needed by each of the above?
1852 deps=$(echo "#include <$h>" | \
1853 $aros_kernel_cc -E -M - 2>/dev/null | \
1854 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1856 # Copy all the needed headers to a directory beneath gendir.
1859 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1860 sed -n "s,^.*/include\(/.*\),\1,p")
1861 ! test -d $dir && mkdir -p $dir
1862 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1867 AC_MSG_RESULT($aros_kernel_cc_includes)
1868 # Adding -nostdinc to kernel includes as they are always used together.
1869 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1872 if test "$crosstools" != "yes"; then
1873 dnl find out about the target cc's include path
1874 AC_MSG_CHECKING([for the target compiler's include path])
1875 if test "$aros_target_cc_includes" = "" ; then
1876 #try to guess where the directory is
1877 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1878 if ! test -d $aros_target_cc_includes; then
1879 #the directory doesn't exist, we need to do some more work
1880 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1882 #these are the headers we're looking for
1883 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1884 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1888 for h in $headers; do
1889 #which other headers each of the above headers needs?
1890 deps=$(echo "#include <$h>" | \
1891 $orig_target_cc -E -M - 2>/dev/null | \
1892 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1894 #copy all the needed headers to a directory beneath gendir
1897 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1898 sed -n "s,^.*/include\(/.*\),\1,p")
1899 ! test -d $dir && mkdir -p $dir
1900 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1905 AC_MSG_RESULT($aros_target_cc_includes)
1907 # We do not know which gcc version we are going to build and what we need to know
1908 # here is different for different versions so this will be set later during the
1909 # build of crosstools.
1910 aros_target_cc_includes=@aros_target_cc_includes@
1914 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1915 # On GCC >= 4.0 -iquote should be used
1919 save_cflags="$CFLAGS"
1921 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1922 if test "x-$crosstools" != "x-yes"; then
1923 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1925 # we do know it is supported for the smallest version of gcc we are going to build
1926 # we assume it's also supported by later versions
1929 AC_MSG_RESULT($has_iquote)
1930 if test "x-$has_iquote" = "x-yes" ; then
1931 host_cflags_iquote=-iquote
1932 host_cflags_iquote_end=
1934 host_cflags_iquote=-I
1935 host_cflags_iquote_end=-I-
1937 kernel_cflags_iquote=$host_cflags_iquote
1938 kernel_cflags_iquote_end=$host_cflags_iquote_end
1939 if test "x-$cross_compiling" = "x-yes"; then
1940 CC="$aros_kernel_cc"
1941 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1942 if test "x-$crosstools" != "x-yes"; then
1943 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1945 # we do know it is supported for the smallest version of gcc we are going to build
1946 # we assume it's also supported by later versions
1947 use_no_stack_protector=yes
1949 AC_MSG_RESULT($use_no_stack_protector)
1950 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1951 if test "x-$crosstools" != "x-yes"; then
1952 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1954 # we do know it is supported for the smallest version of gcc we are going to build
1955 # we assume it's also supported by later versions
1958 AC_MSG_RESULT($has_iquote)
1959 if test "x-$has_iquote" = "x-yes" ; then
1960 kernel_cflags_iquote=-iquote
1961 kernel_cflags_iquote_end=
1963 kernel_cflags_iquote=-I
1964 kernel_cflags_iquote_end=-I-
1967 aros_cflags_iquote=$kernel_cflags_iquote
1968 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1969 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1970 CC="$orig_target_cc"
1971 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1972 if test "x-$crosstools" != "x-yes"; then
1973 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1975 # we do know it is supported for the smallest version of gcc we are going to build
1976 # we assume it's also supported by later versions
1979 AC_MSG_RESULT($has_iquote)
1980 if test "x-$has_iquote" = "x-yes" ; then
1981 aros_cflags_iquote=-iquote
1982 aros_cflags_iquote_end=
1984 aros_cflags_iquote=-I
1985 aros_cflags_iquote_end=-I-
1988 if test "x-$use_no_stack_protector" = "x-yes" ; then
1989 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1993 #-----------------------------------------------------------------------------
1995 # Check if the target compiler supports some options used for delinting:
1996 # -Wunused-but-set-variable
2002 if test "x-$crosstools" != "x-yes"; then
2003 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2004 CC="$orig_target_cc"
2006 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2007 CFLAGS=-Wunused-but-set-variable
2008 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2009 AC_MSG_RESULT($aros_unused_but_set_variable)
2010 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2011 aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2014 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2015 CFLAGS=-Warray-bounds
2016 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2017 AC_MSG_RESULT($aros_array_bounds)
2018 if test "x-$aros_array_bounds" = "x-yes" ; then
2019 aros_cflags_array_bounds=-Wno-array-bounds
2022 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2023 CFLAGS=-Wenum-compare
2024 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2025 AC_MSG_RESULT($aros_enum_compare)
2026 if test "x-$aros_enum_compare" = "x-yes" ; then
2027 aros_cflags_enum_compare=-Wno-enum-compare
2030 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2031 CFLAGS=-Wstrict-overflow
2032 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2033 AC_MSG_RESULT($aros_strict_overflow)
2034 if test "x-$aros_strict_overflow" = "x-yes" ; then
2035 aros_cflags_strict_overflow=-Wno-strict-overflow
2038 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2039 CFLAGS=-Wformat-security
2040 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2041 AC_MSG_RESULT($aros_format_security)
2042 if test "x-$aros_format_security" = "x-yes" ; then
2043 aros_cflags_format_security=-Wno-format-security
2046 # We do not know which gcc version we are going to build and what we need to know
2047 # here is different for different versions so this will be set later during the
2048 # build of crosstools.
2049 aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2050 aros_cflags_array_bounds=@aros_cflags_array_bounds@
2051 aros_cflags_enum_compare=@aros_cflags_enum_compare@
2052 aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2053 aros_cflags_format_security=@aros_cflags_format_security@
2056 #-----------------------------------------------------------------------------
2058 # Check if we can explicitly choose older version of symbol hashing
2060 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2061 CC="$aros_kernel_cc"
2062 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2063 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2064 AC_MSG_RESULT($use_hash_style)
2065 if test "x-$use_hash_style" = "x-yes" ; then
2066 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2069 CFLAGS="$save_cflags"
2071 AC_SUBST(host_cflags_iquote)
2072 AC_SUBST(host_cflags_iquote_end)
2073 AC_SUBST(kernel_cflags_iquote)
2074 AC_SUBST(kernel_cflags_iquote_end)
2075 AC_SUBST(aros_cflags_iquote)
2076 AC_SUBST(aros_cflags_iquote_end)
2079 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2080 AC_MSG_CHECKING([for default resolution of WBScreen])
2081 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2082 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2083 if test "$resolution" = "yes" ; then
2086 if test "$resolution" = "no" ; then
2089 if test "$resolution" != "none" ; then
2090 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2091 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2092 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2094 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2095 aros_cv_default_wbwidth=$aros_default_wbwidth
2096 aros_cv_default_wbheight=$aros_default_wbheight
2097 aros_cv_default_wbdepth=$aros_default_wbdepth
2099 dnl See if the user wants the serial debug output for native flavour
2100 AC_MSG_CHECKING([if serial debug is enabled])
2101 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)
2102 if test "$aros_serial_debug" = 0 ; then
2103 serial_debug_forced=""
2104 if test "$serial_debug" = "yes" ; then
2107 if test "$serial_debug" = "no" ; then
2111 serial_debug_forced="(forced)"
2112 serial_debug=$aros_serial_debug
2114 if test "$serial_debug" != "none" ; then
2115 aros_serial_debug=$serial_debug
2116 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2121 dnl See if the user wants the palm debug output hack for palm native flavour
2122 AC_MSG_CHECKING([if palm debug hack is enabled])
2123 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")
2124 if test "$palm_debug_hack" = "yes" ; then
2125 aros_palm_debug_hack="1"
2127 AC_MSG_RESULT($palm_debug_hack)
2129 dnl See if the user wants the usb3.0 code
2130 AC_MSG_CHECKING([if usb3.0 code is enabled])
2131 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2132 if test "$usb30_code" = "yes" ; then
2133 aros_config_cflags="$aros_config_cflags -DAROS_USB30_CODE"
2134 aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2136 AC_MSG_RESULT($usb30_code)
2138 dnl See if the user wants nesting supervisor activated for unix flavour
2139 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2140 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")
2141 if test "$nesting_supervisor" = "yes" ; then
2142 aros_nesting_supervisor="1"
2144 AC_MSG_RESULT($nesting_supervisor)
2146 dnl See if the user wants to disable MMU support
2147 dnl This can be overriden on per-target basis,
2148 dnl set $aros_enable_mmu to "yes" or "no" to do this
2149 if test "$aros_enable_mmu" = "" ; then
2150 AC_MSG_CHECKING([if MMU support is enabled])
2151 dnl Enabled by default
2152 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2153 if test "$aros_enable_mmu" = "" ; then
2154 aros_enable_mmu="yes"
2156 AC_MSG_RESULT($aros_enable_mmu)
2158 if test "$aros_enable_mmu" = "no" ; then
2165 dnl things specifically required for hosted flavours
2166 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2168 if test "x-$need_dlopen" != "x-no" ; then
2169 dnl some kind of dynamic library access system is required for hostlib.resource
2170 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2171 if test "x-$have_dl" = "x-no" ; then
2172 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2173 aros_host_ldflags="$aros_host_ldflags -ldl"],
2176 if test "x-$have_dl" = "x-no" ; then
2177 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2183 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2184 [build X11 hidd for hosted (default=auto)]),
2185 x11_hidd="$enableval",
2186 x11_hidd="$need_x11")
2187 case "x-$x11_hidd" in
2188 x-yes|x-no|x-auto) ;;
2189 *) x11_hidd="$need_x11" ;;
2195 if test "x-$x11_hidd" != "x-no" ; then
2201 for path in $x_libraries
2203 x_cflags="$x_cflags -L$path"
2206 for path in $x_includes
2208 x_cflags="$x_cflags -I$path"
2211 if test "x-$no_x" = "x-yes" ; then
2214 if test "x-$x11_hidd" != "x-auto" ; then
2215 dnl and they explicitly asked for it, bail out
2216 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2220 dnl found it, setup the metatarget
2221 x11_hidd_target=kernel-x11gfx-kobj
2224 dnl setup shared memory extensions
2225 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2226 [use X11 shared memory (default=auto)]),
2227 x11_hidd_shm="$enableval",
2228 x11_hidd_shm="auto")
2229 case "x-$x11_hidd_shm" in
2230 x-yes|x-no|x-auto) ;;
2231 *) x11_hidd_shm="auto" ;;
2237 if test "x-$x11_hidd_shm" != "x-no" ; then
2239 dnl system shm headers
2240 AC_CHECK_HEADERS(sys/ipc.h)
2241 AC_CHECK_HEADERS(sys/shm.h)
2244 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2246 dnl make sure X libs have shm functions
2247 save_cflags="$CFLAGS"
2248 CFLAGS="$CFLAGS $x_cflags"
2249 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2250 CFLAGS="$save_cflags"
2254 dnl detection done, prepare output
2255 if test "x-$have_xshm" = "x-yes" ; then
2258 elif test "x-$x11_hidd_shm" = "x-yes" ; then
2259 dnl they explicitly asked for it, but we can't do it
2260 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2262 dnl otherwise just disable it
2267 dnl setup vidmode (fullscreen) extensions
2268 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2269 [use X11 vidmode extension (default=auto)]),
2270 x11_hidd_vidmode="$enableval",
2271 x11_hidd_vidmode="auto")
2272 case "x-$x11_hidd_vidmode" in
2273 x-yes|x-no|x-auto) ;;
2274 *) x11_hidd_vidmode="auto" ;;
2280 if test "x-$x11_hidd_vidmode" != "x-no" ; then
2282 dnl make sure X libs have vidmode functions
2283 save_cflags="$CFLAGS"
2284 CFLAGS="$CFLAGS $x_cflags"
2285 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2286 CFLAGS="$save_cflags"
2289 dnl detection done, prepare output
2290 if test "x-$have_vidmode" = "x-yes" ; then
2291 dnl we can do vidmode
2292 DO_VIDMODE_SUPPORT="1"
2293 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2294 dnl they explicitly asked for it, but we can't do it
2295 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2297 dnl otherwise just disable it
2298 DO_VIDMODE_SUPPORT="0"
2302 aros_host_x11_includes=$x_includes
2303 aros_host_x11_libdirs=$x_libraries
2308 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2309 [build SDL hidd for hosted (default=auto)]),
2310 sdl_hidd="$enableval",
2312 case "x-$sdl_hidd" in
2313 x-yes|x-no|x-auto) ;;
2314 *) sdl_hidd="auto" ;;
2318 if test "x-$sdl_hidd" != "x-no" ; then
2321 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2323 if test "x-$have_sdl" != "x-yes" ; then
2326 if test "x-$sdl_hidd" != "x-auto" ; then
2327 dnl and they explicitly asked for it, bail out
2328 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2332 dnl found it, set up the metatarget
2333 sdl_hidd_target=kernel-hidd-sdl
2334 aros_host_sdl_cflags=SDL_CFLAGS
2335 aros_host_sdl_libs=SDL_LIBS
2340 AC_CHECK_HEADER(sys/soundcard.h)
2341 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2342 oss_library_target=workbench-libs-oss-unix
2347 dnl See if the user wants dbus.library
2348 AC_MSG_CHECKING([if building of dbus.library is enabled])
2349 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2350 if test "$dbus" = "yes" ; then
2352 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2353 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2354 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2355 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2359 AC_MSG_RESULT($dbus)
2361 if test "$use_kernel_cc_wrapper" = "yes" ; then
2362 aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2365 if test "${crosstools}" != "yes" ; then
2366 aros_target_toolchain=no
2368 aros_target_toolchain=yes
2371 dnl --------------------------------------------------------------------
2372 dnl Configuration Output Section
2373 dnl --------------------------------------------------------------------
2378 AC_SUBST(aros_flavour)
2379 AC_SUBST(aros_flavour_uc)
2380 AC_SUBST(aros_target_toolchain)
2381 AC_SUBST(AROS_BUILDDIR)
2382 AC_SUBST(AROS_BUILDDIR_UNIX)
2384 AC_SUBST(AROS_CROSSTOOLSDIR)
2385 AC_SUBST(AROS_PORTSSRCDIR)
2387 # Compatability with other Amiga-like operation systems
2388 AC_SUBST(aros_amigaos_compliance)
2391 AC_SUBST(aros_cc_pre)
2392 AC_SUBST(aros_host_strip)
2393 AC_SUBST(aros_host_arch)
2394 AC_SUBST(aros_host_cpu)
2395 AC_SUBST(aros_host_cpp)
2396 AC_SUBST(aros_host_cc)
2397 AC_SUBST(aros_host_cxx)
2398 AC_SUBST(aros_host_ar)
2399 AC_SUBST(aros_host_ranlib)
2400 AC_SUBST(aros_host_ld)
2401 AC_SUBST(aros_host_make)
2402 AC_SUBST(aros_host_cflags)
2403 AC_SUBST(aros_host_cxxflags)
2404 AC_SUBST(gnu89_inline)
2405 AC_SUBST(aros_host_ldflags)
2406 AC_SUBST(aros_host_debug)
2407 AC_SUBST(aros_host_mkdep)
2408 AC_SUBST(aros_host_mkargs)
2409 AC_SUBST(aros_host_exe_suffix)
2410 AC_SUBST(aros_host_lib_suffix)
2411 AC_SUBST(aros_tools_dir)
2412 AC_SUBST(aros_host_aclocal)
2413 AC_SUBST(aros_host_autoconf)
2414 AC_SUBST(aros_host_autoheader)
2415 AC_SUBST(aros_host_automake)
2419 AC_SUBST(aros_target_guitheme)
2420 AC_SUBST(aros_target_iconset)
2421 AC_SUBST(aros_target_bootloader)
2422 AC_SUBST(aros_target_arch)
2423 AC_SUBST(aros_target_family)
2424 AC_SUBST(aros_target_cpu)
2425 AC_SUBST(aros_target_variant)
2426 AC_SUBST(aros_target_suffix)
2427 AC_SUBST(aros_target_ar)
2428 AC_SUBST(aros_target_ranlib)
2429 AC_SUBST(aros_plain_nm)
2430 AC_SUBST(aros_plain_ar)
2431 AC_SUBST(aros_kernel_ar)
2432 AC_SUBST(aros_kernel_ranlib)
2433 AC_SUBST(orig_target_cc)
2434 AC_SUBST(aros_target_cc)
2435 AC_SUBST(aros_kernel_cc)
2436 AC_SUBST(orig_target_cxx)
2437 AC_SUBST(aros_target_cxx)
2438 AC_SUBST(aros_kernel_cxx)
2439 AC_SUBST(orig_target_cpp)
2440 AC_SUBST(aros_target_cpp)
2441 AC_SUBST(aros_kernel_cpp)
2442 AC_SUBST(orig_target_as)
2443 AC_SUBST(aros_target_as)
2444 AC_SUBST(aros_kernel_as)
2445 AC_SUBST(orig_target_ld)
2446 AC_SUBST(aros_target_ld)
2447 AC_SUBST(aros_kernel_ld)
2448 AC_SUBST(aros_target_cc_includes)
2449 AC_SUBST(aros_target_cc_path)
2450 AC_SUBST(aros_target_objdump)
2451 AC_SUBST(aros_target_objcopy)
2452 AC_SUBST(aros_target_strip)
2453 AC_SUBST(aros_target_nm)
2454 AC_SUBST(aros_kernel_rescomp)
2455 AC_SUBST(aros_shared_default)
2456 AC_SUBST(aros_shared_ld)
2457 AC_SUBST(aros_object_format)
2458 AC_SUBST(aros_compiler_libs)
2459 AC_SUBST(aros_arch_libs)
2461 AC_SUBST(aros_config_cflags)
2462 AC_SUBST(aros_config_aflags)
2463 AC_SUBST(aros_config_ldflags)
2465 AC_SUBST(aros_shared_cflags)
2466 AC_SUBST(aros_shared_aflags)
2467 AC_SUBST(aros_shared_ldflags)
2468 AC_SUBST(aros_kernel_cflags)
2469 AC_SUBST(aros_kernel_includes)
2470 AC_SUBST(aros_kernel_objcflags)
2471 AC_SUBST(aros_kernel_ldflags)
2472 AC_SUBST(aros_target_cflags)
2473 AC_SUBST(aros_debug_cflags)
2474 AC_SUBST(aros_debug_aflags)
2475 AC_SUBST(aros_debug_ldflags)
2476 AC_SUBST(aros_target_genmap)
2477 AC_SUBST(aros_target_strip_flags)
2479 AC_SUBST(crosstools_target)
2480 AC_SUBST(crosstools_cxx_target)
2482 # Delinting target compiler flags
2483 AC_SUBST(aros_cflags_unused_but_set_variable)
2484 AC_SUBST(aros_cflags_array_bounds)
2485 AC_SUBST(aros_cflags_enum_compare)
2486 AC_SUBST(aros_cflags_strict_overflow)
2487 AC_SUBST(aros_cflags_format_security)
2490 AC_SUBST(x11_hidd_target)
2491 AC_SUBST(sdl_hidd_target)
2492 AC_SUBST(pci_hidd_target)
2493 AC_SUBST(oss_library_target)
2495 AC_SUBST(aros_default_wbwidth)
2496 AC_SUBST(aros_default_wbheight)
2497 AC_SUBST(aros_default_wbdepth)
2498 AC_SUBST(DO_XSHM_SUPPORT)
2499 AC_SUBST(DO_VIDMODE_SUPPORT)
2501 AC_SUBST(aros_host_x11_includes)
2502 AC_SUBST(aros_host_x11_libdirs)
2503 AC_SUBST(aros_host_sdl_cflags)
2504 AC_SUBST(aros_host_sdl_libs)
2506 # Native version related
2507 AC_SUBST(aros_serial_debug)
2509 # Palm native version related
2510 AC_SUBST(aros_palm_debug_hack)
2513 AC_SUBST(aros_usb30_code)
2515 # Unix/Hosted version related
2516 AC_SUBST(aros_nesting_supervisor)
2519 AC_SUBST(aros_enable_mmu)
2522 AC_SUBST(aros_ios_platform)
2523 AC_SUBST(aros_ios_version)
2524 AC_SUBST(aros_ios_sdk)
2527 AC_SUBST(android_tool)
2528 AC_SUBST(aros_android_level)
2531 AC_SUBST(ENABLE_DBUS)
2532 AC_SUBST(DBUS_CFLAGS)
2533 AC_SUBST(DBUS_LIBFLAGS)
2534 AC_SUBST(KERNEL_DBUS_KOBJ)
2535 AC_SUBST(KERNEL_DBUS_INCLUDES)
2538 AC_SUBST(ENABLE_X11)
2541 AC_SUBST(aros_debug)
2542 AC_SUBST(aros_mungwall_debug)
2543 AC_SUBST(aros_stack_debug)
2544 AC_SUBST(aros_modules_debug)
2546 # Collect-aros stuff: "-ius" to ignore undefined symbols
2547 AC_SUBST(ignore_undefined_symbols)
2549 # C compiler related
2550 AC_SUBST(gcc_target_cpu)
2552 dnl Prepare for output, make up all the generated patches
2553 case "$aros_flavour" in
2554 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2555 aros_flavour="emulation" ;;
2556 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2557 aros_flavour="emulation" ;;
2558 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2559 aros_flavour="standalone";;
2560 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2561 aros_flavour="standalone";;
2562 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2563 aros_flavour="native" ;;
2564 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2565 aros_flavour="native" ;;
2566 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2567 aros_flavour="linklib" ;;
2568 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2569 aros_flavour="palmnative" ;;
2570 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2571 aros_flavour="mac68knative" ;;
2572 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2573 aros_flavour="ppcnative" ;;
2576 if test ! -d ${aros_inc_dir} ; then
2577 ${MKDIR} ${aros_inc_dir}
2579 if test ! -d ${aros_geninc_dir} ; then
2580 ${MKDIR} ${aros_geninc_dir}
2582 if test ! -d ${aros_hostcfg_dir} ; then
2583 ${MKDIR} ${aros_hostcfg_dir}
2585 if test ! -d ${aros_targetcfg_dir} ; then
2586 ${MKDIR} ${aros_targetcfg_dir}
2588 if test ! -d ${aros_tools_dir} ; then
2589 ${MKDIR} ${aros_tools_dir}
2591 if test ! -d ${aros_scripts_dir} ; then
2592 ${MKDIR} ${aros_scripts_dir}
2595 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2597 AC_CONFIG_COMMANDS([compiler_executable],
2599 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2601 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2602 prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2606 chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2608 ln -sf $orig_target_as$aros_host_exe_suffix ${prefix2}-as$aros_host_exe_suffix
2609 ln -sf $orig_target_nm$aros_host_exe_suffix ${prefix2}-nm$aros_host_exe_suffix
2610 ln -sf $orig_target_ar$aros_host_exe_suffix ${prefix2}-ar$aros_host_exe_suffix
2611 ln -sf $orig_target_ranlib$aros_host_exe_suffix ${prefix2}-ranlib$aros_host_exe_suffix
2612 ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2613 ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2614 ln -sf $orig_target_strip$aros_host_exe_suffix ${prefix2}-strip$aros_host_exe_suffix
2616 ln -sf $aros_kernel_ld$aros_host_exe_suffix ${prefix3}-ld$aros_host_exe_suffix
2619 aros_host_exe_suffix=${aros_host_exe_suffix}
2620 aros_tools_dir=${aros_tools_dir}
2621 aros_target_cpu=${aros_target_cpu}
2622 aros_target_arch=${aros_target_arch}
2623 aros_target_suffix=${aros_target_suffix}
2624 orig_target_nm=${orig_target_nm}
2625 orig_target_as=${orig_target_as}
2626 orig_target_ar=${orig_target_ar}
2627 orig_target_ranlib=${orig_target_ranlib}
2628 orig_target_objdump=${orig_target_objdump}
2629 orig_target_objcopy=${orig_target_objcopy}
2630 orig_target_strip=${orig_target_strip}
2631 aros_kernel_ld=${aros_kernel_ld}
2634 AC_CONFIG_COMMANDS([genmf_executable],
2635 [chmod a+x ${aros_tools_dir}/genmf.py],
2636 [aros_tools_dir=${aros_tools_dir}]
2642 ${aros_inc_dir}/config.h:config/config.h.in
2643 ${aros_geninc_dir}/config.h:config/config.h.in
2644 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2645 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2647 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2648 ${aros_targetcfg_dir}/specs:config/specs.in
2649 ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2650 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2651 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2652 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2653 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2654 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2655 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2656 tools/collect-aros/env.h
2657 ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2662 dnl This is in order to not define SHARED_CFLAGS sometimes
2663 dnl We don't always do aros_shared_ar, aros_shared_cflags
2665 #XXX compatability...
2666 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2668 if test -n "$aros_shared_cflags" ; then
2669 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2670 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg