1 dnl Copyright © 1997-2016, 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 # Default versions for the gnu tools we build
26 default_gcc_version="4.6.4"
27 default_binutils_version="2.23.2"
28 default_grub2_version="2.02"
29 target_grub2_version=$default_grub2_version
31 # The AROS target is slightly different to the normal GNU style
32 # format. We don't have the middle part, and we reverse the order
33 # of the $(CPU) and $(OS) bits.
35 # Don't strip the version of the target yet, it might be
36 # useful on some systems.
38 AC_MSG_CHECKING([for AROS style target])
40 if test "$target" = "NONE" ; then
41 target=$host_os-$host_cpu
43 if test "$target" = "" ; then
44 target=$host_os-$host_cpu
47 AC_MSG_RESULT($target)
49 if test "$host_os" = "mingw32" ; then
53 # Don't know where else to put this...
54 AC_MSG_CHECKING([building AROS in])
55 AROS_BUILDDIR=`${PWDCMD-pwd}`
56 AROS_BUILDDIR_UNIX=${PWD}
57 AC_MSG_RESULT($AROS_BUILDDIR)
59 AC_MSG_CHECKING([AROS source in])
60 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
62 AC_MSG_RESULT($SRCDIR)
64 # Parse the target field into something useful.
66 target_os=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\1/'`
67 target_cpu=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\2/'`
70 # Some debug output, to be removed again.
71 AC_MSG_CHECKING([for target system (debug output)])
72 AC_MSG_RESULT($target_os)
73 AC_MSG_CHECKING([for target cpu (debug output)])
74 AC_MSG_RESULT($target_cpu)
76 dnl --------------------------------------------------------------------
77 dnl Set the default Workbench resolution
78 dnl --------------------------------------------------------------------
79 aros_nominal_width=800
80 aros_nominal_height=600
83 dnl --------------------------------------------------------------------
84 dnl Host Configuration Section
85 dnl --------------------------------------------------------------------
87 dnl The idea here is to find out all the information we need about the
88 dnl host. This means things like tools for building directory structures,
89 dnl copying files around and the like.
91 default_c_compilers="gcc clang cc"
92 AC_ARG_WITH(c-compiler,AC_HELP_STRING([--with-c-compiler=VERSION],[Use specified c compiler for building AROS]),use_c_compiler="$withval",use_c_compiler="")
93 if test "$use_c_compiler" = ""; then
94 host_c_compilers="$default_c_compilers"
96 host_c_compilers="$use_c_compiler"
99 default_cxx_compilers="g++ clang++ c++"
100 AC_ARG_WITH(cxx-compiler,AC_HELP_STRING([--with-cxx-compiler=VERSION],[Use specified c++ compiler building AROS]),use_cxx_compiler="$withval",use_cxx_compiler="")
101 if test "$use_cxx_compiler" = ""; then
102 host_cxx_compilers="$default_cxx_compilers"
104 host_cxx_compilers="$use_cxx_compiler"
108 # The first step is to find the host binaries.
109 # Check for a compiler.
110 # Due to a bug in autoconf check for c++ compiler first.
111 # For mor info see, http://osdir.com/ml/bug-autoconf-gnu/2010-05/msg00001.html.
112 AC_PROG_CXX([${host_cxx_compilers}])
113 AC_PROG_CC([${host_c_compilers}])
114 aros_host_def_cc="$CC"
118 # Check for a compatible awk
119 AC_CHECK_PROGS(AWK,[gawk nawk])
120 AROS_REQUIRED(gawk,$AWK)
121 AROS_PROG(MMAKE,mmake)
123 # Perform some default variable assignments. Note all of these will be
124 # Regenerated from the script, so there is no need to cache them.
126 aros_build_host=$host
130 AROS_TOOL_CCPATH(aros_host_ld,ld)
131 AROS_REQUIRED(ld,$aros_host_ld)
132 aros_host_make="make"
133 aros_host_cflags="$CFLAGS"
134 aros_host_cxxflags="$CXXFLAGS"
135 aros_host_cppflags="$CPPFLAGS"
136 aros_host_ldflags="$LDFLAGS"
137 aros_host_debug="-g -O0"
138 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
139 aros_host_mkargs="--no-print-directory"
140 aros_host_exe_suffix="$EXEEXT"
141 aros_host_lib_suffix=""
143 # Ignore all compliance, AROS ROMs = 0
144 # KickStart v1.0 = 30
145 # KickStart v1.3 = 34
146 # KickStart v2.0 = 37
147 # KickStart v3.0 = 39
148 # KickStart v3.1 = 40
150 aros_amigaos_compliance=0
152 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
153 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
154 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
155 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
157 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
158 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
160 case "$aros_host_cc" in
165 aros_host_cc_pipe="-pipe"
175 aros_kernel_cc_includes=""
176 aros_target_cc_includes=""
179 # ----------------------------------------------------------------------------------------
180 # Host-specific defaults
182 # This is the main host configuration section. It is where the host
183 # can change the values of any variables it needs to change. We do
184 # not look at anything that compiles to the target yet, we'll get
189 aros_host_arch="aros"
190 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
196 aros_host_cpu="x86_64"
202 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
203 aros_host_cpu="$host_cpu"
209 aros_host_arch="linux"
210 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
211 android_build_os="linux-x86"
212 android_tool="android"
213 default_android_sdk="/opt/android-sdk-linux_x86"
219 aros_host_cpu="x86_64"
231 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
232 aros_host_cpu="$host_cpu"
238 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe -I/usr/local/include"
239 aros_host_make="gmake"
240 aros_host_arch="freebsd"
243 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
245 dnl FreeBSD 5.x (and later) has changed the default object format.
246 dnl The double [[]] is necessary to get around m4's quoting rules.
249 aros_object_format="elf_i386"
253 aros_object_format="elf_i386_fbsd"
260 AC_CHECK_FILE(/usr/include/stddef.h,,
261 AC_MSG_ERROR([XCode incorrectly configured!
262 please run 'xcode-select --install' before
263 re-running configure])
265 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
266 aros_host_arch="darwin"
268 if [[ -z ${SED+x} ]]; then SED="gsed"; fi
269 android_build_os="darwin-x86"
270 android_tool="android"
271 default_android_sdk="/android-sdk-mac_x86"
277 aros_host_cpu="x86_64"
283 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
284 aros_host_cpu="$host_cpu"
288 aros_host_ldflags="$aros_host_ldflags -liconv"
293 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
294 aros_host_make="gmake"
295 aros_host_arch="dragonfly"
301 aros_host_cpu="x86_64"
304 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
305 aros_host_cpu="$host_cpu"
311 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
312 aros_host_make="gmake"
313 aros_host_arch="netbsd"
322 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
323 aros_host_cpu="$host_cpu"
326 aros_host_lib_suffix=".0.0"
330 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
331 aros_host_make="gmake"
332 aros_host_arch="openbsd"
338 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
339 aros_host_cpu="$host_cpu"
345 aros_host_arch="solaris"
346 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
352 aros_host_cpu="sparc"
355 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
356 aros_host_cpu="$host_cpu"
362 aros_host_arch="morphos"
368 aros_host_arch="amiga"
374 TOUCH="/gg/bin/touch"
383 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
384 aros_host_cpu="$host_cpu"
390 aros_host_arch="cygwin"
391 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
393 android_build_os="windows"
394 android_tool="android.bat"
395 default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
402 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
403 aros_host_cpu="$host_cpu"
409 aros_host_arch="mingw32"
410 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
412 android_build_os="windows"
413 android_tool="android.bat"
414 default_android_sdk="/c/android-sdk-windows-1.6_r1"
416 libpng_libextra="-lws2_32"
420 dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
421 dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
422 dnl Here we attempt to detect Windows home platform by asking gcc about its target.
423 dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
425 AC_MSG_CHECKING([for Windows native gcc target])
426 host_cpu=`gcc -dumpmachine`
427 AC_MSG_RESULT($host_cpu)
438 dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
443 aros_host_cpu="x86_64"
444 dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
445 dnl directory, so we have to add it explicitly here.
446 aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
450 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
451 aros_host_cpu="$host_cpu"
456 AC_MSG_ERROR([Unsupported host architecture $host])
460 AROS_PROG(aros_host_ar,[ar],[cr])
461 AROS_REQUIRED(ar,$aros_host_ar)
462 AROS_PROG(aros_host_ranlib,ranlib)
463 AROS_REQUIRED(ranlib,$aros_host_ranlib)
464 AROS_PROG(aros_host_strip,strip)
465 AROS_REQUIRED(strip,$aros_host_strip)
467 AROS_PROG(RM,[rm],[-rf])
468 AROS_REQUIRED(rm,$RM)
470 AROS_REQUIRED(cp,$CP)
472 AROS_REQUIRED(mv,$MV)
473 AROS_PROG(ECHO,[echo])
474 AROS_REQUIRED(echo,$ECHO)
475 AROS_PROG(MKDIR,[mkdir],[-p])
476 AROS_REQUIRED(mkdir,$MKDIR)
477 AROS_PROG(TOUCH,[touch])
478 AROS_REQUIRED(touch,$TOUCH)
479 AROS_PROG(SORT,[sort])
480 AROS_REQUIRED(sort,$SORT)
481 AROS_PROG(UNIQ,[uniq])
482 AROS_REQUIRED(uniq,$UNIQ)
483 AROS_PROG(NOP,[true])
484 AROS_REQUIRED(true,$NOP)
486 AROS_REQUIRED(cat,$CAT)
487 AROS_PROG(BISON,[bison])
488 AROS_REQUIRED(bison,$BISON)
489 AROS_PROG(FLEX,[flex])
490 AROS_REQUIRED(flex,$FLEX)
491 AROS_PROG(PNGTOPNM,[pngtopnm])
492 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
493 AROS_PROG(PPMTOILBM,[ppmtoilbm])
494 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
496 AROS_REQUIRED(sed,$SED)
497 AROS_PROG(CHMOD,[chmod])
498 AROS_REQUIRED(chmod,$CHMOD)
499 AROS_PROG(PATCH,[patch])
500 AROS_REQUIRED(patch,$PATCH)
504 AC_ARG_ENABLE([libpng-config], [--disable-libpng-config disable libpng-config test and configuration])
505 if test "$enable_libpng_config" != "no"; then
506 AC_CHECK_PROG([arosconfig_use_libpngconfig],[libpng-config],[yes],[no])
508 if test "$arosconfig_use_libpngconfig" = "yes"; then
509 AC_MSG_CHECKING([libpng-config library])
510 libpng_incdir="`libpng-config --cflags`"
511 libpng_libextra="$libpng_libextra `libpng-config --ldflags`"
512 libpng="`libpng-config --libs`"
513 AC_MSG_RESULT($libpng)
515 AC_CHECK_LIB(png, png_read_png, [libpng="-lpng"], [libpng="no"])
516 if test "$libpng_libextra" != ""; then
517 if test "$libpng" != "no"; then
518 libpng_libextra="$libpng_libextra $libpng"
522 AROS_REQUIRED(libpng, $libpng)
524 AC_SUBST(libpng_libextra)
525 AC_SUBST(libpng_incdir)
532 dnl ---------------------------------------------------------------------------
533 dnl Look for things about the host system, good for hosted targets.
534 dnl ---------------------------------------------------------------------------
536 # Check for some includes for the X11 HIDD and the kernel
537 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
538 sys/mmap.h sys/mman.h sysexits.h \
539 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
542 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
559 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
561 # Look for some functions
562 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
563 clone kse_create rfork_thread thr_create sa_register \
564 getcontext makecontext setcontext sigaltstack swapcontext])
568 #-----------------------------------------------------------------------------
571 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
572 # it switched on by default, and we use the host compiler, so it compiles AROS
573 # code with this enabled resulting in link failures as we don't have support
576 # We use two methods to disable it. For the host compiler (used to compile
577 # some hosted modules), we test to see if the compiler supports stack
578 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
579 # work on all platforms.
582 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
583 save_cflags="$CFLAGS"
584 CFLAGS="$CFLAGS -fno-stack-protector"
585 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
586 AC_MSG_RESULT($use_no_stack_protector)
587 if test "x-$use_no_stack_protector" = "x-yes" ; then
588 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
590 CFLAGS="$save_cflags"
592 #-----------------------------------------------------------------------------
594 # Disable pointer-signedness warnings if the compiler recognises the option
595 # (this only works for the host compiler at the moment)
597 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
598 save_cflags="$CFLAGS"
599 CFLAGS="$CFLAGS -Wno-pointer-sign"
600 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
601 AC_MSG_RESULT($use_no_sign_warning)
602 if test "x-$use_no_sign_warning" = "x-yes" ; then
603 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
605 CFLAGS="$save_cflags"
607 #-----------------------------------------------------------------------------
609 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
611 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
612 save_cflags="$CFLAGS"
613 CFLAGS="$CFLAGS -fgnu89-inline"
614 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
615 AC_MSG_RESULT($use_gnu89_inline)
616 if test "x-$use_gnu89_inline" = "x-yes" ; then
617 gnu89_inline="-fgnu89-inline"
619 CFLAGS="$save_cflags"
622 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
623 # On GCC >= 4.0 -iquote should be used
625 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
626 CFLAGS="$CFLAGS -iquote."
627 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
628 AC_MSG_RESULT($has_iquote)
629 if test "x-$has_iquote" = "x-yes" ; then
630 host_cflags_iquote=-iquote
631 host_cflags_iquote_end=
633 host_cflags_iquote=-I
634 host_cflags_iquote_end=-I-
637 AC_MSG_NOTICE([Performing target configuration...])
639 dnl --------------------------------------------------------------------
640 dnl Target Configuration Section
641 dnl --------------------------------------------------------------------
643 dnl The target configuration section is responsible for setting up all
644 dnl the paths for includes, and tools required to build AROS to some
645 dnl particular target.
647 aros_nowarn_flags="NOWARN_UNUSED_COMMAND_LINE_ARGUMENT NOWARN_UNKNOWN_WARNING_OPTION NOWARN_POINTER_SIGN NOWARN_PARENTHESES"
649 toolchain_needs_sysroot=no
654 aros_config_cppflags=
656 aros_config_cxxflags=
657 aros_config_aflags="-Wall -x assembler-with-cpp -c"
658 aros_config_ldflags=""
660 aros_shared_default=yes
662 aros_shared_cflags="-fPIC"
663 aros_shared_aflags=""
664 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
665 aros_kernel_ldflags="-Wl,-rpath,./lib"
667 aros_kernel_ar_flags="cr"
668 aros_target_ar_flags="cr"
669 aros_target_nm_flags="-C -ul"
670 aros_target_strip_flags="--strip-unneeded -R.comment"
675 aros_target_genmap="-Wl,-Map -Xlinker"
677 # Native flavour stuff
678 aros_serial_debug="0"
680 # Palm native flavour stuff
681 aros_palm_debug_hack="0"
684 aros_nesting_supervisor="0"
686 # Collect-aros stuff: "-ius" to ignore undefined symbols
687 ignore_undefined_symbols=""
689 # Check for X11 by default
697 AC_MSG_CHECKING([Which toolchain family to use ...])
698 AC_ARG_WITH(toolchain,AC_HELP_STRING([--with-toolchain=family],[Which toolchain family to crosscompile with (defaults to gnu)]),aros_toolchain="$withval",aros_toolchain="gnu")
699 AC_MSG_RESULT($aros_toolchain)
702 AC_MSG_CHECKING([if we should enable link time optimizations (LTO)])
703 AC_ARG_ENABLE(lto,AC_HELP_STRING([--enable-lto=[yes|no]],[Enable link time optimizations if the target compiler supports them (default=no)]),
704 aros_config_lto="$enableval",aros_config_lto="no")
705 if test "$aros_config_lto" != "no"; then
706 aros_config_lto="yes"
708 AC_MSG_RESULT($aros_config_lto)
710 AC_MSG_CHECKING([if we should enable coverage instrumentation])
711 AC_ARG_ENABLE(coverage,AC_HELP_STRING([--enable-coverage=[yes|no]],[Enable coverage instrumentation if the target compiler supports it (default=no)]),
712 aros_config_coverage="$enableval",aros_config_coverage="no")
713 if test "$aros_config_coverage" != "no"; then
714 aros_config_coverage="yes"
716 AC_MSG_RESULT($aros_config_coverage)
720 case "$aros_toolchain" in
722 # toolchain_needs_sysroot=yes
723 toolchain_c_compiler="clang"
724 toolchain_cxx_compiler="clang++"
725 toolchain_cpp_preprocessor="clang -E"
726 toolchain_ld="ld.lld"
728 toolchain_as="llvm-as"
729 toolchain_ar="llvm-ar"
730 toolchain_ranlib="llvm-ranlib"
731 toolchain_nm="llvm-nm"
732 toolchain_strip="true"
733 toolchain_objcopy="llvm-objcopy"
734 toolchain_objdump="llvm-objdump"
737 toolchain_c_compiler="gcc"
738 toolchain_cxx_compiler="g++"
739 toolchain_cpp_preprocessor="gcc -E"
742 if test "$aros_config_lto" != "yes"; then
745 toolchain_ranlib="ranlib"
748 toolchain_ld="ld.bfd"
749 toolchain_ar="gcc-ar"
750 toolchain_ranlib="gcc-ranlib"
751 toolchain_nm="gcc-nm"
753 toolchain_strip="strip"
754 toolchain_objcopy="objcopy"
755 toolchain_objdump="objdump"
758 AC_MSG_WARN("Unknown toolchain family!")
759 toolchain_c_compiler="cc"
760 toolchain_cxx_compiler="c++"
761 toolchain_cpp_preprocessor="cpp"
766 toolchain_ranlib="ranlib"
768 toolchain_strip="strip"
769 toolchain_objcopy="objcopy"
770 toolchain_objdump="objdump"
774 #-----------------------------------------------------------------------------
776 AC_MSG_CHECKING([which type of build to do])
777 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")
779 if test "$build_type" = "nightly"; then
780 build_type_string="NIGHTLY"
781 elif test "$build_type" = "snapshot"; then
782 build_type_string="SNAPSHOT"
783 elif test "$build_type" = "milestone"; then
784 build_type_string="MILESTONE"
785 elif test "$build_type" = "release"; then
786 build_type_string="RELEASE"
788 build_type_string="PERSONAL"
789 build_type="personal"
792 aros_config_cppflags="$aros_config_cppflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
794 AC_MSG_RESULT($build_type)
796 #-----------------------------------------------------------------------------
797 all_debug_types="messages stack modules mungwall symbols"
799 AC_MSG_CHECKING([which debug types to enable])
800 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)]),
801 debug="$enableval",debug="")
803 if test "$debug" = "" -o "$debug" = "no"; then
805 elif test "$debug" = "yes"; then
809 if test "$debug" = "all" ; then
810 debug="messages stack modules symbols"
811 for d in $all_debug_types; do
812 export aros_${d}_debug="1"
815 for d in $all_debug_types; do
816 export aros_${d}_debug="0"
820 if test "$debug" != "none"; then
821 debug=`echo $debug | sed s/,/\ /g`
824 for d2 in $all_debug_types; do
825 if test "$d2" = "$d"; then
830 if test "$found" = "0"; then
831 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
833 export aros_${d}_debug="1"
837 AC_MSG_RESULT($debug)
839 if test "$aros_messages_debug" = "1"; then
840 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
842 aros_messages_debug=""
844 if test "$aros_symbols_debug" = "1"; then
845 aros_symbols_debug="-g"
847 aros_symbols_debug=""
850 # These are the flags to pass when compiling debugged programs
851 aros_debug_cppflags="$aros_messages_debug"
852 aros_debug_cflags="$aros_symbols_debug"
855 aros_debug_ldflags="$aros_symbols_debug"
857 #-----------------------------------------------------------------------------
858 # Checking for distcc and ccache.
860 # Always apply the transforms in this particular order. Basically you should
861 # always run 'ccache distcc compiler' in that order for the best performance.
863 AC_MSG_CHECKING([whether to enable distcc])
864 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
865 if test "$distcc" != "" -a "$distcc" != "no"; then
866 # AC_CHECK_PROG will print out the result in this case
867 AC_PATH_PROG(DISTCC,[distcc],distcc,)
872 AC_MSG_CHECKING([whether to enable ccache])
873 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
874 if test "$ccache" != "" -a "$ccache" != "no"; then
875 # AC_CHECK_PROG will print out the result in this case
876 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
881 #-----------------------------------------------------------------------------
882 AC_MSG_CHECKING([what specific host gcc version to use])
883 AC_ARG_WITH(kernel-gcc-version,AC_HELP_STRING([--with-kernel-gcc-version=VERSION],[Use gcc-VERSION for building bootstrap]),kernel_tool_version="$withval",kernel_tool_version="")
884 if test "$kernel_tool_version" != "" ; then
885 msg_result=$kernel_tool_version
889 AC_MSG_RESULT($msg_result)
891 #-----------------------------------------------------------------------------
892 AC_MSG_CHECKING([what optimization flags to use])
893 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (e.g --with-optimization=-O2).]),optimization_level="$withval",optimization_level="unknown")
894 if test "$optimization_level" = "unknown"; then
895 dnl default is -O2 for normal builds, -O0 for debug builds
896 optimization="default"
897 if test "$debug" != "none"; then
898 optimization_level="-O0"
900 optimization_level="-O2"
903 optimization="$optimization_level"
905 AC_MSG_RESULT($optimization)
908 #-----------------------------------------------------------------------------
909 AC_MSG_CHECKING([which paranoia flags to use])
910 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=(yes|no|FLAGS)],[Specific compiler warning FLAGS to enable for paranoia builds (default=-Wall -Werror)]),[paranoia_flags="$withval"],[paranoia_flags="$paranoia_default"])
911 if test "$paranoia_flags" = "no"; then
912 paranoia_flags="-Wall -Werror-implicit-function-declaration"
915 if test "$paranoia_flags" = "yes"; then
916 paranoia_flags="-Wall -Werror"
918 msg_result="$paranoia_flags"
920 AC_MSG_RESULT($msg_result)
921 aros_warn_flags="$aros_warn_flags $paranoia_flags"
923 #-----------------------------------------------------------------------------
924 AC_MSG_CHECKING([what target variant to enable])
925 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant (default=none)]),target_variant=$enableval,target_variant="")
926 if test "$target_variant" = ""; then
927 aros_target_variant=""
928 aros_target_suffix=""
931 aros_target_variant="$target_variant"
932 aros_target_suffix="-$target_variant"
934 AC_MSG_RESULT($enableval)
936 #-----------------------------------------------------------------------------
937 # Target-specific defaults. You can override then on a per-target basis.
939 # Bootloader name. Currently used by PC target.
940 target_bootloader="none"
944 #-----------------------------------------------------------------------------
945 # Additional options for some specific targets
947 case "$aros_target_variant" in
949 AC_MSG_CHECKING([XCode path])
950 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")
951 AC_MSG_RESULT($aros_xcode_path)
953 AC_MSG_CHECKING([what iOS SDK version to use])
954 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")
955 AC_MSG_RESULT($aros_sdk_version)
960 AC_MSG_CHECKING([Android SDK path])
961 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)
962 AC_MSG_RESULT($aros_android_sdk)
964 AC_MSG_CHECKING([Android NDK path])
965 AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
966 AC_MSG_RESULT($aros_android_ndk)
968 AC_MSG_CHECKING([what Android SDK version to use])
969 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")
970 AC_MSG_RESULT($aros_sdk_version)
972 aros_android_level=android-$aros_sdk_version
973 if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
974 echo "Platform $aros_android_level is not installed in your SDK"
975 echo "Use --with-sdk-version=<API level number> to select another platform version"
976 echo "You can check what plaform versions are installed in your SDK"
977 echo "by examining contents of $aros_android_sdk/platforms directory"
978 AC_MSG_ERROR([Android platform $aros_android_level is not installed])
981 export PATH="$aros_android_sdk/tools:$PATH"
982 AC_PATH_PROG(android_tool, $android_tool)
983 AROS_REQUIRED(android,$android_tool)
985 if test "$aros_android_ndk" != "none"; then
986 AC_MSG_CHECKING([what Android NDK version to use])
987 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")
988 AC_MSG_RESULT($aros_ndk_version)
991 AC_PATH_PROG(ant, ant)
992 if test "$ant" = ""; then
993 AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
996 AC_MSG_CHECKING([Build debug or release apk])
997 AC_ARG_WITH(apk-version,AC_HELP_STRING([--with-apk-version=(release|debug)],[Which version of AROSBootstrap.apk to compile. Release version needs key for signing, debug version will only run in emulator. (default=release)]),aros_android_antapk=$withval,aros_android_antapk=release)
998 if test $aros_android_antapk != release -a $aros_android_antapk != debug; then
999 AC_MSG_ERROR([apk-version has to be release or debug])
1001 AC_MSG_RESULT($aros_android_antapk)
1003 dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
1004 if test "$host_os" = "mingw32"; then
1005 android_tool="cmd //c $android_tool"
1013 #-----------------------------------------------------------------------------
1014 # External toolchains
1015 kernel_tool_prefix="none"
1016 aros_tool_prefix="none"
1017 elf_tool_prefix="${target_cpu}-elf-"
1018 x86_isa_extra="ISA_X86_FLAGS := -m32 -march=i486"
1019 x86_64_isa_extra="ISA_X8664_FLAGS := -mcmodel=large"
1022 # This is the target configuration switch.
1023 case "$target_os" in
1025 aros_target_arch="linux"
1026 aros_target_family="unix"
1027 case "$target_cpu" in
1029 aros_target_cpu="m68k"
1030 aros_object_format="m68kelf"
1031 aros_flavour="emulcompat"
1032 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
1033 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
1034 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
1035 gcc_target_cpu="mc68000"
1038 aros_target_cpu="i386"
1039 aros_object_format="elf_i386"
1040 aros_flavour="emulation"
1041 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
1042 aros_isa_flags="$""(ISA_X86_FLAGS)"
1043 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1044 aros_kernel_ldflags="-Wl,-melf_i386"
1045 aros_nominal_depth=8
1046 gcc_target_cpu="i386"
1047 pci_hidd_target="hidd-pci-linux"
1048 android_tool_dir_prefix="x86"
1049 android_tool_prefix="i686-android-linux"
1050 android_ndk_arch="x86"
1053 aros_target_cpu="x86_64"
1054 aros_object_format="elf_x86_64"
1055 aros_flavour="emulation"
1056 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
1057 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1058 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1059 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1060 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1061 aros_nominal_depth=8
1062 pci_hidd_target="hidd-pci-linux"
1065 aros_target_cpu="ppc"
1066 aros_object_format="elf32ppc"
1067 aros_flavour="emulation"
1068 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1069 aros_nominal_depth=8
1070 gcc_target_cpu="ppc"
1073 # Same as powerpc, but I need this for the nightly build to work again.
1074 # Actually, the nightly should be made working with powerpc target.
1075 # That just was too much work for the moment, another week or two.
1077 aros_target_cpu="ppc"
1078 aros_object_format="elf32ppc"
1079 aros_flavour="emulation"
1080 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1081 aros_nominal_depth=8
1082 gcc_target_cpu="ppc"
1085 aros_target_cpu="aarch64"
1086 target_cpu="aarch64"
1087 aros_object_format="aarch64elf_aros"
1088 aros_flavour="emulation"
1089 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1090 gcc_target_cpu="aarch64"
1091 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1092 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1093 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1094 aros_arch_libs="-laeabi"
1095 gcc_default_float_abi="hard"
1096 kernel_tool_prefix="aarch64-linux-gnueabihf-"
1099 aros_target_cpu="arm"
1101 aros_object_format="armelf_aros"
1102 aros_flavour="emulation"
1103 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1104 gcc_target_cpu="arm"
1105 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1106 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1107 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1108 aros_arch_libs="-laeabi"
1109 gcc_default_float_abi="hard"
1110 android_tool_dir_prefix="arm-linux-androideabi"
1111 android_tool_prefix="arm-linux-androideabi"
1112 android_ndk_arch="arm"
1113 kernel_tool_prefix="arm-linux-gnueabihf-"
1116 aros_target_cpu="arm"
1117 aros_object_format="armelf_aros"
1118 aros_flavour="emulation"
1119 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1120 gcc_target_cpu="arm"
1121 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1122 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1123 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1124 aros_arch_libs="-laeabi"
1125 android_tool_dir_prefix="arm-linux-androideabi"
1126 android_tool_prefix="arm-linux-androideabi"
1127 android_ndk_arch="arm"
1128 kernel_tool_prefix="arm-linux-gnueabi-"
1131 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
1134 case "$aros_target_variant" in
1137 dnl Not all Linux CPUs are supported by Android
1138 if test "$android_ndk_arch" = ""; then
1139 AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
1142 aros_nominal_width=320
1143 aros_nominal_height=480
1144 if test "$aros_android_ndk" = "none"; then
1145 dnl Use standalone toolchain, don't adjust paths
1146 aros_kernel_cflags="-mandroid"
1147 aros_kernel_ldflags="-mandroid"
1150 dnl In Android NDK toolchains are placed in own directories,
1151 dnl but tool names are not suffixed with version
1152 export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$kernel_tool_version/prebuilt/$android_build_os/bin:$PATH"
1153 kernel_tool_version=""
1154 aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
1155 aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
1156 aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
1157 CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
1158 aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
1161 host_android_gfx=yes
1162 # Disable implicit PIC mode
1163 aros_config_cflags="$aros_config_cflags -fno-pic"
1164 kernel_tool_prefix="$android_tool_prefix-"
1170 aros_target_arch="pc"
1171 aros_shared_default="no"
1172 target_bootloader="grub2"
1173 case "$target_cpu" in
1175 aros_target_cpu="i386"
1177 dnl If somebody hasn't already set the target object
1178 dnl format, then use this value. Mostly to support
1179 dnl FreeBSD cross-compilation.
1180 dnl TODO: Remove when we always use our compiler.
1182 if test "$aros_object_format" = "" ; then
1183 aros_object_format="elf_i386"
1185 aros_flavour="standalone"
1186 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1187 aros_isa_flags="$""(ISA_X86_FLAGS)"
1188 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1189 aros_kernel_ldflags="-Wl,-melf_i386"
1190 aros_nominal_width=640
1191 aros_nominal_height=480
1192 gcc_target_cpu="i386"
1195 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1196 aros_target_cpu="x86_64"
1198 if test "$aros_object_format" = "" ; then
1199 aros_object_format="elf_x86_64"
1201 aros_flavour="standalone"
1202 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1203 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1204 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1205 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1206 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1207 aros_kernel_ldflags=""
1208 aros_nominal_width=640
1209 aros_nominal_height=480
1210 case "$aros_target_variant" in
1212 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1217 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1223 aros_target_arch="prep"
1224 aros_shared_default="no"
1225 aros_target_cpu="ppc"
1226 aros_object_format="elf32ppc"
1227 aros_flavour="ppcnative"
1228 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1229 aros_kernel_ldflags=""
1230 aros_nominal_width=640
1231 aros_nominal_height=480
1232 gcc_target_cpu="ppc"
1236 aros_target_arch="freebsd"
1237 aros_target_family="unix"
1238 aros_target_cpu="i386"
1239 aros_flavour="emulation"
1240 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1241 gcc_target_cpu="i386"
1243 aros_target_strip_flags="-x"
1247 aros_target_arch="darwin"
1248 aros_target_family="unix"
1249 aros_flavour="emulation"
1250 case "$target_cpu" in
1252 aros_ios_platform="iPhoneSimulator"
1253 aros_target_cpu="i386"
1254 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1255 aros_isa_flags="$""(ISA_X86_FLAGS)"
1256 aros_kernel_ldflags=""
1257 aros_macosx_version="10.4"
1258 aros_nominal_depth=8
1259 gcc_target_cpu="i386"
1260 aros_object_format="elf_i386"
1261 aros_kernel_ar_flags="-cr"
1262 aros_target_strip_flags="-x"
1263 kernel_tool_flags="-m32"
1266 aros_target_cpu="x86_64"
1267 aros_object_format="elf_x86_64"
1268 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1269 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1270 aros_macosx_version="10.6"
1271 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1272 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1273 aros_kernel_cflags="-m64"
1274 aros_kernel_ldflags="-m64"
1275 aros_nominal_depth=8
1277 aros_kernel_ar_flags="-cr"
1280 aros_kernel_ranlib="ranlib"
1282 aros_kernel_strip="strip"
1283 kernel_tool_prefix="i686-apple-darwin10-"
1286 aros_target_cpu="ppc"
1287 aros_object_format="elf32ppc"
1288 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1289 aros_kernel_ldflags=""
1290 aros_macosx_version="10.0"
1291 aros_nominal_depth=8
1292 gcc_target_cpu="ppc"
1294 aros_kernel_ar_flags="-cr"
1295 aros_kernel_ld="ld -arch ppc"
1296 aros_kernel_as="as -arch ppc"
1297 aros_kernel_ranlib="ranlib -arch ppc"
1298 aros_kernel_nm="nm -arch ppc"
1299 aros_kernel_strip="strip -arch ppc"
1300 kernel_tool_prefix="powerpc-apple-darwin10-"
1303 aros_ios_platform="iPhoneOS"
1304 aros_target_cpu="arm"
1305 aros_object_format="armelf_aros"
1306 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1307 aros_arch_libs="-laeabi"
1308 aros_nominal_depth=8
1309 gcc_target_cpu="arm"
1311 aros_kernel_ar_flags="-cr"
1312 aros_kernel_ld="ld -arch arm"
1313 aros_kernel_ranlib="ranlib -arch arm"
1314 kernel_tool_prefix="arm-apple-darwin10-"
1315 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1318 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1321 case "$aros_target_variant" in
1323 aros_ios_version="3.0"
1324 aros_nominal_width=320
1325 aros_nominal_height=480
1326 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1327 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1328 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1330 # This is here because it may depend on iOS or SDK version
1331 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1332 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1333 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1336 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1337 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1343 aros_target_arch="dragonfly"
1344 aros_target_family="unix"
1345 aros_flavour="emulation"
1346 case "$target_cpu" in
1348 aros_target_cpu="i386"
1349 aros_object_format="elf_i386"
1350 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1351 aros_isa_flags="$""(ISA_X86_FLAGS)"
1354 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1355 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1356 aros_target_cpu="x86_64"
1357 aros_object_format="elf_x86_64"
1358 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1359 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1362 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1368 aros_target_arch="netbsd"
1369 aros_target_family="unix"
1370 case "$target_cpu" in
1372 aros_target_cpu="m68k"
1373 aros_object_format="m68kelf"
1374 aros_flavour="emulcompat"
1375 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1376 gcc_target_cpu="mc68000"
1379 aros_target_cpu="i386"
1380 aros_object_format="elf_i386"
1381 aros_flavour="emulation"
1382 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1383 aros_isa_flags="$""(ISA_X86_FLAGS)"
1384 aros_nominal_depth=8
1385 gcc_target_cpu="i386"
1388 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1391 aros_target_genmap="-Wl,-M -Xlinker >"
1392 aros_flavour="emulation"
1393 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1397 aros_target_arch="openbsd"
1398 aros_target_family="unix"
1399 case "$target_cpu" in
1401 aros_target_cpu="i386"
1402 aros_object_format="elf_i386"
1403 aros_flavour="emulation"
1404 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1405 aros_isa_flags="$""(ISA_X86_FLAGS)"
1406 gcc_target_cpu="i386"
1409 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1412 aros_target_genmap="-Wl,-M -Xlinker >"
1413 aros_target_nm_flags="-u"
1414 aros_flavour="emulation"
1418 aros_target_arch="solaris"
1419 aros_target_family="unix"
1420 case "$target_cpu" in
1422 aros_target_cpu="i386"
1423 aros_object_format="elf_i386"
1424 aros_flavour="emulation"
1425 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1426 aros_isa_flags="$""(ISA_X86_FLAGS)"
1427 aros_nominal_depth=8
1428 gcc_target_cpu="i386"
1431 aros_target_cpu="sparc"
1432 aros_object_format="elf_sparc"
1433 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1434 gcc_target_cpu="sparc"
1437 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1440 aros_config_cppflags="$aros_config_cppflags -D$aros_target_cpu"
1441 aros_flavour="emulation"
1445 aros_target_arch="morphos"
1446 aros_shared_default="no"
1447 aros_target_cpu="ppc"
1448 aros_object_format="elf_ppc"
1449 aros_flavour="nativecompat"
1450 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1451 gcc_target_cpu="ppc"
1455 aros_target_arch="sam440"
1456 aros_shared_default="no"
1457 aros_target_cpu="ppc"
1458 aros_object_format="elf32ppc"
1459 aros_flavour="ppcnative"
1460 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1461 aros_kernel_ldflags=""
1462 aros_nominal_width=1024
1463 aros_nominal_height=768
1464 aros_nominal_depth=24
1465 aros_isa_flags="$aros_isa_flags -mcpu=440fp -mno-toc"
1466 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1467 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1468 gcc_target_cpu="powerpc"
1472 aros_target_arch="efika"
1473 aros_shared_default="no"
1474 aros_target_cpu="arm"
1475 aros_object_format="armelf_aros"
1476 aros_flavour="standalone"
1477 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1478 aros_kernel_ldflags=""
1479 aros_nominal_width=1024
1480 aros_nominal_height=600
1481 aros_arch_libs="-laeabi"
1482 gcc_default_cpu="armv7-a"
1483 gcc_default_fpu="vfpv3"
1484 aros_isa_flags="$aros_isa_flags -mtune=cortex-a8"
1485 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1486 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1487 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1488 if test "$optimization" = "default"; then
1489 optimization_level="-Os"
1491 case "$target_cpu" in
1493 gcc_default_float_abi="hard"
1498 gcc_default_float_abi="softfp"
1501 AC_MSG_ERROR("Unknown CPU for EfikaMX $target_cpu")
1507 aros_target_arch="chrp"
1508 aros_shared_default="no"
1509 aros_target_cpu="ppc"
1510 aros_object_format="elf32ppc"
1511 aros_flavour="ppcnative"
1512 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1513 aros_kernel_ldflags=""
1514 aros_nominal_width=640
1515 aros_nominal_height=480
1516 aros_isa_flags="$aros_isa_flags -mno-toc"
1517 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1518 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1519 gcc_target_cpu="powerpc"
1520 case "$aros_target_variant" in
1522 aros_isa_flags="$aros_isa_flags -mcpu=603e"
1523 aros_config_cppflags="$aros_config_cppflags -DBIG_ENDIAN_OHCI=1"
1529 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1530 aros_flavour="standalone"
1531 aros_target_arch="raspi"
1533 aros_shared_default="no"
1535 aros_target_mkdep="$aros_target_mkdep -D__GNUC__"
1537 case "$target_cpu" in
1539 aros_target_cpu="aarch64"
1540 gcc_default_cpu="aarch64"
1541 aros_object_format="aarch64elf_aros"
1544 aros_target_cpu="arm"
1545 gcc_default_cpu="armv6zk"
1546 gcc_default_cpu_tune="arm1176jzf-s"
1547 aros_object_format="armelf_aros"
1548 aros_isa_flags="$aros_isa_flags -marm"
1549 aros_config_cflags="$aros_config_cflags"
1550 aros_config_cxxflags="$aros_config_cxxflags"
1551 aros_config_aflags="$aros_config_aflags -marm"
1552 aros_kernel_cflags="$aros_kernel_cflags -marm"
1553 aros_target_mkdep="$aros_target_mkdep -Darm"
1554 aros_arch_libs="-laeabi"
1557 aros_target_cpu="arm"
1558 gcc_default_cpu="armv6zk"
1559 gcc_default_cpu_tune="arm1176jzf-s"
1560 aros_object_format="armelf_aros"
1561 aros_isa_flags="$aros_isa_flags -marm"
1562 aros_config_cflags="$aros_config_cflags"
1563 aros_config_cxxflags="$aros_config_cxxflags"
1564 aros_config_aflags="$aros_config_aflags -marm"
1565 aros_kernel_cflags="$aros_kernel_cflags -marm"
1566 aros_target_mkdep="$aros_target_mkdep -Darm"
1567 aros_arch_libs="-laeabi"
1570 AC_MSG_ERROR("Unknown CPU for RasPi $target_cpu")
1574 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1575 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
1576 aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
1577 aros_kernel_cflags="$aros_kernel_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1579 case "$aros_target_variant" in
1581 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1587 aros_flavour="standalone"
1588 aros_target_arch="stm32f7_discovery"
1589 aros_target_cpu="arm"
1590 aros_target_cpu_mode="thumb2"
1591 aros_object_format="armelf_aros"
1592 aros_shared_default="no"
1594 gcc_default_cpu="armv7e-m"
1595 gcc_default_cpu_tune="cortex-m7"
1596 gcc_default_fpu="fpv5-sp-d16"
1597 gcc_default_float_abi="hard"
1599 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dthumb"
1603 aros_target_arch="amiga"
1604 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1605 aros_shared_default="no"
1607 case "$target_cpu" in
1609 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")
1611 aros_target_cpu="m68k"
1612 aros_object_format="m68kelf"
1613 aros_flavour="standcompat"
1614 gcc_target_cpu="m68000"
1615 aros_nowarn_flags="$aros_nowarn_flags NOWARN_VOLATILE_REGISTER_VAR"
1616 aros_config_cppflags="$aros_config_cppflags -DNOLIBINLINE"
1617 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1618 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1619 if test "$optimization" = "default"; then
1620 optimization_level="-Os"
1622 aros_config_aflags="$aros_config_aflags"
1623 aros_target_strip_flags="-R.comment --strip-debug"
1624 aros_nominal_width=640
1625 aros_nominal_height=256
1626 aros_nominal_depth=2
1630 aros_flavour="native"
1631 gcc_target_cpu="ppc"
1634 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1640 aros_target_arch="mingw32"
1641 aros_shared_default="no"
1642 aros_flavour="emulation"
1643 aros_shared_cflags=""
1644 need_crosstools="yes"
1647 case "$target_cpu" in
1649 aros_target_cpu="i386"
1650 aros_object_format="elf_i386"
1651 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1652 aros_isa_flags="$""(ISA_X86_FLAGS)"
1653 aros_nominal_depth=8
1654 gcc_target_cpu="i386"
1656 kernel_tool_prefix="i386-mingw32-"
1659 aros_target_cpu="x86_64"
1660 aros_object_format="elf_x86_64"
1661 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1662 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1663 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1664 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1665 aros_nominal_depth=8
1666 kernel_tool_prefix="x86_64-w64-mingw32-"
1669 aros_target_cpu="arm"
1670 aros_object_format="armelf_aros"
1671 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1672 aros_arch_libs="-laeabi"
1673 aros_nominal_depth=8
1674 gcc_target_cpu="arm"
1675 gcc_default_float_abi="soft"
1676 kernel_tool_prefix="arm-mingw32ce-"
1677 aros_nominal_width=160
1678 aros_nominal_height=160
1681 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1684 if test $host_os = "cygwin"; then
1685 aros_kernel_cflags="-mno-cygwin"
1689 aros_target_arch="pp"
1690 aros_shared_default="no"
1691 case "$target_cpu" in
1693 aros_target_cpu="m68k"
1694 aros_object_format="m68kelf"
1695 aros_flavour="palmnative"
1696 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1697 aros_nominal_width=160
1698 aros_nominal_height=160
1699 aros_nominal_depth=1
1700 aros_target_ar_flags="cru"
1701 aros_compiler_libs="-lgcc1"
1702 aros_shared_default=no
1703 aros_shared_cflags="-fpic"
1704 aros_shared_aflags=""
1705 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1706 aros_kernel_ldflags="-Wl,-rpath,./lib"
1707 aros_debug_cppflags="$aros_messages_debug"
1708 aros_debug_cflags="$aros_symbols_debug"
1709 aros_debug_aflags=""
1710 aros_debug_ldflags="$aros_symbols_debug"
1711 aros_mungwall_debug="0"
1712 aros_modules_debug="0"
1713 gcc_target_cpu="mc68000"
1714 ignore_undefined_symbols="-ius"
1717 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1723 aros_target_arch="mac"
1724 aros_shared_default="no"
1725 case "$target_cpu" in
1727 aros_target_cpu="m68k"
1728 aros_object_format="m68kelf"
1729 aros_flavour="mac68knative"
1730 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1731 aros_nominal_width=512
1732 aros_nominal_height=384
1733 aros_nominal_depth=8
1734 aros_target_ar_flags="cru"
1735 aros_compiler_libs="-lgcc1"
1736 aros_shared_default=no
1737 aros_shared_cflags="-fpic"
1738 aros_shared_aflags=""
1739 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1740 aros_kernel_ldflags="-Wl,-rpath,./lib"
1741 aros_debug_cppflags="$aros_messages_debug"
1742 aros_debug_cflags="$aros_symbols_debug"
1743 aros_debug_aflags=""
1744 aros_debug_ldflags="$aros_symbols_debug"
1745 aros_mungwall_debug="0"
1746 aros_modules_debug="0"
1747 gcc_target_cpu="mc68000"
1748 ignore_undefined_symbols="-ius"
1751 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1757 AC_MSG_ERROR([Unsupported target architecture $target])
1761 #-----------------------------------------------------------------------------
1762 crosstools_guess="yes"
1763 aros_target_toolchain="no"
1764 aros_config_sysroot=""
1765 aros_kernel_sysroot=""
1767 AC_MSG_CHECKING([Kernel toolchain prefix])
1768 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1769 AC_MSG_RESULT($kernel_tool_prefix)
1771 AC_MSG_CHECKING([ELF toolchain prefix])
1772 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"
1773 crosstools_guess="no"])
1774 AC_MSG_RESULT($elf_tool_prefix)
1776 AC_MSG_CHECKING([AROS toolchain prefix])
1777 AC_ARG_WITH(aros-toolchain,AC_HELP_STRING([--with-aros-toolchain=PREFIX],[Specify prebuilt AROS toolchain. Use yes for default name]),[aros_tool_prefix="$withval"
1778 crosstools_guess="no"])
1779 if test "$aros_tool_prefix" = "yes" ; then
1780 aros_tool_prefix=$aros_target_cpu-aros-
1782 AC_MSG_RESULT($aros_tool_prefix)
1784 #-----------------------------------------------------------------------------
1785 # Checking if we should build crosstools..
1786 AC_MSG_CHECKING([whether to build crosstools])
1787 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1788 AC_MSG_RESULT($crosstools)
1790 if test "${crosstools}" = "yes"; then
1791 if test "${crosstools_guess}" = "no"; then
1792 AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1796 if test "${crosstools}" = "yes" || test "${crosstools_guess}" = "no"; then
1797 aros_target_toolchain="yes"
1800 AC_MSG_CHECKING([where to install the crosstools binaries])
1801 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])
1802 if test "x$aros_toolchain_install" = "x"; then
1803 AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1805 AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1806 PATH="$AROS_CROSSTOOLSDIR:$PATH"
1807 if test "$crosstools_guess" = "no" ; then
1808 toolchain_needs_sysroot=yes
1810 if test "x-$aros_flavour" != "x-emulation" -a "x-$aros_flavour" != "x-emulcompat" ; then
1811 aros_kernel_sysroot = $aros_config_sysroot
1815 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1817 AC_MSG_CHECKING([If we need to use --sysroot])
1818 if test "$toolchain_needs_sysroot" = "yes" ; then
1819 aros_config_sysroot="--sysroot $AROS_BUILDDIR_UNIX/bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer"
1821 AC_MSG_RESULT($toolchain_needs_sysroot)
1823 #-----------------------------------------------------------------------------
1824 if test "$aros_toolchain" = "gnu" ; then
1825 AC_MSG_CHECKING([what specific target binutils version to use])
1827 AC_ARG_WITH(binutils-version,AC_HELP_STRING([--with-binutils-version=VERSION],[Use binutils-VERSION for building AROS]),use_binutils_version="$withval",use_binutils_version="")
1828 if test "$use_binutils_version" = ""; then
1829 target_binutils_version="$default_binutils_version"
1831 target_binutils_version="$use_binutils_version"
1833 if test "$aros_toolchain" = "gnu" ; then
1834 AC_MSG_RESULT($target_binutils_version)
1838 # Helper to identify gcc version
1839 AC_DEFUN([CROSS_GCC_VERSION], [
1840 target_gcc_version=""
1841 AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
1842 ax_cv_gcc_version="`$AROS_CROSSTOOLSDIR/${aros_tool_prefix}${toolchain_cpp_preprocessor} -dumpversion`"
1843 AS_IF([test "x$ax_cv_gcc_version" = "x"],[
1844 ax_cv_gcc_version=""
1847 target_gcc_version=$ax_cv_gcc_version
1848 AC_SUBST([target_gcc_version])
1851 #-----------------------------------------------------------------------------
1852 if test "$aros_toolchain" = "gnu" ; then
1853 AC_MSG_CHECKING([what specific target gcc version to use])
1855 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Compile gcc-VERSION for AROS]),use_gcc_version="$withval",use_gcc_version="")
1856 if test "$use_gcc_version" = ""; then
1857 if test "${crosstools}" = "no"; then
1858 if test "x$aros_toolchain_install" != "x"; then
1862 if test "$use_gcc_version" = ""; then
1863 target_gcc_version="$default_gcc_version"
1866 target_gcc_version="$use_gcc_version"
1868 if test "$aros_toolchain" = "gnu" ; then
1869 AC_MSG_RESULT($target_gcc_version)
1871 GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1)
1872 GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2)
1873 GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3)
1875 gcc_fix_bitfields="false"
1876 if test "$GCC_VERSION_MAJOR" -gt "4" ; then
1877 gcc_fix_bitfields="true"
1879 if test "$GCC_VERSION_MAJOR" -gt "3" ; then
1880 if test "$GCC_VERSION_MINOR" -gt "6" ; then
1881 gcc_fix_bitfields="true"
1886 if test "$gcc_fix_bitfields" = "true" ; then
1887 case "$aros_target_cpu" in
1889 x86_isa_extra="$x86_isa_extra -mno-ms-bitfields"
1890 x86_64_isa_extra="$x86_64_isa_extra -mno-ms-bitfields"
1896 AC_MSG_CHECKING([whether to enable Objective-C suppport])
1897 AC_ARG_ENABLE(objc,AC_HELP_STRING([--enable-objc],[Enable Objectve-C support (default=no)]),objc="$enableval",objc="no")
1898 AC_MSG_RESULT($objc)
1899 if test "x$objc" = "xyes"; then
1902 objc_target="no-objc"
1905 AC_MSG_CHECKING([whether to enable Java suppport])
1906 AC_ARG_ENABLE(java,AC_HELP_STRING([--enable-java],[Enable Java support (default=no)]),java="$enableval",java="no")
1907 AC_MSG_RESULT($java)
1908 if test "x$java" != "xno"; then
1911 java_target="no-java"
1914 spec_obj_format="-m $aros_object_format"
1915 # Now process extra architecture-specific options.
1916 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1917 # as well as floating-point ABI.
1918 case "$aros_target_cpu" in
1920 aros_isa_extra="$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
1921 dnl x86_64 can build 32 or 64bit code
1922 spec_obj_format="%{!m32:-m elf_x86_64} %{m32:-m elf_i386}"
1925 dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
1926 if test "$gcc_default_cpu" = ""; then
1927 gcc_default_cpu="armv6"
1929 if test "$gcc_default_fpu" = ""; then
1930 gcc_default_fpu="vfp"
1932 if test "$gcc_default_float_abi" = ""; then
1933 if test "$target_cpu" = "armhf"; then
1934 gcc_default_float_abi="hard"
1936 gcc_default_float_abi="softfp"
1940 AC_MSG_CHECKING([Which minimum CPU to use])
1941 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)
1942 AC_MSG_RESULT($aros_gcc_cpu)
1944 AC_MSG_CHECKING([Which minimum FPU to use])
1945 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)
1946 AC_MSG_RESULT($aros_gcc_fpu)
1948 AC_MSG_CHECKING([Which floating point ABI to use])
1949 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)
1950 AC_MSG_RESULT($aros_gcc_float_abi)
1952 AC_MSG_CHECKING([Which ARM mode to use])
1953 if test "$aros_target_cpu_mode" = ""; then
1954 aros_target_cpu_mode="arm32"
1955 AC_MSG_RESULT([Defaulting to $aros_target_cpu_mode])
1957 AC_MSG_RESULT([$aros_target_cpu_mode])
1960 case "$aros_target_cpu_mode" in
1962 gcc_default_mode="arm"
1963 aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
1966 AC_MSG_ERROR([ARM 64-bit mode is unsupported])
1969 AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
1972 AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
1975 gcc_default_mode="thumb"
1976 # Do not specify -mthumb-interwork as it may add extra code to support arm/thumb interwork
1977 aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
1980 AC_MSG_ERROR([Unsupported ARM mode specified $aros_target_cpu_mode])
1984 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1985 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
1986 aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
1989 aros_isa_extra="$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
1990 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
1994 # Some architectures may need custom ELF specs.
1995 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
1996 elf_specs_in=config/${aros_object_format}-specs.in
1998 elf_specs_in=config/elf-specs.in
2001 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
2002 # Since we override specs, we may need to put these defines there
2003 if test "$gcc_target_cpu" != ""; then
2004 gcc_target_cpu="-D__${gcc_target_cpu}__"
2007 AC_MSG_CHECKING([where to download sourcecode for external ports])
2008 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
2009 if test "$with_portssrcdir" = "default"; then
2010 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
2012 AROS_PORTSSRCDIR="$with_portssrcdir"
2014 AC_MSG_RESULT($AROS_PORTSSRCDIR)
2016 AC_MSG_CHECKING([which bootloader to use])
2017 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
2018 if test "$target_bootloader" = "none"; then
2019 aros_target_bootloader=""
2021 aros_target_bootloader="$target_bootloader"
2023 AC_MSG_RESULT($target_bootloader)
2025 AC_MSG_CHECKING([which icon-set to use])
2026 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
2027 if test "$target_iconset" = "default"; then
2028 aros_target_iconset="Gorilla"
2029 target_iconset="default (Gorilla)"
2031 aros_target_iconset="$target_iconset"
2033 AC_MSG_RESULT($target_iconset)
2035 AC_MSG_CHECKING([which GUI Theme to use])
2036 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
2037 if test "$target_guitheme" = "default"; then
2038 aros_target_guitheme="Ice"
2040 aros_target_guitheme="$target_guitheme"
2042 AC_MSG_RESULT($aros_target_guitheme)
2044 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
2048 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
2049 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
2053 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
2054 dnl The flag itself is given in per-target section, because some targets require to pass it
2055 dnl in a different manner, otherwise some tests fail.
2056 dnl TODO: Justify this.
2057 if test "$aros_host_cpu" == "x86_64" ; then
2058 if test "$aros_target_cpu" == "i386" ; then
2063 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2064 dnl For a hosted build we are cross-compiling if host OS differs from build OS.
2065 dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
2066 dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
2067 dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
2068 dnl used to build bootstrap for target arch in either case.
2069 dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
2070 dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
2071 dnl perhaps introducing aros_host_variant
2072 if test "$aros_host_arch" != "$aros_target_arch" ; then
2076 dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
2077 dnl it as kernel_cc. If not, (e.g. we are on Windows or Darwin), we need a crosscompiler.
2078 if test "$host_cc_elf" = "no" ; then
2083 if test "$cross_compiling" = "no" ; then
2084 kernel_tool_prefix=""
2085 if test "$host_cc_elf" = "yes" ; then
2090 if test "$kernel_tool_version" != ""; then
2091 kernel_tool_version="-$kernel_tool_version"
2094 #######################################################################
2095 ## Compute what toolchains to use, and their paths ##
2096 #######################################################################
2098 # This takes, as input:
2099 # crosstools {yes,no}
2100 # kernel_tool_version {"",[version]}
2101 # target_tool_version {"",[version]}
2102 # kernel_tool_prefix {none,[some-arch-os-]}
2104 # target_tool_prefix ${aros_target_cpu}-aros-
2105 # aros_tool_prefix ${aros_target_cpu}-aros-
2108 # aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2109 # Where the 'kernel' binaries are located
2110 # orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2111 # Where the 'target' binaries are located
2112 # (not the symlink farm - that is aros_target_*!)
2115 # if crosstools then
2116 # if kernel_tools_prefix = "no-kernel-prefix-"
2117 # aros_kernel_* = crosstools cc paths
2118 # aros_kernel_cc = elf cc wrapper around crosstools cc
2120 # VALIDATE(${kernel_tools_prefix}*)
2121 # aros_kernel_* = ${kernel_tools_prefix}*
2122 # if ${kernel_tools_prefix}cc is an AROS gcc
2123 # aros_kernel_cc = ${kernel_tools_prefix}cc
2125 # aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
2129 # orig_target_* = aros built crosstools
2130 # orig_target_cc = elf cc wrapper around crosstools cc
2132 # VALIDATE(${kernel_tools_prefix}*)
2134 # orig_target_* = aros_kernel_*
2135 # if aros_kernel_cc is an AROS gcc
2136 # orig_target_cc = aros_kernel_cc
2138 # orig_target_cc = aros cc wrapper around aros_kernel_cc
2142 if test "$aros_toolchain" = "gnu" ; then
2143 target_tool_prefix="${aros_target_cpu}-aros-"
2144 elif test "$aros_toolchain" = "llvm" ; then
2145 target_tool_prefix="bin/"
2148 if test "$kernel_tool_prefix" != "" ; then
2149 AC_MSG_CHECKING([which kernel tools])
2150 AC_MSG_RESULT([$kernel_tool_prefix]);
2153 if test "$kernel_tool_prefix" = "none" ; then
2154 dnl ELF wrapper can be used only for native bootstrap
2155 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2156 AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
2159 # Kernel tools required - find them
2160 # Note that 'normally', aros_kernel_* overrides will be
2161 # empty, unless specified in the per-arch sections above.
2162 if test "x$aros_kernel_cpp" = "x"; then
2163 aros_kernel_cpp=${kernel_tool_prefix}${CPP}
2165 AROS_BUILDCMD(aros_kernel_cpp,$aros_kernel_cpp,${kernel_tool_version})
2166 AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
2167 AROS_REQUIRED(cpp,$aros_kernel_cpp)
2169 if test "x$aros_kernel_cc" = "x"; then
2170 aros_kernel_cc=${kernel_tool_prefix}${CC}
2172 AROS_BUILDCMD(aros_kernel_cc,$aros_kernel_cc,${kernel_tool_version})
2173 AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc)
2174 AROS_REQUIRED(cc,$aros_kernel_cc)
2176 if test "x$aros_kernel_cxx" = "x"; then
2177 aros_kernel_cxx=${kernel_tool_prefix}${CXX}
2179 AROS_BUILDCMD(aros_kernel_cxx,$aros_kernel_cxx,${kernel_tool_version})
2180 AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx)
2181 # If it's set, make sure it's really there
2182 if test "x$aros_kernel_cxx" != "x" ; then
2183 AROS_REQUIRED(cxx,$aros_kernel_cxx)
2185 AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
2186 AROS_REQUIRED(ld,$aros_kernel_ld)
2187 AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
2188 AROS_REQUIRED(as,$aros_kernel_as)
2189 AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
2190 AROS_REQUIRED(ar,$aros_kernel_ar)
2191 AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
2192 AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
2193 AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
2194 AROS_REQUIRED(nm,$aros_kernel_nm)
2195 AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
2196 AROS_REQUIRED(strip,$aros_kernel_strip)
2198 # Objcopy and objdump are not required for the kernel
2199 # toolchain on many architectures.
2200 # So we'll look for them, but not make them strictly required.
2201 AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
2202 AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
2203 if test "x${crosstools}" != "xyes" ; then
2204 AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
2205 AROS_REQUIRED(objdump,$aros_kernel_objdump)
2209 AC_MSG_CHECKING([which target tools to use])
2210 if test "$aros_target_toolchain" = "yes"; then
2211 if test "$aros_toolchain" = "llvm" ; then
2214 msg_result=$target_tool_prefix
2216 AC_MSG_RESULT([$msg_result])
2217 # We are building AROS crosstools
2218 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
2219 orig_target_cc="${tmp_tool_prefix}${toolchain_c_compiler}${target_tool_version}"
2220 orig_target_cxx="${tmp_tool_prefix}${toolchain_cxx_compiler}${target_tool_version}"
2221 orig_target_cpp="${tmp_tool_prefix}${toolchain_cpp_preprocessor}"
2222 orig_target_ld="${tmp_tool_prefix}${toolchain_ld}"
2223 orig_target_as="${tmp_tool_prefix}${toolchain_as}"
2224 orig_target_ar="${tmp_tool_prefix}${toolchain_ar}"
2225 orig_target_ranlib="${tmp_tool_prefix}${toolchain_ranlib}"
2226 orig_target_nm="${tmp_tool_prefix}${toolchain_nm}"
2227 orig_target_strip="${tmp_tool_prefix}${toolchain_strip}"
2228 orig_target_objcopy="${tmp_tool_prefix}${toolchain_objcopy}"
2229 orig_target_objdump="${tmp_tool_prefix}${toolchain_objdump}"
2231 # Determine whether AROS or ELF tools should be used
2232 if test "$aros_tool_prefix" = "none"; then
2233 aros_tool_prefix="${elf_tool_prefix}"
2236 AC_MSG_RESULT([$aros_tool_prefix])
2237 # We are *not* building AROS crosstools - use the AROS or ELF tools
2238 AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}${toolchain_cpp_preprocessor}${target_tool_version})
2239 AROS_REQUIRED(cpp,$orig_target_cpp)
2240 AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}${toolchain_c_compiler}${target_tool_version})
2241 AROS_REQUIRED(cc,$orig_target_cc)
2242 AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}${toolchain_cxx_compiler}${target_tool_version})
2243 AROS_REQUIRED(cxx,$orig_target_cxx)
2244 AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}${toolchain_ld})
2245 AROS_REQUIRED(ld,$orig_target_ld)
2246 AROS_TOOL_TARGET(orig_target_as,as,aros_tool_prefix}${toolchain_as})
2247 AROS_REQUIRED(as,$orig_target_as)
2248 AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}${toolchain_ar})
2249 AROS_REQUIRED(ar,$orig_target_ar)
2250 AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}${toolchain_ranlib})
2251 AROS_REQUIRED(ranlib,$orig_target_ranlib)
2252 AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}${toolchain_nm})
2253 AROS_REQUIRED(nm,$orig_target_nm)
2254 AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}${toolchain_strip})
2255 AROS_REQUIRED(strip,$orig_target_strip)
2256 AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}${toolchain_objcopy})
2257 AROS_REQUIRED(objcopy,$orig_target_objcopy)
2258 AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}${toolchain_objdump})
2259 AROS_REQUIRED(objdump,$orig_target_objdump)
2262 if test "$kernel_tool_prefix" = "none" ; then
2263 # No kernel tools specified
2264 # Assume target tools == kernel tools with ELF wrapper
2265 aros_kernel_cc=$orig_target_cc
2266 aros_kernel_cxx=$orig_target_cxx
2267 aros_kernel_cpp=$orig_target_cpp
2268 aros_kernel_ld=$orig_target_ld
2269 aros_kernel_as=$orig_target_as
2270 aros_kernel_ar=$orig_target_ar
2271 aros_kernel_ranlib=$orig_target_ranlib
2272 aros_kernel_nm=$orig_target_nm
2273 aros_kernel_strip=$orig_target_strip
2274 aros_kernel_objcopy=$orig_target_objcopy
2275 aros_kernel_objdump=$orig_target_objdump
2276 use_kernel_cc_wrapper=yes
2279 # At this point, all aros_kernel_* and aros_target_*
2280 # tools should be set up correctly
2282 CC="$aros_kernel_cc $kernel_tool_flags"
2283 CPP="$aros_kernel_cpp"
2285 #-----------------------------------------------------------------------------
2287 # Find all the tools we need to compile. This could be cross-compiling
2288 # though! If that is the case we use the GNU form of the target and
2289 # simply add this to the front of the binary name. This is rather simple,
2290 # but it should work under most circumstances.
2292 # The default tools are to use the same as the host, but only if the
2293 # host and target CPU are the same. With GCC this is normally enough.
2297 aros_shared_ld="$aros_host_ld"
2299 aros_target_mkdep="$aros_host_mkdep"
2301 # The default tools executables to be linked to.
2302 if test "$rescomp" != ""; then
2303 AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
2304 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
2307 # Set up the sources for the symlink farm
2308 if test "$crosstools" = "yes"; then
2309 crosstools_target=tools-crosstools
2312 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
2313 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
2315 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/host/config"
2316 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
2317 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer/include/aros"
2318 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
2319 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
2320 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
2321 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
2323 # aros_cc_pre is a variable that is added to the front of the compiler name
2324 # in the generated aros-gcc shell script. We need this to enable the cache
2325 # to work across cleaned builds. Also, support DISTCC using the correct
2326 # environment variable.
2329 if test "x${DISTCC}" != "x" ; then
2330 if test "x${CCACHE}" != "x" ; then
2331 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
2333 aros_cc_pre="${DISTCC} "
2336 if test "x${CCACHE}" != "x" ; then
2337 aros_cc_pre="${CCACHE} "
2341 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
2342 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
2343 AC_SUBST(aros_target_nix_ldflags,-nix)
2344 AC_SUBST(aros_target_detach_ldflags,-detach)
2345 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
2348 AC_SUBST(aros_toolchain)
2349 if test "$aros_target_toolchain" != "yes"; then
2350 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
2351 if test "$GCC" = "yes"; then
2352 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
2355 # We do not know which c compiler version we are going to build and what we need to know
2356 # here is different for different versions so this will be set later during the
2357 # build of crosstools.
2358 if test "$aros_toolchain" = "gnu" ; then
2359 prefix="$AROS_CROSSTOOLSDIR/${aros_target_cpu}-aros-"
2360 elif test "$aros_toolchain" = "llvm" ; then
2361 prefix="$AROS_CROSSTOOLSDIR/bin/"
2363 aros_target_cc_path=@aros_target_cc_path@
2365 aros_target_cpp="${prefix}${toolchain_cpp_preprocessor}"
2366 aros_target_cc="${prefix}${toolchain_c_compiler}"
2367 aros_target_cxx="${prefix}${toolchain_cxx_compiler}"
2368 aros_target_as="${prefix}${toolchain_as}"
2369 if test "${use_ld_wrapper}" = "yes"; then
2370 aros_target_ld="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}"
2372 aros_target_ld="${prefix}${toolchain_ld}"
2374 aros_toolchain_ld="${prefix}${toolchain_ld}"
2376 aros_target_ar="${prefix}${toolchain_ar} $aros_target_ar_flags"
2377 aros_target_objcopy="${prefix}${toolchain_objcopy}"
2378 aros_target_objdump="${prefix}${toolchain_objdump}"
2379 aros_target_ranlib="${prefix}${toolchain_ranlib} $aros_target_ranlib_flags"
2380 aros_target_nm="${prefix}${toolchain_nm} $aros_target_nm_flags"
2381 aros_target_strip="${prefix}${toolchain_strip}"
2382 aros_plain_nm="${prefix}${toolchain_nm}"
2383 aros_plain_ar="${prefix}${toolchain_ar}"
2385 AC_ARG_ENABLE(includes,
2386 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
2387 [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`])
2389 if test "$aros_kernel_includes" = ""; then
2390 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2391 aros_kernel_includes="-isystem $aros_target_incl"
2395 if test "$aros_kernel_includes" != "" ; then
2396 dnl find out about the kernel cc's include path
2397 AC_MSG_CHECKING([for the kernel compiler's include path])
2398 if test "$aros_kernel_cc_includes" = "" ; then
2399 # Try to guess where the directory is.
2400 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
2401 if test -d $aros_kernel_cc_includes; then
2402 # Check if there is also an include-fixed directory and add it
2403 # to kernel compiler's include path as it may contain some of
2404 # the headers we need.
2405 if test -d "$aros_kernel_cc_includes"-fixed; then
2406 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
2408 # Check for specific includes directory. Needed for Ubuntu 11.10 and Debian
2409 if test -d "/usr/include/${aros_target_cpu}-linux-gnu"; then
2410 aros_kernel_cc_includes+=" -isystem /usr/include/${aros_target_cpu}-linux-gnu"
2413 # The directory doesn't exist, we need to do some more work.
2414 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
2416 # These are the headers we're looking for.
2417 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2418 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
2422 for h in $headers; do
2423 # Which other headers are needed by each of the above?
2424 deps=$(echo "#include <$h>" | \
2425 $aros_kernel_cc -E -M - 2>/dev/null | \
2426 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2428 # Copy all the needed headers to a directory beneath gendir.
2431 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
2432 sed -n "s,^.*/include\(/.*\),\1,p")
2433 ! test -d $dir && mkdir -p $dir
2434 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2439 AC_MSG_RESULT($aros_kernel_cc_includes)
2440 # Adding -nostdinc to kernel includes as they are always used together.
2441 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
2444 if test "$crosstools" != "yes"; then
2445 dnl find out about the target cc's include path
2446 AC_MSG_CHECKING([for the target compiler's include path])
2447 if test "$aros_target_cc_includes" = "" ; then
2448 #try to guess where the directory is
2449 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
2450 if ! test -d $aros_target_cc_includes; then
2451 #the directory doesn't exist, we need to do some more work
2452 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
2454 #these are the headers we're looking for
2455 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2456 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
2460 for h in $headers; do
2461 #which other headers each of the above headers needs?
2462 deps=$(echo "#include <$h>" | \
2463 $orig_target_cc -E -M - 2>/dev/null | \
2464 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2466 #copy all the needed headers to a directory beneath gendir
2469 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
2470 sed -n "s,^.*/include\(/.*\),\1,p")
2471 ! test -d $dir && mkdir -p $dir
2472 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2477 AC_MSG_RESULT($aros_target_cc_includes)
2479 # We do not know which c compiler version we are going to build and what we need to know
2480 # here is different for different versions so this will be set later during the
2481 # build of crosstools.
2482 aros_target_cc_includes=@aros_target_cc_includes@
2486 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
2487 # On GCC >= 4.0 -iquote should be used
2491 save_cflags="$CFLAGS"
2493 kernel_cflags_iquote=$host_cflags_iquote
2494 kernel_cflags_iquote_end=$host_cflags_iquote_end
2495 if test "x-$cross_compiling" = "x-yes"; then
2496 CC="$aros_kernel_cc"
2497 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2498 if test "x-$crosstools" != "x-yes"; then
2499 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2501 # we do know it is supported for the smallest version of gcc we are going to build
2502 # we assume it's also supported by later versions
2503 use_no_stack_protector=yes
2505 AC_MSG_RESULT($use_no_stack_protector)
2506 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2507 if test "x-$crosstools" != "x-yes"; then
2508 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2510 # we do know it is supported for the smallest version of gcc we are going to build
2511 # we assume it's also supported by later versions
2514 AC_MSG_RESULT($has_iquote)
2515 if test "x-$has_iquote" = "x-yes" ; then
2516 kernel_cflags_iquote=-iquote
2517 kernel_cflags_iquote_end=
2519 kernel_cflags_iquote=-I
2520 kernel_cflags_iquote_end=-I-
2523 if test "x-$use_no_stack_protector" = "x-yes" ; then
2524 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2527 #-----------------------------------------------------------------------------
2529 # Check if we can explicitly choose older version of symbol hashing
2531 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2532 CC="$aros_kernel_cc"
2533 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2534 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2535 AC_MSG_RESULT($use_hash_style)
2536 if test "x-$use_hash_style" = "x-yes" ; then
2537 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2540 CFLAGS="$save_cflags"
2542 AC_SUBST(host_cflags_iquote)
2543 AC_SUBST(host_cflags_iquote_end)
2544 AC_SUBST(kernel_cflags_iquote)
2545 AC_SUBST(kernel_cflags_iquote_end)
2548 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2549 AC_MSG_CHECKING([for default resolution of WBScreen])
2550 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2551 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2552 if test "$resolution" = "yes" ; then
2555 if test "$resolution" = "no" ; then
2558 if test "$resolution" != "none" ; then
2559 aros_nominal_width=`echo $resolution | cut -d'x' -f1`
2560 aros_nominal_height=`echo $resolution | cut -d'x' -f2`
2561 aros_nominal_depth=`echo $resolution | cut -d'x' -f3`
2563 AC_MSG_RESULT($aros_nominal_width x $aros_nominal_height x $aros_nominal_depth)
2564 aros_cv_nominal_width=$aros_nominal_width
2565 aros_cv_nominal_height=$aros_nominal_height
2566 aros_cv_nominal_depth=$aros_nominal_depth
2568 dnl See if the user wants the serial debug output for native flavour
2569 AC_MSG_CHECKING([whether serial debug is enabled])
2570 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)
2571 if test "$aros_serial_debug" = 0 ; then
2572 serial_debug_forced=""
2573 if test "$serial_debug" = "yes" ; then
2576 if test "$serial_debug" = "no" ; then
2580 serial_debug_forced="(forced)"
2581 serial_debug=$aros_serial_debug
2583 if test "$serial_debug" != "none" ; then
2584 aros_serial_debug=$serial_debug
2585 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2590 dnl See if the user wants the palm debug output hack for palm native flavour
2591 AC_MSG_CHECKING([whether palm debug hack is enabled])
2592 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")
2593 if test "$palm_debug_hack" = "yes" ; then
2594 aros_palm_debug_hack="1"
2596 AC_MSG_RESULT($palm_debug_hack)
2598 dnl See if dev wants the usb3.0 code
2599 AC_MSG_CHECKING([whether usb3.0 code is enabled])
2600 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2601 if test "$usb30_code" = "yes" ; then
2602 aros_config_cppflags="$aros_config_cppflags -DAROS_USB30_CODE"
2603 aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2605 AC_MSG_RESULT($usb30_code)
2607 dnl See if the user wants nesting supervisor activated for unix flavour
2608 AC_MSG_CHECKING([whether nesting supervisor support is enabled])
2609 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")
2610 if test "$nesting_supervisor" = "yes" ; then
2611 aros_nesting_supervisor="1"
2613 AC_MSG_RESULT($nesting_supervisor)
2615 dnl See if the user wants to disable MMU support
2616 dnl This can be overriden on per-target basis,
2617 dnl set $aros_enable_mmu to "yes" or "no" to do this
2618 if test "$aros_enable_mmu" = "" ; then
2619 AC_MSG_CHECKING([whether MMU support is enabled])
2620 dnl Enabled by default
2621 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2622 if test "$aros_enable_mmu" = "" ; then
2623 aros_enable_mmu="yes"
2625 AC_MSG_RESULT($aros_enable_mmu)
2627 if test "$aros_enable_mmu" = "no" ; then
2634 dnl things specifically required for hosted flavours
2635 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2637 if test "x-$need_dlopen" != "x-no" ; then
2640 dnl some kind of dynamic library access system is required for hostlib.resource
2641 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2642 if test "x-$have_dl" = "x-no" ; then
2643 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2644 aros_host_ldflags="$aros_host_ldflags -ldl"],
2647 if test "x-$have_dl" = "x-no" ; then
2648 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2655 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2656 [build X11 hidd for hosted (default=auto)]),
2657 x11_hidd="$enableval",
2658 x11_hidd="$need_x11")
2659 case "x-$x11_hidd" in
2660 x-yes|x-no|x-auto) ;;
2661 *) x11_hidd="$need_x11" ;;
2667 if test "x-$x11_hidd" != "x-no" ; then
2672 if test -n "$x_includes"; then
2673 X_CFLAGS="$X_CFLAGS -I$x_includes"
2676 if test -n "$x_libraries"; then
2677 X_LIBS="$X_LIBS -L$x_libraries"
2680 if test "x-$no_x" = "x-yes" ; then
2683 if test "x-$x11_hidd" != "x-auto" ; then
2684 dnl and they explicitly asked for it, bail out
2685 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2689 dnl found it, setup the metatarget
2693 aros_host_x11_cflags="$X_CFLAGS"
2694 aros_host_x11_ldflags="$X_LIBS -lX11"
2696 dnl setup shared memory extensions
2697 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2698 [use X11 shared memory (default=auto)]),
2699 x11_hidd_shm="$enableval",
2700 x11_hidd_shm="auto")
2701 case "x-$x11_hidd_shm" in
2702 x-yes|x-no|x-auto) ;;
2703 *) x11_hidd_shm="auto" ;;
2709 if test "x-$x11_hidd_shm" != "x-no" ; then
2711 dnl system shm headers
2712 AC_CHECK_HEADERS(sys/ipc.h)
2713 AC_CHECK_HEADERS(sys/shm.h)
2716 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2718 dnl make sure X libs have shm functions
2719 save_cflags="$CFLAGS"
2720 save_ldflags="$LDFLAGS"
2721 CFLAGS="$CFLAGS $X_CFLAGS"
2722 LDFLAGS="$LDFLAGS $X_LIBS"
2723 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2724 CFLAGS="$save_cflags"
2725 LDFLAGS="$save_ldflags"
2729 dnl detection done, prepare output
2730 if test "x-$have_xshm" = "x-yes" ; then
2733 elif test "x-$x11_hidd_shm" = "x-yes" ; then
2734 dnl they explicitly asked for it, but we can't do it
2735 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2737 dnl otherwise just disable it
2742 dnl setup vidmode (fullscreen) extensions
2743 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2744 [use X11 vidmode extension (default=auto)]),
2745 x11_hidd_vidmode="$enableval",
2746 x11_hidd_vidmode="auto")
2747 case "x-$x11_hidd_vidmode" in
2748 x-yes|x-no|x-auto) ;;
2749 *) x11_hidd_vidmode="auto" ;;
2755 if test "x-$x11_hidd_vidmode" != "x-no" ; then
2757 dnl make sure X libs have vidmode functions
2758 save_cflags="$CFLAGS"
2759 save_ldflags="$LDFLAGS"
2760 CFLAGS="$CFLAGS $X_CFLAGS"
2761 LDFLAGS="$LDFLAGS $X_LIBS"
2762 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2763 CFLAGS="$save_cflags"
2764 LDFLAGS="$save_ldflags"
2767 dnl detection done, prepare output
2768 if test "x-$have_vidmode" = "x-yes" ; then
2769 dnl we can do vidmode
2770 DO_VIDMODE_SUPPORT="1"
2771 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2772 dnl they explicitly asked for it, but we can't do it
2773 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2775 dnl otherwise just disable it
2776 DO_VIDMODE_SUPPORT="0"
2782 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2783 [build SDL hidd for hosted (default=auto)]),
2784 sdl_hidd="$enableval",
2786 case "x-$sdl_hidd" in
2787 x-yes|x-no|x-auto) ;;
2788 *) sdl_hidd="auto" ;;
2792 if test "x-$sdl_hidd" != "x-no" ; then
2796 AM_PATH_SDL($SDL_VERSION, [have_sdl="yes"],
2799 if test "x-$have_sdl" != "x-yes" ; then
2802 if test "x-$sdl_hidd" != "x-auto" ; then
2803 dnl and they explicitly asked for it, bail out
2804 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2808 dnl found it, enable the build
2810 aros_host_sdl_cflags=$SDL_CFLAGS
2811 aros_host_sdl_libs=$SDL_LIBS
2818 dnl See if the user wants dbus.library
2819 AC_MSG_CHECKING([whether building of dbus.library is enabled])
2820 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2821 if test "$dbus" = "yes" ; then
2823 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2824 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2825 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2826 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2830 AC_MSG_RESULT($dbus)
2832 if test "$use_kernel_cc_wrapper" = "yes" ; then
2833 aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-${toolchain_c_compiler}"
2836 aros_kernel_cppflags=$aros_config_cppflags
2837 aros_optimization_cflags="$optimization_level"
2838 if test "$optimization" = "default"; then
2839 AC_MSG_CHECKING([default optimization level to use])
2840 AC_MSG_RESULT($optimization_level)
2843 dnl --------------------------------------------------------------------
2844 dnl Configuration Output Section
2845 dnl --------------------------------------------------------------------
2850 AC_SUBST(aros_flavour)
2851 AC_SUBST(aros_flavour_uc)
2852 AC_SUBST(aros_target_toolchain)
2853 AC_SUBST(aros_toolchain_ld)
2854 AC_SUBST(aros_build_host)
2855 AC_SUBST(AROS_BUILDDIR)
2856 AC_SUBST(AROS_BUILDDIR_UNIX)
2858 AC_SUBST(AROS_CROSSTOOLSDIR)
2859 AC_SUBST(AROS_PORTSSRCDIR)
2861 # Compatability with other Amiga-like operation systems
2862 AC_SUBST(aros_amigaos_compliance)
2865 AC_SUBST(aros_cc_pre)
2866 AC_SUBST(aros_host_strip)
2867 AC_SUBST(aros_host_arch)
2868 AC_SUBST(aros_host_cpu)
2869 AC_SUBST(aros_host_cpp)
2870 AC_SUBST(aros_host_def_cc)
2871 AC_SUBST(aros_host_cc)
2872 AC_SUBST(aros_host_cxx)
2873 AC_SUBST(aros_host_ar)
2874 AC_SUBST(aros_host_ranlib)
2875 AC_SUBST(aros_host_ld)
2876 AC_SUBST(aros_host_make)
2877 AC_SUBST(aros_host_cppflags)
2878 AC_SUBST(aros_host_cflags)
2879 AC_SUBST(aros_host_cxxflags)
2880 AC_SUBST(gnu89_inline)
2881 AC_SUBST(aros_host_ldflags)
2882 AC_SUBST(aros_host_debug)
2883 AC_SUBST(aros_host_mkdep)
2884 AC_SUBST(aros_host_mkargs)
2885 AC_SUBST(aros_host_exe_suffix)
2886 AC_SUBST(aros_host_lib_suffix)
2887 AC_SUBST(aros_tools_dir)
2888 AC_SUBST(aros_host_aclocal)
2889 AC_SUBST(aros_host_autoconf)
2890 AC_SUBST(aros_host_autoheader)
2891 AC_SUBST(aros_host_automake)
2895 AC_SUBST(aros_target_guitheme)
2896 AC_SUBST(aros_target_iconset)
2897 AC_SUBST(aros_target_bootloader)
2898 AC_SUBST(aros_target_arch)
2899 AC_SUBST(aros_target_family)
2900 AC_SUBST(aros_target_cpu)
2901 AC_SUBST(aros_target_cpu_mode)
2902 AC_SUBST(aros_target_variant)
2903 AC_SUBST(aros_target_suffix)
2904 AC_SUBST(aros_target_ar)
2905 AC_SUBST(aros_target_ranlib)
2906 AC_SUBST(aros_plain_nm)
2907 AC_SUBST(aros_plain_ar)
2908 AC_SUBST(aros_kernel_ar)
2909 AC_SUBST(aros_kernel_ranlib)
2910 AC_SUBST(orig_target_cc)
2911 AC_SUBST(aros_target_cc)
2912 AC_SUBST(aros_kernel_cc)
2913 AC_SUBST(orig_target_cxx)
2914 AC_SUBST(aros_target_cxx)
2915 AC_SUBST(aros_kernel_cxx)
2916 AC_SUBST(orig_target_cpp)
2917 AC_SUBST(aros_target_cpp)
2918 AC_SUBST(aros_kernel_cpp)
2919 AC_SUBST(orig_target_as)
2920 AC_SUBST(aros_target_as)
2921 AC_SUBST(aros_kernel_as)
2922 AC_SUBST(orig_target_ld)
2923 AC_SUBST(aros_target_ld)
2924 AC_SUBST(aros_kernel_ld)
2925 AC_SUBST(aros_target_cc_includes)
2926 AC_SUBST(aros_target_cc_path)
2927 AC_SUBST(aros_target_objdump)
2928 AC_SUBST(aros_target_objcopy)
2929 AC_SUBST(aros_target_strip)
2930 AC_SUBST(aros_target_nm)
2931 AC_SUBST(aros_kernel_rescomp)
2932 AC_SUBST(aros_shared_default)
2933 AC_SUBST(aros_shared_ld)
2934 AC_SUBST(aros_object_format)
2935 AC_SUBST(spec_obj_format)
2936 AC_SUBST(aros_compiler_libs)
2937 AC_SUBST(aros_arch_libs)
2939 AC_SUBST(aros_shared_cflags)
2940 AC_SUBST(aros_shared_aflags)
2941 AC_SUBST(aros_shared_ldflags)
2943 AC_SUBST(aros_config_sysroot)
2944 AC_SUBST(aros_warn_flags)
2945 AC_SUBST(aros_nowarn_flags)
2946 AC_SUBST(aros_config_cppflags)
2947 AC_SUBST(aros_config_cflags)
2948 AC_SUBST(aros_config_cxxflags)
2949 AC_SUBST(aros_config_aflags)
2950 AC_SUBST(aros_config_ldflags)
2952 AC_SUBST(aros_kernel_sysroot)
2953 AC_SUBST(aros_kernel_cppflags)
2954 AC_SUBST(aros_kernel_cflags)
2955 AC_SUBST(aros_kernel_includes)
2956 AC_SUBST(aros_kernel_objcflags)
2957 AC_SUBST(aros_kernel_ldflags)
2958 AC_SUBST(aros_debug_cppflags)
2959 AC_SUBST(aros_debug_cflags)
2960 AC_SUBST(aros_debug_cxxflags)
2961 AC_SUBST(aros_debug_aflags)
2962 AC_SUBST(aros_debug_ldflags)
2963 AC_SUBST(aros_target_genmap)
2964 AC_SUBST(aros_target_strip_flags)
2965 AC_SUBST(aros_config_lto)
2966 AC_SUBST(aros_config_coverage)
2967 AC_SUBST(aros_optimization_cflags)
2968 AC_SUBST(aros_isa_extra)
2969 AC_SUBST(aros_isa_flags)
2971 AC_SUBST(crosstools_target)
2972 AC_SUBST(crosstools_cxx_target)
2974 # Hosted Graphics Related
2975 AC_SUBST(host_x_gfx)
2976 AC_SUBST(host_sdl_gfx)
2977 AC_SUBST(host_android_gfx)
2979 AC_SUBST(pci_hidd_target)
2981 AC_SUBST(aros_nominal_width)
2982 AC_SUBST(aros_nominal_height)
2983 AC_SUBST(aros_nominal_depth)
2984 AC_SUBST(DO_XSHM_SUPPORT)
2985 AC_SUBST(DO_VIDMODE_SUPPORT)
2987 AC_SUBST(aros_host_x11_cflags)
2988 AC_SUBST(aros_host_x11_ldflags)
2989 AC_SUBST(aros_host_sdl_cflags)
2990 AC_SUBST(aros_host_sdl_libs)
2992 # Bootloader related
2993 AC_SUBST(target_grub2_version)
2995 # Native version related
2996 AC_SUBST(aros_serial_debug)
2997 AC_SUBST(PLATFORM_EXECSMP)
2998 AC_SUBST(ENABLE_EXECSMP)
3000 # Palm native version related
3001 AC_SUBST(aros_palm_debug_hack)
3003 # Unix/Hosted version related
3004 AC_SUBST(aros_nesting_supervisor)
3007 AC_SUBST(aros_enable_mmu)
3010 AC_SUBST(aros_ios_platform)
3011 AC_SUBST(aros_ios_version)
3012 AC_SUBST(aros_ios_sdk)
3014 # ARM default GCC target related
3015 AC_SUBST(gcc_default_cpu)
3016 AC_SUBST(gcc_default_cpu_tune)
3017 AC_SUBST(gcc_default_fpu)
3018 AC_SUBST(gcc_default_float_abi)
3019 AC_SUBST(gcc_default_mode)
3022 AC_SUBST(android_tool)
3023 AC_SUBST(aros_android_level)
3024 AC_SUBST(aros_android_antapk)
3027 AC_SUBST(ENABLE_DBUS)
3028 AC_SUBST(DBUS_CFLAGS)
3029 AC_SUBST(DBUS_LIBFLAGS)
3030 AC_SUBST(KERNEL_DBUS_KOBJ)
3031 AC_SUBST(KERNEL_DBUS_INCLUDES)
3034 AC_SUBST(ENABLE_X11)
3037 AC_SUBST(aros_debug)
3038 AC_SUBST(aros_mungwall_debug)
3039 AC_SUBST(aros_stack_debug)
3040 AC_SUBST(aros_modules_debug)
3042 # Collect-aros stuff: "-ius" to ignore undefined symbols
3043 AC_SUBST(ignore_undefined_symbols)
3045 # C compiler related
3046 AC_SUBST(gcc_target_cpu)
3047 AC_SUBST(target_binutils_version)
3048 AC_SUBST(target_gcc_version)
3050 #ObjC compiler related
3051 AC_SUBST(objc_target)
3054 AC_SUBST(java_target)
3057 AC_SUBST(aros_usb30_code)
3059 dnl Prepare for output, make up all the generated patches
3060 case "$aros_flavour" in
3061 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
3062 aros_flavour="emulation" ;;
3063 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
3064 aros_flavour="emulation" ;;
3065 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
3066 aros_flavour="standalone";;
3067 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3068 aros_flavour="standalone";;
3069 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
3070 aros_flavour="native" ;;
3071 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
3072 aros_flavour="native" ;;
3073 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
3074 aros_flavour="linklib" ;;
3075 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3076 aros_flavour="palmnative" ;;
3077 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3078 aros_flavour="mac68knative" ;;
3079 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3080 aros_flavour="ppcnative" ;;
3083 if test ! -d ${aros_inc_dir} ; then
3084 ${MKDIR} ${aros_inc_dir}
3086 if test ! -d ${aros_geninc_dir} ; then
3087 ${MKDIR} ${aros_geninc_dir}
3089 if test ! -d ${aros_hostcfg_dir} ; then
3090 ${MKDIR} ${aros_hostcfg_dir}
3092 if test ! -d ${aros_targetcfg_dir} ; then
3093 ${MKDIR} ${aros_targetcfg_dir}
3095 if test ! -d ${aros_tools_dir} ; then
3096 ${MKDIR} ${aros_tools_dir}
3098 if test ! -d ${aros_scripts_dir} ; then
3099 ${MKDIR} ${aros_scripts_dir}
3102 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
3104 # Generic build tools (metamake, etc)
3105 AC_CONFIG_COMMANDS([genmf-executable-support],
3107 chmod a+x ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname
3108 chmod a+x ${aros_tools_dir}/genmf.py
3111 AROS_CROSSTOOLSDIR=${AROS_CROSSTOOLSDIR}
3112 aros_tools_dir=${aros_tools_dir}
3118 ${aros_inc_dir}/config.h:config/config.h.in
3119 ${aros_geninc_dir}/config.h:config/config.h.in
3120 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
3121 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
3122 ${aros_targetcfg_dir}/build.cfg:config/build.cfg.in
3124 compiler/include/geninc.cfg:compiler/include/geninc.cfg.in
3125 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
3126 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
3127 ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname:scripts/uname.in
3128 tools/collect-aros/env.h
3132 AC_CONFIG_COMMANDS([binutils-support],
3134 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3136 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3138 chmod a+x ${prefix2}-ld
3140 ln -sf $orig_target_as$aros_host_exe_suffix ${prefix2}-as$aros_host_exe_suffix
3141 ln -sf $orig_target_nm$aros_host_exe_suffix ${prefix2}-nm$aros_host_exe_suffix
3142 ln -sf $orig_target_ar$aros_host_exe_suffix ${prefix2}-ar$aros_host_exe_suffix
3143 ln -sf $orig_target_ranlib$aros_host_exe_suffix ${prefix2}-ranlib$aros_host_exe_suffix
3144 ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
3145 ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
3146 ln -sf $orig_target_strip$aros_host_exe_suffix ${prefix2}-strip$aros_host_exe_suffix
3149 aros_host_exe_suffix=${aros_host_exe_suffix}
3150 aros_tools_dir=${aros_tools_dir}
3151 aros_target_cpu=${aros_target_cpu}
3152 aros_target_arch=${aros_target_arch}
3153 aros_target_suffix=${aros_target_suffix}
3154 orig_target_nm=${orig_target_nm}
3155 orig_target_as=${orig_target_as}
3156 orig_target_ar=${orig_target_ar}
3157 orig_target_ranlib=${orig_target_ranlib}
3158 orig_target_objdump=${orig_target_objdump}
3159 orig_target_objcopy=${orig_target_objcopy}
3160 orig_target_strip=${orig_target_strip}
3161 aros_kernel_ld=${aros_kernel_ld}
3164 if test "${use_ld_wrapper}" = "yes"; then
3166 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}:scripts/aros-ld.in
3169 # Bare Elf support script and spec
3170 if test "${use_kernel_cc_wrapper}" = "yes"; then
3171 AC_CONFIG_COMMANDS([elf-compiler-support],
3173 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3175 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
3177 chmod a+x ${prefix2}-gcc
3179 ln -sf $aros_kernel_ld$aros_host_exe_suffix ${prefix2}-ld$aros_host_exe_suffix
3182 aros_host_exe_suffix=${aros_host_exe_suffix}
3183 aros_tools_dir=${aros_tools_dir}
3184 aros_target_cpu=${aros_target_cpu}
3185 aros_target_arch=${aros_target_arch}
3186 aros_target_suffix=${aros_target_suffix}
3187 aros_kernel_ld=${aros_kernel_ld}
3191 ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
3192 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
3196 # Host compiler support scripts and spec
3197 if test "${aros_target_toolchain}" = "no"; then
3198 AC_CONFIG_COMMANDS([host-compiler-wrapper-support],
3200 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3202 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3204 chmod a+x ${prefix2}-${toolchain_c_compiler} ${prefix2}-${toolchain_cxx_compiler} ${prefix2}-${toolchain_cpp_preprocessor}
3207 aros_host_exe_suffix=${aros_host_exe_suffix}
3208 aros_tools_dir=${aros_tools_dir}
3209 aros_target_cpu=${aros_target_cpu}
3210 aros_target_arch=${aros_target_arch}
3211 aros_target_suffix=${aros_target_suffix}
3215 ${aros_targetcfg_dir}/specs:config/specs.in
3216 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cpp_preprocessor}:scripts/aros-${toolchain_cpp_preprocessor}.in
3217 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_c_compiler}:scripts/aros-${toolchain_c_compiler}.in
3218 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cxx_compiler}:scripts/aros-${toolchain_cxx_compiler}.in
3223 if test "$aros_target_variant" == "android"; then
3224 AC_CONFIG_FILES(${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in)
3228 AC_CONFIG_FILES(${aros_targetcfg_dir}/conf.cmake:config/conf.cmake.in)
3232 dnl This is in order to not define SHARED_CFLAGS sometimes
3233 dnl We don't always do aros_shared_ar, aros_shared_cflags
3235 #XXX compatability...
3236 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
3238 if test -n "$aros_shared_cflags" ; then
3239 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
3240 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg