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)
1655 # Objcopy and objdump are not required for the kernel
1656 # toolchain on many architectures.
1657 # So we'll look for them, but not make them strictly required.
1658 AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1659 AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1660 if test "x${crosstools}" != "yes" ; then
1661 AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1662 AROS_REQUIRED(objdump,$aros_kernel_objdump)
1666 AC_MSG_CHECKING([which target tools])
1667 if test "$crosstools" = "yes"; then
1668 AC_MSG_RESULT([$target_tool_prefix])
1669 # We are are building AROS crosstools
1670 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1671 orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1672 orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1673 orig_target_cpp="${tmp_tool_prefix}cpp"
1674 orig_target_ld="${tmp_tool_prefix}ld"
1675 orig_target_as="${tmp_tool_prefix}as"
1676 orig_target_ar="${tmp_tool_prefix}ar"
1677 orig_target_ranlib="${tmp_tool_prefix}ranlib"
1678 orig_target_nm="${tmp_tool_prefix}nm"
1679 orig_target_strip="${tmp_tool_prefix}strip"
1680 orig_target_objcopy="${tmp_tool_prefix}objcopy"
1681 orig_target_objdump="${tmp_tool_prefix}objdump"
1683 AC_MSG_RESULT([$kernel_tool_prefix])
1684 # We are *not* building AROS crosstools - use the kernel tools
1685 orig_target_cpp="${aros_kernel_cpp}"
1686 AROS_REQUIRED(cpp,$orig_target_cpp)
1687 orig_target_cc="${aros_kernel_cc}"
1688 AROS_REQUIRED(cc,$orig_target_cc)
1689 orig_target_cxx="${aros_kernel_cxx}"
1690 if test "x$orig_target_cxx" != "x" ; then
1691 AROS_REQUIRED(cxx,$orig_target_cxx)
1693 orig_target_ld="${aros_kernel_ld}"
1694 AROS_REQUIRED(ld,$orig_target_ld)
1695 orig_target_as="${aros_kernel_as}"
1696 AROS_REQUIRED(as,$orig_target_as)
1697 orig_target_ar="${aros_kernel_ar}"
1698 AROS_REQUIRED(ar,$orig_target_ar)
1699 orig_target_ranlib="${aros_kernel_ranlib}"
1700 AROS_REQUIRED(ranlib,$orig_target_ranlib)
1701 orig_target_nm="${aros_kernel_nm}"
1702 AROS_REQUIRED(nm,$orig_target_nm)
1703 orig_target_strip="${aros_kernel_strip}"
1704 AROS_REQUIRED(strip,$orig_target_strip)
1705 orig_target_objcopy="${aros_kernel_objcopy}"
1706 AROS_REQUIRED(objcopy,$orig_target_objcopy)
1707 orig_target_objdump="${aros_kernel_objdump}"
1708 AROS_REQUIRED(objdump,$orig_target_objdump)
1711 # At this point, all aros_kernel_* and aros_target_*
1712 # tools should be set up correctly
1714 CC="$aros_kernel_cc $kernel_tool_flags"
1715 CPP="$aros_kernel_cpp"
1717 #-----------------------------------------------------------------------------
1719 # Disable pointer-signedness warnings if the compiler recognises the option
1721 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1722 save_cflags="$CFLAGS"
1723 if test "$crosstools" != "yes" ; then
1724 CFLAGS="$CFLAGS -Wno-pointer-sign"
1725 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1727 # we do know it is supported for the smallest version of gcc we are going to build
1728 # we assume it's also supported by later versions
1729 use_no_sign_warning=yes
1731 AC_MSG_RESULT($use_no_sign_warning)
1732 if test "x-$use_no_sign_warning" = "x-yes" ; then
1733 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1735 CFLAGS="$save_cflags"
1737 #-----------------------------------------------------------------------------
1739 # Find all the tools we need to compile. This could be cross-compiling
1740 # though! If that is the case we use the GNU form of the target and
1741 # simply add this to the front of the binary name. This is rather simple,
1742 # but it should work under most circumstances.
1744 # The default tools are to use the same as the host, but only if the
1745 # host and target CPU are the same. With GCC this is normally enough.
1749 aros_shared_ld="$aros_host_ld"
1751 aros_target_mkdep="$aros_host_mkdep"
1753 # The default tools executables to be linked to.
1754 if test "$rescomp" != ""; then
1755 AROS_TOOL_KERNEL(aros_kernel_rescomp,$rescomp)
1756 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1759 # Set up the sources for the symlink farm
1760 if test "$crosstools" = "yes"; then
1761 crosstools_target=tools-crosstools
1763 crosstools_cxx_target=tools-crosstools
1766 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1767 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1770 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1771 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1772 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1773 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1774 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1775 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1776 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1778 # aros_cc_pre is a variable that is added to the front of the compiler name
1779 # in the generated aros-gcc shell script. We need this to enable the cache
1780 # to work across cleaned builds. Also, support DISTCC using the correct
1781 # environment variable.
1784 if test "x${DISTCC}" != "x" ; then
1785 if test "x${CCACHE}" != "x" ; then
1786 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1788 aros_cc_pre="${DISTCC} "
1791 if test "x${CCACHE}" != "x" ; then
1792 aros_cc_pre="${CCACHE} "
1796 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1798 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1799 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1800 AC_SUBST(aros_target_nix_ldflags,-nix)
1801 AC_SUBST(aros_target_detach_ldflags,-detach)
1802 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1805 if test "$crosstools" != "yes"; then
1806 if test "$GCC" = "yes"; then
1807 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1810 # We do not know which gcc version we are going to build and what we need to know
1811 # here is different for different versions so this will be set later during the
1812 # build of crosstools.
1813 aros_target_cc_path=@aros_target_cc_path@
1815 aros_target_cpp="${prefix}cpp"
1816 aros_target_cc="${prefix}gcc"
1817 aros_target_cxx="${prefix}g++"
1818 aros_target_as="${prefix}as"
1819 aros_target_ld="${prefix}ld"
1820 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1821 aros_target_objcopy="${prefix}objcopy"
1822 aros_target_objdump="${prefix}objdump"
1823 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1824 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1825 aros_target_strip="${prefix}strip"
1826 aros_plain_nm="${prefix}nm"
1827 aros_plain_ar="${prefix}ar"
1829 if test "$aros_kernel_includes" != "" ; then
1830 dnl find out about the kernel cc's include path
1831 AC_MSG_CHECKING([for the kernel compiler's include path])
1832 if test "$aros_kernel_cc_includes" = "" ; then
1833 # Try to guess where the directory is.
1834 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1835 if test -d $aros_kernel_cc_includes; then
1836 # Check if there is also an include-fixed directory and add it
1837 # to kernel compiler's include path as it may contain some of
1838 # the headers we need.
1839 if test -d "$aros_kernel_cc_includes"-fixed; then
1840 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1842 # Check for specific includes directory. Neede for Ubuntu 11.10
1843 if test -d "/usr/include/i386-linux-gnu"; then
1844 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1847 # The directory doesn't exist, we need to do some more work.
1848 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1850 # These are the headers we're looking for.
1851 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1852 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1856 for h in $headers; do
1857 # Which other headers are needed by each of the above?
1858 deps=$(echo "#include <$h>" | \
1859 $aros_kernel_cc -E -M - 2>/dev/null | \
1860 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1862 # Copy all the needed headers to a directory beneath gendir.
1865 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1866 sed -n "s,^.*/include\(/.*\),\1,p")
1867 ! test -d $dir && mkdir -p $dir
1868 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1873 AC_MSG_RESULT($aros_kernel_cc_includes)
1874 # Adding -nostdinc to kernel includes as they are always used together.
1875 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1878 if test "$crosstools" != "yes"; then
1879 dnl find out about the target cc's include path
1880 AC_MSG_CHECKING([for the target compiler's include path])
1881 if test "$aros_target_cc_includes" = "" ; then
1882 #try to guess where the directory is
1883 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1884 if ! test -d $aros_target_cc_includes; then
1885 #the directory doesn't exist, we need to do some more work
1886 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1888 #these are the headers we're looking for
1889 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1890 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1894 for h in $headers; do
1895 #which other headers each of the above headers needs?
1896 deps=$(echo "#include <$h>" | \
1897 $orig_target_cc -E -M - 2>/dev/null | \
1898 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1900 #copy all the needed headers to a directory beneath gendir
1903 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1904 sed -n "s,^.*/include\(/.*\),\1,p")
1905 ! test -d $dir && mkdir -p $dir
1906 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1911 AC_MSG_RESULT($aros_target_cc_includes)
1913 # We do not know which gcc version we are going to build and what we need to know
1914 # here is different for different versions so this will be set later during the
1915 # build of crosstools.
1916 aros_target_cc_includes=@aros_target_cc_includes@
1920 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1921 # On GCC >= 4.0 -iquote should be used
1925 save_cflags="$CFLAGS"
1927 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1928 if test "x-$crosstools" != "x-yes"; then
1929 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1931 # we do know it is supported for the smallest version of gcc we are going to build
1932 # we assume it's also supported by later versions
1935 AC_MSG_RESULT($has_iquote)
1936 if test "x-$has_iquote" = "x-yes" ; then
1937 host_cflags_iquote=-iquote
1938 host_cflags_iquote_end=
1940 host_cflags_iquote=-I
1941 host_cflags_iquote_end=-I-
1943 kernel_cflags_iquote=$host_cflags_iquote
1944 kernel_cflags_iquote_end=$host_cflags_iquote_end
1945 if test "x-$cross_compiling" = "x-yes"; then
1946 CC="$aros_kernel_cc"
1947 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1948 if test "x-$crosstools" != "x-yes"; then
1949 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1951 # we do know it is supported for the smallest version of gcc we are going to build
1952 # we assume it's also supported by later versions
1953 use_no_stack_protector=yes
1955 AC_MSG_RESULT($use_no_stack_protector)
1956 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1957 if test "x-$crosstools" != "x-yes"; then
1958 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1960 # we do know it is supported for the smallest version of gcc we are going to build
1961 # we assume it's also supported by later versions
1964 AC_MSG_RESULT($has_iquote)
1965 if test "x-$has_iquote" = "x-yes" ; then
1966 kernel_cflags_iquote=-iquote
1967 kernel_cflags_iquote_end=
1969 kernel_cflags_iquote=-I
1970 kernel_cflags_iquote_end=-I-
1973 aros_cflags_iquote=$kernel_cflags_iquote
1974 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1975 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1976 CC="$orig_target_cc"
1977 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1978 if test "x-$crosstools" != "x-yes"; then
1979 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1981 # we do know it is supported for the smallest version of gcc we are going to build
1982 # we assume it's also supported by later versions
1985 AC_MSG_RESULT($has_iquote)
1986 if test "x-$has_iquote" = "x-yes" ; then
1987 aros_cflags_iquote=-iquote
1988 aros_cflags_iquote_end=
1990 aros_cflags_iquote=-I
1991 aros_cflags_iquote_end=-I-
1994 if test "x-$use_no_stack_protector" = "x-yes" ; then
1995 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1999 #-----------------------------------------------------------------------------
2001 # Check if the target compiler supports some options used for delinting:
2002 # -Wunused-but-set-variable
2008 if test "x-$crosstools" != "x-yes"; then
2009 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2010 CC="$orig_target_cc"
2012 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2013 CFLAGS=-Wunused-but-set-variable
2014 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2015 AC_MSG_RESULT($aros_unused_but_set_variable)
2016 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2017 aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2020 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2021 CFLAGS=-Warray-bounds
2022 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2023 AC_MSG_RESULT($aros_array_bounds)
2024 if test "x-$aros_array_bounds" = "x-yes" ; then
2025 aros_cflags_array_bounds=-Wno-array-bounds
2028 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2029 CFLAGS=-Wenum-compare
2030 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2031 AC_MSG_RESULT($aros_enum_compare)
2032 if test "x-$aros_enum_compare" = "x-yes" ; then
2033 aros_cflags_enum_compare=-Wno-enum-compare
2036 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2037 CFLAGS=-Wstrict-overflow
2038 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2039 AC_MSG_RESULT($aros_strict_overflow)
2040 if test "x-$aros_strict_overflow" = "x-yes" ; then
2041 aros_cflags_strict_overflow=-Wno-strict-overflow
2044 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2045 CFLAGS=-Wformat-security
2046 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2047 AC_MSG_RESULT($aros_format_security)
2048 if test "x-$aros_format_security" = "x-yes" ; then
2049 aros_cflags_format_security=-Wno-format-security
2052 # We do not know which gcc version we are going to build and what we need to know
2053 # here is different for different versions so this will be set later during the
2054 # build of crosstools.
2055 aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2056 aros_cflags_array_bounds=@aros_cflags_array_bounds@
2057 aros_cflags_enum_compare=@aros_cflags_enum_compare@
2058 aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2059 aros_cflags_format_security=@aros_cflags_format_security@
2062 #-----------------------------------------------------------------------------
2064 # Check if we can explicitly choose older version of symbol hashing
2066 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2067 CC="$aros_kernel_cc"
2068 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2069 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2070 AC_MSG_RESULT($use_hash_style)
2071 if test "x-$use_hash_style" = "x-yes" ; then
2072 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2075 CFLAGS="$save_cflags"
2077 AC_SUBST(host_cflags_iquote)
2078 AC_SUBST(host_cflags_iquote_end)
2079 AC_SUBST(kernel_cflags_iquote)
2080 AC_SUBST(kernel_cflags_iquote_end)
2081 AC_SUBST(aros_cflags_iquote)
2082 AC_SUBST(aros_cflags_iquote_end)
2085 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2086 AC_MSG_CHECKING([for default resolution of WBScreen])
2087 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2088 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2089 if test "$resolution" = "yes" ; then
2092 if test "$resolution" = "no" ; then
2095 if test "$resolution" != "none" ; then
2096 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2097 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2098 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2100 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2101 aros_cv_default_wbwidth=$aros_default_wbwidth
2102 aros_cv_default_wbheight=$aros_default_wbheight
2103 aros_cv_default_wbdepth=$aros_default_wbdepth
2105 dnl See if the user wants the serial debug output for native flavour
2106 AC_MSG_CHECKING([if serial debug is enabled])
2107 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)
2108 if test "$aros_serial_debug" = 0 ; then
2109 serial_debug_forced=""
2110 if test "$serial_debug" = "yes" ; then
2113 if test "$serial_debug" = "no" ; then
2117 serial_debug_forced="(forced)"
2118 serial_debug=$aros_serial_debug
2120 if test "$serial_debug" != "none" ; then
2121 aros_serial_debug=$serial_debug
2122 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2127 dnl See if the user wants the palm debug output hack for palm native flavour
2128 AC_MSG_CHECKING([if palm debug hack is enabled])
2129 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")
2130 if test "$palm_debug_hack" = "yes" ; then
2131 aros_palm_debug_hack="1"
2133 AC_MSG_RESULT($palm_debug_hack)
2135 dnl See if the user wants the usb3.0 code
2136 AC_MSG_CHECKING([if usb3.0 code is enabled])
2137 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2138 if test "$usb30_code" = "yes" ; then
2139 aros_config_cflags="$aros_config_cflags -DAROS_USB30_CODE"
2140 aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2142 AC_MSG_RESULT($usb30_code)
2144 dnl See if the user wants nesting supervisor activated for unix flavour
2145 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2146 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")
2147 if test "$nesting_supervisor" = "yes" ; then
2148 aros_nesting_supervisor="1"
2150 AC_MSG_RESULT($nesting_supervisor)
2152 dnl See if the user wants to disable MMU support
2153 dnl This can be overriden on per-target basis,
2154 dnl set $aros_enable_mmu to "yes" or "no" to do this
2155 if test "$aros_enable_mmu" = "" ; then
2156 AC_MSG_CHECKING([if MMU support is enabled])
2157 dnl Enabled by default
2158 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2159 if test "$aros_enable_mmu" = "" ; then
2160 aros_enable_mmu="yes"
2162 AC_MSG_RESULT($aros_enable_mmu)
2164 if test "$aros_enable_mmu" = "no" ; then
2171 dnl things specifically required for hosted flavours
2172 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2174 if test "x-$need_dlopen" != "x-no" ; then
2175 dnl some kind of dynamic library access system is required for hostlib.resource
2176 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2177 if test "x-$have_dl" = "x-no" ; then
2178 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2179 aros_host_ldflags="$aros_host_ldflags -ldl"],
2182 if test "x-$have_dl" = "x-no" ; then
2183 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2189 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2190 [build X11 hidd for hosted (default=auto)]),
2191 x11_hidd="$enableval",
2192 x11_hidd="$need_x11")
2193 case "x-$x11_hidd" in
2194 x-yes|x-no|x-auto) ;;
2195 *) x11_hidd="$need_x11" ;;
2201 if test "x-$x11_hidd" != "x-no" ; then
2207 for path in $x_libraries
2209 x_cflags="$x_cflags -L$path"
2212 for path in $x_includes
2214 x_cflags="$x_cflags -I$path"
2217 if test "x-$no_x" = "x-yes" ; then
2220 if test "x-$x11_hidd" != "x-auto" ; then
2221 dnl and they explicitly asked for it, bail out
2222 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2226 dnl found it, setup the metatarget
2227 x11_hidd_target=kernel-x11gfx-kobj
2230 dnl setup shared memory extensions
2231 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2232 [use X11 shared memory (default=auto)]),
2233 x11_hidd_shm="$enableval",
2234 x11_hidd_shm="auto")
2235 case "x-$x11_hidd_shm" in
2236 x-yes|x-no|x-auto) ;;
2237 *) x11_hidd_shm="auto" ;;
2243 if test "x-$x11_hidd_shm" != "x-no" ; then
2245 dnl system shm headers
2246 AC_CHECK_HEADERS(sys/ipc.h)
2247 AC_CHECK_HEADERS(sys/shm.h)
2250 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2252 dnl make sure X libs have shm functions
2253 save_cflags="$CFLAGS"
2254 CFLAGS="$CFLAGS $x_cflags"
2255 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2256 CFLAGS="$save_cflags"
2260 dnl detection done, prepare output
2261 if test "x-$have_xshm" = "x-yes" ; then
2264 elif test "x-$x11_hidd_shm" = "x-yes" ; then
2265 dnl they explicitly asked for it, but we can't do it
2266 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2268 dnl otherwise just disable it
2273 dnl setup vidmode (fullscreen) extensions
2274 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2275 [use X11 vidmode extension (default=auto)]),
2276 x11_hidd_vidmode="$enableval",
2277 x11_hidd_vidmode="auto")
2278 case "x-$x11_hidd_vidmode" in
2279 x-yes|x-no|x-auto) ;;
2280 *) x11_hidd_vidmode="auto" ;;
2286 if test "x-$x11_hidd_vidmode" != "x-no" ; then
2288 dnl make sure X libs have vidmode functions
2289 save_cflags="$CFLAGS"
2290 CFLAGS="$CFLAGS $x_cflags"
2291 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2292 CFLAGS="$save_cflags"
2295 dnl detection done, prepare output
2296 if test "x-$have_vidmode" = "x-yes" ; then
2297 dnl we can do vidmode
2298 DO_VIDMODE_SUPPORT="1"
2299 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2300 dnl they explicitly asked for it, but we can't do it
2301 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2303 dnl otherwise just disable it
2304 DO_VIDMODE_SUPPORT="0"
2308 aros_host_x11_includes=$x_includes
2309 aros_host_x11_libdirs=$x_libraries
2314 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2315 [build SDL hidd for hosted (default=auto)]),
2316 sdl_hidd="$enableval",
2318 case "x-$sdl_hidd" in
2319 x-yes|x-no|x-auto) ;;
2320 *) sdl_hidd="auto" ;;
2324 if test "x-$sdl_hidd" != "x-no" ; then
2327 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2329 if test "x-$have_sdl" != "x-yes" ; then
2332 if test "x-$sdl_hidd" != "x-auto" ; then
2333 dnl and they explicitly asked for it, bail out
2334 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2338 dnl found it, set up the metatarget
2339 sdl_hidd_target=kernel-hidd-sdl
2340 aros_host_sdl_cflags=SDL_CFLAGS
2341 aros_host_sdl_libs=SDL_LIBS
2346 AC_CHECK_HEADER(sys/soundcard.h)
2347 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2348 oss_library_target=workbench-libs-oss-unix
2353 dnl See if the user wants dbus.library
2354 AC_MSG_CHECKING([if building of dbus.library is enabled])
2355 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2356 if test "$dbus" = "yes" ; then
2358 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2359 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2360 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2361 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2365 AC_MSG_RESULT($dbus)
2367 if test "$use_kernel_cc_wrapper" = "yes" ; then
2368 aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2371 if test "${crosstools}" != "yes" ; then
2372 aros_target_toolchain=no
2374 aros_target_toolchain=yes
2377 dnl --------------------------------------------------------------------
2378 dnl Configuration Output Section
2379 dnl --------------------------------------------------------------------
2384 AC_SUBST(aros_flavour)
2385 AC_SUBST(aros_flavour_uc)
2386 AC_SUBST(aros_target_toolchain)
2387 AC_SUBST(AROS_BUILDDIR)
2388 AC_SUBST(AROS_BUILDDIR_UNIX)
2390 AC_SUBST(AROS_CROSSTOOLSDIR)
2391 AC_SUBST(AROS_PORTSSRCDIR)
2393 # Compatability with other Amiga-like operation systems
2394 AC_SUBST(aros_amigaos_compliance)
2397 AC_SUBST(aros_cc_pre)
2398 AC_SUBST(aros_host_strip)
2399 AC_SUBST(aros_host_arch)
2400 AC_SUBST(aros_host_cpu)
2401 AC_SUBST(aros_host_cpp)
2402 AC_SUBST(aros_host_cc)
2403 AC_SUBST(aros_host_cxx)
2404 AC_SUBST(aros_host_ar)
2405 AC_SUBST(aros_host_ranlib)
2406 AC_SUBST(aros_host_ld)
2407 AC_SUBST(aros_host_make)
2408 AC_SUBST(aros_host_cflags)
2409 AC_SUBST(aros_host_cxxflags)
2410 AC_SUBST(gnu89_inline)
2411 AC_SUBST(aros_host_ldflags)
2412 AC_SUBST(aros_host_debug)
2413 AC_SUBST(aros_host_mkdep)
2414 AC_SUBST(aros_host_mkargs)
2415 AC_SUBST(aros_host_exe_suffix)
2416 AC_SUBST(aros_host_lib_suffix)
2417 AC_SUBST(aros_tools_dir)
2418 AC_SUBST(aros_host_aclocal)
2419 AC_SUBST(aros_host_autoconf)
2420 AC_SUBST(aros_host_autoheader)
2421 AC_SUBST(aros_host_automake)
2425 AC_SUBST(aros_target_guitheme)
2426 AC_SUBST(aros_target_iconset)
2427 AC_SUBST(aros_target_bootloader)
2428 AC_SUBST(aros_target_arch)
2429 AC_SUBST(aros_target_family)
2430 AC_SUBST(aros_target_cpu)
2431 AC_SUBST(aros_target_variant)
2432 AC_SUBST(aros_target_suffix)
2433 AC_SUBST(aros_target_ar)
2434 AC_SUBST(aros_target_ranlib)
2435 AC_SUBST(aros_plain_nm)
2436 AC_SUBST(aros_plain_ar)
2437 AC_SUBST(aros_kernel_ar)
2438 AC_SUBST(aros_kernel_ranlib)
2439 AC_SUBST(orig_target_cc)
2440 AC_SUBST(aros_target_cc)
2441 AC_SUBST(aros_kernel_cc)
2442 AC_SUBST(orig_target_cxx)
2443 AC_SUBST(aros_target_cxx)
2444 AC_SUBST(aros_kernel_cxx)
2445 AC_SUBST(orig_target_cpp)
2446 AC_SUBST(aros_target_cpp)
2447 AC_SUBST(aros_kernel_cpp)
2448 AC_SUBST(orig_target_as)
2449 AC_SUBST(aros_target_as)
2450 AC_SUBST(aros_kernel_as)
2451 AC_SUBST(orig_target_ld)
2452 AC_SUBST(aros_target_ld)
2453 AC_SUBST(aros_kernel_ld)
2454 AC_SUBST(aros_target_cc_includes)
2455 AC_SUBST(aros_target_cc_path)
2456 AC_SUBST(aros_target_objdump)
2457 AC_SUBST(aros_target_objcopy)
2458 AC_SUBST(aros_target_strip)
2459 AC_SUBST(aros_target_nm)
2460 AC_SUBST(aros_kernel_rescomp)
2461 AC_SUBST(aros_shared_default)
2462 AC_SUBST(aros_shared_ld)
2463 AC_SUBST(aros_object_format)
2464 AC_SUBST(aros_compiler_libs)
2465 AC_SUBST(aros_arch_libs)
2467 AC_SUBST(aros_config_cflags)
2468 AC_SUBST(aros_config_aflags)
2469 AC_SUBST(aros_config_ldflags)
2471 AC_SUBST(aros_shared_cflags)
2472 AC_SUBST(aros_shared_aflags)
2473 AC_SUBST(aros_shared_ldflags)
2474 AC_SUBST(aros_kernel_cflags)
2475 AC_SUBST(aros_kernel_includes)
2476 AC_SUBST(aros_kernel_objcflags)
2477 AC_SUBST(aros_kernel_ldflags)
2478 AC_SUBST(aros_target_cflags)
2479 AC_SUBST(aros_debug_cflags)
2480 AC_SUBST(aros_debug_aflags)
2481 AC_SUBST(aros_debug_ldflags)
2482 AC_SUBST(aros_target_genmap)
2483 AC_SUBST(aros_target_strip_flags)
2485 AC_SUBST(crosstools_target)
2486 AC_SUBST(crosstools_cxx_target)
2488 # Delinting target compiler flags
2489 AC_SUBST(aros_cflags_unused_but_set_variable)
2490 AC_SUBST(aros_cflags_array_bounds)
2491 AC_SUBST(aros_cflags_enum_compare)
2492 AC_SUBST(aros_cflags_strict_overflow)
2493 AC_SUBST(aros_cflags_format_security)
2496 AC_SUBST(x11_hidd_target)
2497 AC_SUBST(sdl_hidd_target)
2498 AC_SUBST(pci_hidd_target)
2499 AC_SUBST(oss_library_target)
2501 AC_SUBST(aros_default_wbwidth)
2502 AC_SUBST(aros_default_wbheight)
2503 AC_SUBST(aros_default_wbdepth)
2504 AC_SUBST(DO_XSHM_SUPPORT)
2505 AC_SUBST(DO_VIDMODE_SUPPORT)
2507 AC_SUBST(aros_host_x11_includes)
2508 AC_SUBST(aros_host_x11_libdirs)
2509 AC_SUBST(aros_host_sdl_cflags)
2510 AC_SUBST(aros_host_sdl_libs)
2512 # Native version related
2513 AC_SUBST(aros_serial_debug)
2515 # Palm native version related
2516 AC_SUBST(aros_palm_debug_hack)
2519 AC_SUBST(aros_usb30_code)
2521 # Unix/Hosted version related
2522 AC_SUBST(aros_nesting_supervisor)
2525 AC_SUBST(aros_enable_mmu)
2528 AC_SUBST(aros_ios_platform)
2529 AC_SUBST(aros_ios_version)
2530 AC_SUBST(aros_ios_sdk)
2533 AC_SUBST(android_tool)
2534 AC_SUBST(aros_android_level)
2537 AC_SUBST(ENABLE_DBUS)
2538 AC_SUBST(DBUS_CFLAGS)
2539 AC_SUBST(DBUS_LIBFLAGS)
2540 AC_SUBST(KERNEL_DBUS_KOBJ)
2541 AC_SUBST(KERNEL_DBUS_INCLUDES)
2544 AC_SUBST(ENABLE_X11)
2547 AC_SUBST(aros_debug)
2548 AC_SUBST(aros_mungwall_debug)
2549 AC_SUBST(aros_stack_debug)
2550 AC_SUBST(aros_modules_debug)
2552 # Collect-aros stuff: "-ius" to ignore undefined symbols
2553 AC_SUBST(ignore_undefined_symbols)
2555 # C compiler related
2556 AC_SUBST(gcc_target_cpu)
2558 dnl Prepare for output, make up all the generated patches
2559 case "$aros_flavour" in
2560 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2561 aros_flavour="emulation" ;;
2562 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2563 aros_flavour="emulation" ;;
2564 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2565 aros_flavour="standalone";;
2566 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2567 aros_flavour="standalone";;
2568 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2569 aros_flavour="native" ;;
2570 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2571 aros_flavour="native" ;;
2572 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2573 aros_flavour="linklib" ;;
2574 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2575 aros_flavour="palmnative" ;;
2576 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2577 aros_flavour="mac68knative" ;;
2578 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2579 aros_flavour="ppcnative" ;;
2582 if test ! -d ${aros_inc_dir} ; then
2583 ${MKDIR} ${aros_inc_dir}
2585 if test ! -d ${aros_geninc_dir} ; then
2586 ${MKDIR} ${aros_geninc_dir}
2588 if test ! -d ${aros_hostcfg_dir} ; then
2589 ${MKDIR} ${aros_hostcfg_dir}
2591 if test ! -d ${aros_targetcfg_dir} ; then
2592 ${MKDIR} ${aros_targetcfg_dir}
2594 if test ! -d ${aros_tools_dir} ; then
2595 ${MKDIR} ${aros_tools_dir}
2597 if test ! -d ${aros_scripts_dir} ; then
2598 ${MKDIR} ${aros_scripts_dir}
2601 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2603 AC_CONFIG_COMMANDS([compiler_executable],
2605 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2607 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2608 prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2612 chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2614 ln -sf $orig_target_as$aros_host_exe_suffix ${prefix2}-as$aros_host_exe_suffix
2615 ln -sf $orig_target_nm$aros_host_exe_suffix ${prefix2}-nm$aros_host_exe_suffix
2616 ln -sf $orig_target_ar$aros_host_exe_suffix ${prefix2}-ar$aros_host_exe_suffix
2617 ln -sf $orig_target_ranlib$aros_host_exe_suffix ${prefix2}-ranlib$aros_host_exe_suffix
2618 ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2619 ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2620 ln -sf $orig_target_strip$aros_host_exe_suffix ${prefix2}-strip$aros_host_exe_suffix
2622 ln -sf $aros_kernel_ld$aros_host_exe_suffix ${prefix3}-ld$aros_host_exe_suffix
2625 aros_host_exe_suffix=${aros_host_exe_suffix}
2626 aros_tools_dir=${aros_tools_dir}
2627 aros_target_cpu=${aros_target_cpu}
2628 aros_target_arch=${aros_target_arch}
2629 aros_target_suffix=${aros_target_suffix}
2630 orig_target_nm=${orig_target_nm}
2631 orig_target_as=${orig_target_as}
2632 orig_target_ar=${orig_target_ar}
2633 orig_target_ranlib=${orig_target_ranlib}
2634 orig_target_objdump=${orig_target_objdump}
2635 orig_target_objcopy=${orig_target_objcopy}
2636 orig_target_strip=${orig_target_strip}
2637 aros_kernel_ld=${aros_kernel_ld}
2640 AC_CONFIG_COMMANDS([genmf_executable],
2641 [chmod a+x ${aros_tools_dir}/genmf.py],
2642 [aros_tools_dir=${aros_tools_dir}]
2648 ${aros_inc_dir}/config.h:config/config.h.in
2649 ${aros_geninc_dir}/config.h:config/config.h.in
2650 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2651 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2653 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2654 ${aros_targetcfg_dir}/specs:config/specs.in
2655 ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2656 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2657 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2658 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2659 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2660 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2661 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2662 tools/collect-aros/env.h
2663 ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2668 dnl This is in order to not define SHARED_CFLAGS sometimes
2669 dnl We don't always do aros_shared_ar, aros_shared_cflags
2671 #XXX compatability...
2672 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2674 if test -n "$aros_shared_cflags" ; then
2675 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2676 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg