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 #-----------------------------------------------------------------------------
483 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
484 # it switched on by default, and we use the host compiler, so it compiles AROS
485 # code with this enabled resulting in link failures as we don't have support
488 # We use two methods to disable it. For the host compiler (used to compile
489 # some hosted modules), we test to see if the compiler supports stack
490 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
491 # work on all platforms.
493 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
494 # (this is done unconditionally, as it should have no effect on compilers
495 # without the stack protection feature). This may be specific to the way that
496 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
497 # strong enough to disable it in a generic way though, so we'll live with it
498 # until another vendor ships GCC with it enabled in a different way, and deal
502 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
503 save_cflags="$CFLAGS"
504 CFLAGS="$CFLAGS -fno-stack-protector"
505 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
506 AC_MSG_RESULT($use_no_stack_protector)
507 if test "x-$use_no_stack_protector" = "x-yes" ; then
508 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
510 CFLAGS="$save_cflags"
512 #-----------------------------------------------------------------------------
514 # Disable pointer-signedness warnings if the compiler recognises the option
515 # (this only works for the host compiler at the moment)
517 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
518 save_cflags="$CFLAGS"
519 CFLAGS="$CFLAGS -Wno-pointer-sign"
520 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
521 AC_MSG_RESULT($use_no_sign_warning)
522 if test "x-$use_no_sign_warning" = "x-yes" ; then
523 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
525 CFLAGS="$save_cflags"
527 #-----------------------------------------------------------------------------
529 AC_MSG_CHECKING([for type of build])
530 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")
532 if test "$build_type" = "nightly"; then
533 build_type_string="NIGHTLY"
534 elif test "$build_type" = "snapshot"; then
535 build_type_string="SNAPSHOT"
536 elif test "$build_type" = "milestone"; then
537 build_type_string="MILESTONE"
538 elif test "$build_type" = "release"; then
539 build_type_string="RELEASE"
541 build_type_string="PERSONAL"
542 build_type="personal"
545 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
547 AC_MSG_RESULT($build_type)
549 #-----------------------------------------------------------------------------
550 all_debug_types="messages stack modules mungwall symbols"
552 AC_MSG_CHECKING([which debug types to enable])
553 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)]),
554 debug="$enableval",debug="")
556 if test "$debug" = "" -o "$debug" = "no"; then
558 elif test "$debug" = "yes"; then
562 if test "$debug" = "all" ; then
563 debug="messages stack modules symbols"
564 for d in $all_debug_types; do
565 export aros_${d}_debug="1"
568 for d in $all_debug_types; do
569 export aros_${d}_debug="0"
573 if test "$debug" != "none"; then
574 debug=`echo $debug | sed s/,/\ /g`
577 for d2 in $all_debug_types; do
578 if test "$d2" = "$d"; then
583 if test "$found" = "0"; then
584 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
586 export aros_${d}_debug="1"
590 AC_MSG_RESULT($debug)
592 if test "$aros_messages_debug" = "1"; then
593 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
595 aros_messages_debug=""
597 if test "$aros_symbols_debug" = "1"; then
598 aros_symbols_debug="-g"
600 aros_symbols_debug=""
603 # These are the flags to pass when compiling debugged programs
604 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
606 aros_debug_ldflags="$aros_symbols_debug"
610 #-----------------------------------------------------------------------------
611 # Checking if we should build crosstools..
612 AC_MSG_CHECKING([whether to build crosstools])
613 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--enable-crosstools],[Build cross-compiler toolchains if necessary (default=no).]),crosstools="$enableval",crosstools="no")
614 if test "$crosstools" != "" -a "$crosstools" != "no"; then
616 aros_crosstools="yes"
621 #-----------------------------------------------------------------------------
622 # Checking for distcc and ccache.
624 # Always apply the transforms in this particular order. Basically you should
625 # always run 'ccache distcc compiler' in that order for the best performance.
627 AC_MSG_CHECKING([whether to enable distcc])
628 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
629 if test "$distcc" != "" -a "$distcc" != "no"; then
630 # AC_CHECK_PROG will print out the result in this case
631 AC_PATH_PROG(DISTCC,[distcc],distcc,)
636 AC_MSG_CHECKING([whether to enable ccache])
637 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
638 if test "$ccache" != "" -a "$ccache" != "no"; then
639 # AC_CHECK_PROG will print out the result in this case
640 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
645 #-----------------------------------------------------------------------------
646 AC_MSG_CHECKING([what specific gcc version to use])
647 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")
648 AC_MSG_RESULT($target_tool_version)
650 #-----------------------------------------------------------------------------
651 AC_MSG_CHECKING([what optimization flags to use])
652 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
653 if test "$optimization" = "unknown"; then
654 dnl default is -O2 for normal builds, -O0 for debug builds
655 if test "$debug" != "none"; then
661 aros_config_cflags="$aros_config_cflags $optimization"
662 AC_MSG_RESULT($optimization)
664 #-----------------------------------------------------------------------------
665 AC_MSG_CHECKING([what paranoia flags to use])
666 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
667 if test "$paranoia_flags" = "default"; then
669 else if test "$paranoia_flags" = "yes"; then
670 paranoia_flags="-Wall -Werror"
672 AC_MSG_RESULT($paranoia_flags)
673 aros_paranoia_cflags="$paranoia_flags"
675 #-----------------------------------------------------------------------------
676 if test "$target_os" = "ios"; then
678 AC_MSG_CHECKING([XCode path])
679 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")
680 AC_MSG_RESULT($aros_xcode_path)
682 AC_MSG_CHECKING([for minimum supported iOS version])
683 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")
684 AC_MSG_RESULT($aros_ios_version)
686 AC_MSG_CHECKING([what iOS SDK version to use])
687 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")
688 AC_MSG_RESULT($aros_ios_sdk)
692 #-----------------------------------------------------------------------------
693 AC_MSG_CHECKING([what target variant to enable])
694 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
695 if test "$target_variant" = ""; then
696 aros_target_variant=""
697 aros_target_suffix=""
700 aros_target_variant="$target_variant"
701 aros_target_suffix="-$target_variant"
703 AC_MSG_RESULT($enableval)
705 target_bootloader="none"
707 #-----------------------------------------------------------------------------
708 # This is the target configuration switch.
711 aros_target_arch="linux"
712 aros_target_family="unix"
713 case "$target_cpu" in
715 aros_target_cpu="m68k"
716 aros_object_format="m68kelf"
717 aros_flavour="emulcompat"
718 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
719 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
720 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
721 gcc_target_cpu="mc68000"
724 aros_target_cpu="i386"
725 aros_object_format="elf_i386"
726 aros_flavour="emulation"
727 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
728 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
729 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
730 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
731 aros_config_ldflags="-m32 -march=i486"
732 aros_kernel_ldflags="-melf_i386"
733 aros_default_wbdepth=8
734 gcc_target_cpu="i386"
735 pci_hidd_target="hidd-pci-linux"
738 aros_target_cpu="x86_64"
739 aros_object_format="elf_x86_64"
740 aros_flavour="emulation"
741 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
742 aros_config_cflags="$aros_config_cflags -mno-red-zone"
743 aros_default_wbdepth=8
744 gcc_target_cpu="x86_64"
745 pci_hidd_target="hidd-pci-linux"
748 aros_target_cpu="ppc"
749 aros_object_format="elf32ppc"
750 aros_flavour="emulation"
751 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
752 aros_default_wbdepth=8
756 # Same as powerpc, but I need this for the nightly build to work again.
757 # Actually, the nightly should be made working with powerpc target.
758 # That just was too much work for the moment, another week or two.
760 aros_target_cpu="ppc"
761 aros_object_format="elf32ppc"
762 aros_flavour="emulation"
763 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
764 aros_default_wbdepth=8
768 aros_target_cpu="arm"
769 aros_object_format="armelf_linux_eabi"
770 aros_flavour="emulation"
771 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
773 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
774 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
775 aros_arch_libs="-laeabi"
778 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
784 aros_target_arch="pc"
785 aros_shared_default="no"
786 target_bootloader="grub2"
787 case "$target_cpu" in
789 aros_target_cpu="i386"
791 dnl If somebody hasn't already set the target object
792 dnl format, then use this value. Mostly to support
793 dnl FreeBSD cross-compilation.
794 dnl TODO: Remove when we always use our compiler.
796 if test "$aros_object_format" = "" ; then
797 aros_object_format="elf_i386"
799 aros_flavour="standalone"
800 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
801 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
802 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
803 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
804 aros_config_ldflags="-m32 -march=i486"
805 aros_kernel_ldflags="-melf_i386"
806 aros_default_wbwidth=640
807 aros_default_wbheight=480
808 gcc_target_cpu="i386"
811 aros_target_cpu="x86_64"
813 if test "$aros_object_format" = "" ; then
814 aros_object_format="elf_x86_64"
816 aros_flavour="standalone"
817 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
818 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
819 aros_kernel_ldflags=""
820 aros_default_wbwidth=640
821 aros_default_wbheight=480
822 gcc_target_cpu="x86_64"
825 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
831 aros_target_arch="prep"
832 aros_shared_default="no"
833 aros_target_cpu="ppc"
834 aros_object_format="elf32ppc"
835 aros_flavour="ppcnative"
836 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
837 aros_kernel_ldflags=""
838 aros_default_wbwidth=640
839 aros_default_wbheight=480
844 aros_target_arch="freebsd"
845 aros_target_family="unix"
846 aros_target_cpu="i386"
847 aros_flavour="emulation"
848 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
849 gcc_target_cpu="i386"
851 aros_target_strip_flags="-x"
855 aros_target_arch="darwin"
856 aros_target_family="unix"
857 aros_flavour="emulation"
858 case "$target_cpu" in
860 aros_target_cpu="i386"
861 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
862 aros_kernel_cflags="$aros_kernel_cflags -m32"
863 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
864 aros_default_wbdepth=8
865 gcc_target_cpu="i386"
866 aros_object_format="elf_i386"
867 aros_target_strip_flags="-x"
868 aros_target_cc="i386-aros-gcc"
869 aros_target_cxx="i386-aros-g++"
870 aros_target_ld="i386-aros-ld"
871 aros_target_as="i386-aros-as"
872 aros_target_ar="i386-aros-ar"
873 aros_target_ranlib="i386-aros-ranlib"
874 aros_target_nm="i386-aros-nm"
875 aros_target_strip="i386-aros-strip"
876 aros_target_objcopy="i386-aros-objcopy"
877 aros_target_objdump="i386-aros-objdump"
878 target_tool_prefix="i686-apple-darwin10-"
881 aros_target_cpu="x86_64"
882 aros_object_format="elf_x86_64"
883 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
884 aros_kernel_cflags="$aros_kernel_cflags -m64"
885 aros_kernel_ldflags="$aros_kernel_ldflags -m64"
886 aros_default_wbdepth=8
887 gcc_target_cpu="x86_64"
888 aros_target_cc="x86_64-aros-gcc"
889 aros_target_cxx="x86_64-aros-g++"
890 aros_target_ld="x86_64-aros-ld"
891 aros_target_as="x86_64-aros-as"
892 aros_target_ar="x86_64-aros-ar"
893 aros_target_ranlib="x86_64-aros-ranlib"
894 aros_target_nm="x86_64-aros-nm"
895 aros_target_strip="x86_64-aros-strip"
896 aros_target_objcopy="x86_64-aros-objcopy"
897 aros_target_objdump="x86_64-aros-objdump"
898 target_tool_prefix="i686-apple-darwin10-"
901 aros_target_cpu="ppc"
902 aros_object_format="elf32_ppc"
903 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
904 aros_default_wbdepth=8
906 aros_target_cc="ppc-aros-gcc"
907 aros_target_cxx="ppc-aros-g++"
908 aros_target_ld="ppc-aros-ld"
909 aros_target_as="ppc-aros-as"
910 aros_target_ar="ppc-aros-ar"
911 aros_target_ranlib="ppc-aros-ranlib"
912 aros_target_nm="ppc-aros-nm"
913 aros_target_strip="ppc-aros-strip"
914 aros_target_objcopy="ppc-aros-objcopy"
915 aros_target_objdump="ppc-aros-objdump"
916 target_tool_prefix="powerpc-apple-darwin10-"
919 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
925 aros_target_arch="ios"
926 aros_target_family="unix"
927 aros_flavour="emulation"
928 # This is here because it may depend on iOS or SDK version
929 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
930 case "$target_cpu" in
932 aros_ios_platform="iPhoneSimulator"
933 aros_target_cpu="i386"
934 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
935 aros_default_wbdepth=8
936 gcc_target_cpu="i386"
937 aros_object_format="elf_i386"
938 aros_target_strip_flags="-x"
939 aros_target_cc="i386-aros-gcc"
940 aros_target_cxx="i386-aros-g++"
941 aros_target_ld="i386-aros-ld"
942 aros_target_as="i386-aros-as"
943 aros_target_ar="i386-aros-ar"
944 aros_target_ranlib="i386-aros-ranlib"
945 aros_target_nm="i386-aros-nm"
946 aros_target_strip="i386-aros-strip"
947 aros_target_objcopy="i386-aros-objcopy"
948 aros_target_objdump="i386-aros-objdump"
949 target_tool_prefix="i686-apple-darwin10-"
950 target_tool_flags="-m32"
953 aros_ios_platform="iPhoneOS"
954 aros_target_cpu="arm"
955 aros_object_format="armelf_linux_eabi"
956 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
957 aros_config_cflags="$aros_config_cflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
958 aros_config_aflags="$aros_config_aflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
959 aros_arch_libs="-laeabi"
960 aros_default_wbdepth=8
962 aros_kernel_ld="ld -arch armv6"
963 aros_target_cc="arm-aros-gcc"
964 aros_target_cxx="arm-aros-g++"
965 aros_target_ld="arm-aros-ld"
966 aros_target_as="arm-aros-as"
967 aros_target_ar="arm-aros-ar"
968 aros_target_ranlib="arm-aros-ranlib"
969 aros_target_nm="arm-aros-nm"
970 aros_target_strip="arm-aros-strip"
971 aros_target_objcopy="arm-aros-objcopy"
972 aros_target_objdump="arm-aros-objdump"
973 target_tool_prefix="arm-apple-darwin10-"
974 aros_default_wbwidth=320
975 aros_default_wbheight=480
976 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
979 AC_MSG_ERROR("Unsupported target CPU for iOS hosted flavour -- $target_cpu")
982 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
983 target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
987 aros_target_arch="dragonfly"
988 aros_target_family="unix"
989 aros_flavour="emulation"
990 case "$target_cpu" in
992 aros_target_cpu="i386"
993 aros_object_format="elf_i386"
994 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
997 aros_target_cpu="x86_64"
998 aros_object_format="elf_x86_64"
999 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1002 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1008 aros_target_arch="netbsd"
1009 aros_target_family="unix"
1010 case "$target_cpu" in
1012 aros_target_cpu="m68k"
1013 aros_object_format="m68kelf"
1014 aros_flavour="emulcompat"
1015 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1016 gcc_target_cpu="mc68000"
1019 aros_target_cpu="i386"
1020 aros_object_format="elf_i386"
1021 aros_flavour="emulation"
1022 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1023 aros_default_wbdepth=8
1024 gcc_target_cpu="i386"
1027 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1030 aros_target_genmap="-Wl,-M -Xlinker >"
1031 aros_flavour="emulation"
1032 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1036 aros_target_arch="openbsd"
1037 aros_target_family="unix"
1038 case "$target_cpu" in
1040 aros_target_cpu="i386"
1041 aros_object_format="elf_i386"
1042 aros_flavour="emulation"
1043 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1044 gcc_target_cpu="i386"
1047 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1050 aros_target_genmap="-Wl,-M -Xlinker >"
1051 aros_target_nm_flags="-u"
1052 aros_flavour="emulation"
1056 aros_target_arch="solaris"
1057 aros_target_family="unix"
1058 case "$target_cpu" in
1060 aros_target_cpu="i386"
1061 aros_object_format="elf_i386"
1062 aros_flavour="emulation"
1063 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1064 aros_default_wbdepth=8
1065 gcc_target_cpu="i386"
1068 aros_target_cpu="sparc"
1069 aros_object_format="elf_sparc"
1070 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1071 gcc_target_cpu="sparc"
1074 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1077 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1078 aros_flavour="emulation"
1082 aros_target_arch="morphos"
1083 aros_shared_default="no"
1084 aros_target_cpu="ppc"
1085 aros_object_format="elf_ppc"
1086 aros_flavour="nativecompat"
1087 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1088 gcc_target_cpu="ppc"
1092 aros_target_arch="sam440"
1093 aros_shared_default="no"
1094 aros_target_cpu="ppc"
1095 aros_object_format="elf32ppc"
1096 aros_flavour="ppcnative"
1097 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1098 aros_kernel_ldflags=""
1099 aros_default_wbwidth=1024
1100 aros_default_wbheight=768
1101 aros_default_wbdepth=24
1102 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1103 gcc_target_cpu="powerpc"
1107 aros_target_arch="efika"
1108 aros_shared_default="no"
1109 aros_target_cpu="arm"
1110 aros_object_format="armelf_linux_eabi"
1111 aros_flavour="standalone"
1112 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1113 aros_kernel_ldflags=""
1114 aros_default_wbwidth=1024
1115 aros_default_wbheight=600
1116 aros_arch_libs="-laeabi"
1117 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"
1118 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"
1122 aros_target_arch="chrp"
1123 aros_shared_default="no"
1124 aros_target_cpu="ppc"
1125 aros_object_format="elf32ppc"
1126 aros_flavour="ppcnative"
1127 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1128 aros_kernel_ldflags=""
1129 aros_default_wbwidth=640
1130 aros_default_wbheight=480
1131 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1132 gcc_target_cpu="powerpc"
1133 case "$aros_target_variant" in
1135 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1141 aros_target_arch="amiga"
1142 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1143 aros_shared_default="no"
1145 case "$target_cpu" in
1147 aros_target_cpu="m68k"
1148 aros_object_format="m68kelf"
1149 aros_flavour="standalone"
1150 gcc_target_cpu="mc68000"
1151 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1152 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1153 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1154 target_tool_prefix="m68k-elf-"
1155 aros_target_nostdlib_ldflags="" # We always need -lgcc
1156 aros_target_strip_flags="-R.comment"
1159 aros_target_cpu="m68k"
1160 aros_object_format="m68kelf"
1161 aros_flavour="standcompat"
1162 gcc_target_cpu="mc68000"
1163 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"
1164 aros_config_aflags="$aros_config_aflags -g3 -${gcc_target_cpu}"
1165 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1166 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1167 target_tool_prefix="m68k-elf-"
1168 aros_target_nostdlib_ldflags="" # We always need -lgcc
1169 aros_target_strip_flags="-R.comment"
1173 aros_flavour="native"
1174 gcc_target_cpu="ppc"
1177 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1183 aros_target_arch="mingw32"
1184 aros_shared_default="no"
1185 aros_flavour="emulation"
1186 aros_shared_cflags=""
1189 case "$target_cpu" in
1191 aros_target_cpu="i386"
1192 aros_object_format="elf_i386"
1193 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1194 aros_default_wbdepth=8
1195 gcc_target_cpu="i386"
1196 aros_target_cc="i386-aros-gcc"
1197 aros_target_cxx="i386-aros-g++"
1198 aros_target_ld="i386-aros-ld"
1199 aros_target_as="i386-aros-as"
1200 aros_target_ar="i386-aros-ar"
1201 aros_target_ranlib="i386-aros-ranlib"
1202 aros_target_nm="i386-aros-nm"
1203 aros_target_strip="i386-aros-strip"
1204 aros_target_objcopy="i386-aros-objcopy"
1205 aros_target_objdump="i386-aros-objdump"
1206 target_tool_prefix="i386-mingw32-"
1209 aros_target_cpu="x86_64"
1210 aros_object_format="elf_x86_64"
1211 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1212 aros_default_wbdepth=8
1213 gcc_target_cpu="x86_64"
1214 aros_target_cc="x86_64-aros-gcc"
1215 aros_target_cxx="x86_64-aros-g++"
1216 aros_target_ld="x86_64-aros-ld"
1217 aros_target_as="x86_64-aros-as"
1218 aros_target_ar="x86_64-aros-ar"
1219 aros_target_ranlib="x86_64-aros-ranlib"
1220 aros_target_nm="x86_64-aros-nm"
1221 aros_target_strip="x86_64-aros-strip"
1222 aros_target_objcopy="x86_64-aros-objcopy"
1223 aros_target_objdump="x86_64-aros-objdump"
1224 target_tool_prefix="x86_64-w64-mingw32-"
1227 aros_target_cpu="arm"
1228 aros_object_format="armelf_linux_eabi"
1229 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1230 aros_arch_libs="-laeabi"
1231 aros_default_wbdepth=8
1232 gcc_target_cpu="arm"
1233 aros_target_cc="arm-aros-gcc"
1234 aros_target_cxx="arm-aros-g++"
1235 aros_target_ld="arm-aros-ld"
1236 aros_target_as="arm-aros-as"
1237 aros_target_ar="arm-aros-ar"
1238 aros_target_ranlib="arm-aros-ranlib"
1239 aros_target_nm="arm-aros-nm"
1240 aros_target_strip="arm-aros-strip"
1241 aros_target_objcopy="arm-aros-objcopy"
1242 aros_target_objdump="arm-aros-objdump"
1243 target_tool_prefix="arm-mingw32ce-"
1244 aros_default_wbwidth=160
1245 aros_default_wbheight=160
1248 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1251 if test $host_os = "cygwin"; then
1252 aros_kernel_cflags="-mno-cygwin"
1256 aros_target_arch="pp"
1257 aros_shared_default="no"
1258 case "$target_cpu" in
1260 aros_target_cpu="m68k"
1261 aros_object_format="m68kelf"
1262 aros_flavour="palmnative"
1263 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1264 aros_default_wbwidth=160
1265 aros_default_wbheight=160
1266 aros_default_wbdepth=1
1267 aros_target_ar_flags="cru"
1268 aros_compiler_libs="-lgcc1"
1269 aros_shared_default=no
1270 aros_shared_cflags="-fpic"
1271 aros_shared_aflags=""
1272 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1273 aros_kernel_ldflags="-Wl,-rpath,./lib"
1274 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1275 aros_debug_aflags=""
1276 aros_debug_ldflags="$aros_symbols_debug"
1277 aros_mungwall_debug="0"
1278 aros_modules_debug="0"
1279 gcc_target_cpu="mc68000"
1280 ignore_undefined_symbols="-ius"
1283 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1289 aros_target_arch="mac"
1290 aros_shared_default="no"
1291 case "$target_cpu" in
1293 aros_target_cpu="m68k"
1294 aros_object_format="m68kelf"
1295 aros_flavour="mac68knative"
1296 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1297 aros_default_wbwidth=512
1298 aros_default_wbheight=384
1299 aros_default_wbdepth=8
1300 aros_target_ar_flags="cru"
1301 aros_compiler_libs="-lgcc1"
1302 aros_shared_default=no
1303 aros_shared_cflags="-fpic"
1304 aros_shared_aflags=""
1305 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1306 aros_kernel_ldflags="-Wl,-rpath,./lib"
1307 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
1308 aros_debug_aflags=""
1309 aros_debug_ldflags="$aros_symbols_debug"
1310 aros_mungwall_debug="0"
1311 aros_modules_debug="0"
1312 gcc_target_cpu="mc68000"
1313 ignore_undefined_symbols="-ius"
1316 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1322 AC_MSG_ERROR([Unsupported target architecture $target])
1326 # FIXME: for cross-compiling this should point to another location
1327 if test "$aros_flavour" = "emulation"; then
1328 aros_kernel_includes="-isystem /usr/include"
1330 if test "$aros_flavour" = "emulcompat"; then
1331 aros_kernel_includes="-isystem /usr/include"
1334 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1335 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1336 if test "$with_portssrcdir" = "default"; then
1337 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1339 AROS_PORTSSRCDIR="$with_portssrcdir"
1341 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1343 AC_MSG_CHECKING([which bootloader to use])
1344 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1345 if test "$target_bootloader" = "none"; then
1346 aros_target_bootloader=""
1348 aros_target_bootloader="$target_bootloader"
1350 AC_MSG_RESULT($target_bootloader)
1352 AC_MSG_CHECKING([which icon-set to use])
1353 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1354 if test "$target_iconset" = "default"; then
1355 aros_target_iconset="Gorilla"
1356 target_iconset="default (Gorilla)"
1358 aros_target_iconset="$target_iconset"
1360 AC_MSG_RESULT($target_iconset)
1362 AC_MSG_CHECKING([which GUI Theme to use])
1363 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1364 if test "$target_guitheme" = "default"; then
1365 aros_target_guitheme="Ice"
1367 aros_target_guitheme="$target_guitheme"
1369 AC_MSG_RESULT($aros_target_guitheme)
1371 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1374 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1377 if test "$aros_host_cpu" == "x86_64" ; then
1378 if test "$aros_target_cpu" == "i386" ; then
1379 if test "$aros_target_arch" != "mingw32"; then
1384 if test "$aros_host_arch" == "darwin" ; then
1385 if test "$aros_target_arch" != "darwin" ; then
1390 # Set prefix for target compiler etc. if we're cross-compiling
1391 # (should possibly be earlier but needs to be after AC_PROG_CC)
1392 if test "$cross_compiling" = "yes" ; then
1393 if test "$target_tool_prefix" = ""; then
1394 target_tool_prefix=${target_cpu}-elf-
1396 CC=${target_tool_prefix}gcc
1397 dnl CPP is needed for AC_CHECK_HEADER to work correctly
1398 CPP=${target_tool_prefix}cpp
1399 if test "$target_tool_version" != "default"; then
1400 CC="$CC-$target_tool_version"
1401 CPP="$CC-$target_tool_version"
1403 AC_PATH_PROG(CC,$CC)
1404 AROS_REQUIRED(gcc,$CC)
1406 CC="$CC $target_tool_flags"
1408 #-----------------------------------------------------------------------------
1410 # Disable pointer-signedness warnings if the compiler recognises the option
1412 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1413 save_cflags="$CFLAGS"
1414 CFLAGS="$CFLAGS -Wno-pointer-sign"
1415 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1416 AC_MSG_RESULT($use_no_sign_warning)
1417 if test "x-$use_no_sign_warning" = "x-yes" ; then
1418 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1420 CFLAGS="$save_cflags"
1422 #-----------------------------------------------------------------------------
1424 # Find all the tools we need to compile. This could be cross-compiling
1425 # though! If that is the case we use the GNU form of the target and
1426 # simply add this to the front of the binary name. This is rather simple,
1427 # but it should work under most circumstances.
1429 # The default tools are to use the same as the host, but only if the
1430 # host and target CPU are the same. With GCC this is normally enough.
1434 aros_shared_ld="$aros_host_ld"
1436 aros_target_mkdep="$aros_host_mkdep"
1437 aros_target_incl_def="$aros_host_incl"
1439 aros_kernel_cc="$CC"
1441 # The default tools executables to be linked to.
1442 if test "$aros_target_cc" != ""; then
1443 AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1444 AROS_REQUIRED(gcc,$aros_target_cc)
1446 if test "$aros_target_ld" != ""; then
1447 AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1448 AROS_REQUIRED(ld,$aros_target_ld)
1451 if test "$crosstools" != "yes"; then
1452 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1453 AROS_REQUIRED(as,$aros_target_as_ln)
1454 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1455 AROS_REQUIRED(ld,$aros_kernel_ld)
1456 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1457 AROS_REQUIRED(ar,$aros_target_ar_ln)
1458 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1459 AROS_REQUIRED(nm,$aros_target_nm_ln)
1460 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1461 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1462 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1463 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1464 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1465 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1466 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1467 AROS_REQUIRED(strip,$aros_target_strip_ln)
1468 if test "$aros_target_cxx" != ""; then
1469 AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1470 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1471 # AROS_REQUIRED(c++,$aros_target_cxx)
1474 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1478 # Build crosstools if we have no C++ - temporary thing
1479 if test "$aros_target_cxx" = ""; then
1480 crosstools_target=tools-crosstools
1483 if test "$rescomp" != ""; then
1484 if test "$cross_compiling" = "yes" ; then
1485 rescomp=${target_tool_prefix}${rescomp}
1487 AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1488 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1491 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1492 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1493 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1494 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1495 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1496 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1497 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1499 # aros_cc_pre is a variable that is added to the front of the compiler name
1500 # in the generated aros-gcc shell script. We need this to enable the cache
1501 # to work across cleaned builds. Also, support DISTCC using the correct
1502 # environment variable.
1505 if test "x${DISTCC}" != "x" ; then
1506 if test "x${CCACHE}" != "x" ; then
1507 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1509 aros_cc_pre="${DISTCC} "
1512 if test "x${CCACHE}" != "x" ; then
1513 aros_cc_pre="${CCACHE} "
1517 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1519 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1520 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1521 AC_SUBST(aros_target_nix_ldflags,-nix)
1522 AC_SUBST(aros_target_detach_ldflags,-detach)
1523 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1526 if test "$aros_target_cc" = ""; then
1527 orig_target_cc=$aros_kernel_cc
1529 orig_target_cc=$aros_target_cc
1531 if test "$aros_target_ld" = ""; then
1532 orig_target_ld=$aros_kernel_ld
1534 orig_target_ld=$aros_target_ld
1536 if test "$GCC" = "yes"; then
1537 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1539 aros_target_cc="${prefix}-gcc"
1540 aros_target_as="${prefix}-as"
1541 aros_target_ld="${prefix}-ld"
1542 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1543 aros_target_objcopy=${prefix}-objcopy
1544 aros_target_objdump=${prefix}-objdump
1545 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1546 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1547 aros_kernel_nm="${prefix}-nm"
1548 aros_target_strip=${prefix}-strip
1550 # Find the system include path. We can suggest that an alternative is
1551 # used if we don't get it correct. The default is to use /usr/include.
1552 # Which is set in the aros_target_incl_def variable.
1554 AC_ARG_ENABLE(includes,
1555 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1556 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1558 if test "$aros_kernel_includes" != "" ; then
1559 dnl find out about the kernel cc's include path
1560 AC_MSG_CHECKING([for the kernel compiler's include path])
1561 if test "$aros_kernel_cc_includes" = "" ; then
1562 # Try to guess where the directory is.
1563 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1564 if ! test -d $aros_kernel_cc_includes; then
1565 # The directory doesn't exist, we need to do some more work.
1566 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1568 # These are the headers we're looking for.
1569 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1570 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1574 for h in $headers; do
1575 # Which other headers are needed by each of the above?
1576 deps=$(echo "#include <$h>" | \
1577 $aros_kernel_cc -E -M - 2>/dev/null | \
1578 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1580 # Copy all the needed headers to a directory beneath gendir.
1583 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1584 sed -n "s,^.*/include\(/.*\),\1,p")
1585 ! test -d $dir && mkdir -p $dir
1586 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1591 AC_MSG_RESULT($aros_kernel_cc_includes)
1592 # Adding -nostdinc to kernel includes as they are always used together.
1593 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1596 dnl find out about the target cc's include path
1597 AC_MSG_CHECKING([for the target compiler's include path])
1598 if test "$aros_target_cc_includes" = "" ; then
1599 #try to guess where the directory is
1600 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1601 if ! test -d $aros_target_cc_includes; then
1602 #the directory doesn't exist, we need to do some more work
1603 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1605 #these are the headers we're looling for
1606 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1607 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1611 for h in $headers; do
1612 #which other headers each of the above headers needs?
1613 deps=$(echo "#include <$h>" | \
1614 $orig_target_cc -E -M - 2>/dev/null | \
1615 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1617 #copy all the needed headers to a directory beneath gendir
1620 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1621 sed -n "s,^.*/include\(/.*\),\1,p")
1622 ! test -d $dir && mkdir -p $dir
1623 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1628 AC_MSG_RESULT($aros_target_cc_includes)
1631 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1632 # On GCC >= 4.0 -iquote should be used
1636 save_cflags="$CFLAGS"
1638 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1639 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1640 AC_MSG_RESULT($has_iquote)
1641 if test "x-$has_iquote" = "x-yes" ; then
1642 host_cflags_iquote=-iquote
1643 host_cflags_iquote_end=
1645 host_cflags_iquote=-I
1646 host_cflags_iquote_end=-I-
1648 kernel_cflags_iquote=$host_cflags_iquote
1649 kernel_cflags_iquote_end=$host_cflags_iquote_end
1650 if test "x-$cross_compiling" = "x-yes"; then
1651 CC="$aros_kernel_cc"
1652 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1653 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1654 AC_MSG_RESULT($use_no_stack_protector)
1655 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1656 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1657 AC_MSG_RESULT($has_iquote)
1658 if test "x-$has_iquote" = "x-yes" ; then
1659 kernel_cflags_iquote=-iquote
1660 kernel_cflags_iquote_end=
1662 kernel_cflags_iquote=-I
1663 kernel_cflags_iquote_end=-I-
1666 aros_cflags_iquote=$kernel_cflags_iquote
1667 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1668 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1669 CC="$orig_target_cc"
1670 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1671 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1672 AC_MSG_RESULT($has_iquote)
1673 if test "x-$has_iquote" = "x-yes" ; then
1674 aros_cflags_iquote=-iquote
1675 aros_cflags_iquote_end=
1677 aros_cflags_iquote=-I
1678 aros_cflags_iquote_end=-I-
1681 if test "x-$use_no_stack_protector" = "x-yes" ; then
1682 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1685 #-----------------------------------------------------------------------------
1687 # Check if we can explicitly choose older version of symbol hashing
1689 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1690 CC="$aros_kernel_cc"
1691 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1692 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1693 AC_MSG_RESULT($use_hash_style)
1694 if test "x-$use_hash_style" = "x-yes" ; then
1695 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1698 CFLAGS="$save_cflags"
1700 AC_SUBST(host_cflags_iquote)
1701 AC_SUBST(host_cflags_iquote_end)
1702 AC_SUBST(kernel_cflags_iquote)
1703 AC_SUBST(kernel_cflags_iquote_end)
1704 AC_SUBST(aros_cflags_iquote)
1705 AC_SUBST(aros_cflags_iquote_end)
1708 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1709 AC_MSG_CHECKING([for default resolution of WBScreen])
1710 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1711 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1712 if test "$resolution" = "yes" ; then
1715 if test "$resolution" = "no" ; then
1718 if test "$resolution" != "none" ; then
1719 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1720 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1721 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1723 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1724 aros_cv_default_wbwidth=$aros_default_wbwidth
1725 aros_cv_default_wbheight=$aros_default_wbheight
1726 aros_cv_default_wbdepth=$aros_default_wbdepth
1728 dnl See if the user wants the serial debug output for native flavour
1729 AC_MSG_CHECKING([if serial debug is enabled])
1730 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)
1731 if test "$aros_serial_debug" = 0 ; then
1732 serial_debug_forced=""
1733 if test "$serial_debug" = "yes" ; then
1736 if test "$serial_debug" = "no" ; then
1740 serial_debug_forced="(forced)"
1741 serial_debug=$aros_serial_debug
1743 if test "$serial_debug" != "none" ; then
1744 aros_serial_debug=$serial_debug
1745 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1750 dnl See if the user wants the palm debug output hack for palm native flavour
1751 AC_MSG_CHECKING([if palm debug hack is enabled])
1752 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")
1753 if test "$palm_debug_hack" = "yes" ; then
1754 aros_palm_debug_hack="1"
1756 AC_MSG_RESULT($palm_debug_hack)
1759 dnl See if the user wants nesting supervisor activated for unix flavour
1760 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1761 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")
1762 if test "$nesting_supervisor" = "yes" ; then
1763 aros_nesting_supervisor="1"
1765 AC_MSG_RESULT($nesting_supervisor)
1768 dnl things specifically required for hosted flavours
1769 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1771 if test "x-$need_dlopen" != "x-no" ; then
1772 dnl some kind of dynamic library access system is required for hostlib.resource
1773 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1774 if test "x-$have_dl" = "x-no" ; then
1775 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1776 aros_host_ldflags="$aros_host_ldflags -ldl"],
1779 if test "x-$have_dl" = "x-no" ; then
1780 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1786 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1787 [build X11 hidd for hosted (default=auto)]),
1788 x11_hidd="$enableval",
1790 case "x-$x11_hidd" in
1791 x-yes|x-no|x-auto) ;;
1792 *) x11_hidd="auto" ;;
1798 if test "x-$x11_hidd" != "x-no" ; then
1804 for path in $x_libraries
1806 x_cflags="$x_cflags -L$path"
1809 for path in $x_includes
1811 x_cflags="$x_cflags -I$path"
1814 if test "x-$no_x" = "x-yes" ; then
1817 if test "x-$x11_hidd" != "x-auto" ; then
1818 dnl and they explicitly asked for it, bail out
1819 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1823 dnl found it, setup the metatarget
1824 x11_hidd_target=kernel-x11gfx-kobj
1827 dnl setup shared memory extensions
1828 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1829 [use X11 shared memory (default=auto)]),
1830 x11_hidd_shm="$enableval",
1831 x11_hidd_shm="auto")
1832 case "x-$x11_hidd_shm" in
1833 x-yes|x-no|x-auto) ;;
1834 *) x11_hidd_shm="auto" ;;
1840 if test "x-$x11_hidd_shm" != "x-no" ; then
1842 dnl system shm headers
1843 AC_CHECK_HEADERS(sys/ipc.h)
1844 AC_CHECK_HEADERS(sys/shm.h)
1847 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1849 dnl make sure X libs have shm functions
1850 save_cflags="$CFLAGS"
1851 CFLAGS="$CFLAGS $x_cflags"
1852 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1853 CFLAGS="$save_cflags"
1857 dnl detection done, prepare output
1858 if test "x-$have_xshm" = "x-yes" ; then
1861 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1862 dnl they explicitly asked for it, but we can't do it
1863 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1865 dnl otherwise just disable it
1870 dnl setup vidmode (fullscreen) extensions
1871 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1872 [use X11 vidmode extension (default=auto)]),
1873 x11_hidd_vidmode="$enableval",
1874 x11_hidd_vidmode="auto")
1875 case "x-$x11_hidd_vidmode" in
1876 x-yes|x-no|x-auto) ;;
1877 *) x11_hidd_vidmode="auto" ;;
1883 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1885 dnl make sure X libs have vidmode functions
1886 save_cflags="$CFLAGS"
1887 CFLAGS="$CFLAGS $x_cflags"
1888 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1889 CFLAGS="$save_cflags"
1892 dnl detection done, prepare output
1893 if test "x-$have_vidmode" = "x-yes" ; then
1894 dnl we can do vidmode
1895 DO_VIDMODE_SUPPORT="1"
1896 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1897 dnl they explicitly asked for it, but we can't do it
1898 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1900 dnl otherwise just disable it
1901 DO_VIDMODE_SUPPORT="0"
1905 aros_host_x11_includes=$x_includes
1906 aros_host_x11_libdirs=$x_libraries
1911 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1912 [build SDL hidd for hosted (default=auto)]),
1913 sdl_hidd="$enableval",
1915 case "x-$sdl_hidd" in
1916 x-yes|x-no|x-auto) ;;
1917 *) sdl_hidd="auto" ;;
1921 if test "x-$sdl_hidd" != "x-no" ; then
1924 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1926 if test "x-$have_sdl" != "x-yes" ; then
1929 if test "x-$sdl_hidd" != "x-auto" ; then
1930 dnl and they explicitly asked for it, bail out
1931 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1935 dnl found it, set up the metatarget
1936 sdl_hidd_target=kernel-hidd-sdl
1937 aros_host_sdl_cflags=SDL_CFLAGS
1938 aros_host_sdl_libs=SDL_LIBS
1943 AC_CHECK_HEADER(sys/soundcard.h)
1944 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
1945 oss_library_target=workbench-libs-oss-unix
1950 dnl See if the user wants dbus.library
1951 AC_MSG_CHECKING([if building of dbus.library is enabled])
1952 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1953 if test "$dbus" = "yes" ; then
1955 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1956 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1957 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1958 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1962 AC_MSG_RESULT($dbus)
1965 dnl --------------------------------------------------------------------
1966 dnl Configuration Output Section
1967 dnl --------------------------------------------------------------------
1972 AC_SUBST(aros_flavour)
1973 AC_SUBST(aros_flavour_uc)
1974 AC_SUBST(AROS_BUILDDIR)
1975 AC_SUBST(AROS_BUILDDIR_UNIX)
1977 AC_SUBST(AROS_PORTSSRCDIR)
1980 AC_SUBST(aros_cc_pre)
1981 AC_SUBST(aros_host_strip)
1982 AC_SUBST(aros_host_arch)
1983 AC_SUBST(aros_host_cpu)
1984 AC_SUBST(aros_host_cc)
1985 AC_SUBST(aros_host_ar)
1986 AC_SUBST(aros_host_ranlib)
1987 AC_SUBST(aros_host_ld)
1988 AC_SUBST(aros_host_make)
1989 AC_SUBST(aros_host_cflags)
1990 AC_SUBST(aros_host_ldflags)
1991 AC_SUBST(aros_host_debug)
1992 AC_SUBST(aros_host_mkdep)
1993 AC_SUBST(aros_host_mkargs)
1994 AC_SUBST(aros_host_exe_suffix)
1995 AC_SUBST(aros_host_lib_suffix)
1996 AC_SUBST(aros_tools_dir)
1997 AC_SUBST(aros_host_aclocal)
1998 AC_SUBST(aros_host_autoconf)
1999 AC_SUBST(aros_host_autoheader)
2000 AC_SUBST(aros_host_automake)
2003 AC_SUBST(aros_target_guitheme)
2004 AC_SUBST(aros_target_iconset)
2005 AC_SUBST(aros_target_bootloader)
2006 AC_SUBST(aros_target_arch)
2007 AC_SUBST(aros_target_family)
2008 AC_SUBST(aros_target_cpu)
2009 AC_SUBST(aros_target_variant)
2010 AC_SUBST(aros_target_suffix)
2011 AC_SUBST(aros_target_incl)
2012 AC_SUBST(aros_target_ar)
2013 AC_SUBST(aros_target_ranlib)
2014 AC_SUBST(aros_kernel_nm)
2015 AC_SUBST(orig_target_cc)
2016 AC_SUBST(aros_target_cc)
2017 AC_SUBST(aros_target_cxx)
2018 AC_SUBST(aros_kernel_cc)
2019 AC_SUBST(aros_target_as)
2020 AC_SUBST(orig_target_ld)
2021 AC_SUBST(aros_target_ld)
2022 AC_SUBST(aros_kernel_ld)
2023 AC_SUBST(aros_target_cc_includes)
2024 AC_SUBST(aros_target_cc_path)
2025 AC_SUBST(aros_target_objdump)
2026 AC_SUBST(aros_target_objcopy)
2027 AC_SUBST(aros_target_strip)
2028 AC_SUBST(aros_target_nm)
2029 AC_SUBST(aros_kernel_rescomp)
2030 AC_SUBST(aros_shared_default)
2031 AC_SUBST(aros_shared_ld)
2032 AC_SUBST(aros_object_format)
2033 AC_SUBST(aros_compiler_libs)
2034 AC_SUBST(aros_arch_libs)
2036 AC_SUBST(aros_config_cflags)
2037 AC_SUBST(aros_config_aflags)
2038 AC_SUBST(aros_config_ldflags)
2040 AC_SUBST(aros_shared_cflags)
2041 AC_SUBST(aros_shared_aflags)
2042 AC_SUBST(aros_shared_ldflags)
2043 AC_SUBST(aros_kernel_cflags)
2044 AC_SUBST(aros_kernel_includes)
2045 AC_SUBST(aros_kernel_objcflags)
2046 AC_SUBST(aros_kernel_ldflags)
2047 AC_SUBST(aros_debug_cflags)
2048 AC_SUBST(aros_debug_aflags)
2049 AC_SUBST(aros_debug_ldflags)
2050 AC_SUBST(aros_paranoia_cflags)
2051 AC_SUBST(aros_target_genmap)
2052 AC_SUBST(aros_target_strip_flags)
2054 AC_SUBST(crosstools_target)
2057 AC_SUBST(x11_hidd_target)
2058 AC_SUBST(sdl_hidd_target)
2059 AC_SUBST(pci_hidd_target)
2060 AC_SUBST(oss_library_target)
2062 AC_SUBST(aros_default_wbwidth)
2063 AC_SUBST(aros_default_wbheight)
2064 AC_SUBST(aros_default_wbdepth)
2065 AC_SUBST(DO_XSHM_SUPPORT)
2066 AC_SUBST(DO_VIDMODE_SUPPORT)
2068 AC_SUBST(aros_host_x11_includes)
2069 AC_SUBST(aros_host_x11_libdirs)
2070 AC_SUBST(aros_host_sdl_cflags)
2071 AC_SUBST(aros_host_sdl_libs)
2073 # Native version related
2074 AC_SUBST(aros_serial_debug)
2076 # Palm native version related
2077 AC_SUBST(aros_palm_debug_hack)
2079 # Unix/Hosted version related
2080 AC_SUBST(aros_nesting_supervisor)
2083 AC_SUBST(aros_ios_platform)
2084 AC_SUBST(aros_ios_version)
2085 AC_SUBST(aros_ios_sdk)
2088 AC_SUBST(ENABLE_DBUS)
2089 AC_SUBST(DBUS_CFLAGS)
2090 AC_SUBST(DBUS_LIBFLAGS)
2091 AC_SUBST(KERNEL_DBUS_KOBJ)
2092 AC_SUBST(KERNEL_DBUS_INCLUDES)
2095 AC_SUBST(ENABLE_X11)
2098 AC_SUBST(aros_debug)
2099 AC_SUBST(aros_mungwall_debug)
2100 AC_SUBST(aros_stack_debug)
2101 AC_SUBST(aros_modules_debug)
2103 # Collect-aros stuff: "-ius" to ignore undefined symbols
2104 AC_SUBST(ignore_undefined_symbols)
2106 # C compiler related
2107 AC_SUBST(gcc_target_cpu)
2109 dnl Prepare for output, make up all the generated patches
2110 case "$aros_flavour" in
2111 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2112 aros_flavour="emulation" ;;
2113 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2114 aros_flavour="emulation" ;;
2115 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2116 aros_flavour="standalone";;
2117 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2118 aros_flavour="standalone";;
2119 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2120 aros_flavour="native" ;;
2121 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2122 aros_flavour="native" ;;
2123 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2124 aros_flavour="linklib" ;;
2125 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2126 aros_flavour="palmnative" ;;
2127 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2128 aros_flavour="mac68knative" ;;
2129 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2130 aros_flavour="ppcnative" ;;
2133 if test ! -d ${aros_inc_dir} ; then
2134 ${MKDIR} ${aros_inc_dir}
2136 if test ! -d ${aros_geninc_dir} ; then
2137 ${MKDIR} ${aros_geninc_dir}
2139 if test ! -d ${aros_hostcfg_dir} ; then
2140 ${MKDIR} ${aros_hostcfg_dir}
2142 if test ! -d ${aros_targetcfg_dir} ; then
2143 ${MKDIR} ${aros_targetcfg_dir}
2145 if test ! -d ${aros_tools_dir} ; then
2146 ${MKDIR} ${aros_tools_dir}
2148 if test ! -d ${aros_scripts_dir} ; then
2149 ${MKDIR} ${aros_scripts_dir}
2152 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2154 AC_CONFIG_COMMANDS([compiler_executable],
2156 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2158 prefix="${prefix}/${aros_target_cpu}-aros"
2159 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2163 chmod a+x ${prefix2}-gcc ${prefix2}-ld
2165 ln -sf ${prefix2}-gcc ${prefix}-gcc
2166 ln -sf ${prefix2}-ld ${prefix}-ld
2168 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix}-as
2169 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix}-nm
2170 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix}-ar
2171 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix}-ranlib
2172 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2173 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2174 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix}-strip
2176 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix2}-as
2177 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix2}-nm
2178 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix2}-ar
2179 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix2}-ranlib
2180 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2181 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2182 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix2}-strip
2185 aros_host_exe_suffix=${aros_host_exe_suffix}
2186 aros_tools_dir=${aros_tools_dir}
2187 aros_target_cpu=${aros_target_cpu}
2188 aros_target_arch=${aros_target_arch}
2189 aros_target_suffix=${aros_target_suffix}
2190 aros_target_nm_ln=${aros_target_nm_ln}
2191 aros_target_as_ln=${aros_target_as_ln}
2192 aros_target_ar_ln=${aros_target_ar_ln}
2193 aros_target_ranlib_ln=${aros_target_ranlib_ln}
2194 aros_target_objdump_ln=${aros_target_objdump_ln}
2195 aros_target_objcopy_ln=${aros_target_objcopy_ln}
2196 aros_target_strip_ln=${aros_target_strip_ln}
2199 AC_CONFIG_COMMANDS([genshared_executable],
2200 [chmod a+x ${aros_scripts_dir}/genshared],
2201 [aros_scripts_dir=${aros_scripts_dir}]
2203 AC_CONFIG_COMMANDS([genmf_executable],
2204 [chmod a+x ${aros_tools_dir}/genmf.py],
2205 [aros_tools_dir=${aros_tools_dir}]
2211 ${aros_inc_dir}/config.h:config/config.h.in
2212 ${aros_geninc_dir}/config.h:config/config.h.in
2213 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2214 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2216 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2217 ${aros_targetcfg_dir}/specs:config/specs.in
2218 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2219 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2220 ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
2221 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2222 tools/collect-aros/env.h
2227 dnl This is in order to not define SHARED_CFLAGS sometimes
2228 dnl We don't always do aros_shared_ar, aros_shared_cflags
2230 #XXX compatability...
2231 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2233 if test -n "$aros_shared_cflags" ; then
2234 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2235 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg