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_toolchain_family=`cat ${srcdir}/config/toolchain_def`
27 default_gcc_version=`cat ${srcdir}/config/gcc_def`
28 exp_gcc_version=`cat ${srcdir}/config/gcc_exp`
29 default_binutils_version=`cat ${srcdir}/config/binutils_def`
30 exp_binutils_version=`cat ${srcdir}/config/binutils_exp`
31 default_grub2_version="2.02"
32 target_grub2_version=$default_grub2_version
34 # The AROS target is slightly different to the normal GNU style
35 # format. We don't have the middle part, and we reverse the order
36 # of the $(CPU) and $(OS) bits.
38 # Don't strip the version of the target yet, it might be
39 # useful on some systems.
41 AC_MSG_CHECKING([for AROS style target])
43 if test "$target" = "NONE" ; then
44 target=$host_os-$host_cpu
46 if test "$target" = "" ; then
47 target=$host_os-$host_cpu
50 AC_MSG_RESULT($target)
52 if test "$host_os" = "mingw32" ; then
56 # Don't know where else to put this...
57 AC_MSG_CHECKING([building AROS in])
58 AROS_BUILDDIR=`${PWDCMD-pwd}`
59 AROS_BUILDDIR_UNIX=${PWD}
60 AC_MSG_RESULT($AROS_BUILDDIR)
62 AC_MSG_CHECKING([AROS source in])
63 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
65 AC_MSG_RESULT($SRCDIR)
67 # Parse the target field into something useful.
69 target_os=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\1/'`
70 target_cpu=`echo $target | sed 's/^\([^-].*\)-\(.*\)$/\2/'`
73 # Some debug output, to be removed again.
74 AC_MSG_CHECKING([for target system (debug output)])
75 AC_MSG_RESULT($target_os)
76 AC_MSG_CHECKING([for target cpu (debug output)])
77 AC_MSG_RESULT($target_cpu)
79 dnl --------------------------------------------------------------------
80 dnl Set the default Workbench resolution
81 dnl --------------------------------------------------------------------
82 aros_nominal_width=800
83 aros_nominal_height=600
86 dnl --------------------------------------------------------------------
87 dnl Host Configuration Section
88 dnl --------------------------------------------------------------------
90 dnl The idea here is to find out all the information we need about the
91 dnl host. This means things like tools for building directory structures,
92 dnl copying files around and the like.
94 default_c_compilers="gcc clang cc"
95 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="")
96 if test "$use_c_compiler" = ""; then
97 host_c_compilers="$default_c_compilers"
99 host_c_compilers="$use_c_compiler"
102 default_cxx_compilers="g++ clang++ c++"
103 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="")
104 if test "$use_cxx_compiler" = ""; then
105 host_cxx_compilers="$default_cxx_compilers"
107 host_cxx_compilers="$use_cxx_compiler"
111 # The first step is to find the host binaries.
112 # Check for a compiler.
113 # Due to a bug in autoconf check for c++ compiler first.
114 # For mor info see, http://osdir.com/ml/bug-autoconf-gnu/2010-05/msg00001.html.
115 AC_PROG_CXX([${host_cxx_compilers}])
116 AC_PROG_CC([${host_c_compilers}])
117 aros_host_def_cc="$CC"
121 # Check for a compatible awk
122 AC_CHECK_PROGS(AWK,[gawk nawk])
123 AROS_REQUIRED(gawk,$AWK)
124 AROS_PROG(MMAKE,mmake)
126 # Perform some default variable assignments. Note all of these will be
127 # Regenerated from the script, so there is no need to cache them.
129 aros_build_host=$host
133 AROS_TOOL_CCPATH(aros_host_ld,ld)
134 AROS_REQUIRED(ld,$aros_host_ld)
135 aros_host_make="make"
136 aros_host_cflags="$CFLAGS"
137 aros_host_cxxflags="$CXXFLAGS"
138 aros_host_cppflags="$CPPFLAGS"
139 aros_host_ldflags="$LDFLAGS"
140 aros_host_debug="-g -O0"
141 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
142 aros_host_mkargs="--no-print-directory"
143 aros_host_exe_suffix="$EXEEXT"
144 aros_host_lib_suffix=""
146 # Ignore all compliance, AROS ROMs = 0
147 # KickStart v1.0 = 30
148 # KickStart v1.3 = 34
149 # KickStart v2.0 = 37
150 # KickStart v3.0 = 39
151 # KickStart v3.1 = 40
153 aros_amigaos_compliance=0
155 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
156 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
157 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
158 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
160 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
161 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
163 case "$aros_host_cc" in
168 aros_host_cc_pipe="-pipe"
178 aros_kernel_cc_includes=""
179 aros_target_cc_includes=""
182 # ----------------------------------------------------------------------------------------
183 # Host-specific defaults
185 # This is the main host configuration section. It is where the host
186 # can change the values of any variables it needs to change. We do
187 # not look at anything that compiles to the target yet, we'll get
192 aros_host_arch="aros"
193 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
199 aros_host_cpu="x86_64"
205 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
206 aros_host_cpu="$host_cpu"
212 aros_host_arch="linux"
213 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
214 android_build_os="linux-x86"
215 android_tool="android"
216 default_android_sdk="/opt/android-sdk-linux_x86"
222 aros_host_cpu="x86_64"
234 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
235 aros_host_cpu="$host_cpu"
241 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe -I/usr/local/include"
242 aros_host_make="gmake"
243 aros_host_arch="freebsd"
246 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
248 dnl FreeBSD 5.x (and later) has changed the default object format.
249 dnl The double [[]] is necessary to get around m4's quoting rules.
252 aros_object_format="elf_i386"
256 aros_object_format="elf_i386_fbsd"
263 AC_MSG_CHECKING([for macOS SDK files])
264 LOC=$( xcode-select -p )
265 AS_IF([ test $? != 0],[AC_MSG_ERROR([XCode incorrectly configured!
266 please run 'xcode-select --install' before
267 re-running configure])])
269 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
270 aros_host_arch="darwin"
272 if [[ -z ${SED+x} ]]; then SED="gsed"; fi
273 android_build_os="darwin-x86"
274 android_tool="android"
275 default_android_sdk="/android-sdk-mac_x86"
281 aros_host_cpu="x86_64"
287 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
288 aros_host_cpu="$host_cpu"
292 aros_host_ldflags="$aros_host_ldflags -liconv"
297 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
298 aros_host_make="gmake"
299 aros_host_arch="dragonfly"
305 aros_host_cpu="x86_64"
308 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
309 aros_host_cpu="$host_cpu"
315 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
316 aros_host_make="gmake"
317 aros_host_arch="netbsd"
326 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
327 aros_host_cpu="$host_cpu"
330 aros_host_lib_suffix=".0.0"
334 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
335 aros_host_make="gmake"
336 aros_host_arch="openbsd"
342 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
343 aros_host_cpu="$host_cpu"
349 aros_host_arch="solaris"
350 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
356 aros_host_cpu="sparc"
359 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
360 aros_host_cpu="$host_cpu"
366 aros_host_arch="morphos"
372 aros_host_arch="amiga"
378 TOUCH="/gg/bin/touch"
387 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
388 aros_host_cpu="$host_cpu"
394 aros_host_arch="cygwin"
395 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
397 android_build_os="windows"
398 android_tool="android.bat"
399 default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
406 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
407 aros_host_cpu="$host_cpu"
413 aros_host_arch="mingw32"
414 aros_host_cflags="$aros_host_cflags $aros_host_cc_pipe"
416 android_build_os="windows"
417 android_tool="android.bat"
418 default_android_sdk="/c/android-sdk-windows-1.6_r1"
420 libpng_libextra="-lws2_32"
424 dnl Currently there's neither 64-bit MinGW nor MSYS. Both environments are 32-bit
425 dnl and run under emulation. Consequently, uname reports i386 even on 64-bit systems.
426 dnl Here we attempt to detect Windows home platform by asking gcc about its target.
427 dnl 64-bit gcc will output "x86_64-w64-mingw32" here.
429 AC_MSG_CHECKING([for Windows native gcc target])
430 host_cpu=`gcc -dumpmachine`
431 AC_MSG_RESULT($host_cpu)
442 dnl Native i386 gcc for MinGW32 reports 'mingw32' with -dumpmachine switch
447 aros_host_cpu="x86_64"
448 dnl Dragon's x86_64-w64-mingw32-gcc is a bit broken. It ignores standard $prefix/include
449 dnl directory, so we have to add it explicitly here.
450 aros_host_cflags="$aros_host_cflags -isystem /mingw/include"
454 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
455 aros_host_cpu="$host_cpu"
460 AC_MSG_ERROR([Unsupported host architecture $host])
464 AROS_PROG(aros_host_ar,[ar],[cr])
465 AROS_REQUIRED(ar,$aros_host_ar)
466 AROS_PROG(aros_host_ranlib,ranlib)
467 AROS_REQUIRED(ranlib,$aros_host_ranlib)
468 AROS_PROG(aros_host_strip,strip)
469 AROS_REQUIRED(strip,$aros_host_strip)
471 AROS_PROG(RM,[rm],[-rf])
472 AROS_REQUIRED(rm,$RM)
474 AROS_REQUIRED(cp,$CP)
476 AROS_REQUIRED(mv,$MV)
477 AROS_PROG(ECHO,[echo])
478 AROS_REQUIRED(echo,$ECHO)
479 AROS_PROG(MKDIR,[mkdir],[-p])
480 AROS_REQUIRED(mkdir,$MKDIR)
481 AROS_PROG(TOUCH,[touch])
482 AROS_REQUIRED(touch,$TOUCH)
483 AROS_PROG(SORT,[sort])
484 AROS_REQUIRED(sort,$SORT)
485 AROS_PROG(UNIQ,[uniq])
486 AROS_REQUIRED(uniq,$UNIQ)
487 AROS_PROG(NOP,[true])
488 AROS_REQUIRED(true,$NOP)
490 AROS_REQUIRED(cat,$CAT)
491 AROS_PROG(BISON,[bison])
492 AROS_REQUIRED(bison,$BISON)
493 AROS_PROG(FLEX,[flex])
494 AROS_REQUIRED(flex,$FLEX)
495 AROS_PROG(PNGTOPNM,[pngtopnm])
496 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
497 AROS_PROG(PPMTOILBM,[ppmtoilbm])
498 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
500 AROS_REQUIRED(sed,$SED)
501 AROS_PROG(CHMOD,[chmod])
502 AROS_REQUIRED(chmod,$CHMOD)
503 AROS_PROG(PATCH,[patch])
504 AROS_REQUIRED(patch,$PATCH)
508 AC_ARG_ENABLE([libpng-config], [--disable-libpng-config disable libpng-config test and configuration])
509 if test "$enable_libpng_config" != "no"; then
510 AC_CHECK_PROG([arosconfig_use_libpngconfig],[libpng-config],[yes],[no])
512 if test "$arosconfig_use_libpngconfig" = "yes"; then
513 AC_MSG_CHECKING([libpng-config library])
514 libpng_incdir="`libpng-config --cflags`"
515 libpng_libextra="$libpng_libextra `libpng-config --ldflags`"
516 libpng="`libpng-config --libs`"
517 AC_MSG_RESULT($libpng)
519 AC_CHECK_LIB(png, png_read_png, [libpng="-lpng"], [libpng="no"])
520 if test "$libpng_libextra" != ""; then
521 if test "$libpng" != "no"; then
522 libpng_libextra="$libpng_libextra $libpng"
526 AROS_REQUIRED(libpng, $libpng)
528 AC_SUBST(libpng_libextra)
529 AC_SUBST(libpng_incdir)
536 dnl ---------------------------------------------------------------------------
537 dnl Look for things about the host system, good for hosted targets.
538 dnl ---------------------------------------------------------------------------
540 # Check for some includes for the X11 HIDD and the kernel
541 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
542 sys/mmap.h sys/mman.h sysexits.h \
543 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
546 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
547 AC_CHECK_HEADERS([GL/glx.h],[host_feature_glx=yes],[host_feature_glx=no],)
549 AC_MSG_CHECKING([if __unused conflicts with sys/stat.h])
550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
552 #define __unused __attribute__((unused))
553 #include <sys/stat.h>
555 [host_stat_h__unused_used=no],
556 [host_stat_h__unused_used=yes])
557 AC_MSG_RESULT($host_stat_h__unused_used)
574 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
576 # Look for some functions
577 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
578 clone kse_create rfork_thread thr_create sa_register \
579 getcontext makecontext setcontext sigaltstack swapcontext])
583 #-----------------------------------------------------------------------------
586 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
587 # it switched on by default, and we use the host compiler, so it compiles AROS
588 # code with this enabled resulting in link failures as we don't have support
591 # We use two methods to disable it. For the host compiler (used to compile
592 # some hosted modules), we test to see if the compiler supports stack
593 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
594 # work on all platforms.
597 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
598 save_cflags="$CFLAGS"
599 CFLAGS="$CFLAGS -fno-stack-protector"
600 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
601 AC_MSG_RESULT($use_no_stack_protector)
602 if test "x-$use_no_stack_protector" = "x-yes" ; then
603 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
605 CFLAGS="$save_cflags"
607 #-----------------------------------------------------------------------------
609 # Disable pointer-signedness warnings if the compiler recognises the option
610 # (this only works for the host compiler at the moment)
612 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
613 save_cflags="$CFLAGS"
614 CFLAGS="$CFLAGS -Wno-pointer-sign"
615 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
616 AC_MSG_RESULT($use_no_sign_warning)
617 if test "x-$use_no_sign_warning" = "x-yes" ; then
618 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
620 CFLAGS="$save_cflags"
622 #-----------------------------------------------------------------------------
624 # Check if host compiler supports -fgnu89-inline, can be needed for crosstools.
626 AC_MSG_CHECKING([whether ${CC} accepts -fgnu89-inline])
627 save_cflags="$CFLAGS"
628 CFLAGS="$CFLAGS -fgnu89-inline"
629 AC_TRY_COMPILE(,, use_gnu89_inline="yes", use_gnu89_inline="no")
630 AC_MSG_RESULT($use_gnu89_inline)
631 if test "x-$use_gnu89_inline" = "x-yes" ; then
632 gnu89_inline="-fgnu89-inline"
634 CFLAGS="$save_cflags"
637 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
638 # On GCC >= 4.0 -iquote should be used
640 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
641 CFLAGS="$CFLAGS -iquote."
642 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
643 AC_MSG_RESULT($has_iquote)
644 if test "x-$has_iquote" = "x-yes" ; then
645 host_cflags_iquote=-iquote
646 host_cflags_iquote_end=
648 host_cflags_iquote=-I
649 host_cflags_iquote_end=-I-
652 AC_MSG_NOTICE([Performing target configuration...])
654 dnl --------------------------------------------------------------------
655 dnl Target Configuration Section
656 dnl --------------------------------------------------------------------
658 dnl The target configuration section is responsible for setting up all
659 dnl the paths for includes, and tools required to build AROS to some
660 dnl particular target.
664 aros_nowarn_flags="NOWARN_UNUSED_COMMAND_LINE_ARGUMENT NOWARN_UNKNOWN_WARNING_OPTION NOWARN_POINTER_SIGN NOWARN_PARENTHESES"
672 aros_config_cppflags=
674 aros_config_cxxflags=
675 aros_config_aflags="-Wall -x assembler-with-cpp -c"
676 aros_config_ldflags=""
678 aros_shared_default=yes
680 aros_shared_cflags="-fPIC"
681 aros_shared_aflags=""
682 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
683 aros_kernel_ldflags="-Wl,-rpath,./lib"
685 aros_kernel_ar_flags="cr"
686 aros_target_ar_flags="cr"
687 aros_target_nm_flags="-C -ul"
688 aros_target_strip_flags="--strip-unneeded -R.comment"
693 aros_target_genmap="-Wl,-Map -Xlinker"
695 # Native flavour stuff
696 aros_serial_debug="0"
698 # Palm native flavour stuff
699 aros_palm_debug_hack="0"
702 aros_nesting_supervisor="0"
704 # Collect-aros stuff: "-ius" to ignore undefined symbols
705 ignore_undefined_symbols=""
707 # Check for X11 by default
710 AC_MSG_CHECKING([Which toolchain family to use ...])
711 AC_ARG_WITH(toolchain,AC_HELP_STRING([--with-toolchain=family],[Which toolchain family to crosscompile with (defaults to gnu)]),aros_toolchain="$withval",aros_toolchain="$default_toolchain_family")
712 AC_MSG_RESULT($aros_toolchain)
715 AC_MSG_CHECKING([if we should enable link time optimizations (LTO)])
716 AC_ARG_ENABLE(lto,AC_HELP_STRING([--enable-lto=[yes|no]],[Enable link time optimizations if the target compiler supports them (default=no)]),
717 aros_config_lto="$enableval",aros_config_lto="no")
718 if test "$aros_config_lto" != "no"; then
719 aros_config_lto="yes"
721 AC_MSG_RESULT($aros_config_lto)
723 AC_MSG_CHECKING([if we should enable coverage instrumentation])
724 AC_ARG_ENABLE(coverage,AC_HELP_STRING([--enable-coverage=[yes|no]],[Enable coverage instrumentation if the target compiler supports it (default=no)]),
725 aros_config_coverage="$enableval",aros_config_coverage="no")
726 if test "$aros_config_coverage" != "no"; then
727 aros_config_coverage="yes"
729 AC_MSG_RESULT($aros_config_coverage)
733 case "$aros_toolchain" in
735 toolchain_c_compiler="clang"
736 toolchain_cxx_compiler="clang++"
737 toolchain_cpp_preprocessor="clang -E"
738 toolchain_ld="ld.lld"
740 toolchain_as="llvm-as"
741 toolchain_ar="llvm-ar"
742 toolchain_ranlib="llvm-ranlib"
743 toolchain_nm="llvm-nm"
744 toolchain_strip="true"
745 toolchain_objcopy="llvm-objcopy"
746 toolchain_objdump="llvm-objdump"
749 toolchain_c_compiler="gcc"
750 toolchain_cxx_compiler="g++"
751 toolchain_cpp_preprocessor="gcc -E"
754 if test "$aros_config_lto" != "yes"; then
757 toolchain_ranlib="ranlib"
760 toolchain_ld="ld.bfd"
761 toolchain_ar="gcc-ar"
762 toolchain_ranlib="gcc-ranlib"
763 toolchain_nm="gcc-nm"
765 toolchain_strip="strip"
766 toolchain_objcopy="objcopy"
767 toolchain_objdump="objdump"
770 AC_MSG_WARN("Unknown toolchain family!")
771 toolchain_c_compiler="cc"
772 toolchain_cxx_compiler="c++"
773 toolchain_cpp_preprocessor="cpp"
778 toolchain_ranlib="ranlib"
780 toolchain_strip="strip"
781 toolchain_objcopy="objcopy"
782 toolchain_objdump="objdump"
786 #-----------------------------------------------------------------------------
788 AC_MSG_CHECKING([which type of build to do])
789 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")
791 if test "$build_type" = "nightly"; then
792 build_type_string="NIGHTLY"
793 elif test "$build_type" = "snapshot"; then
794 build_type_string="SNAPSHOT"
795 elif test "$build_type" = "milestone"; then
796 build_type_string="MILESTONE"
797 elif test "$build_type" = "release"; then
798 build_type_string="RELEASE"
800 build_type_string="PERSONAL"
801 build_type="personal"
804 aros_config_cppflags="$aros_config_cppflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
806 AC_MSG_RESULT($build_type)
808 #-----------------------------------------------------------------------------
809 all_debug_types="messages stack modules mungwall symbols"
811 AC_MSG_CHECKING([which debug types to enable])
812 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)]),
813 debug="$enableval",debug="")
815 if test "$debug" = "" -o "$debug" = "no"; then
817 elif test "$debug" = "yes"; then
821 if test "$debug" = "all" ; then
822 debug="messages stack modules symbols"
823 for d in $all_debug_types; do
824 export aros_${d}_debug="1"
827 for d in $all_debug_types; do
828 export aros_${d}_debug="0"
832 if test "$debug" != "none"; then
833 debug=`echo $debug | sed s/,/\ /g`
836 for d2 in $all_debug_types; do
837 if test "$d2" = "$d"; then
842 if test "$found" = "0"; then
843 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
845 export aros_${d}_debug="1"
849 AC_MSG_RESULT($debug)
851 if test "$aros_messages_debug" = "1"; then
852 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
854 aros_messages_debug=""
856 if test "$aros_symbols_debug" = "1"; then
857 aros_symbols_debug="-g"
859 aros_symbols_debug=""
862 # These are the flags to pass when compiling debugged programs
863 aros_debug_cppflags="$aros_messages_debug"
864 aros_debug_cflags="$aros_symbols_debug"
867 aros_debug_ldflags="$aros_symbols_debug"
869 #-----------------------------------------------------------------------------
870 # Checking for distcc and ccache.
872 # Always apply the transforms in this particular order. Basically you should
873 # always run 'ccache distcc compiler' in that order for the best performance.
875 AC_MSG_CHECKING([whether to enable distcc])
876 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
877 if test "$distcc" != "" -a "$distcc" != "no"; then
878 # AC_CHECK_PROG will print out the result in this case
879 AC_PATH_PROG(DISTCC,[distcc],distcc,)
884 AC_MSG_CHECKING([whether to enable ccache])
885 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
886 if test "$ccache" != "" -a "$ccache" != "no"; then
887 # AC_CHECK_PROG will print out the result in this case
888 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
893 #-----------------------------------------------------------------------------
894 AC_MSG_CHECKING([what specific host gcc version to use])
895 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="")
896 if test "$kernel_tool_version" != "" ; then
897 msg_result=$kernel_tool_version
901 AC_MSG_RESULT($msg_result)
903 #-----------------------------------------------------------------------------
904 AC_MSG_CHECKING([what optimization flags to use])
905 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")
906 if test "$optimization_level" = "unknown"; then
907 dnl default is -O2 for normal builds, -O0 for debug builds
908 optimization="default"
909 if test "$debug" != "none"; then
910 optimization_level="-O0"
912 optimization_level="-O2"
915 optimization="$optimization_level"
917 AC_MSG_RESULT($optimization)
920 #-----------------------------------------------------------------------------
921 AC_MSG_CHECKING([which paranoia flags to use])
922 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"])
923 if test "$paranoia_flags" = "no"; then
924 paranoia_flags="-Wall -Werror-implicit-function-declaration"
927 if test "$paranoia_flags" = "yes"; then
928 paranoia_flags="-Wall -Werror"
930 msg_result="$paranoia_flags"
932 AC_MSG_RESULT($msg_result)
933 aros_warn_flags="$aros_warn_flags $paranoia_flags"
935 #-----------------------------------------------------------------------------
936 AC_MSG_CHECKING([what target variant to enable])
937 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant (default=none)]),target_variant=$enableval,target_variant="")
938 if test "$target_variant" = ""; then
939 aros_target_variant=""
940 aros_target_suffix=""
943 aros_target_variant="$target_variant"
944 aros_target_suffix="-$target_variant"
946 AC_MSG_RESULT($enableval)
948 #-----------------------------------------------------------------------------
949 # Target-specific defaults. You can override then on a per-target basis.
951 # Bootloader name. Currently used by PC target.
952 target_bootloader="none"
956 #-----------------------------------------------------------------------------
957 # Additional options for some specific targets
959 case "$aros_target_variant" in
961 AC_MSG_CHECKING([XCode path])
962 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")
963 AC_MSG_RESULT($aros_xcode_path)
965 AC_MSG_CHECKING([what iOS SDK version to use])
966 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")
967 AC_MSG_RESULT($aros_sdk_version)
972 AC_MSG_CHECKING([Android SDK path])
973 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)
974 AC_MSG_RESULT($aros_android_sdk)
976 AC_MSG_CHECKING([Android NDK path])
977 AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=none).]),aros_android_ndk="$withval",aros_android_ndk="none")
978 AC_MSG_RESULT($aros_android_ndk)
980 AC_MSG_CHECKING([what Android SDK version to use])
981 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")
982 AC_MSG_RESULT($aros_sdk_version)
984 aros_android_level=android-$aros_sdk_version
985 if test ! -d $aros_android_sdk/platforms/$aros_android_level; then
986 echo "Platform $aros_android_level is not installed in your SDK"
987 echo "Use --with-sdk-version=<API level number> to select another platform version"
988 echo "You can check what plaform versions are installed in your SDK"
989 echo "by examining contents of $aros_android_sdk/platforms directory"
990 AC_MSG_ERROR([Android platform $aros_android_level is not installed])
993 export PATH="$aros_android_sdk/tools:$PATH"
994 AC_PATH_PROG(android_tool, $android_tool)
995 AROS_REQUIRED(android,$android_tool)
997 if test "$aros_android_ndk" != "none"; then
998 AC_MSG_CHECKING([what Android NDK version to use])
999 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")
1000 AC_MSG_RESULT($aros_ndk_version)
1003 AC_PATH_PROG(ant, ant)
1004 if test "$ant" = ""; then
1005 AC_MSG_WARN([Apache Ant is missing, Java bootstrap can't be built automatically])
1008 AC_MSG_CHECKING([Build debug or release apk])
1009 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)
1010 if test $aros_android_antapk != release -a $aros_android_antapk != debug; then
1011 AC_MSG_ERROR([apk-version has to be release or debug])
1013 AC_MSG_RESULT($aros_android_antapk)
1015 target_extra_cfg+="$export_newline""# Android$export_newline""AROS_ANDROID_ANTAPK := $aros_android_antapk$export_newline"
1016 host_extra_cfg+="$export_newline""# Android-specific$export_newline""ANDROID := $android_tool$export_newline""ANT := $ant$export_newline"
1017 aros_target_options+="$export_newline""# Enable Android Gfx Driver$export_newline""OPT_HOST_ANDROIDGFX := yes$export_newline"
1019 dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
1020 if test "$host_os" = "mingw32"; then
1021 android_tool="cmd //c $android_tool"
1029 #-----------------------------------------------------------------------------
1030 # External toolchains
1031 kernel_tool_prefix="none"
1032 aros_tool_prefix="none"
1033 elf_tool_prefix="${target_cpu}-elf-"
1035 # Base target cpu ISA configuration switch.
1036 case "$target_cpu" in
1042 m68k_isa_extra="ISA_MC68000_FLAGS := -march=68000"
1043 m68k_020_isa_extra="ISA_MC68020_FLAGS := -march=68020"
1044 m68k_030_isa_extra="ISA_MC68030_FLAGS := -march=68030"
1045 m68k_040_isa_extra="ISA_MC68040_FLAGS := -march=68040"
1046 m68k_060_isa_extra="ISA_MC68060_FLAGS := -march=68060"
1047 m68k_ac080_isa_extra="ISA_AC68080_FLAGS := -march=68040"
1048 m68k_020_ext="ISA_MC68020_EXT :=020"
1049 m68k_030_ext="ISA_MC68030_EXT :=030"
1050 m68k_040_ext="ISA_MC68040_EXT :=040"
1051 m68k_060_ext="ISA_MC68060_EXT :=060"
1052 m68k_020_cflags="ISA_MC68020_CFLAGS :="
1053 m68k_030_cflags="ISA_MC68030_CFLAGS :="
1054 m68k_040_cflags="ISA_MC68040_CFLAGS :="
1055 m68k_060_cflags="ISA_MC68060_CFLAGS :="
1056 m68k_020_cppflags="ISA_MC68020_CPPFLAGS :="
1057 m68k_030_cppflags="ISA_MC68030_CPPFLAGS :="
1058 m68k_040_cppflags="ISA_MC68040_CPPFLAGS :="
1059 m68k_060_cppflags="ISA_MC68060_CPPFLAGS :="
1060 m68k_020_ldflags="ISA_MC68020_LDFLAGS :="
1061 m68k_030_ldflags="ISA_MC68030_LDFLAGS :="
1062 m68k_040_ldflags="ISA_MC68040_LDFLAGS :="
1063 m68k_060_ldflags="ISA_MC68060_LDFLAGS :="
1066 x86_isa_extra="ISA_X86_FLAGS := -m32 -march=i486"
1067 x86_64_isa_extra="ISA_X8664_FLAGS := -mcmodel=large"
1073 # This is the target configuration switch.
1074 case "$target_os" in
1076 aros_target_arch="linux"
1077 aros_target_family="unix"
1078 case "$target_cpu" in
1080 aros_target_cpu="m68k"
1081 aros_object_format="m68kelf"
1082 aros_flavour="emulcompat"
1083 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
1084 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1085 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
1086 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
1087 gcc_target_cpu="mc68000"
1090 aros_target_cpu="i386"
1091 aros_object_format="elf_i386"
1092 aros_flavour="emulation"
1093 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
1094 aros_isa_flags="$""(ISA_X86_FLAGS)"
1095 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1096 aros_kernel_ldflags="-Wl,-melf_i386"
1097 aros_nominal_depth=8
1098 gcc_target_cpu="i386"
1099 pci_hidd_target="hidd-pci-linux"
1100 android_tool_dir_prefix="x86"
1101 android_tool_prefix="i686-android-linux"
1102 android_ndk_arch="x86"
1105 aros_target_cpu="x86_64"
1106 aros_object_format="elf_x86_64"
1107 aros_flavour="emulation"
1108 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
1109 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1110 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1111 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1112 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1113 aros_nominal_depth=8
1114 pci_hidd_target="hidd-pci-linux"
1117 aros_target_cpu="ppc"
1118 aros_object_format="elf32ppc"
1119 aros_flavour="emulation"
1120 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1121 aros_nominal_depth=8
1122 gcc_target_cpu="ppc"
1125 # Same as powerpc, but I need this for the nightly build to work again.
1126 # Actually, the nightly should be made working with powerpc target.
1127 # That just was too much work for the moment, another week or two.
1129 aros_target_cpu="ppc"
1130 aros_object_format="elf32ppc"
1131 aros_flavour="emulation"
1132 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
1133 aros_nominal_depth=8
1134 gcc_target_cpu="ppc"
1137 aros_target_cpu="aarch64"
1138 target_cpu="aarch64"
1139 aros_object_format="aarch64elf_aros"
1140 aros_flavour="emulation"
1141 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1142 gcc_target_cpu="aarch64"
1143 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1144 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1145 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1146 aros_arch_libs="-laeabi"
1147 gcc_default_float_abi="hard"
1148 kernel_tool_prefix="aarch64-linux-gnueabihf-"
1151 aros_target_cpu="arm"
1153 aros_object_format="armelf_aros"
1154 aros_flavour="emulation"
1155 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1156 gcc_target_cpu="arm"
1157 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1158 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1159 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1160 aros_arch_libs="-laeabi"
1161 gcc_default_float_abi="hard"
1162 android_tool_dir_prefix="arm-linux-androideabi"
1163 android_tool_prefix="arm-linux-androideabi"
1164 android_ndk_arch="arm"
1165 kernel_tool_prefix="arm-linux-gnueabihf-"
1168 aros_target_cpu="arm"
1169 aros_object_format="armelf_aros"
1170 aros_flavour="emulation"
1171 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
1172 gcc_target_cpu="arm"
1173 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-omit-frame-pointer"
1174 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-omit-frame-pointer"
1175 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing"
1176 aros_arch_libs="-laeabi"
1177 android_tool_dir_prefix="arm-linux-androideabi"
1178 android_tool_prefix="arm-linux-androideabi"
1179 android_ndk_arch="arm"
1180 kernel_tool_prefix="arm-linux-gnueabi-"
1183 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
1186 case "$aros_target_variant" in
1189 dnl Not all Linux CPUs are supported by Android
1190 if test "$android_ndk_arch" = ""; then
1191 AC_MSG_ERROR("Unsupported CPU for Android -- $target_cpu")
1194 aros_nominal_width=320
1195 aros_nominal_height=480
1196 if test "$aros_android_ndk" = "none"; then
1197 dnl Use standalone toolchain, don't adjust paths
1198 aros_kernel_cflags="-mandroid"
1199 aros_kernel_ldflags="-mandroid"
1202 dnl In Android NDK toolchains are placed in own directories,
1203 dnl but tool names are not suffixed with version
1204 export PATH="$aros_android_ndk/toolchains/$android_tool_dir_prefix-$kernel_tool_version/prebuilt/$android_build_os/bin:$PATH"
1205 kernel_tool_version=""
1206 aros_android_ndk="$aros_android_ndk/platforms/android-$aros_ndk_version/arch-$android_ndk_arch"
1207 aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
1208 aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
1209 CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
1210 aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
1213 # Disable implicit PIC mode
1214 aros_config_cflags="$aros_config_cflags -fno-pic"
1215 kernel_tool_prefix="$android_tool_prefix-"
1221 aros_target_arch="pc"
1222 aros_shared_default="no"
1223 target_bootloader="grub2"
1224 case "$target_cpu" in
1226 aros_target_cpu="i386"
1228 dnl If somebody hasn't already set the target object
1229 dnl format, then use this value. Mostly to support
1230 dnl FreeBSD cross-compilation.
1231 dnl TODO: Remove when we always use our compiler.
1233 if test "$aros_object_format" = "" ; then
1234 aros_object_format="elf_i386"
1236 aros_flavour="standalone"
1237 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1238 aros_isa_flags="$""(ISA_X86_FLAGS)"
1239 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1240 aros_kernel_ldflags="-Wl,-melf_i386"
1241 aros_nominal_width=640
1242 aros_nominal_height=480
1243 gcc_target_cpu="i386"
1246 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1247 aros_target_cpu="x86_64"
1249 if test "$aros_object_format" = "" ; then
1250 aros_object_format="elf_x86_64"
1252 aros_flavour="standalone"
1253 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1254 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1255 x86_64_isa_extra="$x86_64_isa_extra -mno-red-zone"
1256 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1257 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-omit-frame-pointer"
1258 aros_kernel_ldflags=""
1259 aros_nominal_width=640
1260 aros_nominal_height=480
1261 case "$aros_target_variant" in
1263 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1268 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
1274 aros_target_arch="prep"
1275 aros_shared_default="no"
1276 aros_target_cpu="ppc"
1277 aros_object_format="elf32ppc"
1278 aros_flavour="ppcnative"
1279 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1280 aros_kernel_ldflags=""
1281 aros_nominal_width=640
1282 aros_nominal_height=480
1283 gcc_target_cpu="ppc"
1287 aros_target_arch="freebsd"
1288 aros_target_family="unix"
1289 aros_target_cpu="i386"
1290 aros_flavour="emulation"
1291 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1292 gcc_target_cpu="i386"
1294 aros_target_strip_flags="-x"
1298 aros_target_arch="darwin"
1299 aros_target_family="unix"
1300 aros_flavour="emulation"
1301 case "$target_cpu" in
1303 aros_ios_platform="iPhoneSimulator"
1304 aros_target_cpu="i386"
1305 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1306 aros_isa_flags="$""(ISA_X86_FLAGS)"
1307 aros_kernel_ldflags=""
1308 aros_macosx_version="10.4"
1309 aros_nominal_depth=8
1310 gcc_target_cpu="i386"
1311 aros_object_format="elf_i386"
1312 aros_kernel_ar_flags="-cr"
1313 aros_target_strip_flags="-x"
1314 kernel_tool_flags="-m32"
1317 aros_target_cpu="x86_64"
1318 aros_object_format="elf_x86_64"
1319 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1320 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1321 aros_macosx_version="10.6"
1322 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1323 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1324 aros_kernel_cflags="-m64"
1325 aros_kernel_ldflags="-m64"
1326 aros_nominal_depth=8
1328 aros_kernel_ar_flags="-cr"
1331 aros_kernel_ranlib="ranlib"
1333 aros_kernel_strip="strip"
1334 kernel_tool_prefix="i686-apple-darwin10-"
1337 aros_target_cpu="ppc"
1338 aros_object_format="elf32ppc"
1339 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1340 aros_kernel_ldflags=""
1341 aros_macosx_version="10.0"
1342 aros_nominal_depth=8
1343 gcc_target_cpu="ppc"
1345 aros_kernel_ar_flags="-cr"
1346 aros_kernel_ld="ld -arch ppc"
1347 aros_kernel_as="as -arch ppc"
1348 aros_kernel_ranlib="ranlib -arch ppc"
1349 aros_kernel_nm="nm -arch ppc"
1350 aros_kernel_strip="strip -arch ppc"
1351 kernel_tool_prefix="powerpc-apple-darwin10-"
1354 aros_ios_platform="iPhoneOS"
1355 aros_target_cpu="arm"
1356 aros_object_format="armelf_aros"
1357 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1358 aros_arch_libs="-laeabi"
1359 aros_nominal_depth=8
1360 gcc_target_cpu="arm"
1362 aros_kernel_ar_flags="-cr"
1363 aros_kernel_ld="ld -arch arm"
1364 aros_kernel_ranlib="ranlib -arch arm"
1365 kernel_tool_prefix="arm-apple-darwin10-"
1366 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1369 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1372 case "$aros_target_variant" in
1374 make_extra_targetcfg="$export_newline""# Apple iOS stuff for gcc$export_newline""IOS_LDFLAGS := -F$""(IOS_SDK_PATH)/System/Library/Frameworks$export_newline"
1375 aros_ios_version="3.0"
1376 aros_nominal_width=320
1377 aros_nominal_height=480
1378 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_sdk_version.sdk"
1379 target_extra_cfg+="$export_newline""# Apple iOS specific$export_newline""IOS_PLATFORM := $aros_ios_platform$export_newline""IOS_OS_VERSION := $aros_ios_version$export_newline""IOS_SDK_PATH := $aros_ios_sdk$export_newline"
1380 kernel_tool_flags="$target_tool_flags -isysroot $aros_ios_sdk"
1381 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1383 # This is here because it may depend on iOS or SDK version
1384 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1385 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1386 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1389 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1390 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1396 aros_target_arch="dragonfly"
1397 aros_target_family="unix"
1398 aros_flavour="emulation"
1399 case "$target_cpu" in
1401 aros_target_cpu="i386"
1402 aros_object_format="elf_i386"
1403 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1404 aros_isa_flags="$""(ISA_X86_FLAGS)"
1407 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1408 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1409 aros_target_cpu="x86_64"
1410 aros_object_format="elf_x86_64"
1411 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1412 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1415 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1421 aros_target_arch="netbsd"
1422 aros_target_family="unix"
1423 case "$target_cpu" in
1425 aros_target_cpu="m68k"
1426 aros_object_format="m68kelf"
1427 aros_flavour="emulcompat"
1428 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1429 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1430 gcc_target_cpu="mc68000"
1433 aros_target_cpu="i386"
1434 aros_object_format="elf_i386"
1435 aros_flavour="emulation"
1436 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1437 aros_isa_flags="$""(ISA_X86_FLAGS)"
1438 aros_nominal_depth=8
1439 gcc_target_cpu="i386"
1442 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1445 aros_target_genmap="-Wl,-M -Xlinker >"
1446 aros_flavour="emulation"
1447 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1451 aros_target_arch="openbsd"
1452 aros_target_family="unix"
1453 case "$target_cpu" in
1455 aros_target_cpu="i386"
1456 aros_object_format="elf_i386"
1457 aros_flavour="emulation"
1458 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1459 aros_isa_flags="$""(ISA_X86_FLAGS)"
1460 gcc_target_cpu="i386"
1463 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1466 aros_target_genmap="-Wl,-M -Xlinker >"
1467 aros_target_nm_flags="-u"
1468 aros_flavour="emulation"
1472 aros_target_arch="solaris"
1473 aros_target_family="unix"
1474 case "$target_cpu" in
1476 aros_target_cpu="i386"
1477 aros_object_format="elf_i386"
1478 aros_flavour="emulation"
1479 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1480 aros_isa_flags="$""(ISA_X86_FLAGS)"
1481 aros_nominal_depth=8
1482 gcc_target_cpu="i386"
1485 aros_target_cpu="sparc"
1486 aros_object_format="elf_sparc"
1487 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1488 gcc_target_cpu="sparc"
1491 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1494 aros_config_cppflags="$aros_config_cppflags -D$aros_target_cpu"
1495 aros_flavour="emulation"
1499 aros_target_arch="morphos"
1500 aros_shared_default="no"
1501 aros_target_cpu="ppc"
1502 aros_object_format="elf_ppc"
1503 aros_flavour="nativecompat"
1504 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1505 gcc_target_cpu="ppc"
1509 aros_target_arch="sam440"
1510 aros_shared_default="no"
1511 aros_target_cpu="ppc"
1512 aros_object_format="elf32ppc"
1513 aros_flavour="ppcnative"
1514 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1515 aros_kernel_ldflags=""
1516 aros_nominal_width=1024
1517 aros_nominal_height=768
1518 aros_nominal_depth=24
1519 aros_isa_flags="$aros_isa_flags -mcpu=440fp -mno-toc"
1520 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1521 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1522 gcc_target_cpu="powerpc"
1526 aros_target_arch="efika"
1527 aros_shared_default="no"
1528 aros_target_cpu="arm"
1529 aros_object_format="armelf_aros"
1530 aros_flavour="standalone"
1531 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1532 aros_kernel_ldflags=""
1533 aros_nominal_width=1024
1534 aros_nominal_height=600
1535 aros_arch_libs="-laeabi"
1536 gcc_default_cpu="armv7-a"
1537 gcc_default_fpu="vfpv3"
1538 aros_isa_flags="$aros_isa_flags -mtune=cortex-a8"
1539 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1540 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1541 aros_config_aflags="$aros_config_aflags -fno-strict-aliasing -fno-asynchronous-unwind-tables"
1542 if test "$optimization" = "default"; then
1543 optimization_level="-Os"
1545 case "$target_cpu" in
1547 gcc_default_float_abi="hard"
1552 gcc_default_float_abi="softfp"
1555 AC_MSG_ERROR("Unknown CPU for EfikaMX $target_cpu")
1561 aros_target_arch="chrp"
1562 aros_shared_default="no"
1563 aros_target_cpu="ppc"
1564 aros_object_format="elf32ppc"
1565 aros_flavour="ppcnative"
1566 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1567 aros_kernel_ldflags=""
1568 aros_nominal_width=640
1569 aros_nominal_height=480
1570 aros_isa_flags="$aros_isa_flags -mno-toc"
1571 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
1572 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables"
1573 gcc_target_cpu="powerpc"
1574 case "$aros_target_variant" in
1576 aros_isa_flags="$aros_isa_flags -mcpu=603e"
1577 aros_config_cppflags="$aros_config_cppflags -DBIG_ENDIAN_OHCI=1"
1583 PLATFORM_EXECSMP="#define __AROSPLATFORM_SMP__"
1584 aros_flavour="standalone"
1585 aros_target_arch="raspi"
1587 aros_shared_default="no"
1589 aros_target_mkdep="$aros_target_mkdep -D__GNUC__"
1591 case "$target_cpu" in
1593 aros_target_cpu="aarch64"
1594 gcc_default_cpu="aarch64"
1595 aros_object_format="aarch64elf_aros"
1598 aros_target_cpu="arm"
1599 gcc_default_cpu="armv6zk"
1600 gcc_default_cpu_tune="arm1176jzf-s"
1601 aros_object_format="armelf_aros"
1602 aros_isa_flags="$aros_isa_flags -marm"
1603 aros_config_cflags="$aros_config_cflags"
1604 aros_config_cxxflags="$aros_config_cxxflags"
1605 aros_config_aflags="$aros_config_aflags -marm"
1606 aros_kernel_cflags="$aros_kernel_cflags -marm"
1607 aros_target_mkdep="$aros_target_mkdep -Darm"
1608 aros_arch_libs="-laeabi"
1611 aros_flavour="standcompat"
1612 aros_target_cpu="armeb"
1613 gcc_default_float_abi="hard"
1614 gcc_default_cpu="armv7ve"
1615 gcc_default_cpu_tune="cortex-a7"
1616 aros_object_format="armelfb_aros"
1617 aros_isa_flags="$aros_isa_flags -marm"
1618 aros_config_cflags="$aros_config_cflags"
1619 aros_config_cxxflags="$aros_config_cxxflags"
1620 aros_config_aflags="$aros_config_aflags -marm"
1621 aros_kernel_cflags="$aros_kernel_cflags -marm"
1622 aros_target_mkdep="$aros_target_mkdep -Darm"
1623 aros_arch_libs="-laeabi"
1626 aros_target_cpu="arm"
1627 gcc_default_cpu="armv6zk"
1628 gcc_default_cpu_tune="arm1176jzf-s"
1629 aros_object_format="armelf_aros"
1630 aros_isa_flags="$aros_isa_flags -marm"
1631 aros_config_cflags="$aros_config_cflags"
1632 aros_config_cxxflags="$aros_config_cxxflags"
1633 aros_config_aflags="$aros_config_aflags -marm"
1634 aros_kernel_cflags="$aros_kernel_cflags -marm"
1635 aros_target_mkdep="$aros_target_mkdep -Darm"
1636 aros_arch_libs="-laeabi"
1639 AC_MSG_ERROR("Unknown CPU for RasPi $target_cpu")
1643 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1644 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
1645 aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
1646 aros_kernel_cflags="$aros_kernel_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
1648 case "$aros_target_variant" in
1650 ENABLE_EXECSMP="#define __AROSEXEC_SMP__"
1656 aros_flavour="standalone"
1657 aros_target_arch="stm32f7_discovery"
1658 aros_target_cpu="arm"
1659 aros_target_cpu_mode="thumb2"
1660 aros_object_format="armelf_aros"
1661 aros_shared_default="no"
1663 gcc_default_cpu="armv7e-m"
1664 gcc_default_cpu_tune="cortex-m7"
1665 gcc_default_fpu="fpv5-sp-d16"
1666 gcc_default_float_abi="hard"
1668 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dthumb"
1672 aros_elf_translate="$""(ELF2HUNK)"
1673 make_extra_commands="$export_newline""ELF2HUNK := $""(TOOLDIR)/elf2hunk$""(HOST_EXE_SUFFIX)$export_newline"
1674 aros_target_arch="amiga"
1675 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1676 aros_shared_default="no"
1678 case "$target_cpu" in
1680 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")
1682 aros_target_cpu="m68k"
1683 aros_object_format="m68kelf"
1684 aros_flavour="standcompat"
1685 gcc_target_cpu="m68000"
1686 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1687 aros_nowarn_flags="$aros_nowarn_flags NOWARN_VOLATILE_REGISTER_VAR"
1688 aros_config_cppflags="$aros_config_cppflags -DNOLIBINLINE"
1689 aros_config_cflags="$aros_config_cflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1690 aros_config_cxxflags="$aros_config_cxxflags -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -fbuiltin"
1691 if test "$optimization" = "default"; then
1692 optimization_level="-Os"
1694 aros_config_aflags="$aros_config_aflags"
1695 aros_target_strip_flags="-R.comment --strip-debug"
1696 aros_nominal_width=640
1697 aros_nominal_height=256
1698 aros_nominal_depth=2
1702 aros_flavour="native"
1703 gcc_target_cpu="ppc"
1706 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1712 aros_target_arch="mingw32"
1713 aros_shared_default="no"
1714 aros_flavour="emulation"
1715 aros_shared_cflags=""
1716 need_crosstools="yes"
1719 case "$target_cpu" in
1721 aros_target_cpu="i386"
1722 aros_object_format="elf_i386"
1723 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1724 aros_isa_flags="$""(ISA_X86_FLAGS)"
1725 aros_nominal_depth=8
1726 gcc_target_cpu="i386"
1728 kernel_tool_prefix="i386-mingw32-"
1731 aros_target_cpu="x86_64"
1732 aros_object_format="elf_x86_64"
1733 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1734 aros_isa_flags="$""(ISA_X8664_FLAGS)"
1735 aros_config_cflags="$aros_config_cflags -fno-omit-frame-pointer"
1736 aros_config_cxxflags="$aros_config_cxxflags -fno-omit-frame-pointer"
1737 aros_nominal_depth=8
1738 kernel_tool_prefix="x86_64-w64-mingw32-"
1741 aros_target_cpu="arm"
1742 aros_object_format="armelf_aros"
1743 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1744 aros_arch_libs="-laeabi"
1745 aros_nominal_depth=8
1746 gcc_target_cpu="arm"
1747 gcc_default_float_abi="soft"
1748 kernel_tool_prefix="arm-mingw32ce-"
1749 aros_nominal_width=160
1750 aros_nominal_height=160
1753 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1756 if test $host_os = "cygwin"; then
1757 aros_kernel_cflags="-mno-cygwin"
1761 aros_target_arch="pp"
1762 aros_shared_default="no"
1763 case "$target_cpu" in
1765 aros_target_cpu="m68k"
1766 aros_object_format="m68kelf"
1767 aros_flavour="palmnative"
1768 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1769 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1770 aros_nominal_width=160
1771 aros_nominal_height=160
1772 aros_nominal_depth=1
1773 aros_target_ar_flags="cru"
1774 aros_compiler_libs="-lgcc1"
1775 aros_shared_default=no
1776 aros_shared_cflags="-fpic"
1777 aros_shared_aflags=""
1778 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1779 aros_kernel_ldflags="-Wl,-rpath,./lib"
1780 aros_debug_cppflags="$aros_messages_debug"
1781 aros_debug_cflags="$aros_symbols_debug"
1782 aros_debug_aflags=""
1783 aros_debug_ldflags="$aros_symbols_debug"
1784 aros_mungwall_debug="0"
1785 aros_modules_debug="0"
1786 gcc_target_cpu="mc68000"
1787 ignore_undefined_symbols="-ius"
1790 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1796 aros_target_arch="mac"
1797 aros_shared_default="no"
1798 case "$target_cpu" in
1800 aros_target_cpu="m68k"
1801 aros_object_format="m68kelf"
1802 aros_flavour="mac68knative"
1803 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1804 aros_isa_flags="$""(ISA_MC68000_FLAGS)"
1805 aros_nominal_width=512
1806 aros_nominal_height=384
1807 aros_nominal_depth=8
1808 aros_target_ar_flags="cru"
1809 aros_compiler_libs="-lgcc1"
1810 aros_shared_default=no
1811 aros_shared_cflags="-fpic"
1812 aros_shared_aflags=""
1813 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1814 aros_kernel_ldflags="-Wl,-rpath,./lib"
1815 aros_debug_cppflags="$aros_messages_debug"
1816 aros_debug_cflags="$aros_symbols_debug"
1817 aros_debug_aflags=""
1818 aros_debug_ldflags="$aros_symbols_debug"
1819 aros_mungwall_debug="0"
1820 aros_modules_debug="0"
1821 gcc_target_cpu="mc68000"
1822 ignore_undefined_symbols="-ius"
1825 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1831 AC_MSG_ERROR([Unsupported target architecture $target])
1835 #-----------------------------------------------------------------------------
1836 crosstools_guess="yes"
1837 aros_target_toolchain="no"
1838 aros_kernel_sysroot=""
1840 AC_MSG_CHECKING([Kernel toolchain prefix])
1841 AC_ARG_WITH(kernel-toolchain-prefix,AC_HELP_STRING([--with-kernel-toolchain-prefix=...],[Specify crosscompile toolchain prefix for kernel objects]),[kernel_tool_prefix="$withval"])
1842 AC_MSG_RESULT($kernel_tool_prefix)
1844 AC_MSG_CHECKING([ELF toolchain prefix])
1845 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"
1846 crosstools_guess="no"])
1847 AC_MSG_RESULT($elf_tool_prefix)
1849 AC_MSG_CHECKING([AROS toolchain prefix])
1850 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"
1851 crosstools_guess="no"])
1852 if test "$aros_tool_prefix" = "yes" ; then
1853 aros_tool_prefix=$aros_target_cpu-aros-
1855 AC_MSG_RESULT($aros_tool_prefix)
1857 #-----------------------------------------------------------------------------
1858 # Checking if we should build crosstools..
1859 AC_MSG_CHECKING([whether to build crosstools])
1860 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--disable-crosstools],[Do not build cross-compiler toolchain]),crosstools="$enableval",crosstools="$crosstools_guess")
1861 AC_MSG_RESULT($crosstools)
1863 if test "${crosstools}" = "yes"; then
1864 if test "${crosstools_guess}" = "no"; then
1865 AC_MSG_ERROR([Cannot build external toolchain if an external ELF or AROS toolchain is specified])
1869 if test "${crosstools}" = "yes" || test "${crosstools_guess}" = "no"; then
1870 aros_target_toolchain="yes"
1873 AC_MSG_CHECKING([where to install the crosstools binaries])
1874 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])
1875 if test "x$aros_toolchain_install" = "x"; then
1876 AROS_CROSSTOOLSDIR="$AROS_BUILDDIR_UNIX/bin/$aros_host_arch-$aros_host_cpu/tools/crosstools"
1878 AROS_CROSSTOOLSDIR="$aros_toolchain_install"
1879 PATH="$AROS_CROSSTOOLSDIR:$PATH"
1880 if test "$crosstools_guess" = "no" ; then
1881 if test "x-$aros_flavour" != "x-emulation" -a "x-$aros_flavour" != "x-emulcompat" ; then
1882 aros_kernel_sysroot="$""(TARGET_SYSROOT)"
1886 AC_MSG_RESULT($AROS_CROSSTOOLSDIR)
1888 #-----------------------------------------------------------------------------
1889 if test "$aros_toolchain" = "gnu" ; then
1890 AC_MSG_CHECKING([what specific target binutils version to use])
1892 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="")
1893 if test "$use_binutils_version" = ""; then
1894 target_binutils_version="$default_binutils_version"
1896 target_binutils_version="$use_binutils_version"
1898 if test "$aros_toolchain" = "gnu" ; then
1899 AC_MSG_RESULT($target_binutils_version)
1903 # Helper to identify gcc version
1904 AC_DEFUN([CROSS_GCC_VERSION], [
1905 target_gcc_version=""
1906 AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
1907 ax_cv_gcc_version="`$AROS_CROSSTOOLSDIR/${aros_tool_prefix}${toolchain_cpp_preprocessor} -dumpversion`"
1908 AS_IF([test "x$ax_cv_gcc_version" = "x"],[
1909 ax_cv_gcc_version=""
1912 target_gcc_version=$ax_cv_gcc_version
1913 AC_SUBST([target_gcc_version])
1916 #-----------------------------------------------------------------------------
1917 if test "$aros_toolchain" = "gnu" ; then
1918 AC_MSG_CHECKING([what specific target gcc version to use])
1920 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Compile gcc-VERSION for AROS]),use_gcc_version="$withval",use_gcc_version="")
1921 if test "$use_gcc_version" = ""; then
1922 if test "${crosstools}" = "no"; then
1923 if test "x$aros_toolchain_install" != "x"; then
1927 if test "$use_gcc_version" = ""; then
1928 target_gcc_version="$default_gcc_version"
1931 target_gcc_version="$use_gcc_version"
1933 if test "$aros_toolchain" = "gnu" ; then
1934 AC_MSG_RESULT($target_gcc_version)
1936 GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1)
1937 GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2)
1938 GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3)
1940 gcc_fix_bitfields="false"
1941 if test "$GCC_VERSION_MAJOR" -gt "4" ; then
1942 gcc_fix_bitfields="true"
1944 if test "$GCC_VERSION_MAJOR" -gt "3" ; then
1945 if test "$GCC_VERSION_MINOR" -gt "6" ; then
1946 gcc_fix_bitfields="true"
1951 if test "$gcc_fix_bitfields" = "true" ; then
1952 case "$aros_target_cpu" in
1954 x86_isa_extra="$x86_isa_extra -mno-ms-bitfields"
1955 x86_64_isa_extra="$x86_64_isa_extra -mno-ms-bitfields"
1961 AC_MSG_CHECKING([whether to enable Objective-C suppport])
1962 AC_ARG_ENABLE(objc,AC_HELP_STRING([--enable-objc],[Enable Objectve-C support (default=no)]),objc="$enableval",objc="no")
1963 AC_MSG_RESULT($objc)
1964 if test "x$objc" = "xyes"; then
1967 objc_target="no-objc"
1970 AC_MSG_CHECKING([whether to enable Java suppport])
1971 AC_ARG_ENABLE(java,AC_HELP_STRING([--enable-java],[Enable Java support (default=no)]),java="$enableval",java="no")
1972 AC_MSG_RESULT($java)
1973 if test "x$java" != "xno"; then
1976 java_target="no-java"
1979 spec_obj_format="-m $aros_object_format"
1980 # Now process extra architecture-specific options.
1981 # Currently this is implemented only for ARM. We can specify which minimum CPU and FPU to use,\
1982 # as well as floating-point ABI.
1983 case "$aros_target_cpu" in
1985 aros_isa_targets="M68K_ISA_TARGETS :=MC68020 MC68040"
1986 aros_isa_extra="$aros_isa_extra$export_newline$aros_isa_targets$export_newline"
1987 aros_isa_extra="$aros_isa_extra$m68k_isa_extra$export_newline$m68k_020_isa_extra$export_newline$m68k_030_isa_extra$export_newline$m68k_040_isa_extra$export_newline$m68k_060_isa_extra$export_newline$m68k_ac080_isa_extra$export_newline"
1988 aros_isa_extra="$aros_isa_extra$m68k_020_cppflags$export_newline$m68k_030_cppflags$export_newline$m68k_040_cppflags$export_newline$m68k_060_cppflags$export_newline"
1989 aros_isa_extra="$aros_isa_extra$m68k_020_cflags$export_newline$m68k_030_cflags$export_newline$m68k_040_cflags$export_newline$m68k_060_cflags$export_newline"
1990 aros_isa_extra="$aros_isa_extra$m68k_020_ldflags$export_newline$m68k_030_ldflags$export_newline$m68k_040_ldflags$export_newline$m68k_060_ldflags$export_newline"
1991 aros_isa_extra="$aros_isa_extra$m68k_020_ext$export_newline$m68k_030_ext$export_newline$m68k_040_ext$export_newline$m68k_060_ext$export_newline"
1994 aros_isa_extra="$export_newline$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
1995 dnl x86_64 can build 32 or 64bit code
1996 spec_obj_format="%{!m32:-m elf_x86_64} %{m32:-m elf_i386}"
1999 dnl ARM defaults are: armv6 + vfp (unless overriden in per-target section above)
2000 if test "$gcc_default_cpu" = ""; then
2001 gcc_default_cpu="armv6"
2003 if test "$gcc_default_fpu" = ""; then
2004 gcc_default_fpu="vfp"
2006 if test "$gcc_default_endian" = ""; then
2007 if test "$target_cpu" = "armeb"; then
2008 gcc_default_endian="big-endian"
2010 gcc_default_endian="little-endian"
2013 if test "$gcc_default_float_abi" = ""; then
2014 if test "$target_cpu" = "armhf"; then
2015 gcc_default_float_abi="hard"
2017 gcc_default_float_abi="softfp"
2021 AC_MSG_CHECKING([Which minimum CPU to use])
2022 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)
2023 AC_MSG_RESULT($aros_gcc_cpu)
2025 AC_MSG_CHECKING([Which minimum FPU to use])
2026 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)
2027 AC_MSG_RESULT($aros_gcc_fpu)
2029 AC_MSG_CHECKING([Which floating point ABI to use])
2030 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)
2031 AC_MSG_RESULT($aros_gcc_float_abi)
2033 AC_MSG_CHECKING([Which ARM mode to use])
2034 if test "$aros_target_cpu_mode" = ""; then
2035 aros_target_cpu_mode="arm32"
2036 AC_MSG_RESULT([Defaulting to $aros_target_cpu_mode])
2038 AC_MSG_RESULT([$aros_target_cpu_mode])
2041 case "$aros_target_cpu_mode" in
2043 gcc_default_mode="arm"
2044 aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -m$gcc_default_endian -mthumb-interwork -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
2047 AC_MSG_ERROR([ARM 64-bit mode is unsupported])
2050 AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
2053 AC_MSG_ERROR([Thumb1 16-bit mode is unsupported])
2056 gcc_default_mode="thumb"
2057 # Do not specify -mthumb-interwork as it may add extra code to support arm/thumb interwork
2058 aros_isa_flags="$aros_isa_flags -m$gcc_default_mode -$gcc_default_endian -march=$aros_gcc_cpu -mfpu=$aros_gcc_fpu -mfloat-abi=$aros_gcc_float_abi"
2061 AC_MSG_ERROR([Unsupported ARM mode specified $aros_target_cpu_mode])
2065 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -fno-exceptions"
2066 aros_config_cxxflags="$aros_config_cxxflags -fno-asynchronous-unwind-tables -fno-exceptions"
2067 aros_config_aflags="$aros_config_aflags -fno-asynchronous-unwind-tables -fno-exceptions"
2070 aros_isa_extra="$x86_isa_extra$export_newline$x86_64_isa_extra$export_newline"
2071 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
2075 # Some architectures may need custom ELF specs.
2076 if test -f $SRCDIR/config/${aros_object_format}-specs.in; then
2077 elf_specs_in=config/${aros_object_format}-specs.in
2079 elf_specs_in=config/elf-specs.in
2082 # Some compilers (ppc-elf-gcc is known to) have CPU defines in specs
2083 # Since we override specs, we may need to put these defines there
2084 if test "$gcc_target_cpu" != ""; then
2085 gcc_target_cpu="-D__${gcc_target_cpu}__"
2088 AC_MSG_CHECKING([where to download sourcecode for external ports])
2089 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
2090 if test "$with_portssrcdir" = "default"; then
2091 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
2093 AROS_PORTSSRCDIR="$with_portssrcdir"
2095 AC_MSG_RESULT($AROS_PORTSSRCDIR)
2097 AC_MSG_CHECKING([which bootloader to use])
2098 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
2099 if test "$target_bootloader" = "none"; then
2100 aros_target_bootloader=""
2102 aros_target_bootloader="$target_bootloader"
2104 AC_MSG_RESULT($target_bootloader)
2106 AC_MSG_CHECKING([which icon-set to use])
2107 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
2108 if test "$target_iconset" = "default"; then
2109 aros_target_iconset="Gorilla"
2110 target_iconset="default (Gorilla)"
2112 aros_target_iconset="$target_iconset"
2114 AC_MSG_RESULT($target_iconset)
2116 AC_MSG_CHECKING([which GUI Theme to use])
2117 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
2118 if test "$target_guitheme" = "default"; then
2119 aros_target_guitheme="Ice"
2121 aros_target_guitheme="$target_guitheme"
2123 AC_MSG_RESULT($aros_target_guitheme)
2125 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
2129 dnl The first case is simple. If we are compiling for another CPU, we are cross-compiling for sure
2130 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
2134 dnl x86-64 toolchains can also produce i386 binaries, given -m32 flag.
2135 dnl The flag itself is given in per-target section, because some targets require to pass it
2136 dnl in a different manner, otherwise some tests fail.
2137 dnl TODO: Justify this.
2138 if test "$aros_host_cpu" == "x86_64" ; then
2139 if test "$aros_target_cpu" == "i386" ; then
2144 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2145 dnl For a hosted build we are cross-compiling if host OS differs from build OS.
2146 dnl TODO: This might get a little bit more tricky if we ever cross-compile ARM-Android-hosted
2147 dnl AROS on ARM Linux, or even vice versa (Linux-hosted ARM AROS building on ARM Android).
2148 dnl ARM ABIs of Linux and Android are not compatible (despite very close), so host_cc can't be
2149 dnl used to build bootstrap for target arch in either case.
2150 dnl For us Android is not a separate OS, but a variant of Linux, so both systems will be
2151 dnl identified as 'linux'. If this ever involves, we'll have to implement some additional check,
2152 dnl perhaps introducing aros_host_variant
2153 if test "$aros_host_arch" != "$aros_target_arch" ; then
2157 dnl For a native build we only care if our host_cc can produce static ELF files. If so, we can use
2158 dnl it as kernel_cc. If not, (e.g. we are on Windows or Darwin), we need a crosscompiler.
2159 if test "$host_cc_elf" = "no" ; then
2164 if test "$cross_compiling" = "no" ; then
2165 kernel_tool_prefix=""
2166 if test "$host_cc_elf" = "yes" ; then
2171 if test "$kernel_tool_version" != ""; then
2172 kernel_tool_version="-$kernel_tool_version"
2175 #######################################################################
2176 ## Compute what toolchains to use, and their paths ##
2177 #######################################################################
2179 # This takes, as input:
2180 # crosstools {yes,no}
2181 # kernel_tool_version {"",[version]}
2182 # target_tool_version {"",[version]}
2183 # kernel_tool_prefix {none,[some-arch-os-]}
2185 # target_tool_prefix ${aros_target_cpu}-aros-
2186 # aros_tool_prefix ${aros_target_cpu}-aros-
2189 # aros_kernel_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2190 # Where the 'kernel' binaries are located
2191 # orig_target_{cpp,cc,ar,ld,as,ranlib,nm,strip}
2192 # Where the 'target' binaries are located
2193 # (not the symlink farm - that is aros_target_*!)
2196 # if crosstools then
2197 # if kernel_tools_prefix = "no-kernel-prefix-"
2198 # aros_kernel_* = crosstools cc paths
2199 # aros_kernel_cc = elf cc wrapper around crosstools cc
2201 # VALIDATE(${kernel_tools_prefix}*)
2202 # aros_kernel_* = ${kernel_tools_prefix}*
2203 # if ${kernel_tools_prefix}cc is an AROS gcc
2204 # aros_kernel_cc = ${kernel_tools_prefix}cc
2206 # aros_kernel_cc = elf cc wrapper around ${kernel_tools_prefix}cc
2210 # orig_target_* = aros built crosstools
2211 # orig_target_cc = elf cc wrapper around crosstools cc
2213 # VALIDATE(${kernel_tools_prefix}*)
2215 # orig_target_* = aros_kernel_*
2216 # if aros_kernel_cc is an AROS gcc
2217 # orig_target_cc = aros_kernel_cc
2219 # orig_target_cc = aros cc wrapper around aros_kernel_cc
2223 if test "$aros_toolchain" = "gnu" ; then
2224 target_tool_prefix="${aros_target_cpu}-aros-"
2225 elif test "$aros_toolchain" = "llvm" ; then
2226 target_tool_prefix="bin/"
2229 if test "$kernel_tool_prefix" != "" ; then
2230 AC_MSG_CHECKING([which kernel tools])
2231 AC_MSG_RESULT([$kernel_tool_prefix]);
2234 if test "$kernel_tool_prefix" = "none" ; then
2235 dnl ELF wrapper can be used only for native bootstrap
2236 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2237 AC_MSG_ERROR([--with-kernel-toolchain-prefix= is required for this arch])
2240 # Kernel tools required - find them
2241 # Note that 'normally', aros_kernel_* overrides will be
2242 # empty, unless specified in the per-arch sections above.
2244 if test "x$aros_kernel_cpp" = "x"; then
2245 aros_kernel_cpp=${kernel_tool_prefix}${CPP}
2247 AROS_BUILDCMD(aros_kernel_cpp,$aros_kernel_cpp,${kernel_tool_version})
2248 AROS_TOOL_KERNEL(aros_kernel_cpp,cpp,$aros_kernel_cpp)
2249 AROS_REQUIRED(cpp,$aros_kernel_cpp)
2251 if test "x$aros_kernel_cc" = "x"; then
2252 aros_kernel_cc=${kernel_tool_prefix}${CC}
2254 AROS_BUILDCMD(aros_kernel_cc,$aros_kernel_cc,${kernel_tool_version})
2255 AROS_TOOL_KERNEL(aros_kernel_cc,cc,$aros_kernel_cc)
2256 AROS_REQUIRED(cc,$aros_kernel_cc)
2258 if test "x$aros_kernel_cxx" = "x"; then
2259 aros_kernel_cxx=${kernel_tool_prefix}${CXX}
2261 AROS_BUILDCMD(aros_kernel_cxx,$aros_kernel_cxx,${kernel_tool_version})
2262 AROS_TOOL_KERNEL(aros_kernel_cxx,cxx,$aros_kernel_cxx)
2263 # If it's set, make sure it's really there
2264 if test "x$aros_kernel_cxx" != "x" ; then
2265 AROS_REQUIRED(cxx,$aros_kernel_cxx)
2267 AROS_TOOL_KERNEL(aros_kernel_ld,ld,$aros_kernel_ld)
2268 AROS_REQUIRED(ld,$aros_kernel_ld)
2269 AROS_TOOL_KERNEL(aros_kernel_as,as,$aros_kernel_as)
2270 AROS_REQUIRED(as,$aros_kernel_as)
2271 AROS_TOOL_KERNEL(aros_kernel_ar,ar,$aros_kernel_ar)
2272 AROS_REQUIRED(ar,$aros_kernel_ar)
2273 AROS_TOOL_KERNEL(aros_kernel_ranlib,ranlib,$aros_kernel_ranlib)
2274 AROS_REQUIRED(ranlib,$aros_kernel_ranlib)
2275 AROS_TOOL_KERNEL(aros_kernel_nm,nm,$aros_kernel_nm)
2276 AROS_REQUIRED(nm,$aros_kernel_nm)
2277 AROS_TOOL_KERNEL(aros_kernel_strip,strip,$aros_kernel_strip)
2278 AROS_REQUIRED(strip,$aros_kernel_strip)
2280 # Objcopy and objdump are not required for the kernel
2281 # toolchain on many architectures.
2282 # So we'll look for them, but not make them strictly required.
2283 AROS_TOOL_KERNEL(aros_kernel_objcopy,objcopy,$aros_kernel_objcopy)
2284 AROS_TOOL_KERNEL(aros_kernel_objdump,objdump,$aros_kernel_objdump)
2285 if test "x${crosstools}" != "xyes" ; then
2286 AROS_REQUIRED(objcopy,$aros_kernel_objcopy)
2287 AROS_REQUIRED(objdump,$aros_kernel_objdump)
2291 AC_MSG_CHECKING([which target tools to use])
2292 if test "$aros_target_toolchain" = "yes"; then
2293 if test "$aros_toolchain" = "llvm" ; then
2296 msg_result=$target_tool_prefix
2298 AC_MSG_RESULT([$msg_result])
2299 # We are building AROS crosstools
2300 tmp_tool_prefix="$AROS_CROSSTOOLSDIR/${target_tool_prefix}"
2301 orig_target_cc="${tmp_tool_prefix}${toolchain_c_compiler}${target_tool_version}"
2302 orig_target_cxx="${tmp_tool_prefix}${toolchain_cxx_compiler}${target_tool_version}"
2303 orig_target_cpp="${tmp_tool_prefix}${toolchain_cpp_preprocessor}"
2304 orig_target_ld="${tmp_tool_prefix}${toolchain_ld}"
2305 orig_target_as="${tmp_tool_prefix}${toolchain_as}"
2306 orig_target_ar="${tmp_tool_prefix}${toolchain_ar}"
2307 orig_target_ranlib="${tmp_tool_prefix}${toolchain_ranlib}"
2308 orig_target_nm="${tmp_tool_prefix}${toolchain_nm}"
2309 orig_target_strip="${tmp_tool_prefix}${toolchain_strip}"
2310 orig_target_objcopy="${tmp_tool_prefix}${toolchain_objcopy}"
2311 orig_target_objdump="${tmp_tool_prefix}${toolchain_objdump}"
2313 # Determine whether AROS or ELF tools should be used
2314 if test "$aros_tool_prefix" = "none"; then
2315 aros_tool_prefix="${elf_tool_prefix}"
2318 AC_MSG_RESULT([$aros_tool_prefix])
2319 # We are *not* building AROS crosstools - use the AROS or ELF tools
2320 AROS_TOOL_TARGET(orig_target_cpp,cpp,${aros_tool_prefix}${toolchain_cpp_preprocessor}${target_tool_version})
2321 AROS_REQUIRED(cpp,$orig_target_cpp)
2322 AROS_TOOL_TARGET(orig_target_cc,gcc,${aros_tool_prefix}${toolchain_c_compiler}${target_tool_version})
2323 AROS_REQUIRED(cc,$orig_target_cc)
2324 AROS_TOOL_TARGET(orig_target_cxx,g++,${aros_tool_prefix}${toolchain_cxx_compiler}${target_tool_version})
2325 AROS_REQUIRED(cxx,$orig_target_cxx)
2326 AROS_TOOL_TARGET(orig_target_ld,gcc,${aros_tool_prefix}${toolchain_ld})
2327 AROS_REQUIRED(ld,$orig_target_ld)
2328 AROS_TOOL_TARGET(orig_target_as,as,aros_tool_prefix}${toolchain_as})
2329 AROS_REQUIRED(as,$orig_target_as)
2330 AROS_TOOL_TARGET(orig_target_ar,ar,${aros_tool_prefix}${toolchain_ar})
2331 AROS_REQUIRED(ar,$orig_target_ar)
2332 AROS_TOOL_TARGET(orig_target_ranlib,ar,${aros_tool_prefix}${toolchain_ranlib})
2333 AROS_REQUIRED(ranlib,$orig_target_ranlib)
2334 AROS_TOOL_TARGET(orig_target_nm,nm,${aros_tool_prefix}${toolchain_nm})
2335 AROS_REQUIRED(nm,$orig_target_nm)
2336 AROS_TOOL_TARGET(orig_target_strip,strip,${aros_tool_prefix}${toolchain_strip})
2337 AROS_REQUIRED(strip,$orig_target_strip)
2338 AROS_TOOL_TARGET(orig_target_objcopy,objcopy,${aros_tool_prefix}${toolchain_objcopy})
2339 AROS_REQUIRED(objcopy,$orig_target_objcopy)
2340 AROS_TOOL_TARGET(orig_target_objdump,objdump,${aros_tool_prefix}${toolchain_objdump})
2341 AROS_REQUIRED(objdump,$orig_target_objdump)
2344 if test "$kernel_tool_prefix" = "none" ; then
2345 # No kernel tools specified
2346 # Assume target tools == kernel tools with ELF wrapper
2347 aros_kernel_cc=$orig_target_cc
2348 aros_kernel_cxx=$orig_target_cxx
2349 aros_kernel_cpp=$orig_target_cpp
2350 aros_kernel_ld=$orig_target_ld
2351 aros_kernel_as=$orig_target_as
2352 aros_kernel_ar=$orig_target_ar
2353 aros_kernel_ranlib=$orig_target_ranlib
2354 aros_kernel_nm=$orig_target_nm
2355 aros_kernel_strip=$orig_target_strip
2356 aros_kernel_objcopy=$orig_target_objcopy
2357 aros_kernel_objdump=$orig_target_objdump
2358 use_kernel_cc_wrapper=yes
2361 # At this point, all aros_kernel_* and aros_target_*
2362 # tools should be set up correctly
2364 CC="$aros_kernel_cc $kernel_tool_flags"
2365 CPP="$aros_kernel_cpp"
2367 #-----------------------------------------------------------------------------
2369 # Find all the tools we need to compile. This could be cross-compiling
2370 # though! If that is the case we use the GNU form of the target and
2371 # simply add this to the front of the binary name. This is rather simple,
2372 # but it should work under most circumstances.
2374 # The default tools are to use the same as the host, but only if the
2375 # host and target CPU are the same. With GCC this is normally enough.
2379 aros_shared_ld="$aros_host_ld"
2381 aros_target_mkdep="$aros_host_mkdep"
2383 # The default tools executables to be linked to.
2384 if test "$rescomp" != ""; then
2385 AC_PATH_PROG(aros_kernel_rescomp,${kernel_tool_prefix}$rescomp)
2386 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
2389 # Set up the sources for the symlink farm
2390 if test "$crosstools" = "yes"; then
2391 crosstools_target=tools-crosstools
2394 aros_kernel_cc="$aros_kernel_cc $kernel_tool_flags"
2395 aros_kernel_ar="$aros_kernel_ar $aros_kernel_ar_flags"
2397 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/host/config"
2398 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
2399 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Developer/include/aros"
2400 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
2401 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
2402 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
2403 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
2405 # aros_cc_pre is a variable that is added to the front of the compiler name
2406 # in the generated aros-gcc shell script. We need this to enable the cache
2407 # to work across cleaned builds. Also, support DISTCC using the correct
2408 # environment variable.
2411 if test "x${DISTCC}" != "x" ; then
2412 if test "x${CCACHE}" != "x" ; then
2413 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
2415 aros_cc_pre="${DISTCC} "
2418 if test "x${CCACHE}" != "x" ; then
2419 aros_cc_pre="${CCACHE} "
2423 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
2424 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
2425 AC_SUBST(aros_target_nix_ldflags,-nix)
2426 AC_SUBST(aros_target_detach_ldflags,-detach)
2427 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
2429 aros_target_cc_path=
2432 AC_SUBST(aros_toolchain)
2433 if test "$aros_target_toolchain" != "yes"; then
2434 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-"
2435 if test "$GCC" = "yes"; then
2436 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
2439 # We do not know which c compiler version we are going to build and what we need to know
2440 # here is different for different versions so this will be set later during the
2441 # build of crosstools.
2442 if test "$aros_toolchain" = "gnu" ; then
2443 prefix="$AROS_CROSSTOOLSDIR/${aros_target_cpu}-aros-"
2444 elif test "$aros_toolchain" = "llvm" ; then
2445 prefix="$AROS_CROSSTOOLSDIR/bin/"
2447 aros_target_cc_path=@aros_target_cc_path@
2449 aros_target_cpp="${prefix}${toolchain_cpp_preprocessor}"
2450 aros_target_cc="${prefix}${toolchain_c_compiler}"
2451 aros_target_cxx="${prefix}${toolchain_cxx_compiler}"
2452 aros_target_as="${prefix}${toolchain_as}"
2453 if test "${use_ld_wrapper}" = "yes"; then
2454 aros_target_ld="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}"
2456 aros_target_ld="${prefix}${toolchain_ld}"
2458 aros_toolchain_ld="${prefix}${toolchain_ld}"
2460 aros_target_ar="${prefix}${toolchain_ar} $aros_target_ar_flags"
2461 aros_target_objcopy="${prefix}${toolchain_objcopy}"
2462 aros_target_objdump="${prefix}${toolchain_objdump}"
2463 aros_target_ranlib="${prefix}${toolchain_ranlib} $aros_target_ranlib_flags"
2464 aros_target_nm="${prefix}${toolchain_nm} $aros_target_nm_flags"
2465 aros_target_strip="${prefix}${toolchain_strip}"
2466 aros_plain_nm="${prefix}${toolchain_nm}"
2467 aros_plain_ar="${prefix}${toolchain_ar}"
2469 AC_ARG_ENABLE(includes,
2470 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
2471 [aros_target_incl=$enable_includes], [aros_target_incl=no])
2473 if test "x$aros_target_incl" = "xno"; then
2474 if test "x$test_kernel_cc" != "xno"; then
2475 aros_target_incl=`$aros_kernel_cc -print-sysroot`/`$aros_kernel_cc --print-sysroot-headers-suffix 2>/dev/null || echo usr/include`
2481 if test "x$aros_kernel_includes" = "x"; then
2482 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2483 if test "x$aros_target_incl" != "x"; then
2484 aros_kernel_includes="-isystem $aros_target_incl"
2489 if test "x$test_kernel_cc" != "xno"; then
2490 if test "$aros_kernel_includes" != "" ; then
2491 dnl find out about the kernel cc's include path
2492 AC_MSG_CHECKING([for the kernel compiler's include path])
2493 if test "$aros_kernel_cc_includes" = "" ; then
2494 # Try to guess where the directory is.
2495 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
2496 if test -d $aros_kernel_cc_includes; then
2497 # Check if there is also an include-fixed directory and add it
2498 # to kernel compiler's include path as it may contain some of
2499 # the headers we need.
2500 if test -d "$aros_kernel_cc_includes"-fixed; then
2501 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
2503 # Check for specific includes directory. Needed for Ubuntu 11.10 and Debian
2504 if test -d "/usr/include/${aros_target_cpu}-linux-gnu"; then
2505 aros_kernel_cc_includes+=" -isystem /usr/include/${aros_target_cpu}-linux-gnu"
2508 # The directory doesn't exist, we need to do some more work.
2509 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
2511 # These are the headers we're looking for.
2512 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2513 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
2517 for h in $headers; do
2518 # Which other headers are needed by each of the above?
2519 deps=$(echo "#include <$h>" | \
2520 $aros_kernel_cc -E -M - 2>/dev/null | \
2521 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2523 # Copy all the needed headers to a directory beneath gendir.
2526 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
2527 sed -n "s,^.*/include\(/.*\),\1,p")
2528 ! test -d $dir && mkdir -p $dir
2529 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2534 AC_MSG_RESULT($aros_kernel_cc_includes)
2535 # Adding -nostdinc to kernel includes as they are always used together.
2536 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
2540 if test "$crosstools" != "yes"; then
2541 dnl find out about the target cc's include path
2542 AC_MSG_CHECKING([for the target compiler's include path])
2543 if test "$aros_target_cc_includes" = "" ; then
2544 #try to guess where the directory is
2545 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
2546 if ! test -d $aros_target_cc_includes; then
2547 #the directory doesn't exist, we need to do some more work
2548 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
2550 #these are the headers we're looking for
2551 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
2552 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
2556 for h in $headers; do
2557 #which other headers each of the above headers needs?
2558 deps=$(echo "#include <$h>" | \
2559 $orig_target_cc -E -M - 2>/dev/null | \
2560 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
2562 #copy all the needed headers to a directory beneath gendir
2565 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
2566 sed -n "s,^.*/include\(/.*\),\1,p")
2567 ! test -d $dir && mkdir -p $dir
2568 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
2573 AC_MSG_RESULT($aros_target_cc_includes)
2575 # We do not know which c compiler version we are going to build and what we need to know
2576 # here is different for different versions so this will be set later during the
2577 # build of crosstools.
2578 aros_target_cc_includes=@aros_target_cc_includes@
2582 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
2583 # On GCC >= 4.0 -iquote should be used
2587 save_cflags="$CFLAGS"
2588 if test "x$test_kernel_cc" != "xno"; then
2590 kernel_cflags_iquote=$host_cflags_iquote
2591 kernel_cflags_iquote_end=$host_cflags_iquote_end
2592 if test "x-$cross_compiling" = "x-yes"; then
2593 CC="$aros_kernel_cc"
2594 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
2595 if test "x-$crosstools" != "x-yes"; then
2596 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
2598 # we do know it is supported for the smallest version of gcc we are going to build
2599 # we assume it's also supported by later versions
2600 use_no_stack_protector=yes
2602 AC_MSG_RESULT($use_no_stack_protector)
2603 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
2604 if test "x-$crosstools" != "x-yes"; then
2605 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
2607 # we do know it is supported for the smallest version of gcc we are going to build
2608 # we assume it's also supported by later versions
2611 AC_MSG_RESULT($has_iquote)
2612 if test "x-$has_iquote" = "x-yes" ; then
2613 kernel_cflags_iquote=-iquote
2614 kernel_cflags_iquote_end=
2616 kernel_cflags_iquote=-I
2617 kernel_cflags_iquote_end=-I-
2620 if test "x-$use_no_stack_protector" = "x-yes" ; then
2621 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
2624 #-----------------------------------------------------------------------------
2626 # Check if we can explicitly choose older version of symbol hashing
2628 CFLAGS="save_cflags -Wl,--hash-style=sysv"
2629 CC="$aros_kernel_cc"
2630 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
2631 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
2632 AC_MSG_RESULT($use_hash_style)
2633 if test "x-$use_hash_style" = "x-yes" ; then
2634 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
2637 kernel_cflags_iquote="$""(CFLAGS_IQUOTE)"
2638 kernel_cflags_iquote_end="$""(CFLAGS_IQUOTE_END)"
2641 CFLAGS="$save_cflags"
2643 AC_SUBST(host_cflags_iquote)
2644 AC_SUBST(host_cflags_iquote_end)
2645 AC_SUBST(kernel_cflags_iquote)
2646 AC_SUBST(kernel_cflags_iquote_end)
2649 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
2650 AC_MSG_CHECKING([for default resolution of WBScreen])
2651 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
2652 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
2653 if test "$resolution" = "yes" ; then
2656 if test "$resolution" = "no" ; then
2659 if test "$resolution" != "none" ; then
2660 aros_nominal_width=`echo $resolution | cut -d'x' -f1`
2661 aros_nominal_height=`echo $resolution | cut -d'x' -f2`
2662 aros_nominal_depth=`echo $resolution | cut -d'x' -f3`
2664 AC_MSG_RESULT($aros_nominal_width x $aros_nominal_height x $aros_nominal_depth)
2665 aros_cv_nominal_width=$aros_nominal_width
2666 aros_cv_nominal_height=$aros_nominal_height
2667 aros_cv_nominal_depth=$aros_nominal_depth
2669 dnl See if the user wants the serial debug output for native flavour
2670 AC_MSG_CHECKING([whether serial debug is enabled])
2671 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)
2672 if test "$aros_serial_debug" = 0 ; then
2673 serial_debug_forced=""
2674 if test "$serial_debug" = "yes" ; then
2677 if test "$serial_debug" = "no" ; then
2681 serial_debug_forced="(forced)"
2682 serial_debug=$aros_serial_debug
2684 if test "$serial_debug" != "none" ; then
2685 aros_serial_debug=$serial_debug
2686 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
2691 dnl See if the user wants the palm debug output hack for palm native flavour
2692 AC_MSG_CHECKING([whether palm debug hack is enabled])
2693 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")
2694 if test "$palm_debug_hack" = "yes" ; then
2695 aros_palm_debug_hack="1"
2697 AC_MSG_RESULT($palm_debug_hack)
2699 dnl See if dev wants the usb3.0 code
2700 AC_MSG_CHECKING([whether usb3.0 code is enabled])
2701 AC_ARG_ENABLE(usb30_code,AC_HELP_STRING([--enable-usb30-code],[Enable usb3.0 code (default=no)]),usb30_code="yes",usb30_code="no")
2702 if test "$usb30_code" = "yes" ; then
2703 aros_config_cppflags="$aros_config_cppflags -DAROS_USB30_CODE"
2704 aros_kernel_cflags="$aros_kernel_cflags -DAROS_USB30_CODE"
2706 AC_MSG_RESULT($usb30_code)
2708 dnl See if the user wants nesting supervisor activated for unix flavour
2709 AC_MSG_CHECKING([whether nesting supervisor support is enabled])
2710 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")
2711 if test "$nesting_supervisor" = "yes" ; then
2712 aros_nesting_supervisor="1"
2714 AC_MSG_RESULT($nesting_supervisor)
2716 dnl See if the user wants to disable MMU support
2717 dnl This can be overriden on per-target basis,
2718 dnl set $aros_enable_mmu to "yes" or "no" to do this
2719 if test "$aros_enable_mmu" = "" ; then
2720 AC_MSG_CHECKING([whether MMU support is enabled])
2721 dnl Enabled by default
2722 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
2723 if test "$aros_enable_mmu" = "" ; then
2724 aros_enable_mmu="yes"
2726 AC_MSG_RESULT($aros_enable_mmu)
2728 if test "$aros_enable_mmu" = "no" ; then
2735 dnl things specifically required for hosted flavours
2736 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
2738 if test "x-$need_dlopen" != "x-no" ; then
2741 dnl some kind of dynamic library access system is required for hostlib.resource
2742 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
2743 if test "x-$have_dl" = "x-no" ; then
2744 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
2745 aros_host_ldflags="$aros_host_ldflags -ldl"],
2748 if test "x-$have_dl" = "x-no" ; then
2749 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
2756 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
2757 [build X11 hidd for hosted (default=auto)]),
2758 x11_hidd="$enableval",
2759 x11_hidd="$need_x11")
2760 case "x-$x11_hidd" in
2761 x-yes|x-no|x-auto) ;;
2762 *) x11_hidd="$need_x11" ;;
2768 if test "x-$x11_hidd" != "x-no" ; then
2773 if test -n "$x_includes"; then
2774 X_CFLAGS="$X_CFLAGS -I$x_includes"
2777 if test -n "$x_libraries"; then
2778 X_LIBS="$X_LIBS -L$x_libraries"
2781 if test "x-$no_x" = "x-yes" ; then
2784 if test "x-$x11_hidd" != "x-auto" ; then
2785 dnl and they explicitly asked for it, bail out
2786 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
2790 dnl found it, setup the metatarget
2791 aros_target_options+="$export_newline""# Enable X11 Gfx Driver$export_newline""OPT_HOST_X11GFX := yes$export_newline"
2792 if test "x-$host_feature_glx" != "x-no" ; then
2793 aros_target_options+="$export_newline""# Enable X11 HostGL 3D Passthrough$export_newline""OPT_HOST_X11_HOSTGL := yes$export_newline"
2797 aros_host_x11_cflags="$X_CFLAGS"
2798 aros_host_x11_ldflags="$X_LIBS -lX11"
2800 dnl setup shared memory extensions
2801 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
2802 [use X11 shared memory (default=auto)]),
2803 x11_hidd_shm="$enableval",
2804 x11_hidd_shm="auto")
2805 case "x-$x11_hidd_shm" in
2806 x-yes|x-no|x-auto) ;;
2807 *) x11_hidd_shm="auto" ;;
2813 if test "x-$x11_hidd_shm" != "x-no" ; then
2815 dnl system shm headers
2816 AC_CHECK_HEADERS(sys/ipc.h)
2817 AC_CHECK_HEADERS(sys/shm.h)
2820 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
2822 dnl make sure X libs have shm functions
2823 save_cflags="$CFLAGS"
2824 save_ldflags="$LDFLAGS"
2825 CFLAGS="$CFLAGS $X_CFLAGS"
2826 LDFLAGS="$LDFLAGS $X_LIBS"
2827 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
2828 CFLAGS="$save_cflags"
2829 LDFLAGS="$save_ldflags"
2833 dnl detection done, prepare output
2834 if test "x-$have_xshm" = "x-yes" ; then
2837 elif test "x-$x11_hidd_shm" = "x-yes" ; then
2838 dnl they explicitly asked for it, but we can't do it
2839 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
2841 dnl otherwise just disable it
2846 dnl setup vidmode (fullscreen) extensions
2847 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
2848 [use X11 vidmode extension (default=auto)]),
2849 x11_hidd_vidmode="$enableval",
2850 x11_hidd_vidmode="auto")
2851 case "x-$x11_hidd_vidmode" in
2852 x-yes|x-no|x-auto) ;;
2853 *) x11_hidd_vidmode="auto" ;;
2859 if test "x-$x11_hidd_vidmode" != "x-no" ; then
2861 dnl make sure X libs have vidmode functions
2862 save_cflags="$CFLAGS"
2863 save_ldflags="$LDFLAGS"
2864 CFLAGS="$CFLAGS $X_CFLAGS"
2865 LDFLAGS="$LDFLAGS $X_LIBS"
2866 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
2867 CFLAGS="$save_cflags"
2868 LDFLAGS="$save_ldflags"
2871 dnl detection done, prepare output
2872 if test "x-$have_vidmode" = "x-yes" ; then
2873 dnl we can do vidmode
2874 DO_VIDMODE_SUPPORT="1"
2875 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
2876 dnl they explicitly asked for it, but we can't do it
2877 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
2879 dnl otherwise just disable it
2880 DO_VIDMODE_SUPPORT="0"
2886 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
2887 [build SDL hidd for hosted (default=auto)]),
2888 sdl_hidd="$enableval",
2890 case "x-$sdl_hidd" in
2891 x-yes|x-no|x-auto) ;;
2892 *) sdl_hidd="auto" ;;
2896 if test "x-$sdl_hidd" != "x-no" ; then
2900 AM_PATH_SDL($SDL_VERSION, [have_sdl="yes"],
2903 if test "x-$have_sdl" != "x-yes" ; then
2906 if test "x-$sdl_hidd" != "x-auto" ; then
2907 dnl and they explicitly asked for it, bail out
2908 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2912 dnl found it, enable the build
2913 aros_target_options+="$export_newline""# Enable SDL Gfx Driver$export_newline""OPT_HOST_SDLGFX := yes$export_newline"
2914 aros_host_sdl_cflags=$SDL_CFLAGS
2915 aros_host_sdl_libs=$SDL_LIBS
2922 dnl See if the user wants dbus.library
2923 AC_MSG_CHECKING([whether building of dbus.library is enabled])
2924 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2925 if test "$dbus" = "yes" ; then
2927 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2928 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2929 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2930 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2934 AC_MSG_RESULT($dbus)
2936 if test "$use_kernel_cc_wrapper" = "yes" ; then
2937 aros_kernel_cc="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-${toolchain_c_compiler}"
2940 aros_kernel_cppflags=$aros_config_cppflags
2941 aros_optimization_cflags="$optimization_level"
2942 if test "$optimization" = "default"; then
2943 AC_MSG_CHECKING([default optimization level to use])
2944 AC_MSG_RESULT($optimization_level)
2947 if ! test "$gcc_default_cpu" = "" ; then
2948 target_extra_cfg+="$export_newline""# ARM gcc default target$export_newline""GCC_DEFAULT_CPU := $gcc_default_cpu$export_newline""GCC_DEFAULT_FPU := $gcc_default_fpu$export_newline""GCC_DEFAULT_FLOAT_ABI := $gcc_default_float_abi$export_newline""GCC_DEFAULT_MODE := $gcc_default_mode$export_newline"
2951 dnl --------------------------------------------------------------------
2952 dnl Configuration Output Section
2953 dnl --------------------------------------------------------------------
2958 AC_SUBST(aros_flavour)
2959 AC_SUBST(aros_flavour_uc)
2960 AC_SUBST(aros_target_toolchain)
2961 AC_SUBST(aros_toolchain_ld)
2962 AC_SUBST(aros_build_host)
2963 AC_SUBST(AROS_BUILDDIR)
2964 AC_SUBST(AROS_BUILDDIR_UNIX)
2966 AC_SUBST(AROS_CROSSTOOLSDIR)
2967 AC_SUBST(AROS_PORTSSRCDIR)
2969 # Compatability with other Amiga-like operation systems
2970 AC_SUBST(aros_amigaos_compliance)
2973 AC_SUBST(host_stat_h__unused_used)
2974 AC_SUBST(host_extra_cfg)
2975 AC_SUBST(aros_cc_pre)
2976 AC_SUBST(aros_host_strip)
2977 AC_SUBST(aros_host_arch)
2978 AC_SUBST(aros_host_cpu)
2979 AC_SUBST(aros_host_cpp)
2980 AC_SUBST(aros_host_def_cc)
2981 AC_SUBST(aros_host_cc)
2982 AC_SUBST(aros_host_cxx)
2983 AC_SUBST(aros_host_ar)
2984 AC_SUBST(aros_host_ranlib)
2985 AC_SUBST(aros_host_ld)
2986 AC_SUBST(aros_host_make)
2987 AC_SUBST(aros_host_cppflags)
2988 AC_SUBST(aros_host_cflags)
2989 AC_SUBST(aros_host_cxxflags)
2990 AC_SUBST(gnu89_inline)
2991 AC_SUBST(aros_host_ldflags)
2992 AC_SUBST(aros_host_debug)
2993 AC_SUBST(aros_host_mkdep)
2994 AC_SUBST(aros_host_mkargs)
2995 AC_SUBST(aros_host_exe_suffix)
2996 AC_SUBST(aros_host_lib_suffix)
2997 AC_SUBST(aros_tools_dir)
2998 AC_SUBST(aros_host_aclocal)
2999 AC_SUBST(aros_host_autoconf)
3000 AC_SUBST(aros_host_autoheader)
3001 AC_SUBST(aros_host_automake)
3005 AC_SUBST(aros_elf_translate)
3006 AC_SUBST(make_extra_commands)
3007 AC_SUBST(make_extra_targetcfg)
3008 AC_SUBST(target_extra_cfg)
3009 AC_SUBST(aros_target_options)
3011 AC_SUBST(aros_target_guitheme)
3012 AC_SUBST(aros_target_iconset)
3013 AC_SUBST(aros_target_bootloader)
3014 AC_SUBST(aros_target_arch)
3015 AC_SUBST(aros_target_family)
3016 AC_SUBST(aros_target_cpu)
3017 AC_SUBST(aros_target_cpu_mode)
3018 AC_SUBST(aros_target_variant)
3019 AC_SUBST(aros_target_suffix)
3020 AC_SUBST(aros_target_ar)
3021 AC_SUBST(aros_target_ranlib)
3022 AC_SUBST(aros_plain_nm)
3023 AC_SUBST(aros_plain_ar)
3024 AC_SUBST(aros_kernel_ar)
3025 AC_SUBST(aros_kernel_ranlib)
3026 AC_SUBST(orig_target_cc)
3027 AC_SUBST(aros_target_cc)
3028 AC_SUBST(aros_kernel_cc)
3029 AC_SUBST(orig_target_cxx)
3030 AC_SUBST(aros_target_cxx)
3031 AC_SUBST(aros_kernel_cxx)
3032 AC_SUBST(orig_target_cpp)
3033 AC_SUBST(aros_target_cpp)
3034 AC_SUBST(aros_kernel_cpp)
3035 AC_SUBST(orig_target_as)
3036 AC_SUBST(aros_target_as)
3037 AC_SUBST(aros_kernel_as)
3038 AC_SUBST(orig_target_ld)
3039 AC_SUBST(aros_target_ld)
3040 AC_SUBST(aros_kernel_ld)
3041 AC_SUBST(aros_target_cc_includes)
3042 AC_SUBST(aros_target_cc_path)
3043 AC_SUBST(aros_target_objdump)
3044 AC_SUBST(aros_target_objcopy)
3045 AC_SUBST(aros_target_strip)
3046 AC_SUBST(aros_target_nm)
3047 AC_SUBST(aros_kernel_rescomp)
3048 AC_SUBST(aros_shared_default)
3049 AC_SUBST(aros_shared_ld)
3050 AC_SUBST(aros_object_format)
3051 AC_SUBST(spec_obj_format)
3052 AC_SUBST(aros_compiler_libs)
3053 AC_SUBST(aros_arch_libs)
3055 AC_SUBST(aros_shared_cflags)
3056 AC_SUBST(aros_shared_aflags)
3057 AC_SUBST(aros_shared_ldflags)
3059 AC_SUBST(aros_warn_flags)
3060 AC_SUBST(aros_nowarn_flags)
3061 AC_SUBST(aros_config_cppflags)
3062 AC_SUBST(aros_config_cflags)
3063 AC_SUBST(aros_config_cxxflags)
3064 AC_SUBST(aros_config_aflags)
3065 AC_SUBST(aros_config_ldflags)
3067 AC_SUBST(aros_kernel_sysroot)
3068 AC_SUBST(aros_kernel_cppflags)
3069 AC_SUBST(aros_kernel_cflags)
3070 AC_SUBST(aros_kernel_includes)
3071 AC_SUBST(aros_kernel_objcflags)
3072 AC_SUBST(aros_kernel_ldflags)
3073 AC_SUBST(aros_debug_cppflags)
3074 AC_SUBST(aros_debug_cflags)
3075 AC_SUBST(aros_debug_cxxflags)
3076 AC_SUBST(aros_debug_aflags)
3077 AC_SUBST(aros_debug_ldflags)
3078 AC_SUBST(aros_target_genmap)
3079 AC_SUBST(aros_target_strip_flags)
3080 AC_SUBST(aros_config_lto)
3081 AC_SUBST(aros_config_coverage)
3082 AC_SUBST(aros_optimization_cflags)
3083 AC_SUBST(aros_isa_extra)
3084 AC_SUBST(aros_isa_flags)
3086 AC_SUBST(crosstools_target)
3087 AC_SUBST(crosstools_cxx_target)
3090 AC_SUBST(pci_hidd_target)
3092 AC_SUBST(aros_nominal_width)
3093 AC_SUBST(aros_nominal_height)
3094 AC_SUBST(aros_nominal_depth)
3095 AC_SUBST(DO_XSHM_SUPPORT)
3096 AC_SUBST(DO_VIDMODE_SUPPORT)
3098 AC_SUBST(aros_host_x11_cflags)
3099 AC_SUBST(aros_host_x11_ldflags)
3100 AC_SUBST(aros_host_sdl_cflags)
3101 AC_SUBST(aros_host_sdl_libs)
3103 # Bootloader related
3104 AC_SUBST(target_grub2_version)
3106 # Native version related
3107 AC_SUBST(aros_serial_debug)
3108 AC_SUBST(PLATFORM_EXECSMP)
3109 AC_SUBST(ENABLE_EXECSMP)
3111 # Palm native version related
3112 AC_SUBST(aros_palm_debug_hack)
3114 # Unix/Hosted version related
3115 AC_SUBST(aros_nesting_supervisor)
3118 AC_SUBST(aros_enable_mmu)
3121 AC_SUBST(aros_ios_platform)
3122 AC_SUBST(aros_ios_version)
3123 AC_SUBST(aros_ios_sdk)
3125 # ARM default GCC target related
3126 AC_SUBST(gcc_default_cpu)
3127 AC_SUBST(gcc_default_cpu_tune)
3128 AC_SUBST(gcc_default_fpu)
3129 AC_SUBST(gcc_default_float_abi)
3130 AC_SUBST(gcc_default_mode)
3133 AC_SUBST(android_tool)
3134 AC_SUBST(aros_android_level)
3135 AC_SUBST(aros_android_antapk)
3138 AC_SUBST(ENABLE_DBUS)
3139 AC_SUBST(DBUS_CFLAGS)
3140 AC_SUBST(DBUS_LIBFLAGS)
3141 AC_SUBST(KERNEL_DBUS_KOBJ)
3142 AC_SUBST(KERNEL_DBUS_INCLUDES)
3145 AC_SUBST(ENABLE_X11)
3148 AC_SUBST(aros_debug)
3149 AC_SUBST(aros_mungwall_debug)
3150 AC_SUBST(aros_stack_debug)
3151 AC_SUBST(aros_modules_debug)
3153 # Collect-aros stuff: "-ius" to ignore undefined symbols
3154 AC_SUBST(ignore_undefined_symbols)
3156 # C compiler related
3157 AC_SUBST(gcc_target_cpu)
3158 AC_SUBST(target_binutils_version)
3159 AC_SUBST(target_gcc_version)
3161 #ObjC compiler related
3162 AC_SUBST(objc_target)
3165 AC_SUBST(java_target)
3168 AC_SUBST(aros_usb30_code)
3170 dnl Prepare for output, make up all the generated patches
3171 case "$aros_flavour" in
3172 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
3173 aros_flavour="emulation" ;;
3174 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
3175 aros_flavour="emulation" ;;
3176 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
3177 aros_flavour="standalone";;
3178 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3179 aros_flavour="standalone";;
3180 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
3181 aros_flavour="native" ;;
3182 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
3183 aros_flavour="native" ;;
3184 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
3185 aros_flavour="linklib" ;;
3186 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3187 aros_flavour="palmnative" ;;
3188 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
3189 aros_flavour="mac68knative" ;;
3190 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
3191 aros_flavour="ppcnative" ;;
3194 if test ! -d ${aros_inc_dir} ; then
3195 ${MKDIR} ${aros_inc_dir}
3197 if test ! -d ${aros_geninc_dir} ; then
3198 ${MKDIR} ${aros_geninc_dir}
3200 if test ! -d ${aros_hostcfg_dir} ; then
3201 ${MKDIR} ${aros_hostcfg_dir}
3203 if test ! -d ${aros_targetcfg_dir} ; then
3204 ${MKDIR} ${aros_targetcfg_dir}
3206 if test ! -d ${aros_tools_dir} ; then
3207 ${MKDIR} ${aros_tools_dir}
3209 if test ! -d ${aros_scripts_dir} ; then
3210 ${MKDIR} ${aros_scripts_dir}
3213 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
3215 # Generic build tools (metamake, etc)
3216 AC_CONFIG_COMMANDS([genmf-executable-support],
3218 chmod a+x ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname
3219 chmod a+x ${aros_tools_dir}/genmf.py
3222 AROS_CROSSTOOLSDIR=${AROS_CROSSTOOLSDIR}
3223 aros_tools_dir=${aros_tools_dir}
3229 ${aros_inc_dir}/config.h:config/config.h.in
3230 ${aros_geninc_dir}/config.h:config/config.h.in
3231 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
3232 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
3233 ${aros_targetcfg_dir}/build.cfg:config/build.cfg.in
3235 compiler/include/geninc.cfg:compiler/include/geninc.cfg.in
3236 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
3237 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
3238 ${AROS_CROSSTOOLSDIR}/${aros_target_cpu}-aros-uname:scripts/uname.in
3239 tools/collect-aros/env.h
3243 AC_CONFIG_COMMANDS([binutils-support],
3245 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3247 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3249 chmod a+x ${prefix2}-ld
3251 ln -sf $orig_target_as$aros_host_exe_suffix ${prefix2}-as$aros_host_exe_suffix
3252 ln -sf $orig_target_nm$aros_host_exe_suffix ${prefix2}-nm$aros_host_exe_suffix
3253 ln -sf $orig_target_ar$aros_host_exe_suffix ${prefix2}-ar$aros_host_exe_suffix
3254 ln -sf $orig_target_ranlib$aros_host_exe_suffix ${prefix2}-ranlib$aros_host_exe_suffix
3255 ln -sf $orig_target_objcopy$aros_host_exe_suffix ${prefix2}-objcopy$aros_host_exe_suffix
3256 ln -sf $orig_target_objdump$aros_host_exe_suffix ${prefix2}-objdump$aros_host_exe_suffix
3257 ln -sf $orig_target_strip$aros_host_exe_suffix ${prefix2}-strip$aros_host_exe_suffix
3260 aros_host_exe_suffix=${aros_host_exe_suffix}
3261 aros_tools_dir=${aros_tools_dir}
3262 aros_target_cpu=${aros_target_cpu}
3263 aros_target_arch=${aros_target_arch}
3264 aros_target_suffix=${aros_target_suffix}
3265 orig_target_nm=${orig_target_nm}
3266 orig_target_as=${orig_target_as}
3267 orig_target_ar=${orig_target_ar}
3268 orig_target_ranlib=${orig_target_ranlib}
3269 orig_target_objdump=${orig_target_objdump}
3270 orig_target_objcopy=${orig_target_objcopy}
3271 orig_target_strip=${orig_target_strip}
3272 aros_kernel_ld=${aros_kernel_ld}
3275 if test "${use_ld_wrapper}" = "yes"; then
3277 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${aros_ld}:scripts/aros-ld.in
3280 # Bare Elf support script and spec
3281 if test "${use_kernel_cc_wrapper}" = "yes"; then
3282 AC_CONFIG_COMMANDS([elf-compiler-support],
3284 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3286 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf
3288 chmod a+x ${prefix2}-gcc
3290 ln -sf $aros_kernel_ld$aros_host_exe_suffix ${prefix2}-ld$aros_host_exe_suffix
3293 aros_host_exe_suffix=${aros_host_exe_suffix}
3294 aros_tools_dir=${aros_tools_dir}
3295 aros_target_cpu=${aros_target_cpu}
3296 aros_target_arch=${aros_target_arch}
3297 aros_target_suffix=${aros_target_suffix}
3298 aros_kernel_ld=${aros_kernel_ld}
3302 ${aros_targetcfg_dir}/elf-specs:${elf_specs_in}
3303 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-elf-gcc:scripts/elf-gcc.in
3307 # Host compiler support scripts and spec
3308 if test "${aros_target_toolchain}" = "no"; then
3309 AC_CONFIG_COMMANDS([host-compiler-wrapper-support],
3311 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
3313 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
3315 chmod a+x ${prefix2}-${toolchain_c_compiler} ${prefix2}-${toolchain_cxx_compiler} ${prefix2}-${toolchain_cpp_preprocessor}
3318 aros_host_exe_suffix=${aros_host_exe_suffix}
3319 aros_tools_dir=${aros_tools_dir}
3320 aros_target_cpu=${aros_target_cpu}
3321 aros_target_arch=${aros_target_arch}
3322 aros_target_suffix=${aros_target_suffix}
3326 ${aros_targetcfg_dir}/specs:config/specs.in
3327 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cpp_preprocessor}:scripts/aros-${toolchain_cpp_preprocessor}.in
3328 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_c_compiler}:scripts/aros-${toolchain_c_compiler}.in
3329 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-${toolchain_cxx_compiler}:scripts/aros-${toolchain_cxx_compiler}.in
3334 if test "$aros_target_variant" == "android"; then
3335 AC_CONFIG_FILES(${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in)
3339 AC_CONFIG_FILES(${aros_targetcfg_dir}/conf.cmake:config/conf.cmake.in)
3343 dnl This is in order to not define SHARED_CFLAGS sometimes
3344 dnl We don't always do aros_shared_ar, aros_shared_cflags
3346 #XXX compatability...
3347 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
3349 if test -n "$aros_shared_cflags" ; then
3350 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
3351 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg