1 dnl Copyright © 1997-2010, The AROS Development Team. All rights reserved.
4 dnl Desc: Autoconf source for configuration file
8 # method of getting shared/non-shared ld/ar tool for target.
11 # ------------------------------------------------------------------------
12 # Here starts the first section of the configure.in file.
13 # ------------------------------------------------------------------------
17 AC_CONFIG_AUX_DIR(scripts/autoconf)
19 # Check what host we are running on.
20 # If a target is not suggested, we use this one.
21 # Note that what we call a target, Autoconf calls a host.
24 # The AROS target is slightly different to the normal GNU style
25 # format. We don't have the middle part, and we reverse the order
26 # of the $(CPU) and $(OS) bits.
28 # Don't strip the version of the target yet, it might be
29 # useful on some systems.
31 AC_MSG_CHECKING([for AROS style target])
33 if test "$target" = "NONE" ; then
34 target=$host_os-$host_cpu
37 if test "$target" = "" ; then
38 target=$host_os-$host_cpu
44 AC_MSG_RESULT($target)
46 if test "$host_os" = "mingw32" ; then
50 #don't know where else to put this...
51 AC_MSG_CHECKING([Building AROS in .. ])
52 AROS_BUILDDIR=`${PWDCMD-pwd}`
53 AROS_BUILDDIR_UNIX=${PWD}
54 AC_MSG_RESULT($AROS_BUILDDIR)
56 AC_MSG_CHECKING([AROS Source in .. ])
57 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
59 AC_MSG_RESULT($SRCDIR)
61 # Parse the target field into something useful.
63 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
64 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
67 dnl --------------------------------------------------------------------
68 dnl Set the default Workbench resolution
69 dnl --------------------------------------------------------------------
70 aros_default_wbwidth=800
71 aros_default_wbheight=600
72 aros_default_wbdepth=4
74 dnl --------------------------------------------------------------------
75 dnl Host Configuration Section
76 dnl --------------------------------------------------------------------
78 dnl The idea here is to find out all the information we need about the
79 dnl host. This means things like tools for building directory structures,
80 dnl copying files around and the like.
82 # The first step is to find the host binaries.
83 # Check for a compiler.
88 # Check for a compatible awk
89 AC_CHECK_PROGS(AWK,[gawk nawk])
90 AROS_REQUIRED(gawk,$AWK)
91 AROS_PROG(MMAKE,mmake)
93 # Perform some default variable assignments. Note all of these will be
94 # Regenerated from the script, so there is no need to cache them.
97 AROS_TOOL_CCPATH(aros_host_ld,ld)
98 AROS_REQUIRED(ld,$aros_host_ld)
100 aros_host_cflags=$CFLAGS
101 aros_host_ldflags=$LDFLAGS
102 aros_host_debug="-g -O0"
103 aros_host_mkdep="\$(SRCDIR)/scripts/mkdep"
104 aros_host_mkargs="--no-print-directory"
105 aros_host_incl="/usr/include"
106 aros_host_exe_suffix="$EXEEXT"
107 aros_host_lib_suffix=""
109 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
110 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
111 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
112 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
114 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
115 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
117 case "$aros_host_cc" in
119 aros_host_cc_pipe="-pipe"
129 aros_kernel_cc_includes=""
130 aros_target_cc_includes=""
132 # This is the main host configuration section. It is where the host
133 # can change the values of any variables it needs to change. We do
134 # not look at anything that compiles to the target yet, we'll get
139 aros_host_arch="aros"
140 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
146 aros_host_cpu="x86_64"
152 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
153 aros_host_cpu="$host_cpu"
159 aros_host_arch="linux"
160 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
166 aros_host_cpu="x86_64"
178 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
179 aros_host_cpu="$host_cpu"
185 aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
186 aros_host_make="gmake"
187 aros_host_arch="freebsd"
190 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
192 dnl FreeBSD 5.x (and later) has changed the default object format.
193 dnl The double [[]] is necessary to get around m4's quoting rules.
196 aros_object_format="elf_i386"
200 aros_object_format="elf_i386_fbsd"
207 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
208 aros_host_arch="darwin"
214 aros_host_cpu="x86_64"
220 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
221 aros_host_cpu="$host_cpu"
225 aros_host_ldflags="$aros_host_ldflags -liconv"
230 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
231 aros_host_make="gmake"
232 aros_host_arch="dragonfly"
238 aros_host_cpu="x86_64"
241 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
242 aros_host_cpu="$host_cpu"
248 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
249 aros_host_make="gmake"
250 aros_host_arch="netbsd"
259 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
260 aros_host_cpu="$host_cpu"
263 aros_host_lib_suffix=".0.0"
267 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
268 aros_host_make="gmake"
269 aros_host_arch="openbsd"
275 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
276 aros_host_cpu="$host_cpu"
282 aros_host_arch="solaris"
283 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
289 aros_host_cpu="sparc"
292 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
293 aros_host_cpu="$host_cpu"
299 aros_host_arch="morphos"
304 aros_host_arch="amiga"
309 TOUCH="/gg/bin/touch"
318 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
319 aros_host_cpu="$host_cpu"
325 aros_host_arch="cygwin"
326 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
332 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
333 aros_host_cpu="$host_cpu"
339 aros_host_arch="mingw32"
340 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
346 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
347 aros_host_cpu="$host_cpu"
352 AC_MSG_ERROR([Unsupported host architecture $host])
356 AROS_PROG(aros_host_ar,[ar],[cr])
357 AROS_REQUIRED(ar,$aros_host_ar)
358 AROS_PROG(aros_host_ranlib,ranlib)
359 AROS_REQUIRED(ranlib,$aros_host_ranlib)
360 AROS_PROG(aros_host_strip,strip)
361 AROS_REQUIRED(strip,$aros_host_strip)
363 AROS_PROG(RM,[rm],[-rf])
364 AROS_REQUIRED(rm,$RM)
366 AROS_REQUIRED(cp,$CP)
368 AROS_REQUIRED(mv,$MV)
369 AROS_PROG(ECHO,[echo])
370 AROS_REQUIRED(echo,$ECHO)
371 AROS_PROG(MKDIR,[mkdir],[-p])
372 AROS_REQUIRED(mkdir,$MKDIR)
373 AROS_PROG(TOUCH,[touch])
374 AROS_REQUIRED(touch,$TOUCH)
375 AROS_PROG(SORT,[sort])
376 AROS_REQUIRED(sort,$SORT)
377 AROS_PROG(UNIQ,[uniq])
378 AROS_REQUIRED(uniq,$UNIQ)
379 AROS_PROG(NOP,[true])
380 AROS_REQUIRED(true,$NOP)
382 AROS_REQUIRED(cat,$CAT)
383 AROS_PROG(BISON,[bison])
384 AROS_REQUIRED(bison,$BISON)
385 AROS_PROG(FLEX,[flex])
386 AROS_REQUIRED(flex,$FLEX)
387 AROS_PROG(PNGTOPNM,[pngtopnm])
388 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
389 AROS_PROG(PPMTOILBM,[ppmtoilbm])
390 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
392 AROS_REQUIRED(sed,$SED)
393 AROS_PROG(CHMOD,[chmod])
394 AROS_REQUIRED(chmod,$CHMOD)
403 dnl ---------------------------------------------------------------------------
404 dnl Look for things about the host system, good for hosted targets.
405 dnl ---------------------------------------------------------------------------
407 # Check for some includes for the X11 HIDD and the kernel
408 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
409 sys/mmap.h sys/mman.h sysexits.h \
410 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
413 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
430 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
432 # Look for some functions
433 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
434 clone kse_create rfork_thread thr_create sa_register \
435 getcontext makecontext setcontext sigaltstack swapcontext])
440 dnl --------------------------------------------------------------------
441 dnl Target Configuration Section
442 dnl --------------------------------------------------------------------
444 dnl The target configuration section is responsible for setting up all
445 dnl the paths for includes, and tools required to build AROS to some
446 dnl particular target.
448 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
449 aros_config_aflags="-Wall -x assembler-with-cpp -c"
450 aros_config_ldflags=""
452 aros_shared_default=yes
454 aros_shared_cflags="-fPIC"
455 aros_shared_aflags=""
456 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
457 aros_kernel_ldflags="-Wl,-rpath,./lib"
459 aros_target_ar_flags="cr"
460 aros_target_nm_flags="-C -ul"
461 aros_target_strip_flags="--strip-unneeded -R.comment"
466 aros_target_genmap="-Wl,-Map -Xlinker"
468 # Native flavour stuff
469 aros_serial_debug="0"
471 # Palm native flavour stuff
472 aros_palm_debug_hack="0"
475 aros_nesting_supervisor="0"
477 # Collect-aros stuff: "-ius" to ignore undefined symbols
478 ignore_undefined_symbols=""
480 # Check for X11 by default
483 #-----------------------------------------------------------------------------
486 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
487 # it switched on by default, and we use the host compiler, so it compiles AROS
488 # code with this enabled resulting in link failures as we don't have support
491 # We use two methods to disable it. For the host compiler (used to compile
492 # some hosted modules), we test to see if the compiler supports stack
493 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
494 # work on all platforms.
496 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
497 # (this is done unconditionally, as it should have no effect on compilers
498 # without the stack protection feature). This may be specific to the way that
499 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
500 # strong enough to disable it in a generic way though, so we'll live with it
501 # until another vendor ships GCC with it enabled in a different way, and deal
505 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
506 save_cflags="$CFLAGS"
507 CFLAGS="$CFLAGS -fno-stack-protector"
508 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
509 AC_MSG_RESULT($use_no_stack_protector)
510 if test "x-$use_no_stack_protector" = "x-yes" ; then
511 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
513 CFLAGS="$save_cflags"
515 #-----------------------------------------------------------------------------
517 # Disable pointer-signedness warnings if the compiler recognises the option
518 # (this only works for the host compiler at the moment)
520 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
521 save_cflags="$CFLAGS"
522 CFLAGS="$CFLAGS -Wno-pointer-sign"
523 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
524 AC_MSG_RESULT($use_no_sign_warning)
525 if test "x-$use_no_sign_warning" = "x-yes" ; then
526 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
528 CFLAGS="$save_cflags"
530 #-----------------------------------------------------------------------------
532 AC_MSG_CHECKING([for type of build])
533 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")
535 if test "$build_type" = "nightly"; then
536 build_type_string="NIGHTLY"
537 elif test "$build_type" = "snapshot"; then
538 build_type_string="SNAPSHOT"
539 elif test "$build_type" = "milestone"; then
540 build_type_string="MILESTONE"
541 elif test "$build_type" = "release"; then
542 build_type_string="RELEASE"
544 build_type_string="PERSONAL"
545 build_type="personal"
548 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
550 AC_MSG_RESULT($build_type)
552 #-----------------------------------------------------------------------------
553 all_debug_types="messages stack modules mungwall symbols"
555 AC_MSG_CHECKING([which debug types to enable])
556 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)]),
557 debug="$enableval",debug="")
559 if test "$debug" = "" -o "$debug" = "no"; then
561 elif test "$debug" = "yes"; then
565 if test "$debug" = "all" ; then
566 debug="messages stack modules symbols"
567 for d in $all_debug_types; do
568 export aros_${d}_debug="1"
571 for d in $all_debug_types; do
572 export aros_${d}_debug="0"
576 if test "$debug" != "none"; then
577 debug=`echo $debug | sed s/,/\ /g`
580 for d2 in $all_debug_types; do
581 if test "$d2" = "$d"; then
586 if test "$found" = "0"; then
587 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
589 export aros_${d}_debug="1"
593 AC_MSG_RESULT($debug)
595 if test "$aros_messages_debug" = "1"; then
596 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
598 aros_messages_debug=""
600 if test "$aros_symbols_debug" = "1"; then
601 aros_symbols_debug="-g"
603 aros_symbols_debug=""
606 # These are the flags to pass when compiling debugged programs
607 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
609 aros_debug_ldflags="$aros_symbols_debug"
613 #-----------------------------------------------------------------------------
614 # Checking if we should build crosstools..
615 AC_MSG_CHECKING([whether to build crosstools])
616 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--enable-crosstools],[Build cross-compiler toolchains if necessary (default=no).]),crosstools="$enableval",crosstools="no")
617 if test "$crosstools" != "" -a "$crosstools" != "no"; then
619 aros_crosstools="yes"
624 #-----------------------------------------------------------------------------
625 # Checking for distcc and ccache.
627 # Always apply the transforms in this particular order. Basically you should
628 # always run 'ccache distcc compiler' in that order for the best performance.
630 AC_MSG_CHECKING([whether to enable distcc])
631 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
632 if test "$distcc" != "" -a "$distcc" != "no"; then
633 # AC_CHECK_PROG will print out the result in this case
634 AC_PATH_PROG(DISTCC,[distcc],distcc,)
639 AC_MSG_CHECKING([whether to enable ccache])
640 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
641 if test "$ccache" != "" -a "$ccache" != "no"; then
642 # AC_CHECK_PROG will print out the result in this case
643 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
648 #-----------------------------------------------------------------------------
649 AC_MSG_CHECKING([what specific gcc version to use])
650 AC_ARG_WITH(gcc-version,AC_HELP_STRING([--with-gcc-version=VERSION],[Use gcc-VERSION for building AROS]),target_tool_version="$withval",target_tool_version="default")
651 AC_MSG_RESULT($target_tool_version)
653 #-----------------------------------------------------------------------------
654 AC_MSG_CHECKING([what optimization flags to use])
655 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
656 if test "$optimization" = "unknown"; then
657 dnl default is -O2 for normal builds, -O0 for debug builds
658 if test "$debug" != "none"; then
664 aros_config_cflags="$aros_config_cflags $optimization"
665 AC_MSG_RESULT($optimization)
667 #-----------------------------------------------------------------------------
668 AC_MSG_CHECKING([what paranoia flags to use])
669 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
670 if test "$paranoia_flags" = "default"; then
672 else if test "$paranoia_flags" = "yes"; then
673 paranoia_flags="-Wall -Werror"
675 AC_MSG_RESULT($paranoia_flags)
676 aros_paranoia_cflags="$paranoia_flags"
678 #-----------------------------------------------------------------------------
679 AC_MSG_CHECKING([what target variant to enable])
680 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
681 if test "$target_variant" = ""; then
682 aros_target_variant=""
683 aros_target_suffix=""
686 aros_target_variant="$target_variant"
687 aros_target_suffix="-$target_variant"
689 AC_MSG_RESULT($enableval)
691 target_bootloader="none"
693 #-----------------------------------------------------------------------------
694 if test "$aros_target_variant" = "ios"; then
696 AC_MSG_CHECKING([XCode path])
697 AC_ARG_WITH(xcode-path,AC_HELP_STRING([--with-xcode=PATH],[Specify XCode path for iOS targets (default=/Developer).]),aros_xcode_path="$withval",aros_xcode_path="/Developer")
698 AC_MSG_RESULT($aros_xcode_path)
700 AC_MSG_CHECKING([for minimum supported iOS version])
701 AC_ARG_WITH(ios-version,AC_HELP_STRING([--with-ios-version=VERSION],[Specify minimum supported iOS version (default=2.0).]),aros_ios_version="$withval",aros_ios_version="2.0")
702 AC_MSG_RESULT($aros_ios_version)
704 AC_MSG_CHECKING([what iOS SDK version to use])
705 AC_ARG_WITH(ios-sdk,AC_HELP_STRING([--with-ios-sdk=VERSION],[Use iOS SDK version VERSION (default=4.1).]),aros_ios_sdk="$withval",aros_ios_sdk="4.1")
706 AC_MSG_RESULT($aros_ios_sdk)
710 #-----------------------------------------------------------------------------
711 # This is the target configuration switch.
714 aros_target_arch="linux"
715 aros_target_family="unix"
716 case "$target_cpu" in
718 aros_target_cpu="m68k"
719 aros_object_format="m68kelf"
720 aros_flavour="emulcompat"
721 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
722 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
723 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
724 gcc_target_cpu="mc68000"
727 aros_target_cpu="i386"
728 aros_object_format="elf_i386"
729 aros_flavour="emulation"
730 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
731 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
732 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
733 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
734 aros_config_ldflags="-m32 -march=i486"
735 aros_kernel_ldflags="-melf_i386"
736 aros_default_wbdepth=8
737 gcc_target_cpu="i386"
738 pci_hidd_target="hidd-pci-linux"
741 aros_target_cpu="x86_64"
742 aros_object_format="elf_x86_64"
743 aros_flavour="emulation"
744 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
745 aros_config_cflags="$aros_config_cflags -mno-red-zone"
746 aros_default_wbdepth=8
747 gcc_target_cpu="x86_64"
748 pci_hidd_target="hidd-pci-linux"
751 aros_target_cpu="ppc"
752 aros_object_format="elf32ppc"
753 aros_flavour="emulation"
754 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
755 aros_default_wbdepth=8
759 # Same as powerpc, but I need this for the nightly build to work again.
760 # Actually, the nightly should be made working with powerpc target.
761 # That just was too much work for the moment, another week or two.
763 aros_target_cpu="ppc"
764 aros_object_format="elf32ppc"
765 aros_flavour="emulation"
766 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
767 aros_default_wbdepth=8
771 aros_target_cpu="arm"
772 aros_object_format="armelf_linux_eabi"
773 aros_flavour="emulation"
774 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
776 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
777 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
778 aros_arch_libs="-laeabi"
781 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
787 aros_target_arch="pc"
788 aros_shared_default="no"
789 target_bootloader="grub2"
790 case "$target_cpu" in
792 aros_target_cpu="i386"
794 dnl If somebody hasn't already set the target object
795 dnl format, then use this value. Mostly to support
796 dnl FreeBSD cross-compilation.
797 dnl TODO: Remove when we always use our compiler.
799 if test "$aros_object_format" = "" ; then
800 aros_object_format="elf_i386"
802 aros_flavour="standalone"
803 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
804 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
805 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
806 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
807 aros_config_ldflags="-m32 -march=i486"
808 aros_kernel_ldflags="-melf_i386"
809 aros_default_wbwidth=640
810 aros_default_wbheight=480
811 gcc_target_cpu="i386"
814 aros_target_cpu="x86_64"
816 if test "$aros_object_format" = "" ; then
817 aros_object_format="elf_x86_64"
819 aros_flavour="standalone"
820 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
821 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
822 aros_kernel_ldflags=""
823 aros_default_wbwidth=640
824 aros_default_wbheight=480
825 gcc_target_cpu="x86_64"
828 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
834 aros_target_arch="prep"
835 aros_shared_default="no"
836 aros_target_cpu="ppc"
837 aros_object_format="elf32ppc"
838 aros_flavour="ppcnative"
839 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
840 aros_kernel_ldflags=""
841 aros_default_wbwidth=640
842 aros_default_wbheight=480
847 aros_target_arch="freebsd"
848 aros_target_family="unix"
849 aros_target_cpu="i386"
850 aros_flavour="emulation"
851 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
852 gcc_target_cpu="i386"
854 aros_target_strip_flags="-x"
858 aros_target_arch="darwin"
859 aros_target_family="unix"
860 aros_flavour="emulation"
861 case "$target_cpu" in
863 aros_ios_platform="iPhoneSimulator"
864 aros_target_cpu="i386"
865 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
866 aros_default_wbdepth=8
867 gcc_target_cpu="i386"
868 aros_object_format="elf_i386"
869 aros_target_strip_flags="-x"
870 aros_target_cc="i386-aros-gcc"
871 aros_target_cxx="i386-aros-g++"
872 aros_target_ld="i386-aros-ld"
873 aros_target_as="i386-aros-as"
874 aros_target_ar="i386-aros-ar"
875 aros_target_ranlib="i386-aros-ranlib"
876 aros_target_nm="i386-aros-nm"
877 aros_target_strip="i386-aros-strip"
878 aros_target_objcopy="i386-aros-objcopy"
879 aros_target_objdump="i386-aros-objdump"
880 target_tool_prefix="i686-apple-darwin10-"
881 target_tool_flags="-m32"
884 aros_target_cpu="x86_64"
885 aros_object_format="elf_x86_64"
886 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
887 aros_kernel_cflags="$aros_kernel_cflags -m64"
888 aros_kernel_ldflags="$aros_kernel_ldflags -m64"
889 aros_default_wbdepth=8
890 gcc_target_cpu="x86_64"
891 aros_target_cc="x86_64-aros-gcc"
892 aros_target_cxx="x86_64-aros-g++"
893 aros_target_ld="x86_64-aros-ld"
894 aros_target_as="x86_64-aros-as"
895 aros_target_ar="x86_64-aros-ar"
896 aros_target_ranlib="x86_64-aros-ranlib"
897 aros_target_nm="x86_64-aros-nm"
898 aros_target_strip="x86_64-aros-strip"
899 aros_target_objcopy="x86_64-aros-objcopy"
900 aros_target_objdump="x86_64-aros-objdump"
901 target_tool_prefix="i686-apple-darwin10-"
904 aros_target_cpu="ppc"
905 aros_object_format="elf32_ppc"
906 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
907 aros_default_wbdepth=8
909 aros_target_cc="ppc-aros-gcc"
910 aros_target_cxx="ppc-aros-g++"
911 aros_target_ld="ppc-aros-ld"
912 aros_target_as="ppc-aros-as"
913 aros_target_ar="ppc-aros-ar"
914 aros_target_ranlib="ppc-aros-ranlib"
915 aros_target_nm="ppc-aros-nm"
916 aros_target_strip="ppc-aros-strip"
917 aros_target_objcopy="ppc-aros-objcopy"
918 aros_target_objdump="ppc-aros-objdump"
919 target_tool_prefix="powerpc-apple-darwin10-"
922 aros_ios_platform="iPhoneOS"
923 aros_target_cpu="arm"
924 aros_object_format="armelf_linux_eabi"
925 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
926 aros_config_cflags="$aros_config_cflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
927 aros_config_aflags="$aros_config_aflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
928 aros_arch_libs="-laeabi"
929 aros_default_wbdepth=8
931 aros_kernel_ld="ld -arch armv6"
932 aros_target_cc="arm-aros-gcc"
933 aros_target_cxx="arm-aros-g++"
934 aros_target_ld="arm-aros-ld"
935 aros_target_as="arm-aros-as"
936 aros_target_ar="arm-aros-ar"
937 aros_target_ranlib="arm-aros-ranlib"
938 aros_target_nm="arm-aros-nm"
939 aros_target_strip="arm-aros-strip"
940 aros_target_objcopy="arm-aros-objcopy"
941 aros_target_objdump="arm-aros-objdump"
942 target_tool_prefix="arm-apple-darwin10-"
943 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
946 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
949 case "$aros_target_variant" in
951 aros_default_wbwidth=320
952 aros_default_wbheight=480
953 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
954 target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
956 # This is here because it may depend on iOS or SDK version
957 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
963 aros_target_arch="dragonfly"
964 aros_target_family="unix"
965 aros_flavour="emulation"
966 case "$target_cpu" in
968 aros_target_cpu="i386"
969 aros_object_format="elf_i386"
970 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
973 aros_target_cpu="x86_64"
974 aros_object_format="elf_x86_64"
975 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
978 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
984 aros_target_arch="netbsd"
985 aros_target_family="unix"
986 case "$target_cpu" in
988 aros_target_cpu="m68k"
989 aros_object_format="m68kelf"
990 aros_flavour="emulcompat"
991 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
992 gcc_target_cpu="mc68000"
995 aros_target_cpu="i386"
996 aros_object_format="elf_i386"
997 aros_flavour="emulation"
998 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
999 aros_default_wbdepth=8
1000 gcc_target_cpu="i386"
1003 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1006 aros_target_genmap="-Wl,-M -Xlinker >"
1007 aros_flavour="emulation"
1008 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1012 aros_target_arch="openbsd"
1013 aros_target_family="unix"
1014 case "$target_cpu" in
1016 aros_target_cpu="i386"
1017 aros_object_format="elf_i386"
1018 aros_flavour="emulation"
1019 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1020 gcc_target_cpu="i386"
1023 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1026 aros_target_genmap="-Wl,-M -Xlinker >"
1027 aros_target_nm_flags="-u"
1028 aros_flavour="emulation"
1032 aros_target_arch="solaris"
1033 aros_target_family="unix"
1034 case "$target_cpu" in
1036 aros_target_cpu="i386"
1037 aros_object_format="elf_i386"
1038 aros_flavour="emulation"
1039 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1040 aros_default_wbdepth=8
1041 gcc_target_cpu="i386"
1044 aros_target_cpu="sparc"
1045 aros_object_format="elf_sparc"
1046 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1047 gcc_target_cpu="sparc"
1050 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1053 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1054 aros_flavour="emulation"
1058 aros_target_arch="morphos"
1059 aros_shared_default="no"
1060 aros_target_cpu="ppc"
1061 aros_object_format="elf_ppc"
1062 aros_flavour="nativecompat"
1063 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1064 gcc_target_cpu="ppc"
1068 aros_target_arch="sam440"
1069 aros_shared_default="no"
1070 aros_target_cpu="ppc"
1071 aros_object_format="elf32ppc"
1072 aros_flavour="ppcnative"
1073 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1074 aros_kernel_ldflags=""
1075 aros_default_wbwidth=1024
1076 aros_default_wbheight=768
1077 aros_default_wbdepth=24
1078 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1079 gcc_target_cpu="powerpc"
1083 aros_target_arch="efika"
1084 aros_shared_default="no"
1085 aros_target_cpu="arm"
1086 aros_object_format="armelf_linux_eabi"
1087 aros_flavour="standalone"
1088 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1089 aros_kernel_ldflags=""
1090 aros_default_wbwidth=1024
1091 aros_default_wbheight=600
1092 aros_arch_libs="-laeabi"
1093 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1094 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1098 aros_target_arch="chrp"
1099 aros_shared_default="no"
1100 aros_target_cpu="ppc"
1101 aros_object_format="elf32ppc"
1102 aros_flavour="ppcnative"
1103 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1104 aros_kernel_ldflags=""
1105 aros_default_wbwidth=640
1106 aros_default_wbheight=480
1107 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1108 gcc_target_cpu="powerpc"
1109 case "$aros_target_variant" in
1111 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1117 aros_target_arch="amiga"
1118 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1119 aros_shared_default="no"
1121 case "$target_cpu" in
1123 aros_target_cpu="m68k"
1124 aros_object_format="m68kelf"
1125 aros_flavour="standalone"
1126 gcc_target_cpu="mc68000"
1127 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1128 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1129 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1130 target_tool_prefix="m68k-elf-"
1131 aros_target_nostdlib_ldflags="" # We always need -lgcc
1132 aros_target_strip_flags="-R.comment"
1135 aros_target_cpu="m68k"
1136 aros_object_format="m68kelf"
1137 aros_flavour="standcompat"
1138 gcc_target_cpu="mc68000"
1139 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -DAROS_CREATE_ROM"
1140 aros_config_aflags="$aros_config_aflags -g3 -${gcc_target_cpu}"
1141 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1142 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1143 target_tool_prefix="m68k-elf-"
1144 aros_target_nostdlib_ldflags="" # We always need -lgcc
1145 aros_target_strip_flags="-R.comment"
1149 aros_flavour="native"
1150 gcc_target_cpu="ppc"
1153 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1159 aros_target_arch="mingw32"
1160 aros_shared_default="no"
1161 aros_flavour="emulation"
1162 aros_shared_cflags=""
1165 case "$target_cpu" in
1167 aros_target_cpu="i386"
1168 aros_object_format="elf_i386"
1169 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1170 aros_default_wbdepth=8
1171 gcc_target_cpu="i386"
1172 aros_target_cc="i386-aros-gcc"
1173 aros_target_cxx="i386-aros-g++"
1174 aros_target_ld="i386-aros-ld"
1175 aros_target_as="i386-aros-as"
1176 aros_target_ar="i386-aros-ar"
1177 aros_target_ranlib="i386-aros-ranlib"
1178 aros_target_nm="i386-aros-nm"
1179 aros_target_strip="i386-aros-strip"
1180 aros_target_objcopy="i386-aros-objcopy"
1181 aros_target_objdump="i386-aros-objdump"
1182 target_tool_prefix="i386-mingw32-"
1185 aros_target_cpu="x86_64"
1186 aros_object_format="elf_x86_64"
1187 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1188 aros_default_wbdepth=8
1189 gcc_target_cpu="x86_64"
1190 aros_target_cc="x86_64-aros-gcc"
1191 aros_target_cxx="x86_64-aros-g++"
1192 aros_target_ld="x86_64-aros-ld"
1193 aros_target_as="x86_64-aros-as"
1194 aros_target_ar="x86_64-aros-ar"
1195 aros_target_ranlib="x86_64-aros-ranlib"
1196 aros_target_nm="x86_64-aros-nm"
1197 aros_target_strip="x86_64-aros-strip"
1198 aros_target_objcopy="x86_64-aros-objcopy"
1199 aros_target_objdump="x86_64-aros-objdump"
1200 target_tool_prefix="x86_64-w64-mingw32-"
1203 aros_target_cpu="arm"
1204 aros_object_format="armelf_linux_eabi"
1205 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1206 aros_arch_libs="-laeabi"
1207 aros_default_wbdepth=8
1208 gcc_target_cpu="arm"
1209 aros_target_cc="arm-aros-gcc"
1210 aros_target_cxx="arm-aros-g++"
1211 aros_target_ld="arm-aros-ld"
1212 aros_target_as="arm-aros-as"
1213 aros_target_ar="arm-aros-ar"
1214 aros_target_ranlib="arm-aros-ranlib"
1215 aros_target_nm="arm-aros-nm"
1216 aros_target_strip="arm-aros-strip"
1217 aros_target_objcopy="arm-aros-objcopy"
1218 aros_target_objdump="arm-aros-objdump"
1219 target_tool_prefix="arm-mingw32ce-"
1220 aros_default_wbwidth=160
1221 aros_default_wbheight=160
1224 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1227 if test $host_os = "cygwin"; then
1228 aros_kernel_cflags="-mno-cygwin"
1232 aros_target_arch="pp"
1233 aros_shared_default="no"
1234 case "$target_cpu" in
1236 aros_target_cpu="m68k"
1237 aros_object_format="m68kelf"
1238 aros_flavour="palmnative"
1239 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1240 aros_default_wbwidth=160
1241 aros_default_wbheight=160
1242 aros_default_wbdepth=1
1243 aros_target_ar_flags="cru"
1244 aros_compiler_libs="-lgcc1"
1245 aros_shared_default=no
1246 aros_shared_cflags="-fpic"
1247 aros_shared_aflags=""
1248 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1249 aros_kernel_ldflags="-Wl,-rpath,./lib"
1250 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1251 aros_debug_aflags=""
1252 aros_debug_ldflags="$aros_symbols_debug"
1253 aros_mungwall_debug="0"
1254 aros_modules_debug="0"
1255 gcc_target_cpu="mc68000"
1256 ignore_undefined_symbols="-ius"
1259 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1265 aros_target_arch="mac"
1266 aros_shared_default="no"
1267 case "$target_cpu" in
1269 aros_target_cpu="m68k"
1270 aros_object_format="m68kelf"
1271 aros_flavour="mac68knative"
1272 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1273 aros_default_wbwidth=512
1274 aros_default_wbheight=384
1275 aros_default_wbdepth=8
1276 aros_target_ar_flags="cru"
1277 aros_compiler_libs="-lgcc1"
1278 aros_shared_default=no
1279 aros_shared_cflags="-fpic"
1280 aros_shared_aflags=""
1281 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1282 aros_kernel_ldflags="-Wl,-rpath,./lib"
1283 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
1284 aros_debug_aflags=""
1285 aros_debug_ldflags="$aros_symbols_debug"
1286 aros_mungwall_debug="0"
1287 aros_modules_debug="0"
1288 gcc_target_cpu="mc68000"
1289 ignore_undefined_symbols="-ius"
1292 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1298 AC_MSG_ERROR([Unsupported target architecture $target])
1302 # FIXME: for cross-compiling this should point to another location
1303 if test "$aros_flavour" = "emulation"; then
1304 aros_kernel_includes="-isystem /usr/include"
1306 if test "$aros_flavour" = "emulcompat"; then
1307 aros_kernel_includes="-isystem /usr/include"
1310 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1311 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1312 if test "$with_portssrcdir" = "default"; then
1313 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1315 AROS_PORTSSRCDIR="$with_portssrcdir"
1317 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1319 AC_MSG_CHECKING([which bootloader to use])
1320 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1321 if test "$target_bootloader" = "none"; then
1322 aros_target_bootloader=""
1324 aros_target_bootloader="$target_bootloader"
1326 AC_MSG_RESULT($target_bootloader)
1328 AC_MSG_CHECKING([which icon-set to use])
1329 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1330 if test "$target_iconset" = "default"; then
1331 aros_target_iconset="Gorilla"
1332 target_iconset="default (Gorilla)"
1334 aros_target_iconset="$target_iconset"
1336 AC_MSG_RESULT($target_iconset)
1338 AC_MSG_CHECKING([which GUI Theme to use])
1339 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1340 if test "$target_guitheme" = "default"; then
1341 aros_target_guitheme="Ice"
1343 aros_target_guitheme="$target_guitheme"
1345 AC_MSG_RESULT($aros_target_guitheme)
1347 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1350 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1353 if test "$aros_host_cpu" == "x86_64" ; then
1354 if test "$aros_target_cpu" == "i386" ; then
1355 if test "$aros_target_arch" != "mingw32"; then
1360 if test "$aros_host_arch" == "darwin" ; then
1361 if test "$aros_target_arch" != "darwin" ; then
1366 # Set prefix for target compiler etc. if we're cross-compiling
1367 # (should possibly be earlier but needs to be after AC_PROG_CC)
1368 if test "$cross_compiling" = "yes" ; then
1369 if test "$target_tool_prefix" = ""; then
1370 target_tool_prefix=${target_cpu}-elf-
1372 CC=${target_tool_prefix}gcc
1373 dnl CPP is needed for AC_CHECK_HEADER to work correctly
1374 CPP=${target_tool_prefix}cpp
1375 if test "$target_tool_version" != "default"; then
1376 CC="$CC-$target_tool_version"
1377 CPP="$CC-$target_tool_version"
1379 AC_PATH_PROG(CC,$CC)
1380 AROS_REQUIRED(gcc,$CC)
1382 CC="$CC $target_tool_flags"
1384 #-----------------------------------------------------------------------------
1386 # Disable pointer-signedness warnings if the compiler recognises the option
1388 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1389 save_cflags="$CFLAGS"
1390 CFLAGS="$CFLAGS -Wno-pointer-sign"
1391 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1392 AC_MSG_RESULT($use_no_sign_warning)
1393 if test "x-$use_no_sign_warning" = "x-yes" ; then
1394 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1396 CFLAGS="$save_cflags"
1398 #-----------------------------------------------------------------------------
1400 # Find all the tools we need to compile. This could be cross-compiling
1401 # though! If that is the case we use the GNU form of the target and
1402 # simply add this to the front of the binary name. This is rather simple,
1403 # but it should work under most circumstances.
1405 # The default tools are to use the same as the host, but only if the
1406 # host and target CPU are the same. With GCC this is normally enough.
1410 aros_shared_ld="$aros_host_ld"
1412 aros_target_mkdep="$aros_host_mkdep"
1413 aros_target_incl_def="$aros_host_incl"
1415 aros_kernel_cc="$CC"
1417 # The default tools executables to be linked to.
1418 if test "$aros_target_cc" != ""; then
1419 AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1420 AROS_REQUIRED(gcc,$aros_target_cc)
1422 if test "$aros_target_ld" != ""; then
1423 AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1424 AROS_REQUIRED(ld,$aros_target_ld)
1427 if test "$crosstools" != "yes"; then
1428 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1429 AROS_REQUIRED(as,$aros_target_as_ln)
1430 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1431 AROS_REQUIRED(ld,$aros_kernel_ld)
1432 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1433 AROS_REQUIRED(ar,$aros_target_ar_ln)
1434 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1435 AROS_REQUIRED(nm,$aros_target_nm_ln)
1436 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1437 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1438 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1439 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1440 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1441 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1442 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1443 AROS_REQUIRED(strip,$aros_target_strip_ln)
1444 if test "$aros_target_cxx" != ""; then
1445 AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1446 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1447 # AROS_REQUIRED(c++,$aros_target_cxx)
1450 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1454 # Build crosstools if we have no C++ - temporary thing
1455 if test "$aros_target_cxx" = ""; then
1456 crosstools_target=tools-crosstools
1459 if test "$rescomp" != ""; then
1460 if test "$cross_compiling" = "yes" ; then
1461 rescomp=${target_tool_prefix}${rescomp}
1463 AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1464 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1467 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1468 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1469 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1470 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1471 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1472 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1473 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1475 # aros_cc_pre is a variable that is added to the front of the compiler name
1476 # in the generated aros-gcc shell script. We need this to enable the cache
1477 # to work across cleaned builds. Also, support DISTCC using the correct
1478 # environment variable.
1481 if test "x${DISTCC}" != "x" ; then
1482 if test "x${CCACHE}" != "x" ; then
1483 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1485 aros_cc_pre="${DISTCC} "
1488 if test "x${CCACHE}" != "x" ; then
1489 aros_cc_pre="${CCACHE} "
1493 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1495 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1496 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1497 AC_SUBST(aros_target_nix_ldflags,-nix)
1498 AC_SUBST(aros_target_detach_ldflags,-detach)
1499 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1502 if test "$aros_target_cc" = ""; then
1503 orig_target_cc=$aros_kernel_cc
1505 orig_target_cc=$aros_target_cc
1507 if test "$aros_target_ld" = ""; then
1508 orig_target_ld=$aros_kernel_ld
1510 orig_target_ld=$aros_target_ld
1512 if test "$GCC" = "yes"; then
1513 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1515 aros_target_cc="${prefix}-gcc"
1516 aros_target_as="${prefix}-as"
1517 aros_target_ld="${prefix}-ld"
1518 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1519 aros_target_objcopy=${prefix}-objcopy
1520 aros_target_objdump=${prefix}-objdump
1521 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1522 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1523 aros_kernel_nm="${prefix}-nm"
1524 aros_target_strip=${prefix}-strip
1526 # Find the system include path. We can suggest that an alternative is
1527 # used if we don't get it correct. The default is to use /usr/include.
1528 # Which is set in the aros_target_incl_def variable.
1530 AC_ARG_ENABLE(includes,
1531 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1532 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1534 if test "$aros_kernel_includes" != "" ; then
1535 dnl find out about the kernel cc's include path
1536 AC_MSG_CHECKING([for the kernel compiler's include path])
1537 if test "$aros_kernel_cc_includes" = "" ; then
1538 # Try to guess where the directory is.
1539 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1540 if ! test -d $aros_kernel_cc_includes; then
1541 # The directory doesn't exist, we need to do some more work.
1542 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1544 # These are the headers we're looking for.
1545 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1546 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1550 for h in $headers; do
1551 # Which other headers are needed by each of the above?
1552 deps=$(echo "#include <$h>" | \
1553 $aros_kernel_cc -E -M - 2>/dev/null | \
1554 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1556 # Copy all the needed headers to a directory beneath gendir.
1559 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1560 sed -n "s,^.*/include\(/.*\),\1,p")
1561 ! test -d $dir && mkdir -p $dir
1562 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1567 AC_MSG_RESULT($aros_kernel_cc_includes)
1568 # Adding -nostdinc to kernel includes as they are always used together.
1569 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1572 dnl find out about the target cc's include path
1573 AC_MSG_CHECKING([for the target compiler's include path])
1574 if test "$aros_target_cc_includes" = "" ; then
1575 #try to guess where the directory is
1576 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1577 if ! test -d $aros_target_cc_includes; then
1578 #the directory doesn't exist, we need to do some more work
1579 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1581 #these are the headers we're looling for
1582 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1583 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1587 for h in $headers; do
1588 #which other headers each of the above headers needs?
1589 deps=$(echo "#include <$h>" | \
1590 $orig_target_cc -E -M - 2>/dev/null | \
1591 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1593 #copy all the needed headers to a directory beneath gendir
1596 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1597 sed -n "s,^.*/include\(/.*\),\1,p")
1598 ! test -d $dir && mkdir -p $dir
1599 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1604 AC_MSG_RESULT($aros_target_cc_includes)
1607 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1608 # On GCC >= 4.0 -iquote should be used
1612 save_cflags="$CFLAGS"
1614 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1615 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1616 AC_MSG_RESULT($has_iquote)
1617 if test "x-$has_iquote" = "x-yes" ; then
1618 host_cflags_iquote=-iquote
1619 host_cflags_iquote_end=
1621 host_cflags_iquote=-I
1622 host_cflags_iquote_end=-I-
1624 kernel_cflags_iquote=$host_cflags_iquote
1625 kernel_cflags_iquote_end=$host_cflags_iquote_end
1626 if test "x-$cross_compiling" = "x-yes"; then
1627 CC="$aros_kernel_cc"
1628 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1629 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1630 AC_MSG_RESULT($use_no_stack_protector)
1631 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1632 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1633 AC_MSG_RESULT($has_iquote)
1634 if test "x-$has_iquote" = "x-yes" ; then
1635 kernel_cflags_iquote=-iquote
1636 kernel_cflags_iquote_end=
1638 kernel_cflags_iquote=-I
1639 kernel_cflags_iquote_end=-I-
1642 aros_cflags_iquote=$kernel_cflags_iquote
1643 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1644 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1645 CC="$orig_target_cc"
1646 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1647 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1648 AC_MSG_RESULT($has_iquote)
1649 if test "x-$has_iquote" = "x-yes" ; then
1650 aros_cflags_iquote=-iquote
1651 aros_cflags_iquote_end=
1653 aros_cflags_iquote=-I
1654 aros_cflags_iquote_end=-I-
1657 if test "x-$use_no_stack_protector" = "x-yes" ; then
1658 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1661 #-----------------------------------------------------------------------------
1663 # Check if we can explicitly choose older version of symbol hashing
1665 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1666 CC="$aros_kernel_cc"
1667 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1668 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1669 AC_MSG_RESULT($use_hash_style)
1670 if test "x-$use_hash_style" = "x-yes" ; then
1671 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1674 CFLAGS="$save_cflags"
1676 AC_SUBST(host_cflags_iquote)
1677 AC_SUBST(host_cflags_iquote_end)
1678 AC_SUBST(kernel_cflags_iquote)
1679 AC_SUBST(kernel_cflags_iquote_end)
1680 AC_SUBST(aros_cflags_iquote)
1681 AC_SUBST(aros_cflags_iquote_end)
1684 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1685 AC_MSG_CHECKING([for default resolution of WBScreen])
1686 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1687 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1688 if test "$resolution" = "yes" ; then
1691 if test "$resolution" = "no" ; then
1694 if test "$resolution" != "none" ; then
1695 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1696 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1697 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1699 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1700 aros_cv_default_wbwidth=$aros_default_wbwidth
1701 aros_cv_default_wbheight=$aros_default_wbheight
1702 aros_cv_default_wbdepth=$aros_default_wbdepth
1704 dnl See if the user wants the serial debug output for native flavour
1705 AC_MSG_CHECKING([if serial debug is enabled])
1706 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)
1707 if test "$aros_serial_debug" = 0 ; then
1708 serial_debug_forced=""
1709 if test "$serial_debug" = "yes" ; then
1712 if test "$serial_debug" = "no" ; then
1716 serial_debug_forced="(forced)"
1717 serial_debug=$aros_serial_debug
1719 if test "$serial_debug" != "none" ; then
1720 aros_serial_debug=$serial_debug
1721 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1726 dnl See if the user wants the palm debug output hack for palm native flavour
1727 AC_MSG_CHECKING([if palm debug hack is enabled])
1728 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")
1729 if test "$palm_debug_hack" = "yes" ; then
1730 aros_palm_debug_hack="1"
1732 AC_MSG_RESULT($palm_debug_hack)
1735 dnl See if the user wants nesting supervisor activated for unix flavour
1736 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1737 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")
1738 if test "$nesting_supervisor" = "yes" ; then
1739 aros_nesting_supervisor="1"
1741 AC_MSG_RESULT($nesting_supervisor)
1744 dnl things specifically required for hosted flavours
1745 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1747 if test "x-$need_dlopen" != "x-no" ; then
1748 dnl some kind of dynamic library access system is required for hostlib.resource
1749 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1750 if test "x-$have_dl" = "x-no" ; then
1751 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1752 aros_host_ldflags="$aros_host_ldflags -ldl"],
1755 if test "x-$have_dl" = "x-no" ; then
1756 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1762 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1763 [build X11 hidd for hosted (default=auto)]),
1764 x11_hidd="$enableval",
1765 x11_hidd="$need_x11")
1766 case "x-$x11_hidd" in
1767 x-yes|x-no|x-auto) ;;
1768 *) x11_hidd="$need_x11" ;;
1774 if test "x-$x11_hidd" != "x-no" ; then
1780 for path in $x_libraries
1782 x_cflags="$x_cflags -L$path"
1785 for path in $x_includes
1787 x_cflags="$x_cflags -I$path"
1790 if test "x-$no_x" = "x-yes" ; then
1793 if test "x-$x11_hidd" != "x-auto" ; then
1794 dnl and they explicitly asked for it, bail out
1795 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1799 dnl found it, setup the metatarget
1800 x11_hidd_target=kernel-x11gfx-kobj
1803 dnl setup shared memory extensions
1804 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1805 [use X11 shared memory (default=auto)]),
1806 x11_hidd_shm="$enableval",
1807 x11_hidd_shm="auto")
1808 case "x-$x11_hidd_shm" in
1809 x-yes|x-no|x-auto) ;;
1810 *) x11_hidd_shm="auto" ;;
1816 if test "x-$x11_hidd_shm" != "x-no" ; then
1818 dnl system shm headers
1819 AC_CHECK_HEADERS(sys/ipc.h)
1820 AC_CHECK_HEADERS(sys/shm.h)
1823 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1825 dnl make sure X libs have shm functions
1826 save_cflags="$CFLAGS"
1827 CFLAGS="$CFLAGS $x_cflags"
1828 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1829 CFLAGS="$save_cflags"
1833 dnl detection done, prepare output
1834 if test "x-$have_xshm" = "x-yes" ; then
1837 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1838 dnl they explicitly asked for it, but we can't do it
1839 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1841 dnl otherwise just disable it
1846 dnl setup vidmode (fullscreen) extensions
1847 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1848 [use X11 vidmode extension (default=auto)]),
1849 x11_hidd_vidmode="$enableval",
1850 x11_hidd_vidmode="auto")
1851 case "x-$x11_hidd_vidmode" in
1852 x-yes|x-no|x-auto) ;;
1853 *) x11_hidd_vidmode="auto" ;;
1859 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1861 dnl make sure X libs have vidmode functions
1862 save_cflags="$CFLAGS"
1863 CFLAGS="$CFLAGS $x_cflags"
1864 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1865 CFLAGS="$save_cflags"
1868 dnl detection done, prepare output
1869 if test "x-$have_vidmode" = "x-yes" ; then
1870 dnl we can do vidmode
1871 DO_VIDMODE_SUPPORT="1"
1872 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1873 dnl they explicitly asked for it, but we can't do it
1874 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1876 dnl otherwise just disable it
1877 DO_VIDMODE_SUPPORT="0"
1881 aros_host_x11_includes=$x_includes
1882 aros_host_x11_libdirs=$x_libraries
1887 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1888 [build SDL hidd for hosted (default=auto)]),
1889 sdl_hidd="$enableval",
1891 case "x-$sdl_hidd" in
1892 x-yes|x-no|x-auto) ;;
1893 *) sdl_hidd="auto" ;;
1897 if test "x-$sdl_hidd" != "x-no" ; then
1900 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1902 if test "x-$have_sdl" != "x-yes" ; then
1905 if test "x-$sdl_hidd" != "x-auto" ; then
1906 dnl and they explicitly asked for it, bail out
1907 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1911 dnl found it, set up the metatarget
1912 sdl_hidd_target=kernel-hidd-sdl
1913 aros_host_sdl_cflags=SDL_CFLAGS
1914 aros_host_sdl_libs=SDL_LIBS
1919 AC_CHECK_HEADER(sys/soundcard.h)
1920 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
1921 oss_library_target=workbench-libs-oss-unix
1926 dnl See if the user wants dbus.library
1927 AC_MSG_CHECKING([if building of dbus.library is enabled])
1928 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1929 if test "$dbus" = "yes" ; then
1931 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1932 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1933 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1934 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1938 AC_MSG_RESULT($dbus)
1941 dnl --------------------------------------------------------------------
1942 dnl Configuration Output Section
1943 dnl --------------------------------------------------------------------
1948 AC_SUBST(aros_flavour)
1949 AC_SUBST(aros_flavour_uc)
1950 AC_SUBST(AROS_BUILDDIR)
1951 AC_SUBST(AROS_BUILDDIR_UNIX)
1953 AC_SUBST(AROS_PORTSSRCDIR)
1956 AC_SUBST(aros_cc_pre)
1957 AC_SUBST(aros_host_strip)
1958 AC_SUBST(aros_host_arch)
1959 AC_SUBST(aros_host_cpu)
1960 AC_SUBST(aros_host_cc)
1961 AC_SUBST(aros_host_ar)
1962 AC_SUBST(aros_host_ranlib)
1963 AC_SUBST(aros_host_ld)
1964 AC_SUBST(aros_host_make)
1965 AC_SUBST(aros_host_cflags)
1966 AC_SUBST(aros_host_ldflags)
1967 AC_SUBST(aros_host_debug)
1968 AC_SUBST(aros_host_mkdep)
1969 AC_SUBST(aros_host_mkargs)
1970 AC_SUBST(aros_host_exe_suffix)
1971 AC_SUBST(aros_host_lib_suffix)
1972 AC_SUBST(aros_tools_dir)
1973 AC_SUBST(aros_host_aclocal)
1974 AC_SUBST(aros_host_autoconf)
1975 AC_SUBST(aros_host_autoheader)
1976 AC_SUBST(aros_host_automake)
1979 AC_SUBST(aros_target_guitheme)
1980 AC_SUBST(aros_target_iconset)
1981 AC_SUBST(aros_target_bootloader)
1982 AC_SUBST(aros_target_arch)
1983 AC_SUBST(aros_target_family)
1984 AC_SUBST(aros_target_cpu)
1985 AC_SUBST(aros_target_variant)
1986 AC_SUBST(aros_target_suffix)
1987 AC_SUBST(aros_target_incl)
1988 AC_SUBST(aros_target_ar)
1989 AC_SUBST(aros_target_ranlib)
1990 AC_SUBST(aros_kernel_nm)
1991 AC_SUBST(orig_target_cc)
1992 AC_SUBST(aros_target_cc)
1993 AC_SUBST(aros_target_cxx)
1994 AC_SUBST(aros_kernel_cc)
1995 AC_SUBST(aros_target_as)
1996 AC_SUBST(orig_target_ld)
1997 AC_SUBST(aros_target_ld)
1998 AC_SUBST(aros_kernel_ld)
1999 AC_SUBST(aros_target_cc_includes)
2000 AC_SUBST(aros_target_cc_path)
2001 AC_SUBST(aros_target_objdump)
2002 AC_SUBST(aros_target_objcopy)
2003 AC_SUBST(aros_target_strip)
2004 AC_SUBST(aros_target_nm)
2005 AC_SUBST(aros_kernel_rescomp)
2006 AC_SUBST(aros_shared_default)
2007 AC_SUBST(aros_shared_ld)
2008 AC_SUBST(aros_object_format)
2009 AC_SUBST(aros_compiler_libs)
2010 AC_SUBST(aros_arch_libs)
2012 AC_SUBST(aros_config_cflags)
2013 AC_SUBST(aros_config_aflags)
2014 AC_SUBST(aros_config_ldflags)
2016 AC_SUBST(aros_shared_cflags)
2017 AC_SUBST(aros_shared_aflags)
2018 AC_SUBST(aros_shared_ldflags)
2019 AC_SUBST(aros_kernel_cflags)
2020 AC_SUBST(aros_kernel_includes)
2021 AC_SUBST(aros_kernel_objcflags)
2022 AC_SUBST(aros_kernel_ldflags)
2023 AC_SUBST(aros_debug_cflags)
2024 AC_SUBST(aros_debug_aflags)
2025 AC_SUBST(aros_debug_ldflags)
2026 AC_SUBST(aros_paranoia_cflags)
2027 AC_SUBST(aros_target_genmap)
2028 AC_SUBST(aros_target_strip_flags)
2030 AC_SUBST(crosstools_target)
2033 AC_SUBST(x11_hidd_target)
2034 AC_SUBST(sdl_hidd_target)
2035 AC_SUBST(pci_hidd_target)
2036 AC_SUBST(oss_library_target)
2038 AC_SUBST(aros_default_wbwidth)
2039 AC_SUBST(aros_default_wbheight)
2040 AC_SUBST(aros_default_wbdepth)
2041 AC_SUBST(DO_XSHM_SUPPORT)
2042 AC_SUBST(DO_VIDMODE_SUPPORT)
2044 AC_SUBST(aros_host_x11_includes)
2045 AC_SUBST(aros_host_x11_libdirs)
2046 AC_SUBST(aros_host_sdl_cflags)
2047 AC_SUBST(aros_host_sdl_libs)
2049 # Native version related
2050 AC_SUBST(aros_serial_debug)
2052 # Palm native version related
2053 AC_SUBST(aros_palm_debug_hack)
2055 # Unix/Hosted version related
2056 AC_SUBST(aros_nesting_supervisor)
2059 AC_SUBST(aros_ios_platform)
2060 AC_SUBST(aros_ios_version)
2061 AC_SUBST(aros_ios_sdk)
2064 AC_SUBST(ENABLE_DBUS)
2065 AC_SUBST(DBUS_CFLAGS)
2066 AC_SUBST(DBUS_LIBFLAGS)
2067 AC_SUBST(KERNEL_DBUS_KOBJ)
2068 AC_SUBST(KERNEL_DBUS_INCLUDES)
2071 AC_SUBST(ENABLE_X11)
2074 AC_SUBST(aros_debug)
2075 AC_SUBST(aros_mungwall_debug)
2076 AC_SUBST(aros_stack_debug)
2077 AC_SUBST(aros_modules_debug)
2079 # Collect-aros stuff: "-ius" to ignore undefined symbols
2080 AC_SUBST(ignore_undefined_symbols)
2082 # C compiler related
2083 AC_SUBST(gcc_target_cpu)
2085 dnl Prepare for output, make up all the generated patches
2086 case "$aros_flavour" in
2087 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2088 aros_flavour="emulation" ;;
2089 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2090 aros_flavour="emulation" ;;
2091 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2092 aros_flavour="standalone";;
2093 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2094 aros_flavour="standalone";;
2095 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2096 aros_flavour="native" ;;
2097 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2098 aros_flavour="native" ;;
2099 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2100 aros_flavour="linklib" ;;
2101 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2102 aros_flavour="palmnative" ;;
2103 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2104 aros_flavour="mac68knative" ;;
2105 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2106 aros_flavour="ppcnative" ;;
2109 if test ! -d ${aros_inc_dir} ; then
2110 ${MKDIR} ${aros_inc_dir}
2112 if test ! -d ${aros_geninc_dir} ; then
2113 ${MKDIR} ${aros_geninc_dir}
2115 if test ! -d ${aros_hostcfg_dir} ; then
2116 ${MKDIR} ${aros_hostcfg_dir}
2118 if test ! -d ${aros_targetcfg_dir} ; then
2119 ${MKDIR} ${aros_targetcfg_dir}
2121 if test ! -d ${aros_tools_dir} ; then
2122 ${MKDIR} ${aros_tools_dir}
2124 if test ! -d ${aros_scripts_dir} ; then
2125 ${MKDIR} ${aros_scripts_dir}
2128 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2130 AC_CONFIG_COMMANDS([compiler_executable],
2132 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2134 prefix="${prefix}/${aros_target_cpu}-aros"
2135 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2139 chmod a+x ${prefix2}-gcc ${prefix2}-ld
2141 ln -sf ${prefix2}-gcc ${prefix}-gcc
2142 ln -sf ${prefix2}-ld ${prefix}-ld
2144 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix}-as
2145 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix}-nm
2146 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix}-ar
2147 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix}-ranlib
2148 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2149 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2150 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix}-strip
2152 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix2}-as
2153 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix2}-nm
2154 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix2}-ar
2155 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix2}-ranlib
2156 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2157 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2158 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix2}-strip
2161 aros_host_exe_suffix=${aros_host_exe_suffix}
2162 aros_tools_dir=${aros_tools_dir}
2163 aros_target_cpu=${aros_target_cpu}
2164 aros_target_arch=${aros_target_arch}
2165 aros_target_suffix=${aros_target_suffix}
2166 aros_target_nm_ln=${aros_target_nm_ln}
2167 aros_target_as_ln=${aros_target_as_ln}
2168 aros_target_ar_ln=${aros_target_ar_ln}
2169 aros_target_ranlib_ln=${aros_target_ranlib_ln}
2170 aros_target_objdump_ln=${aros_target_objdump_ln}
2171 aros_target_objcopy_ln=${aros_target_objcopy_ln}
2172 aros_target_strip_ln=${aros_target_strip_ln}
2175 AC_CONFIG_COMMANDS([genshared_executable],
2176 [chmod a+x ${aros_scripts_dir}/genshared],
2177 [aros_scripts_dir=${aros_scripts_dir}]
2179 AC_CONFIG_COMMANDS([genmf_executable],
2180 [chmod a+x ${aros_tools_dir}/genmf.py],
2181 [aros_tools_dir=${aros_tools_dir}]
2187 ${aros_inc_dir}/config.h:config/config.h.in
2188 ${aros_geninc_dir}/config.h:config/config.h.in
2189 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2190 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2192 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2193 ${aros_targetcfg_dir}/specs:config/specs.in
2194 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2195 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2196 ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
2197 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2198 tools/collect-aros/env.h
2203 dnl This is in order to not define SHARED_CFLAGS sometimes
2204 dnl We don't always do aros_shared_ar, aros_shared_cflags
2206 #XXX compatability...
2207 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2209 if test -n "$aros_shared_cflags" ; then
2210 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2211 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg