1 dnl Copyright © 1997-2012, 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 # Some debug output, to be removed again.
65 AC_MSG_CHECKING([for target system (debug output)])
66 AC_MSG_RESULT($target_os)
67 AC_MSG_CHECKING([for target cpu (debug output)])
68 AC_MSG_RESULT($target_cpu)
70 dnl --------------------------------------------------------------------
71 dnl Set the default Workbench resolution
72 dnl --------------------------------------------------------------------
73 aros_default_wbwidth=800
74 aros_default_wbheight=600
75 aros_default_wbdepth=4
77 dnl --------------------------------------------------------------------
78 dnl Host Configuration Section
79 dnl --------------------------------------------------------------------
81 dnl The idea here is to find out all the information we need about the
82 dnl host. This means things like tools for building directory structures,
83 dnl copying files around and the like.
85 # The first step is to find the host binaries.
86 # Check for a compiler.
92 # Check for a compatible awk
93 AC_CHECK_PROGS(AWK,[gawk nawk])
94 AROS_REQUIRED(gawk,$AWK)
95 AROS_PROG(MMAKE,mmake)
97 # Perform some default variable assignments. Note all of these will be
98 # Regenerated from the script, so there is no need to cache them.
103 AROS_TOOL_CCPATH(aros_host_ld,ld)
104 AROS_REQUIRED(ld,$aros_host_ld)
105 aros_host_make="make"
106 aros_host_cflags=$CFLAGS
107 aros_host_cxxflags=$CXXFLAGS
108 aros_host_ldflags=$LDFLAGS
109 aros_host_debug="-g -O0"
110 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
111 aros_host_mkargs="--no-print-directory"
112 aros_host_exe_suffix="$EXEEXT"
113 aros_host_lib_suffix=""
115 # Ignore all compliance, AROS ROMs = 0
116 # KickStart v1.0 = 30
117 # KickStart v1.3 = 34
118 # KickStart v2.0 = 37
119 # KickStart v3.0 = 39
120 # KickStart v3.1 = 40
122 aros_amigaos_compliance=0
124 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
125 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
126 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
127 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
129 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
130 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
132 case "$aros_host_cc" in
134 aros_host_cc_pipe="-pipe"
144 aros_kernel_cc_includes=""
145 aros_target_cc_includes=""
148 # ----------------------------------------------------------------------------------------
149 # Host-specific defaults
151 # This is the main host configuration section. It is where the host
152 # can change the values of any variables it needs to change. We do
153 # not look at anything that compiles to the target yet, we'll get
158 aros_host_arch="aros"
159 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
165 aros_host_cpu="x86_64"
171 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
172 aros_host_cpu="$host_cpu"
178 aros_host_arch="linux"
179 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
180 android_build_os="linux-x86"
181 android_tool="android"
182 default_android_sdk="/opt/android-sdk-linux_x86"
188 aros_host_cpu="x86_64"
200 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
201 aros_host_cpu="$host_cpu"
207 aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
208 aros_host_make="gmake"
209 aros_host_arch="freebsd"
212 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
214 dnl FreeBSD 5.x (and later) has changed the default object format.
215 dnl The double [[]] is necessary to get around m4's quoting rules.
218 aros_object_format="elf_i386"
222 aros_object_format="elf_i386_fbsd"
229 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
230 aros_host_arch="darwin"
232 android_build_os="darwin-x86"
233 android_tool="android"
234 default_android_sdk="/android-sdk-mac_x86"
240 aros_host_cpu="x86_64"
246 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
247 aros_host_cpu="$host_cpu"
251 aros_host_ldflags="$aros_host_ldflags -liconv"
256 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
257 aros_host_make="gmake"
258 aros_host_arch="dragonfly"
264 aros_host_cpu="x86_64"
267 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
268 aros_host_cpu="$host_cpu"
274 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
275 aros_host_make="gmake"
276 aros_host_arch="netbsd"
285 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
286 aros_host_cpu="$host_cpu"
289 aros_host_lib_suffix=".0.0"
293 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
294 aros_host_make="gmake"
295 aros_host_arch="openbsd"
301 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
302 aros_host_cpu="$host_cpu"
308 aros_host_arch="solaris"
309 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
315 aros_host_cpu="sparc"
318 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
319 aros_host_cpu="$host_cpu"
325 aros_host_arch="morphos"
331 aros_host_arch="amiga"
337 TOUCH="/gg/bin/touch"
346 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
347 aros_host_cpu="$host_cpu"
353 aros_host_arch="cygwin"
354 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
356 android_build_os="windows"
357 android_tool="android.bat"
358 default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
365 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
366 aros_host_cpu="$host_cpu"
372 aros_host_arch="mingw32"
373 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
375 android_build_os="windows"
376 android_tool="android.bat"
377 default_android_sdk="/c/android-sdk-windows-1.6_r1"
381 dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
382 dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
383 dnl Here we attempt to detect Windows home platform by asking gcc about its target.
384 dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
386 AC_MSG_CHECKING([for Windows native gcc target])
387 host_cpu=`gcc -dumpmachine`
388 AC_MSG_RESULT($host_cpu)
399 dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
404 aros_host_cpu="x86_64"
405 dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
406 dnl directory, so we have to add it explicitly here.
407 aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
411 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
412 aros_host_cpu="$host_cpu"
417 AC_MSG_ERROR([Unsupported host architecture $host])
421 AROS_PROG(aros_host_ar,[ar],[cr])
422 AROS_REQUIRED(ar,$aros_host_ar)
423 AROS_PROG(aros_host_ranlib,ranlib)
424 AROS_REQUIRED(ranlib,$aros_host_ranlib)
425 AROS_PROG(aros_host_strip,strip)
426 AROS_REQUIRED(strip,$aros_host_strip)
428 AROS_PROG(RM,[rm],[-rf])
429 AROS_REQUIRED(rm,$RM)
431 AROS_REQUIRED(cp,$CP)
433 AROS_REQUIRED(mv,$MV)
434 AROS_PROG(ECHO,[echo])
435 AROS_REQUIRED(echo,$ECHO)
436 AROS_PROG(MKDIR,[mkdir],[-p])
437 AROS_REQUIRED(mkdir,$MKDIR)
438 AROS_PROG(TOUCH,[touch])
439 AROS_REQUIRED(touch,$TOUCH)
440 AROS_PROG(SORT,[sort])
441 AROS_REQUIRED(sort,$SORT)
442 AROS_PROG(UNIQ,[uniq])
443 AROS_REQUIRED(uniq,$UNIQ)
444 AROS_PROG(NOP,[true])
445 AROS_REQUIRED(true,$NOP)
447 AROS_REQUIRED(cat,$CAT)
448 AROS_PROG(BISON,[bison])
449 AROS_REQUIRED(bison,$BISON)
450 AROS_PROG(FLEX,[flex])
451 AROS_REQUIRED(flex,$FLEX)
452 AROS_PROG(PNGTOPNM,[pngtopnm])
453 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
454 AROS_PROG(PPMTOILBM,[ppmtoilbm])
455 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
457 AROS_REQUIRED(sed,$SED)
458 AROS_PROG(CHMOD,[chmod])
459 AROS_REQUIRED(chmod,$CHMOD)
460 AROS_PROG(PATCH,[patch])
461 AROS_REQUIRED(patch,$PATCH)
470 dnl ---------------------------------------------------------------------------
471 dnl Look for things about the host system, good for hosted targets.
472 dnl ---------------------------------------------------------------------------
474 # Check for some includes for the X11 HIDD and the kernel
475 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
476 sys/mmap.h sys/mman.h sysexits.h \
477 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
480 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
497 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
499 # Look for some functions
500 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
501 clone kse_create rfork_thread thr_create sa_register \
502 getcontext makecontext setcontext sigaltstack swapcontext])
507 dnl --------------------------------------------------------------------
508 dnl Target Configuration Section
509 dnl --------------------------------------------------------------------
511 dnl The target configuration section is responsible for setting up all
512 dnl the paths for includes, and tools required to build AROS to some
513 dnl particular target.
515 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
516 aros_config_aflags="-Wall -x assembler-with-cpp -c"
517 aros_config_ldflags=""
519 aros_shared_default=yes
521 aros_shared_cflags="-fPIC"
522 aros_shared_aflags=""
523 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
524 aros_kernel_ldflags="-Wl,-rpath,./lib"
526 aros_kernel_ar_flags="cr"
527 aros_target_ar_flags="cr"
528 aros_target_nm_flags="-C -ul"
529 aros_target_strip_flags="--strip-unneeded -R.comment"
534 aros_target_genmap="-Wl,-Map -Xlinker"
536 # Native flavour stuff
537 aros_serial_debug="0"
539 # Palm native flavour stuff
540 aros_palm_debug_hack="0"
543 aros_nesting_supervisor="0"
545 # Collect-aros stuff: "-ius" to ignore undefined symbols
546 ignore_undefined_symbols=""
548 # Check for X11 by default
551 #-----------------------------------------------------------------------------
554 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
555 # it switched on by default, and we use the host compiler, so it compiles AROS
556 # code with this enabled resulting in link failures as we don't have support
559 # We use two methods to disable it. For the host compiler (used to compile
560 # some hosted modules), we test to see if the compiler supports stack
561 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
562 # work on all platforms.
564 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
565 # (this is done unconditionally, as it should have no effect on compilers
566 # without the stack protection feature). This may be specific to the way that
567 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
568 # strong enough to disable it in a generic way though, so we'll live with it
569 # until another vendor ships GCC with it enabled in a different way, and deal
573 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
574 save_cflags="$CFLAGS"
575 CFLAGS="$CFLAGS -fno-stack-protector"
576 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
577 AC_MSG_RESULT($use_no_stack_protector)
578 if test "x-$use_no_stack_protector" = "x-yes" ; then
579 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
581 CFLAGS="$save_cflags"
583 #-----------------------------------------------------------------------------
585 # Disable pointer-signedness warnings if the compiler recognises the option
586 # (this only works for the host compiler at the moment)
588 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
589 save_cflags="$CFLAGS"
590 CFLAGS="$CFLAGS -Wno-pointer-sign"
591 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
592 AC_MSG_RESULT($use_no_sign_warning)
593 if test "x-$use_no_sign_warning" = "x-yes" ; then
594 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
596 CFLAGS="$save_cflags"
598 #-----------------------------------------------------------------------------
600 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
602 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
603 save_cflags="$CFLAGS"
604 CFLAGS="$CFLAGS -fgnu89-inline"
605 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
606 AC_MSG_RESULT($use_gnu89_inline)
607 if test "x-$use_gnu89_inline" = "x-yes" ; then
608 gnu89_inline="-fgnu89-inline"
610 CFLAGS="$save_cflags"
612 #-----------------------------------------------------------------------------
614 AC_MSG_CHECKING([for type of build])
615 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")
617 if test "$build_type" = "nightly"; then
618 build_type_string="NIGHTLY"
619 elif test "$build_type" = "snapshot"; then
620 build_type_string="SNAPSHOT"
621 elif test "$build_type" = "milestone"; then
622 build_type_string="MILESTONE"
623 elif test "$build_type" = "release"; then
624 build_type_string="RELEASE"
626 build_type_string="PERSONAL"
627 build_type="personal"
630 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
632 AC_MSG_RESULT($build_type)
634 #-----------------------------------------------------------------------------
635 all_debug_types="messages stack modules mungwall symbols"
637 AC_MSG_CHECKING([which debug types to enable])
638 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)]),
639 debug="$enableval",debug="")
641 if test "$debug" = "" -o "$debug" = "no"; then
643 elif test "$debug" = "yes"; then
647 if test "$debug" = "all" ; then
648 debug="messages stack modules symbols"
649 for d in $all_debug_types; do
650 export aros_${d}_debug="1"
653 for d in $all_debug_types; do
654 export aros_${d}_debug="0"
658 if test "$debug" != "none"; then
659 debug=`echo $debug | sed s/,/\ /g`
662 for d2 in $all_debug_types; do
663 if test "$d2" = "$d"; then
668 if test "$found" = "0"; then
669 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
671 export aros_${d}_debug="1"
675 AC_MSG_RESULT($debug)
677 if test "$aros_messages_debug" = "1"; then
678 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
680 aros_messages_debug=""
682 if test "$aros_symbols_debug" = "1"; then
683 aros_symbols_debug="-g"
685 aros_symbols_debug=""
688 # These are the flags to pass when compiling debugged programs
689 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
691 aros_debug_ldflags="$aros_symbols_debug"
693 #-----------------------------------------------------------------------------
694 # Checking for distcc and ccache.
696 # Always apply the transforms in this particular order. Basically you should
697 # always run 'ccache distcc compiler' in that order for the best performance.
699 AC_MSG_CHECKING([whether to enable distcc])
700 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
701 if test "$distcc" != "" -a "$distcc" != "no"; then
702 # AC_CHECK_PROG will print out the result in this case
703 AC_PATH_PROG(DISTCC,[distcc],distcc,)
708 AC_MSG_CHECKING([whether to enable ccache])
709 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
710 if test "$ccache" != "" -a "$ccache" != "no"; then
711 # AC_CHECK_PROG will print out the result in this case
712 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
717 #-----------------------------------------------------------------------------
718 AC_MSG_CHECKING([what specific host gcc version to use])
719 AC_ARG_WITH(kernel-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")
720 AC_MSG_RESULT($kernel_tool_version)
722 #-----------------------------------------------------------------------------
723 AC_MSG_CHECKING([what specific target gcc version to use])
724 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")
725 AC_MSG_RESULT($target_tool_version)
727 #-----------------------------------------------------------------------------
728 AC_MSG_CHECKING([what optimization flags to use])
729 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
730 if test "$optimization" = "unknown"; then
731 dnl default is -O2 for normal builds, -O0 for debug builds
732 if test "$debug" != "none"; then
738 aros_config_cflags="$aros_config_cflags $optimization"
739 AC_MSG_RESULT($optimization)
741 #-----------------------------------------------------------------------------
742 AC_MSG_CHECKING([what paranoia flags to use])
743 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
744 if test "$paranoia_flags" = "default"; then
746 else if test "$paranoia_flags" = "yes"; then
747 paranoia_flags="-Wall -Werror"
749 AC_MSG_RESULT($paranoia_flags)
750 aros_config_cflags="$aros_config_cflags $paranoia_flags"
752 #-----------------------------------------------------------------------------
753 AC_MSG_CHECKING([what target variant to enable])
754 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
755 if test "$target_variant" = ""; then
756 aros_target_variant=""
757 aros_target_suffix=""
760 aros_target_variant="$target_variant"
761 aros_target_suffix="-$target_variant"
763 AC_MSG_RESULT($enableval)
765 #-----------------------------------------------------------------------------
766 # Target-specific defaults. You can override then on a per-target basis.
768 # Bootloader name. Currently used by PC target.
769 target_bootloader="none"
771 #-----------------------------------------------------------------------------
772 # Additional options for some specific targets
774 case "$aros_target_variant" in
776 AC_MSG_CHECKING([XCode path])
777 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")
778 AC_MSG_RESULT($aros_xcode_path)
780 AC_MSG_CHECKING([what iOS SDK version to use])
781 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")
782 AC_MSG_RESULT($aros_sdk_version)
787 AC_MSG_CHECKING([Android SDK path])
788 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)
789 AC_MSG_RESULT($aros_android_sdk)
791 AC_MSG_CHECKING([Android NDK path])
792 AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
793 AC_MSG_RESULT($aros_android_ndk)
795 AC_MSG_CHECKING([what Android SDK version to use])
796 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")
797 AC_MSG_RESULT($aros_sdk_version)
799 if test "$aros_android_ndk" != "none"; then
800 AC_MSG_CHECKING([what Android NDK version to use])
801 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")
802 AC_MSG_RESULT($aros_ndk_version)
805 export PATH="$aros_android_sdk/tools:$PATH"
806 AC_PATH_PROG(android_tool, $android_tool)
807 AROS_REQUIRED(android,$android_tool)
809 aros_android_level=android-$aros_sdk_version
810 if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
811 echo "Platform $aros_android_level is not installed in your SDK"
812 echo "Use --with-sdk-version=<API level number> to select another platform version"
813 echo "You can check what plaform versions are installed in your SDK"
814 echo "by examining contents of $aros_android_sdk/platforms directory"
815 AC_MSG_ERROR([Android platform $aros_android_level is not installed])
818 AC_PATH_PROG(ant, ant)
819 if test "$ant" = ""; then
820 AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
823 dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
824 if test "$host_os" = "mingw32"; then
825 android_tool="cmd //c $android_tool"
831 #-----------------------------------------------------------------------------
832 # External toolchains
833 kernel_tool_prefix="none"
834 aros_tool_prefix="none"
835 elf_tool_prefix="${target_cpu}-elf-"
837 # This is the target configuration switch.
840 aros_target_arch="linux"
841 aros_target_family="unix"
842 case "$target_cpu" in
844 aros_target_cpu="m68k"
845 aros_object_format="m68kelf"
846 aros_flavour="emulcompat"
847 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
848 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
849 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
850 gcc_target_cpu="mc68000"
853 aros_target_cpu="i386"
854 aros_object_format="elf_i386"
855 aros_flavour="emulation"
856 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
857 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
858 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
859 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
860 aros_config_ldflags="-m32 -march=i486"
861 aros_kernel_ldflags="-melf_i386"
862 aros_default_wbdepth=8
863 gcc_target_cpu="i386"
864 pci_hidd_target="hidd-pci-linux"
865 android_tool_dir_prefix="x86"
866 android_tool_prefix="i686-android-linux"
867 android_ndk_arch="x86"
870 aros_target_cpu="x86_64"
871 aros_object_format="elf_x86_64"
872 aros_flavour="emulation"
873 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
874 aros_config_cflags="$aros_config_cflags -mno-red-zone -fno-omit-frame-pointer"
875 aros_default_wbdepth=8
876 pci_hidd_target="hidd-pci-linux"
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 # Same as powerpc, but I need this for the nightly build to work again.
888 # Actually, the nightly should be made working with powerpc target.
889 # That just was too much work for the moment, another week or two.
891 aros_target_cpu="ppc"
892 aros_object_format="elf32ppc"
893 aros_flavour="emulation"
894 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
895 aros_default_wbdepth=8
899 aros_target_cpu="arm"
901 aros_object_format="armelf_linux_eabi"
902 aros_flavour="emulation"
903 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
905 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
906 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
907 aros_arch_libs="-laeabi"
908 gcc_default_fpu="vfpv3-d16"
909 gcc_default_float_abi="hard"
910 android_tool_dir_prefix="arm-linux-androideabi"
911 android_tool_prefix="arm-linux-androideabi"
912 android_ndk_arch="arm"
913 kernel_tool_prefix="arm-linux-gnueabihf-"
916 aros_target_cpu="arm"
917 aros_object_format="armelf_linux_eabi"
918 aros_flavour="emulation"
919 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
921 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
922 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
923 aros_arch_libs="-laeabi"
924 android_tool_dir_prefix="arm-linux-androideabi"
925 android_tool_prefix="arm-linux-androideabi"
926 android_ndk_arch="arm"
927 kernel_tool_prefix="arm-linux-gnueabi-"
930 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
933 case "$aros_target_variant" in
936 dnl Not all Linux CPUs are supported by Android
937 if test "$android_ndk_arch" = ""; then
938 AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
941 aros_default_wbwidth=320
942 aros_default_wbheight=480
943 if test "$aros_android_ndk" = "none"; then
944 dnl Use standalone toolchain, don't adjust paths
945 aros_kernel_cflags="-mandroid"
946 aros_kernel_ldflags="-mandroid"
949 export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
950 aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
951 aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
952 aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
953 CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
954 aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
957 dnl (Ab)use $(X11_HIDD_TARGET) as "Default display driver target"
958 dnl in order not to fill mmakefiles with garbage
959 x11_hidd_target=kernel-hidd-androidgfx-kobj
960 # Disable implicit PIC mode
961 aros_target_cflags="$aros_target_cflags -fno-pic"
962 kernel_tool_prefix="$android_tool_prefix-"
968 aros_target_arch="pc"
969 aros_shared_default="no"
970 target_bootloader="grub2"
971 case "$target_cpu" in
973 aros_target_cpu="i386"
975 dnl If somebody hasn't already set the target object
976 dnl format, then use this value. Mostly to support
977 dnl FreeBSD cross-compilation.
978 dnl TODO: Remove when we always use our compiler.
980 if test "$aros_object_format" = "" ; then
981 aros_object_format="elf_i386"
983 aros_flavour="standalone"
984 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
985 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
986 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
987 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
988 aros_config_ldflags="-m32 -march=i486"
989 aros_kernel_ldflags="-melf_i386"
990 aros_default_wbwidth=640
991 aros_default_wbheight=480
992 gcc_target_cpu="i386"
995 aros_target_cpu="x86_64"
997 if test "$aros_object_format" = "" ; then
998 aros_object_format="elf_x86_64"
1000 aros_flavour="standalone"
1001 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1002 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone -fno-omit-frame-pointer"
1003 aros_kernel_ldflags=""
1004 aros_default_wbwidth=640
1005 aros_default_wbheight=480
1008 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1014 aros_target_arch="prep"
1015 aros_shared_default="no"
1016 aros_target_cpu="ppc"
1017 aros_object_format="elf32ppc"
1018 aros_flavour="ppcnative"
1019 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1020 aros_kernel_ldflags=""
1021 aros_default_wbwidth=640
1022 aros_default_wbheight=480
1023 gcc_target_cpu="ppc"
1027 aros_target_arch="freebsd"
1028 aros_target_family="unix"
1029 aros_target_cpu="i386"
1030 aros_flavour="emulation"
1031 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1032 gcc_target_cpu="i386"
1034 aros_target_strip_flags="-x"
1038 aros_target_arch="darwin"
1039 aros_target_family="unix"
1040 aros_flavour="emulation"
1041 case "$target_cpu" in
1043 aros_ios_platform="iPhoneSimulator"
1044 aros_target_cpu="i386"
1045 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1046 aros_kernel_ldflags=""
1047 aros_macosx_version="10.4"
1048 aros_default_wbdepth=8
1049 gcc_target_cpu="i386"
1050 aros_object_format="elf_i386"
1051 aros_kernel_ar_flags="-cr"
1052 aros_target_strip_flags="-x"
1053 kernel_tool_flags="-m32"
1056 aros_target_cpu="x86_64"
1057 aros_object_format="elf_x86_64"
1058 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1059 aros_macosx_version="10.6"
1060 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1061 aros_kernel_cflags="-m64"
1062 aros_kernel_ldflags="-m64"
1063 aros_target_cflags="-mcmodel=large"
1064 aros_default_wbdepth=8
1066 aros_kernel_ar_flags="-cr"
1068 aros_kernel_ranlib="ranlib"
1071 aros_target_cpu="ppc"
1072 aros_object_format="elf32ppc"
1073 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1074 aros_kernel_ldflags=""
1075 aros_macosx_version="10.0"
1076 aros_default_wbdepth=8
1077 gcc_target_cpu="ppc"
1079 aros_kernel_ar_flags="-cr"
1080 aros_kernel_ld="ld -arch ppc"
1081 aros_kernel_as="as -arch ppc"
1082 aros_kernel_ranlib="ranlib -arch ppc"
1083 aros_kernel_nm="nm -arch ppc"
1084 aros_kernel_strip="strip -arch ppc"
1085 kernel_tool_prefix="powerpc-apple-darwin10-"
1088 aros_ios_platform="iPhoneOS"
1089 aros_target_cpu="arm"
1090 aros_object_format="armelf_linux_eabi"
1091 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1092 aros_arch_libs="-laeabi"
1093 aros_default_wbdepth=8
1094 gcc_target_cpu="arm"
1096 aros_kernel_ar_flags="-cr"
1097 aros_kernel_ld="ld -arch arm"
1098 aros_kernel_ranlib="ranlib -arch arm"
1099 kernel_tool_prefix="arm-apple-darwin10-"
1100 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1103 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1106 case "$aros_target_variant" in
1108 aros_ios_version="3.0"
1109 aros_default_wbwidth=320
1110 aros_default_wbheight=480
1111 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1112 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1113 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1115 # This is here because it may depend on iOS or SDK version
1116 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1117 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1118 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1121 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1122 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1128 aros_target_arch="dragonfly"
1129 aros_target_family="unix"
1130 aros_flavour="emulation"
1131 case "$target_cpu" in
1133 aros_target_cpu="i386"
1134 aros_object_format="elf_i386"
1135 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1138 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1139 aros_target_cpu="x86_64"
1140 aros_object_format="elf_x86_64"
1141 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1144 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1150 aros_target_arch="netbsd"
1151 aros_target_family="unix"
1152 case "$target_cpu" in
1154 aros_target_cpu="m68k"
1155 aros_object_format="m68kelf"
1156 aros_flavour="emulcompat"
1157 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1158 gcc_target_cpu="mc68000"
1161 aros_target_cpu="i386"
1162 aros_object_format="elf_i386"
1163 aros_flavour="emulation"
1164 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1165 aros_default_wbdepth=8
1166 gcc_target_cpu="i386"
1169 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1172 aros_target_genmap="-Wl,-M -Xlinker >"
1173 aros_flavour="emulation"
1174 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1178 aros_target_arch="openbsd"
1179 aros_target_family="unix"
1180 case "$target_cpu" in
1182 aros_target_cpu="i386"
1183 aros_object_format="elf_i386"
1184 aros_flavour="emulation"
1185 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1186 gcc_target_cpu="i386"
1189 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1192 aros_target_genmap="-Wl,-M -Xlinker >"
1193 aros_target_nm_flags="-u"
1194 aros_flavour="emulation"
1198 aros_target_arch="solaris"
1199 aros_target_family="unix"
1200 case "$target_cpu" in
1202 aros_target_cpu="i386"
1203 aros_object_format="elf_i386"
1204 aros_flavour="emulation"
1205 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1206 aros_default_wbdepth=8
1207 gcc_target_cpu="i386"
1210 aros_target_cpu="sparc"
1211 aros_object_format="elf_sparc"
1212 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1213 gcc_target_cpu="sparc"
1216 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1219 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1220 aros_flavour="emulation"
1224 aros_target_arch="morphos"
1225 aros_shared_default="no"
1226 aros_target_cpu="ppc"
1227 aros_object_format="elf_ppc"
1228 aros_flavour="nativecompat"
1229 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1230 gcc_target_cpu="ppc"
1234 aros_target_arch="sam440"
1235 aros_shared_default="no"
1236 aros_target_cpu="ppc"
1237 aros_object_format="elf32ppc"
1238 aros_flavour="ppcnative"
1239 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1240 aros_kernel_ldflags=""
1241 aros_default_wbwidth=1024
1242 aros_default_wbheight=768
1243 aros_default_wbdepth=24
1244 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1245 gcc_target_cpu="powerpc"
1249 aros_target_arch="efika"
1250 aros_shared_default="no"
1251 aros_target_cpu="arm"
1252 aros_object_format="armelf_linux_eabi"
1253 aros_flavour="standalone"
1254 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1255 aros_kernel_ldflags=""
1256 aros_default_wbwidth=1024
1257 aros_default_wbheight=600
1258 aros_arch_libs="-laeabi"
1259 gcc_default_cpu="armv7-a"
1260 gcc_default_fpu="vfpv3"
1261 gcc_default_float_abi="softfp"
1262 aros_config_cflags="$aros_config_cflags -mtune=cortex-a8 -fno-strict-aliasing"
1263 aros_config_aflags="$aros_config_aflags -mtune=cortex-a8 -fno-strict-aliasing"
1267 aros_target_arch="chrp"
1268 aros_shared_default="no"
1269 aros_target_cpu="ppc"
1270 aros_object_format="elf32ppc"
1271 aros_flavour="ppcnative"
1272 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1273 aros_kernel_ldflags=""
1274 aros_default_wbwidth=640
1275 aros_default_wbheight=480
1276 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1277 gcc_target_cpu="powerpc"
1278 case "$aros_target_variant" in
1280 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1286 aros_target_arch="amiga"
1287 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1288 aros_shared_default="no"
1290 case "$target_cpu" in
1292 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")
1294 aros_target_cpu="m68k"
1295 aros_object_format="m68kelf"
1296 aros_flavour="standcompat"
1297 gcc_target_cpu="m68000"
1298 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin -Wno-volatile-register-var -Os -DNOLIBINLINE"
1299 aros_config_aflags="$aros_config_aflags"
1300 aros_target_strip_flags="-R.comment --strip-debug"
1301 aros_default_wbwidth=640
1302 aros_default_wbheight=256
1303 aros_default_wbdepth=2
1307 aros_flavour="native"
1308 gcc_target_cpu="ppc"
1311 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1317 aros_target_arch="mingw32"
1318 aros_shared_default="no"
1319 aros_flavour="emulation"
1320 aros_shared_cflags=""
1321 need_crosstools="yes"
1324 case "$target_cpu" in
1326 aros_target_cpu="i386"
1327 aros_object_format="elf_i386"
1328 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1329 aros_default_wbdepth=8
1330 gcc_target_cpu="i386"
1332 kernel_tool_prefix="i386-mingw32-"
1335 aros_target_cpu="x86_64"
1336 aros_object_format="elf_x86_64"
1337 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1338 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1339 aros_default_wbdepth=8
1340 kernel_tool_prefix="x86_64-w64-mingw32-"
1343 aros_target_cpu="arm"
1344 aros_object_format="armelf_linux_eabi"
1345 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1346 aros_arch_libs="-laeabi"
1347 aros_default_wbdepth=8
1348 gcc_target_cpu="arm"
1349 gcc_default_float_abi="soft"
1350 kernel_tool_prefix="arm-mingw32ce-"
1351 aros_default_wbwidth=160
1352 aros_default_wbheight=160
1355 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1358 if test $host_os = "cygwin"; then
1359 aros_kernel_cflags="-mno-cygwin"
1363 aros_target_arch="pp"
1364 aros_shared_default="no"
1365 case "$target_cpu" in
1367 aros_target_cpu="m68k"
1368 aros_object_format="m68kelf"
1369 aros_flavour="palmnative"
1370 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1371 aros_default_wbwidth=160
1372 aros_default_wbheight=160
1373 aros_default_wbdepth=1
1374 aros_target_ar_flags="cru"
1375 aros_compiler_libs="-lgcc1"
1376 aros_shared_default=no
1377 aros_shared_cflags="-fpic"
1378 aros_shared_aflags=""
1379 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1380 aros_kernel_ldflags="-Wl,-rpath,./lib"
1381 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
1382 aros_debug_aflags=""
1383 aros_debug_ldflags="$aros_symbols_debug"
1384 aros_mungwall_debug="0"
1385 aros_modules_debug="0"
1386 gcc_target_cpu="mc68000"
1387 ignore_undefined_symbols="-ius"
1390 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1396 aros_target_arch="mac"
1397 aros_shared_default="no"
1398 case "$target_cpu" in
1400 aros_target_cpu="m68k"
1401 aros_object_format="m68kelf"
1402 aros_flavour="mac68knative"
1403 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1404 aros_default_wbwidth=512
1405 aros_default_wbheight=384
1406 aros_default_wbdepth=8
1407 aros_target_ar_flags="cru"
1408 aros_compiler_libs="-lgcc1"
1409 aros_shared_default=no
1410 aros_shared_cflags="-fpic"
1411 aros_shared_aflags=""
1412 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1413 aros_kernel_ldflags="-Wl,-rpath,./lib"
1414 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
1415 aros_debug_aflags=""
1416 aros_debug_ldflags="$aros_symbols_debug"
1417 aros_mungwall_debug="0"
1418 aros_modules_debug="0"
1419 gcc_target_cpu="mc68000"
1420 ignore_undefined_symbols="-ius"
1423 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1429 AC_MSG_ERROR([Unsupported target architecture $target])
1433 #-----------------------------------------------------------------------------
1434 crosstools_guess=yes
1436 AC_MSG_CHECKING([Kernel toolchain prefix])
1437 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1438 AC_MSG_RESULT($kernel_tool_prefix)
1440 AC_MSG_CHECKING([ELF toolchain prefix])
1441 AC_ARG_WITH(elf-toolchain-prefix,AC_HELP_STRING([--with-elf-toolchain-prefix=...],[Specify crosscompile toolchain prefix to wrap for AROS objects]),[elf_tool_prefix="$withval"
1442 crosstools_guess=no])
1443 AC_MSG_RESULT($elf_tool_prefix)
1445 AC_MSG_CHECKING([AROS toolchain prefix])
1446 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain]),[aros_tool_prefix="$withval"
1447 crosstools_guess=no])
1448 if test "$aros_tool_prefix" = "yes" ; then
1449 aros_tool_prefix=$aros_target_cpu-aros-
1451 AC_MSG_RESULT($aros_tool_prefix)
1453 #-----------------------------------------------------------------------------
1454 # Checking if we should build crosstools..
1455 AC_MSG_CHECKING([whether to build crosstools])
1456 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1457 AC_MSG_RESULT($crosstools)
1459 if test "${crosstools}" = "yes"; then
1460 if test "${crosstools_guess}" = "no"; then
1461 AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1465 AC_MSG_CHECKING([where to install the crosstools binaries])
1466 AC_ARG_WITH(aros-toolchain-install,AC_HELP_STRING([--with-aros-toolchain-install=DIR],[Where to install or search for cross tools binaries]),[aros_toolchain_install=$withval])
1467 if test "x$aros_toolchain_install" = "x"; then
1468 AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1470 AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1471 PATH="$AROS_CROSSTOOLSDIR:$PATH"
1473 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1476 # Now process extra architecture-specific options.
1477 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1478 # as well as floating-point ABI.
1479 case "$aros_target_cpu" in
1481 dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1482 if test "$gcc_default_cpu" = ""; then
1483 gcc_default_cpu="armv6"
1485 if test "$gcc_default_fpu" = ""; then
1486 gcc_default_fpu="vfp"
1488 if test "$gcc_default_float_abi" = ""; then
1489 gcc_default_float_abi="softfp"
1492 AC_MSG_CHECKING([Which minimum CPU to use])
1493 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)
1494 AC_MSG_RESULT($aros_gcc_cpu)
1496 AC_MSG_CHECKING([Which minimum FPU to use])
1497 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)
1498 AC_MSG_RESULT($aros_gcc_fpu)
1500 AC_MSG_CHECKING([Which floating point ABI to use])
1501 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)
1502 AC_MSG_RESULT($aros_gcc_float_abi)
1504 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"
1505 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"
1509 # Some formats need custom ELF specs.
1510 # For example for x86_64 it is needed in order for -m32 switch to work correctly.
1511 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1512 elf_specs_in=config/${aros_object_format}-specs.in
1514 elf_specs_in=config/elf-specs.in
1517 AC_MSG_CHECKING([what specific AROS gcc version to use])
1518 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="")
1519 AC_MSG_RESULT($aros_gcc_version)
1521 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
1522 # Since we override specs, we may need to put these defines there
1523 if test "$gcc_target_cpu" != ""; then
1524 gcc_target_cpu="-D__${gcc_target_cpu}__"
1527 AC_MSG_CHECKING([where to download sourcecode for external ports])
1528 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1529 if test "$with_portssrcdir" = "default"; then
1530 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1532 AROS_PORTSSRCDIR="$with_portssrcdir"
1534 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1536 AC_MSG_CHECKING([which bootloader to use])
1537 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1538 if test "$target_bootloader" = "none"; then
1539 aros_target_bootloader=""
1541 aros_target_bootloader="$target_bootloader"
1543 AC_MSG_RESULT($target_bootloader)
1545 AC_MSG_CHECKING([which icon-set to use])
1546 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1547 if test "$target_iconset" = "default"; then
1548 aros_target_iconset="Gorilla"
1549 target_iconset="default (Gorilla)"
1551 aros_target_iconset="$target_iconset"
1553 AC_MSG_RESULT($target_iconset)
1555 AC_MSG_CHECKING([which GUI Theme to use])
1556 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1557 if test "$target_guitheme" = "default"; then
1558 aros_target_guitheme="Ice"
1560 aros_target_guitheme="$target_guitheme"
1562 AC_MSG_RESULT($aros_target_guitheme)
1564 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1568 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
1569 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1573 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
1574 dnl The flag itself is given in per-target section, because some targets require to pass it
1575 dnl in a different manner, otherwise some tests fail.
1576 dnl TODO: Justify this.
1577 if test "$aros_host_cpu" == "x86_64" ; then
1578 if test "$aros_target_cpu" == "i386" ; then
1583 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1584 dnl For a hosted build we are cross-compiling if host OS differs from build OS.
1585 dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
1586 dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
1587 dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
1588 dnl used to build bootstrap for target arch in either case.
1589 dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
1590 dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
1591 dnl perhaps introducing aros_host_variant
1592 if test "$aros_host_arch" != "$aros_target_arch" ; then
1596 dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
1597 dnl it as kernel_cc. If not, (e. g. we are on Windows or Darwin), we need a crosscompiler.
1598 if test "$host_cc_elf" = "no" ; then
1603 if test "$cross_compiling" = "no" ; then
1604 kernel_tool_prefix=""
1605 if test "$host_cc_elf" = "yes" ; then
1610 #######################################################################
1611 ## Compute what toolchains to use, and their paths ##
1612 #######################################################################
1614 # This takes, as input:
1615 # crosstools {yes,no}
1616 # aros_gcc_version {default,[version]}
1617 # kernel_tool_prefix {none,[some-arch-os-]}
1618 # aros_tool_prefix ${target_cpu}-aros-
1621 # aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1622 # Where the 'kernel' binaries are located
1623 # orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
1624 # Where the 'target' binaries are located
1625 # (not the symlink farm - that is aros_target_*!)
1628 # if crosstools then
1629 # if kernel_tools_prefix = "no-kernel-prefix-"
1630 # aros_kernel_* = crosstools cc paths
1631 # aros_kernel_cc = elf cc wrapper around crosstools cc
1633 # VALIDATE(${kernel_tools_prefix}*)
1634 # aros_kernel_* = ${kernel_tools_prefix}*
1635 # if ${kernel_tools_prefix}cc is an AROS gcc
1636 # aros_kernel_cc = ${kernel_tools_prefix}cc
1638 # aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
1642 # orig_target_* = aros built crosstools
1643 # orig_target_cc = elf cc wrapper around crosstools cc
1645 # VALIDATE(${kernel_tools_prefix}*)
1647 # orig_target_* = aros_kernel_*
1648 # if aros_kernel_cc is an AROS gcc
1649 # orig_target_cc = aros_kernel_cc
1651 # orig_target_cc = aros cc wrapper around aros_kernel_cc
1655 target_tool_prefix="${target_cpu}-aros-"
1657 AC_MSG_CHECKING([which kernel tools])
1658 AC_MSG_RESULT([$kernel_tool_prefix]);
1660 if test "$kernel_tool_prefix" = "none" ; then
1661 dnl ELF wrapper can be used only for native bootstrap
1662 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1663 AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
1666 # Kernel tools required - find them
1667 # Note that 'normally', aros_kernel_* overrides will
1668 # empty, unless specified in the per-arch sections above.
1669 if test "x$aros_kernel_cpp" = "x"; then
1670 aros_kernel_cpp=${kernel_tool_prefix}cpp
1672 AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp${kernel_tool_version})
1673 AROS_REQUIRED(cpp,$aros_kernel_cpp)
1674 if test "x$aros_kernel_cc" = "x"; then
1675 aros_kernel_cc=${kernel_tool_prefix}gcc
1677 AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc${kernel_tool_version})
1678 AROS_REQUIRED(cc,$aros_kernel_cc)
1679 if test "x$aros_kernel_cxx" = "x"; then
1680 aros_kernel_cxx=${kernel_tool_prefix}g++
1682 AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx${kernel_tool_version})
1683 # If it's set, make sure it's really there
1684 if test "x$aros_kernel_cxx" != "x" ; then
1685 AROS_REQUIRED(cxx,$aros_kernel_cxx)
1687 AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
1688 AROS_REQUIRED(ld,$aros_kernel_ld)
1689 AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
1690 AROS_REQUIRED(as,$aros_kernel_as)
1691 AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
1692 AROS_REQUIRED(ar,$aros_kernel_ar)
1693 AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
1694 AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
1695 AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
1696 AROS_REQUIRED(nm,$aros_kernel_nm)
1697 AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
1698 AROS_REQUIRED(strip,$aros_kernel_strip)
1700 # Objcopy and objdump are not required for the kernel
1701 # toolchain on many architectures.
1702 # So we'll look for them, but not make them strictly required.
1703 AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
1704 AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
1705 if test "x${crosstools}" != "xyes" ; then
1706 AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
1707 AROS_REQUIRED(objdump,$aros_kernel_objdump)
1711 AC_MSG_CHECKING([which target tools to use])
1712 if test "$crosstools" = "yes"; then
1713 AC_MSG_RESULT([$target_tool_prefix])
1714 # We are are building AROS crosstools
1715 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
1716 orig_target_cc="${tmp_tool_prefix}gcc${aros_gcc_version}"
1717 orig_target_cxx="${tmp_tool_prefix}g++${aros_gcc_version}"
1718 orig_target_cpp="${tmp_tool_prefix}cpp"
1719 orig_target_ld="${tmp_tool_prefix}ld"
1720 orig_target_as="${tmp_tool_prefix}as"
1721 orig_target_ar="${tmp_tool_prefix}ar"
1722 orig_target_ranlib="${tmp_tool_prefix}ranlib"
1723 orig_target_nm="${tmp_tool_prefix}nm"
1724 orig_target_strip="${tmp_tool_prefix}strip"
1725 orig_target_objcopy="${tmp_tool_prefix}objcopy"
1726 orig_target_objdump="${tmp_tool_prefix}objdump"
1728 # Determine whether AROS or ELF tools should be used
1729 if test "$aros_tool_prefix" = "none"; then
1730 aros_tool_prefix="${elf_tool_prefix}"
1731 crosstools_cxx_target=tools-crosstools
1734 AC_MSG_RESULT([$aros_tool_prefix])
1735 # We are *not* building AROS crosstools - use the AROS or ELF tools
1736 AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}cpp)
1737 AROS_REQUIRED(cpp,$orig_target_cpp)
1738 AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}gcc)
1739 AROS_REQUIRED(cc,$orig_target_cc)
1740 if test "x${crosstools_cxx_target}" = "x" ; then
1741 AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}g++)
1742 AROS_REQUIRED(cxx,$orig_target_cxx)
1744 AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}ld)
1745 AROS_REQUIRED(ld,$orig_target_ld)
1746 AROS_TOOL_TARGET(orig_target_as,as,${aros_tool_prefix}as)
1747 AROS_REQUIRED(as,$orig_target_as)
1748 AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}ar)
1749 AROS_REQUIRED(ar,$orig_target_ar)
1750 AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}ranlib)
1751 AROS_REQUIRED(ranlib,$orig_target_ranlib)
1752 AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}nm)
1753 AROS_REQUIRED(nm,$orig_target_nm)
1754 AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}strip)
1755 AROS_REQUIRED(strip,$orig_target_strip)
1756 AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}objcopy)
1757 AROS_REQUIRED(objcopy,$orig_target_objcopy)
1758 AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}objdump)
1759 AROS_REQUIRED(objdump,$orig_target_objdump)
1762 if test "$kernel_tool_prefix" = "none" ; then
1763 # No kernel tools specified
1764 # Assume target tools == kernel tools with ELF wrapper
1765 aros_kernel_cc=$orig_target_cc
1766 aros_kernel_cxx=$orig_target_cxx
1767 aros_kernel_cpp=$orig_target_cpp
1768 aros_kernel_ld=$orig_target_ld
1769 aros_kernel_as=$orig_target_as
1770 aros_kernel_ar=$orig_target_ar
1771 aros_kernel_ranlib=$orig_target_ranlib
1772 aros_kernel_nm=$orig_target_nm
1773 aros_kernel_strip=$orig_target_strip
1774 aros_kernel_objcopy=$orig_target_objcopy
1775 aros_kernel_objdump=$orig_target_objdump
1776 use_kernel_cc_wrapper=yes
1779 # At this point, all aros_kernel_* and aros_target_*
1780 # tools should be set up correctly
1782 CC="$aros_kernel_cc $kernel_tool_flags"
1783 CPP="$aros_kernel_cpp"
1785 #-----------------------------------------------------------------------------
1787 # Disable pointer-signedness warnings if the compiler recognises the option
1789 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1790 save_cflags="$CFLAGS"
1791 if test "$crosstools" != "yes" ; then
1792 CFLAGS="$CFLAGS -Wno-pointer-sign"
1793 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1795 # we do know it is supported for the smallest version of gcc we are going to build
1796 # we assume it's also supported by later versions
1797 use_no_sign_warning=yes
1799 AC_MSG_RESULT($use_no_sign_warning)
1800 if test "x-$use_no_sign_warning" = "x-yes" ; then
1801 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1803 CFLAGS="$save_cflags"
1805 #-----------------------------------------------------------------------------
1807 # Find all the tools we need to compile. This could be cross-compiling
1808 # though! If that is the case we use the GNU form of the target and
1809 # simply add this to the front of the binary name. This is rather simple,
1810 # but it should work under most circumstances.
1812 # The default tools are to use the same as the host, but only if the
1813 # host and target CPU are the same. With GCC this is normally enough.
1817 aros_shared_ld="$aros_host_ld"
1819 aros_target_mkdep="$aros_host_mkdep"
1821 # The default tools executables to be linked to.
1822 if test "$rescomp" != ""; then
1823 AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
1824 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1827 # Set up the sources for the symlink farm
1828 if test "$crosstools" = "yes"; then
1829 crosstools_target=tools-crosstools
1832 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
1833 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
1836 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1837 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1838 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1839 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1840 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1841 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1842 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1844 # aros_cc_pre is a variable that is added to the front of the compiler name
1845 # in the generated aros-gcc shell script. We need this to enable the cache
1846 # to work across cleaned builds. Also, support DISTCC using the correct
1847 # environment variable.
1850 if test "x${DISTCC}" != "x" ; then
1851 if test "x${CCACHE}" != "x" ; then
1852 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1854 aros_cc_pre="${DISTCC} "
1857 if test "x${CCACHE}" != "x" ; then
1858 aros_cc_pre="${CCACHE} "
1862 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
1864 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1865 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1866 AC_SUBST(aros_target_nix_ldflags,-nix)
1867 AC_SUBST(aros_target_detach_ldflags,-detach)
1868 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1871 if test "$crosstools" != "yes"; then
1872 if test "$GCC" = "yes"; then
1873 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1876 # We do not know which gcc version we are going to build and what we need to know
1877 # here is different for different versions so this will be set later during the
1878 # build of crosstools.
1879 aros_target_cc_path=@aros_target_cc_path@
1881 aros_target_cpp="${prefix}cpp"
1882 aros_target_cc="${prefix}gcc"
1883 aros_target_cxx="${prefix}g++"
1884 aros_target_as="${prefix}as"
1885 aros_target_ld="${prefix}ld"
1886 aros_target_ar="${prefix}ar $aros_target_ar_flags"
1887 aros_target_objcopy="${prefix}objcopy"
1888 aros_target_objdump="${prefix}objdump"
1889 aros_target_ranlib="${prefix}ranlib $aros_target_ranlib_flags"
1890 aros_target_nm="${prefix}nm $aros_target_nm_flags"
1891 aros_target_strip="${prefix}strip"
1892 aros_plain_nm="${prefix}nm"
1893 aros_plain_ar="${prefix}ar"
1895 AC_ARG_ENABLE(includes,
1896 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1897 [aros_target_incl=$enable_includes], [aros_target_incl=`$aros_kernel_cc -print-sysroot`/`$aros_kernel_cc --print-sysroot-headers-suffix 2>/dev/null || echo usr/include`])
1899 if test "$aros_kernel_includes" = ""; then
1900 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1901 aros_kernel_includes="-isystem $aros_target_incl"
1905 if test "$aros_kernel_includes" != "" ; then
1906 dnl find out about the kernel cc's include path
1907 AC_MSG_CHECKING([for the kernel compiler's include path])
1908 if test "$aros_kernel_cc_includes" = "" ; then
1909 # Try to guess where the directory is.
1910 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1911 if test -d $aros_kernel_cc_includes; then
1912 # Check if there is also an include-fixed directory and add it
1913 # to kernel compiler's include path as it may contain some of
1914 # the headers we need.
1915 if test -d "$aros_kernel_cc_includes"-fixed; then
1916 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1918 # Check for specific includes directory. Neede for Ubuntu 11.10
1919 if test -d "/usr/include/i386-linux-gnu"; then
1920 aros_kernel_cc_includes+=" -isystem /usr/include/i386-linux-gnu"
1923 # The directory doesn't exist, we need to do some more work.
1924 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1926 # These are the headers we're looking for.
1927 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1928 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1932 for h in $headers; do
1933 # Which other headers are needed by each of the above?
1934 deps=$(echo "#include <$h>" | \
1935 $aros_kernel_cc -E -M - 2>/dev/null | \
1936 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1938 # Copy all the needed headers to a directory beneath gendir.
1941 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1942 sed -n "s,^.*/include\(/.*\),\1,p")
1943 ! test -d $dir && mkdir -p $dir
1944 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1949 AC_MSG_RESULT($aros_kernel_cc_includes)
1950 # Adding -nostdinc to kernel includes as they are always used together.
1951 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1954 if test "$crosstools" != "yes"; then
1955 dnl find out about the target cc's include path
1956 AC_MSG_CHECKING([for the target compiler's include path])
1957 if test "$aros_target_cc_includes" = "" ; then
1958 #try to guess where the directory is
1959 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1960 if ! test -d $aros_target_cc_includes; then
1961 #the directory doesn't exist, we need to do some more work
1962 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1964 #these are the headers we're looking for
1965 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1966 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1970 for h in $headers; do
1971 #which other headers each of the above headers needs?
1972 deps=$(echo "#include <$h>" | \
1973 $orig_target_cc -E -M - 2>/dev/null | \
1974 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1976 #copy all the needed headers to a directory beneath gendir
1979 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1980 sed -n "s,^.*/include\(/.*\),\1,p")
1981 ! test -d $dir && mkdir -p $dir
1982 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1987 AC_MSG_RESULT($aros_target_cc_includes)
1989 # We do not know which gcc version we are going to build and what we need to know
1990 # here is different for different versions so this will be set later during the
1991 # build of crosstools.
1992 aros_target_cc_includes=@aros_target_cc_includes@
1996 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1997 # On GCC >= 4.0 -iquote should be used
2001 save_cflags="$CFLAGS"
2003 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2004 if test "x-$crosstools" != "x-yes"; then
2005 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2007 # we do know it is supported for the smallest version of gcc we are going to build
2008 # we assume it's also supported by later versions
2011 AC_MSG_RESULT($has_iquote)
2012 if test "x-$has_iquote" = "x-yes" ; then
2013 host_cflags_iquote=-iquote
2014 host_cflags_iquote_end=
2016 host_cflags_iquote=-I
2017 host_cflags_iquote_end=-I-
2019 kernel_cflags_iquote=$host_cflags_iquote
2020 kernel_cflags_iquote_end=$host_cflags_iquote_end
2021 if test "x-$cross_compiling" = "x-yes"; then
2022 CC="$aros_kernel_cc"
2023 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2024 if test "x-$crosstools" != "x-yes"; then
2025 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2027 # we do know it is supported for the smallest version of gcc we are going to build
2028 # we assume it's also supported by later versions
2029 use_no_stack_protector=yes
2031 AC_MSG_RESULT($use_no_stack_protector)
2032 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2033 if test "x-$crosstools" != "x-yes"; then
2034 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2036 # we do know it is supported for the smallest version of gcc we are going to build
2037 # we assume it's also supported by later versions
2040 AC_MSG_RESULT($has_iquote)
2041 if test "x-$has_iquote" = "x-yes" ; then
2042 kernel_cflags_iquote=-iquote
2043 kernel_cflags_iquote_end=
2045 kernel_cflags_iquote=-I
2046 kernel_cflags_iquote_end=-I-
2049 aros_cflags_iquote=$kernel_cflags_iquote
2050 aros_cflags_iquote_end=$kernel_cflags_iquote_end
2051 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2052 CC="$orig_target_cc"
2053 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2054 if test "x-$crosstools" != "x-yes"; then
2055 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2057 # we do know it is supported for the smallest version of gcc we are going to build
2058 # we assume it's also supported by later versions
2061 AC_MSG_RESULT($has_iquote)
2062 if test "x-$has_iquote" = "x-yes" ; then
2063 aros_cflags_iquote=-iquote
2064 aros_cflags_iquote_end=
2066 aros_cflags_iquote=-I
2067 aros_cflags_iquote_end=-I-
2070 if test "x-$use_no_stack_protector" = "x-yes" ; then
2071 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2075 #-----------------------------------------------------------------------------
2077 # Check if the target compiler supports some options used for delinting:
2078 # -Wunused-but-set-variable
2084 if test "x-$crosstools" != "x-yes"; then
2085 if test "$orig_target_cc" != "$aros_kernel_cc"; then
2086 CC="$orig_target_cc"
2088 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
2089 CFLAGS=-Wunused-but-set-variable
2090 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
2091 AC_MSG_RESULT($aros_unused_but_set_variable)
2092 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
2093 aros_cflags_unused_but_set_variable=-Wno-unused-but-set-variable
2096 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
2097 CFLAGS=-Warray-bounds
2098 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
2099 AC_MSG_RESULT($aros_array_bounds)
2100 if test "x-$aros_array_bounds" = "x-yes" ; then
2101 aros_cflags_array_bounds=-Wno-array-bounds
2104 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
2105 CFLAGS=-Wenum-compare
2106 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
2107 AC_MSG_RESULT($aros_enum_compare)
2108 if test "x-$aros_enum_compare" = "x-yes" ; then
2109 aros_cflags_enum_compare=-Wno-enum-compare
2112 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
2113 CFLAGS=-Wstrict-overflow
2114 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
2115 AC_MSG_RESULT($aros_strict_overflow)
2116 if test "x-$aros_strict_overflow" = "x-yes" ; then
2117 aros_cflags_strict_overflow=-Wno-strict-overflow
2120 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
2121 CFLAGS=-Wformat-security
2122 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
2123 AC_MSG_RESULT($aros_format_security)
2124 if test "x-$aros_format_security" = "x-yes" ; then
2125 aros_cflags_format_security=-Wno-format-security
2128 # We do not know which gcc version we are going to build and what we need to know
2129 # here is different for different versions so this will be set later during the
2130 # build of crosstools.
2131 aros_cflags_unused_but_set_variable=@aros_cflags_unused_but_set_variable@
2132 aros_cflags_array_bounds=@aros_cflags_array_bounds@
2133 aros_cflags_enum_compare=@aros_cflags_enum_compare@
2134 aros_cflags_strict_overflow=@aros_cflags_strict_overflow@
2135 aros_cflags_format_security=@aros_cflags_format_security@
2138 #-----------------------------------------------------------------------------
2140 # Check if we can explicitly choose older version of symbol hashing
2142 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2143 CC="$aros_kernel_cc"
2144 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2145 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2146 AC_MSG_RESULT($use_hash_style)
2147 if test "x-$use_hash_style" = "x-yes" ; then
2148 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2151 CFLAGS="$save_cflags"
2153 AC_SUBST(host_cflags_iquote)
2154 AC_SUBST(host_cflags_iquote_end)
2155 AC_SUBST(kernel_cflags_iquote)
2156 AC_SUBST(kernel_cflags_iquote_end)
2157 AC_SUBST(aros_cflags_iquote)
2158 AC_SUBST(aros_cflags_iquote_end)
2161 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2162 AC_MSG_CHECKING([for default resolution of WBScreen])
2163 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2164 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2165 if test "$resolution" = "yes" ; then
2168 if test "$resolution" = "no" ; then
2171 if test "$resolution" != "none" ; then
2172 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
2173 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
2174 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
2176 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
2177 aros_cv_default_wbwidth=$aros_default_wbwidth
2178 aros_cv_default_wbheight=$aros_default_wbheight
2179 aros_cv_default_wbdepth=$aros_default_wbdepth
2181 dnl See if the user wants the serial debug output for native flavour
2182 AC_MSG_CHECKING([if serial debug is enabled])
2183 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)
2184 if test "$aros_serial_debug" = 0 ; then
2185 serial_debug_forced=""
2186 if test "$serial_debug" = "yes" ; then
2189 if test "$serial_debug" = "no" ; then
2193 serial_debug_forced="(forced)"
2194 serial_debug=$aros_serial_debug
2196 if test "$serial_debug" != "none" ; then
2197 aros_serial_debug=$serial_debug
2198 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2203 dnl See if the user wants the palm debug output hack for palm native flavour
2204 AC_MSG_CHECKING([if palm debug hack is enabled])
2205 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")
2206 if test "$palm_debug_hack" = "yes" ; then
2207 aros_palm_debug_hack="1"
2209 AC_MSG_RESULT($palm_debug_hack)
2211 dnl See if the user wants nesting supervisor activated for unix flavour
2212 AC_MSG_CHECKING([if nesting supervisor support is enabled])
2213 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")
2214 if test "$nesting_supervisor" = "yes" ; then
2215 aros_nesting_supervisor="1"
2217 AC_MSG_RESULT($nesting_supervisor)
2219 dnl See if the user wants to disable MMU support
2220 dnl This can be overriden on per-target basis,
2221 dnl set $aros_enable_mmu to "yes" or "no" to do this
2222 if test "$aros_enable_mmu" = "" ; then
2223 AC_MSG_CHECKING([if MMU support is enabled])
2224 dnl Enabled by default
2225 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2226 if test "$aros_enable_mmu" = "" ; then
2227 aros_enable_mmu="yes"
2229 AC_MSG_RESULT($aros_enable_mmu)
2231 if test "$aros_enable_mmu" = "no" ; then
2238 dnl things specifically required for hosted flavours
2239 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2241 if test "x-$need_dlopen" != "x-no" ; then
2242 dnl some kind of dynamic library access system is required for hostlib.resource
2243 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2244 if test "x-$have_dl" = "x-no" ; then
2245 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2246 aros_host_ldflags="$aros_host_ldflags -ldl"],
2249 if test "x-$have_dl" = "x-no" ; then
2250 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2256 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2257 [build X11 hidd for hosted (default=auto)]),
2258 x11_hidd="$enableval",
2259 x11_hidd="$need_x11")
2260 case "x-$x11_hidd" in
2261 x-yes|x-no|x-auto) ;;
2262 *) x11_hidd="$need_x11" ;;
2268 if test "x-$x11_hidd" != "x-no" ; then
2274 for path in $x_libraries
2276 x_cflags="$x_cflags -L$path"
2279 for path in $x_includes
2281 x_cflags="$x_cflags -I$path"
2284 if test "x-$no_x" = "x-yes" ; then
2287 if test "x-$x11_hidd" != "x-auto" ; then
2288 dnl and they explicitly asked for it, bail out
2289 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2293 dnl found it, setup the metatarget
2294 x11_hidd_target=kernel-x11gfx-kobj
2297 dnl setup shared memory extensions
2298 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2299 [use X11 shared memory (default=auto)]),
2300 x11_hidd_shm="$enableval",
2301 x11_hidd_shm="auto")
2302 case "x-$x11_hidd_shm" in
2303 x-yes|x-no|x-auto) ;;
2304 *) x11_hidd_shm="auto" ;;
2310 if test "x-$x11_hidd_shm" != "x-no" ; then
2312 dnl system shm headers
2313 AC_CHECK_HEADERS(sys/ipc.h)
2314 AC_CHECK_HEADERS(sys/shm.h)
2317 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2319 dnl make sure X libs have shm functions
2320 save_cflags="$CFLAGS"
2321 CFLAGS="$CFLAGS $x_cflags"
2322 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2323 CFLAGS="$save_cflags"
2327 dnl detection done, prepare output
2328 if test "x-$have_xshm" = "x-yes" ; then
2331 elif test "x-$x11_hidd_shm" = "x-yes" ; then
2332 dnl they explicitly asked for it, but we can't do it
2333 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2335 dnl otherwise just disable it
2340 dnl setup vidmode (fullscreen) extensions
2341 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2342 [use X11 vidmode extension (default=auto)]),
2343 x11_hidd_vidmode="$enableval",
2344 x11_hidd_vidmode="auto")
2345 case "x-$x11_hidd_vidmode" in
2346 x-yes|x-no|x-auto) ;;
2347 *) x11_hidd_vidmode="auto" ;;
2353 if test "x-$x11_hidd_vidmode" != "x-no" ; then
2355 dnl make sure X libs have vidmode functions
2356 save_cflags="$CFLAGS"
2357 CFLAGS="$CFLAGS $x_cflags"
2358 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2359 CFLAGS="$save_cflags"
2362 dnl detection done, prepare output
2363 if test "x-$have_vidmode" = "x-yes" ; then
2364 dnl we can do vidmode
2365 DO_VIDMODE_SUPPORT="1"
2366 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2367 dnl they explicitly asked for it, but we can't do it
2368 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2370 dnl otherwise just disable it
2371 DO_VIDMODE_SUPPORT="0"
2375 aros_host_x11_includes=$x_includes
2376 aros_host_x11_libdirs=$x_libraries
2381 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2382 [build SDL hidd for hosted (default=auto)]),
2383 sdl_hidd="$enableval",
2385 case "x-$sdl_hidd" in
2386 x-yes|x-no|x-auto) ;;
2387 *) sdl_hidd="auto" ;;
2391 if test "x-$sdl_hidd" != "x-no" ; then
2394 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2396 if test "x-$have_sdl" != "x-yes" ; then
2399 if test "x-$sdl_hidd" != "x-auto" ; then
2400 dnl and they explicitly asked for it, bail out
2401 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2405 dnl found it, set up the metatarget
2406 sdl_hidd_target=kernel-hidd-sdl
2407 aros_host_sdl_cflags=SDL_CFLAGS
2408 aros_host_sdl_libs=SDL_LIBS
2413 AC_CHECK_HEADER(sys/soundcard.h)
2414 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2415 oss_library_target=workbench-libs-oss-unix
2420 dnl See if the user wants dbus.library
2421 AC_MSG_CHECKING([if building of dbus.library is enabled])
2422 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2423 if test "$dbus" = "yes" ; then
2425 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2426 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2427 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2428 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2432 AC_MSG_RESULT($dbus)
2434 if test "$use_kernel_cc_wrapper" = "yes" ; then
2435 aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc"
2438 if test "${crosstools}" != "yes" ; then
2439 aros_target_toolchain=no
2441 aros_target_toolchain=yes
2444 dnl --------------------------------------------------------------------
2445 dnl Configuration Output Section
2446 dnl --------------------------------------------------------------------
2451 AC_SUBST(aros_flavour)
2452 AC_SUBST(aros_flavour_uc)
2453 AC_SUBST(aros_target_toolchain)
2454 AC_SUBST(AROS_BUILDDIR)
2455 AC_SUBST(AROS_BUILDDIR_UNIX)
2457 AC_SUBST(AROS_CROSSTOOLSDIR)
2458 AC_SUBST(AROS_PORTSSRCDIR)
2460 # Compatability with other Amiga-like operation systems
2461 AC_SUBST(aros_amigaos_compliance)
2464 AC_SUBST(aros_cc_pre)
2465 AC_SUBST(aros_host_strip)
2466 AC_SUBST(aros_host_arch)
2467 AC_SUBST(aros_host_cpu)
2468 AC_SUBST(aros_host_cpp)
2469 AC_SUBST(aros_host_cc)
2470 AC_SUBST(aros_host_cxx)
2471 AC_SUBST(aros_host_ar)
2472 AC_SUBST(aros_host_ranlib)
2473 AC_SUBST(aros_host_ld)
2474 AC_SUBST(aros_host_make)
2475 AC_SUBST(aros_host_cflags)
2476 AC_SUBST(aros_host_cxxflags)
2477 AC_SUBST(gnu89_inline)
2478 AC_SUBST(aros_host_ldflags)
2479 AC_SUBST(aros_host_debug)
2480 AC_SUBST(aros_host_mkdep)
2481 AC_SUBST(aros_host_mkargs)
2482 AC_SUBST(aros_host_exe_suffix)
2483 AC_SUBST(aros_host_lib_suffix)
2484 AC_SUBST(aros_tools_dir)
2485 AC_SUBST(aros_host_aclocal)
2486 AC_SUBST(aros_host_autoconf)
2487 AC_SUBST(aros_host_autoheader)
2488 AC_SUBST(aros_host_automake)
2492 AC_SUBST(aros_target_guitheme)
2493 AC_SUBST(aros_target_iconset)
2494 AC_SUBST(aros_target_bootloader)
2495 AC_SUBST(aros_target_arch)
2496 AC_SUBST(aros_target_family)
2497 AC_SUBST(aros_target_cpu)
2498 AC_SUBST(aros_target_variant)
2499 AC_SUBST(aros_target_suffix)
2500 AC_SUBST(aros_target_ar)
2501 AC_SUBST(aros_target_ranlib)
2502 AC_SUBST(aros_plain_nm)
2503 AC_SUBST(aros_plain_ar)
2504 AC_SUBST(aros_kernel_ar)
2505 AC_SUBST(aros_kernel_ranlib)
2506 AC_SUBST(orig_target_cc)
2507 AC_SUBST(aros_target_cc)
2508 AC_SUBST(aros_kernel_cc)
2509 AC_SUBST(orig_target_cxx)
2510 AC_SUBST(aros_target_cxx)
2511 AC_SUBST(aros_kernel_cxx)
2512 AC_SUBST(orig_target_cpp)
2513 AC_SUBST(aros_target_cpp)
2514 AC_SUBST(aros_kernel_cpp)
2515 AC_SUBST(orig_target_as)
2516 AC_SUBST(aros_target_as)
2517 AC_SUBST(aros_kernel_as)
2518 AC_SUBST(orig_target_ld)
2519 AC_SUBST(aros_target_ld)
2520 AC_SUBST(aros_kernel_ld)
2521 AC_SUBST(aros_target_cc_includes)
2522 AC_SUBST(aros_target_cc_path)
2523 AC_SUBST(aros_target_objdump)
2524 AC_SUBST(aros_target_objcopy)
2525 AC_SUBST(aros_target_strip)
2526 AC_SUBST(aros_target_nm)
2527 AC_SUBST(aros_kernel_rescomp)
2528 AC_SUBST(aros_shared_default)
2529 AC_SUBST(aros_shared_ld)
2530 AC_SUBST(aros_object_format)
2531 AC_SUBST(aros_compiler_libs)
2532 AC_SUBST(aros_arch_libs)
2534 AC_SUBST(aros_config_cflags)
2535 AC_SUBST(aros_config_aflags)
2536 AC_SUBST(aros_config_ldflags)
2538 AC_SUBST(aros_shared_cflags)
2539 AC_SUBST(aros_shared_aflags)
2540 AC_SUBST(aros_shared_ldflags)
2541 AC_SUBST(aros_kernel_cflags)
2542 AC_SUBST(aros_kernel_includes)
2543 AC_SUBST(aros_kernel_objcflags)
2544 AC_SUBST(aros_kernel_ldflags)
2545 AC_SUBST(aros_target_cflags)
2546 AC_SUBST(aros_debug_cflags)
2547 AC_SUBST(aros_debug_aflags)
2548 AC_SUBST(aros_debug_ldflags)
2549 AC_SUBST(aros_target_genmap)
2550 AC_SUBST(aros_target_strip_flags)
2552 AC_SUBST(crosstools_target)
2553 AC_SUBST(crosstools_cxx_target)
2555 # Delinting target compiler flags
2556 AC_SUBST(aros_cflags_unused_but_set_variable)
2557 AC_SUBST(aros_cflags_array_bounds)
2558 AC_SUBST(aros_cflags_enum_compare)
2559 AC_SUBST(aros_cflags_strict_overflow)
2560 AC_SUBST(aros_cflags_format_security)
2563 AC_SUBST(x11_hidd_target)
2564 AC_SUBST(sdl_hidd_target)
2565 AC_SUBST(pci_hidd_target)
2566 AC_SUBST(oss_library_target)
2568 AC_SUBST(aros_default_wbwidth)
2569 AC_SUBST(aros_default_wbheight)
2570 AC_SUBST(aros_default_wbdepth)
2571 AC_SUBST(DO_XSHM_SUPPORT)
2572 AC_SUBST(DO_VIDMODE_SUPPORT)
2574 AC_SUBST(aros_host_x11_includes)
2575 AC_SUBST(aros_host_x11_libdirs)
2576 AC_SUBST(aros_host_sdl_cflags)
2577 AC_SUBST(aros_host_sdl_libs)
2579 # Native version related
2580 AC_SUBST(aros_serial_debug)
2582 # Palm native version related
2583 AC_SUBST(aros_palm_debug_hack)
2585 # Unix/Hosted version related
2586 AC_SUBST(aros_nesting_supervisor)
2589 AC_SUBST(aros_enable_mmu)
2592 AC_SUBST(aros_ios_platform)
2593 AC_SUBST(aros_ios_version)
2594 AC_SUBST(aros_ios_sdk)
2596 # ARM default GCC target related
2597 AC_SUBST(gcc_default_cpu)
2598 AC_SUBST(gcc_default_fpu)
2599 AC_SUBST(gcc_default_float_abi)
2602 AC_SUBST(android_tool)
2603 AC_SUBST(aros_android_level)
2606 AC_SUBST(ENABLE_DBUS)
2607 AC_SUBST(DBUS_CFLAGS)
2608 AC_SUBST(DBUS_LIBFLAGS)
2609 AC_SUBST(KERNEL_DBUS_KOBJ)
2610 AC_SUBST(KERNEL_DBUS_INCLUDES)
2613 AC_SUBST(ENABLE_X11)
2616 AC_SUBST(aros_debug)
2617 AC_SUBST(aros_mungwall_debug)
2618 AC_SUBST(aros_stack_debug)
2619 AC_SUBST(aros_modules_debug)
2621 # Collect-aros stuff: "-ius" to ignore undefined symbols
2622 AC_SUBST(ignore_undefined_symbols)
2624 # C compiler related
2625 AC_SUBST(gcc_target_cpu)
2627 dnl Prepare for output, make up all the generated patches
2628 case "$aros_flavour" in
2629 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2630 aros_flavour="emulation" ;;
2631 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2632 aros_flavour="emulation" ;;
2633 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2634 aros_flavour="standalone";;
2635 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2636 aros_flavour="standalone";;
2637 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2638 aros_flavour="native" ;;
2639 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2640 aros_flavour="native" ;;
2641 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2642 aros_flavour="linklib" ;;
2643 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2644 aros_flavour="palmnative" ;;
2645 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2646 aros_flavour="mac68knative" ;;
2647 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2648 aros_flavour="ppcnative" ;;
2651 if test ! -d ${aros_inc_dir} ; then
2652 ${MKDIR} ${aros_inc_dir}
2654 if test ! -d ${aros_geninc_dir} ; then
2655 ${MKDIR} ${aros_geninc_dir}
2657 if test ! -d ${aros_hostcfg_dir} ; then
2658 ${MKDIR} ${aros_hostcfg_dir}
2660 if test ! -d ${aros_targetcfg_dir} ; then
2661 ${MKDIR} ${aros_targetcfg_dir}
2663 if test ! -d ${aros_tools_dir} ; then
2664 ${MKDIR} ${aros_tools_dir}
2666 if test ! -d ${aros_scripts_dir} ; then
2667 ${MKDIR} ${aros_scripts_dir}
2670 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2672 AC_CONFIG_COMMANDS([compiler_executable],
2674 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2676 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2677 prefix3=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
2681 chmod a+x ${prefix2}-gcc ${prefix2}-g++ ${prefix2}-ld ${prefix2}-cpp ${prefix3}-gcc
2683 ln -sf $orig_target_as$aros_host_exe_suffix ${prefix2}-as$aros_host_exe_suffix
2684 ln -sf $orig_target_nm$aros_host_exe_suffix ${prefix2}-nm$aros_host_exe_suffix
2685 ln -sf $orig_target_ar$aros_host_exe_suffix ${prefix2}-ar$aros_host_exe_suffix
2686 ln -sf $orig_target_ranlib$aros_host_exe_suffix ${prefix2}-ranlib$aros_host_exe_suffix
2687 ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
2688 ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
2689 ln -sf $orig_target_strip$aros_host_exe_suffix ${prefix2}-strip$aros_host_exe_suffix
2691 ln -sf $aros_kernel_ld$aros_host_exe_suffix ${prefix3}-ld$aros_host_exe_suffix
2694 aros_host_exe_suffix=${aros_host_exe_suffix}
2695 aros_tools_dir=${aros_tools_dir}
2696 aros_target_cpu=${aros_target_cpu}
2697 aros_target_arch=${aros_target_arch}
2698 aros_target_suffix=${aros_target_suffix}
2699 orig_target_nm=${orig_target_nm}
2700 orig_target_as=${orig_target_as}
2701 orig_target_ar=${orig_target_ar}
2702 orig_target_ranlib=${orig_target_ranlib}
2703 orig_target_objdump=${orig_target_objdump}
2704 orig_target_objcopy=${orig_target_objcopy}
2705 orig_target_strip=${orig_target_strip}
2706 aros_kernel_ld=${aros_kernel_ld}
2709 AC_CONFIG_COMMANDS([genmf_executable],
2710 [chmod a+x ${aros_tools_dir}/genmf.py],
2711 [aros_tools_dir=${aros_tools_dir}]
2717 ${aros_inc_dir}/config.h:config/config.h.in
2718 ${aros_geninc_dir}/config.h:config/config.h.in
2719 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2720 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2722 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2723 ${aros_targetcfg_dir}/specs:config/specs.in
2724 ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
2725 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-cpp:scripts/aros-cpp.in
2726 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2727 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-g++:scripts/aros-g++.in
2728 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
2729 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2730 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2731 tools/collect-aros/env.h
2732 ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2737 dnl This is in order to not define SHARED_CFLAGS sometimes
2738 dnl We don't always do aros_shared_ar, aros_shared_cflags
2740 #XXX compatability...
2741 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2743 if test -n "$aros_shared_cflags" ; then
2744 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2745 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg