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"
737 aros_target_cpu="x86_64"
738 aros_object_format="elf_x86_64"
739 aros_flavour="emulation"
740 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
741 aros_config_cflags="$aros_config_cflags -mno-red-zone"
742 aros_default_wbdepth=8
743 gcc_target_cpu="x86_64"
746 aros_target_cpu="ppc"
747 aros_object_format="elf32ppc"
748 aros_flavour="emulation"
749 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
750 aros_default_wbdepth=8
754 # Same as powerpc, but I need this for the nightly build to work again.
755 # Actually, the nightly should be made working with powerpc target.
756 # That just was too much work for the moment, another week or two.
758 aros_target_cpu="ppc"
759 aros_object_format="elf32ppc"
760 aros_flavour="emulation"
761 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
762 aros_default_wbdepth=8
766 aros_target_cpu="arm"
767 aros_object_format="armelf_linux_eabi"
768 aros_flavour="emulation"
769 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
771 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
772 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
775 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
781 aros_target_arch="pc"
782 aros_shared_default="no"
783 target_bootloader="grub2"
784 case "$target_cpu" in
786 aros_target_cpu="i386"
788 dnl If somebody hasn't already set the target object
789 dnl format, then use this value. Mostly to support
790 dnl FreeBSD cross-compilation.
791 dnl TODO: Remove when we always use our compiler.
793 if test "$aros_object_format" = "" ; then
794 aros_object_format="elf_i386"
796 aros_flavour="standalone"
797 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
798 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
799 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
800 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
801 aros_config_ldflags="-m32 -march=i486"
802 aros_kernel_ldflags="-melf_i386"
803 aros_default_wbwidth=640
804 aros_default_wbheight=480
805 gcc_target_cpu="i386"
808 aros_target_cpu="x86_64"
810 if test "$aros_object_format" = "" ; then
811 aros_object_format="elf_x86_64"
813 aros_flavour="standalone"
814 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
815 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
816 aros_kernel_ldflags=""
817 aros_default_wbwidth=640
818 aros_default_wbheight=480
819 gcc_target_cpu="x86_64"
822 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
828 aros_target_arch="prep"
829 aros_shared_default="no"
830 aros_target_cpu="ppc"
831 aros_object_format="elf32ppc"
832 aros_flavour="ppcnative"
833 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
834 aros_kernel_ldflags=""
835 aros_default_wbwidth=640
836 aros_default_wbheight=480
841 aros_target_arch="freebsd"
842 aros_target_family="unix"
843 aros_target_cpu="i386"
844 aros_flavour="emulation"
845 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
846 gcc_target_cpu="i386"
848 aros_target_strip_flags="-x"
852 aros_target_arch="darwin"
853 aros_target_family="unix"
854 aros_flavour="emulation"
855 case "$target_cpu" in
857 aros_target_cpu="i386"
858 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
859 aros_kernel_cflags="$aros_kernel_cflags -m32"
860 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
861 aros_default_wbdepth=8
862 gcc_target_cpu="i386"
863 aros_object_format="elf_i386"
864 aros_target_strip_flags="-x"
865 aros_target_cc="i386-aros-gcc"
866 aros_target_cxx="i386-aros-g++"
867 aros_target_ld="i386-aros-ld"
868 aros_target_as="i386-aros-as"
869 aros_target_ar="i386-aros-ar"
870 aros_target_ranlib="i386-aros-ranlib"
871 aros_target_nm="i386-aros-nm"
872 aros_target_strip="i386-aros-strip"
873 aros_target_objcopy="i386-aros-objcopy"
874 aros_target_objdump="i386-aros-objdump"
875 target_tool_prefix="i686-apple-darwin10-"
878 aros_target_cpu="x86_64"
879 aros_object_format="elf_x86_64"
880 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
881 aros_kernel_cflags="$aros_kernel_cflags -m64"
882 aros_kernel_ldflags="$aros_kernel_ldflags -m64"
883 aros_default_wbdepth=8
884 gcc_target_cpu="x86_64"
885 aros_target_cc="x86_64-aros-gcc"
886 aros_target_cxx="x86_64-aros-g++"
887 aros_target_ld="x86_64-aros-ld"
888 aros_target_as="x86_64-aros-as"
889 aros_target_ar="x86_64-aros-ar"
890 aros_target_ranlib="x86_64-aros-ranlib"
891 aros_target_nm="x86_64-aros-nm"
892 aros_target_strip="x86_64-aros-strip"
893 aros_target_objcopy="x86_64-aros-objcopy"
894 aros_target_objdump="x86_64-aros-objdump"
895 target_tool_prefix="i686-apple-darwin10-"
898 aros_target_cpu="ppc"
899 aros_object_format="elf32_ppc"
900 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
901 aros_default_wbdepth=8
903 aros_target_cc="ppc-aros-gcc"
904 aros_target_cxx="ppc-aros-g++"
905 aros_target_ld="ppc-aros-ld"
906 aros_target_as="ppc-aros-as"
907 aros_target_ar="ppc-aros-ar"
908 aros_target_ranlib="ppc-aros-ranlib"
909 aros_target_nm="ppc-aros-nm"
910 aros_target_strip="ppc-aros-strip"
911 aros_target_objcopy="ppc-aros-objcopy"
912 aros_target_objdump="ppc-aros-objdump"
913 target_tool_prefix="powerpc-apple-darwin10-"
916 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
922 aros_target_arch="ios"
923 aros_target_family="unix"
924 aros_flavour="emulation"
925 # This is here because it may depend on iOS or SDK version
926 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
927 case "$target_cpu" in
929 aros_ios_platform="iPhoneSimulator"
930 aros_target_cpu="i386"
931 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
932 aros_default_wbdepth=8
933 gcc_target_cpu="i386"
934 aros_object_format="elf_i386"
935 aros_target_strip_flags="-x"
936 aros_target_cc="i386-aros-gcc"
937 aros_target_cxx="i386-aros-g++"
938 aros_target_ld="i386-aros-ld"
939 aros_target_as="i386-aros-as"
940 aros_target_ar="i386-aros-ar"
941 aros_target_ranlib="i386-aros-ranlib"
942 aros_target_nm="i386-aros-nm"
943 aros_target_strip="i386-aros-strip"
944 aros_target_objcopy="i386-aros-objcopy"
945 aros_target_objdump="i386-aros-objdump"
946 target_tool_prefix="i686-apple-darwin10-"
947 target_tool_flags="-m32"
950 aros_ios_platform="iPhoneOS"
951 aros_target_cpu="arm"
952 aros_object_format="armelf_linux_eabi"
953 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
954 aros_config_cflags="$aros_config_cflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
955 aros_config_aflags="$aros_config_aflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
956 aros_arch_libs="-laeabi"
957 aros_default_wbdepth=8
959 aros_kernel_ld="ld -arch armv6"
960 aros_target_cc="arm-aros-gcc"
961 aros_target_cxx="arm-aros-g++"
962 aros_target_ld="arm-aros-ld"
963 aros_target_as="arm-aros-as"
964 aros_target_ar="arm-aros-ar"
965 aros_target_ranlib="arm-aros-ranlib"
966 aros_target_nm="arm-aros-nm"
967 aros_target_strip="arm-aros-strip"
968 aros_target_objcopy="arm-aros-objcopy"
969 aros_target_objdump="arm-aros-objdump"
970 target_tool_prefix="arm-apple-darwin10-"
971 aros_default_wbwidth=320
972 aros_default_wbheight=480
973 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
976 AC_MSG_ERROR("Unsupported target CPU for iOS hosted flavour -- $target_cpu")
979 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
980 target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
984 aros_target_arch="dragonfly"
985 aros_target_family="unix"
986 aros_flavour="emulation"
987 case "$target_cpu" in
989 aros_target_cpu="i386"
990 aros_object_format="elf_i386"
991 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
994 aros_target_cpu="x86_64"
995 aros_object_format="elf_x86_64"
996 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
999 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1005 aros_target_arch="netbsd"
1006 aros_target_family="unix"
1007 case "$target_cpu" in
1009 aros_target_cpu="m68k"
1010 aros_object_format="m68kelf"
1011 aros_flavour="emulcompat"
1012 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1013 gcc_target_cpu="mc68000"
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__NetBSD__"
1020 aros_default_wbdepth=8
1021 gcc_target_cpu="i386"
1024 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1027 aros_target_genmap="-Wl,-M -Xlinker >"
1028 aros_flavour="emulation"
1029 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1033 aros_target_arch="openbsd"
1034 aros_target_family="unix"
1035 case "$target_cpu" in
1037 aros_target_cpu="i386"
1038 aros_object_format="elf_i386"
1039 aros_flavour="emulation"
1040 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1041 gcc_target_cpu="i386"
1044 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1047 aros_target_genmap="-Wl,-M -Xlinker >"
1048 aros_target_nm_flags="-u"
1049 aros_flavour="emulation"
1053 aros_target_arch="solaris"
1054 aros_target_family="unix"
1055 case "$target_cpu" in
1057 aros_target_cpu="i386"
1058 aros_object_format="elf_i386"
1059 aros_flavour="emulation"
1060 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1061 aros_default_wbdepth=8
1062 gcc_target_cpu="i386"
1065 aros_target_cpu="sparc"
1066 aros_object_format="elf_sparc"
1067 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1068 gcc_target_cpu="sparc"
1071 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1074 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1075 aros_flavour="emulation"
1079 aros_target_arch="morphos"
1080 aros_shared_default="no"
1081 aros_target_cpu="ppc"
1082 aros_object_format="elf_ppc"
1083 aros_flavour="nativecompat"
1084 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1085 gcc_target_cpu="ppc"
1089 aros_target_arch="sam440"
1090 aros_shared_default="no"
1091 aros_target_cpu="ppc"
1092 aros_object_format="elf32ppc"
1093 aros_flavour="ppcnative"
1094 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1095 aros_kernel_ldflags=""
1096 aros_default_wbwidth=1024
1097 aros_default_wbheight=768
1098 aros_default_wbdepth=24
1099 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1100 gcc_target_cpu="powerpc"
1104 aros_target_arch="efika"
1105 aros_shared_default="no"
1106 aros_target_cpu="arm"
1107 aros_object_format="armelf_linux_eabi"
1108 aros_flavour="standalone"
1109 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1110 aros_kernel_ldflags=""
1111 aros_default_wbwidth=1024
1112 aros_default_wbheight=600
1113 aros_arch_libs="-laeabi"
1114 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"
1115 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"
1119 aros_target_arch="chrp"
1120 aros_shared_default="no"
1121 aros_target_cpu="ppc"
1122 aros_object_format="elf32ppc"
1123 aros_flavour="ppcnative"
1124 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1125 aros_kernel_ldflags=""
1126 aros_default_wbwidth=640
1127 aros_default_wbheight=480
1128 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1129 gcc_target_cpu="powerpc"
1130 case "$aros_target_variant" in
1132 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1138 aros_target_arch="amiga"
1139 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1140 aros_shared_default="no"
1142 case "$target_cpu" in
1144 aros_target_cpu="m68k"
1145 aros_object_format="m68kelf"
1146 aros_flavour="standalone"
1147 gcc_target_cpu="mc68000"
1148 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1149 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1150 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1151 target_tool_prefix="m68k-elf-"
1152 aros_target_nostdlib_ldflags="" # We always need -lgcc
1153 aros_target_strip_flags="-R.comment"
1156 aros_target_cpu="m68k"
1157 aros_object_format="m68kelf"
1158 aros_flavour="standcompat"
1159 gcc_target_cpu="mc68000"
1160 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1161 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1162 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1163 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1164 target_tool_prefix="m68k-elf-"
1165 aros_target_nostdlib_ldflags="" # We always need -lgcc
1166 aros_target_strip_flags="-R.comment"
1170 aros_flavour="native"
1171 gcc_target_cpu="ppc"
1174 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1180 aros_target_arch="mingw32"
1181 aros_shared_default="no"
1182 aros_flavour="emulation"
1183 aros_shared_cflags=""
1186 case "$target_cpu" in
1188 aros_target_cpu="i386"
1189 aros_object_format="elf_i386"
1190 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1191 aros_default_wbdepth=8
1192 gcc_target_cpu="i386"
1193 aros_target_cc="i386-aros-gcc"
1194 aros_target_cxx="i386-aros-g++"
1195 aros_target_ld="i386-aros-ld"
1196 aros_target_as="i386-aros-as"
1197 aros_target_ar="i386-aros-ar"
1198 aros_target_ranlib="i386-aros-ranlib"
1199 aros_target_nm="i386-aros-nm"
1200 aros_target_strip="i386-aros-strip"
1201 aros_target_objcopy="i386-aros-objcopy"
1202 aros_target_objdump="i386-aros-objdump"
1203 target_tool_prefix="i386-mingw32-"
1206 aros_target_cpu="x86_64"
1207 aros_object_format="elf_x86_64"
1208 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1209 aros_default_wbdepth=8
1210 gcc_target_cpu="x86_64"
1211 aros_target_cc="x86_64-aros-gcc"
1212 aros_target_cxx="x86_64-aros-g++"
1213 aros_target_ld="x86_64-aros-ld"
1214 aros_target_as="x86_64-aros-as"
1215 aros_target_ar="x86_64-aros-ar"
1216 aros_target_ranlib="x86_64-aros-ranlib"
1217 aros_target_nm="x86_64-aros-nm"
1218 aros_target_strip="x86_64-aros-strip"
1219 aros_target_objcopy="x86_64-aros-objcopy"
1220 aros_target_objdump="x86_64-aros-objdump"
1221 target_tool_prefix="x86_64-w64-mingw32-"
1224 aros_target_cpu="arm"
1225 aros_object_format="armelf_linux_eabi"
1226 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1227 aros_arch_libs="-laeabi"
1228 aros_default_wbdepth=8
1229 gcc_target_cpu="arm"
1230 aros_target_cc="arm-aros-gcc"
1231 aros_target_cxx="arm-aros-g++"
1232 aros_target_ld="arm-aros-ld"
1233 aros_target_as="arm-aros-as"
1234 aros_target_ar="arm-aros-ar"
1235 aros_target_ranlib="arm-aros-ranlib"
1236 aros_target_nm="arm-aros-nm"
1237 aros_target_strip="arm-aros-strip"
1238 aros_target_objcopy="arm-aros-objcopy"
1239 aros_target_objdump="arm-aros-objdump"
1240 target_tool_prefix="arm-mingw32ce-"
1241 aros_default_wbwidth=160
1242 aros_default_wbheight=160
1245 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1248 if test $host_os = "cygwin"; then
1249 aros_kernel_cflags="-mno-cygwin"
1253 aros_target_arch="pp"
1254 aros_shared_default="no"
1255 case "$target_cpu" in
1257 aros_target_cpu="m68k"
1258 aros_object_format="m68kelf"
1259 aros_flavour="palmnative"
1260 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1261 aros_default_wbwidth=160
1262 aros_default_wbheight=160
1263 aros_default_wbdepth=1
1264 aros_target_ar_flags="cru"
1265 aros_compiler_libs="-lgcc1"
1266 aros_shared_default=no
1267 aros_shared_cflags="-fpic"
1268 aros_shared_aflags=""
1269 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1270 aros_kernel_ldflags="-Wl,-rpath,./lib"
1271 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1272 aros_debug_aflags=""
1273 aros_debug_ldflags="$aros_symbols_debug"
1274 aros_mungwall_debug="0"
1275 aros_modules_debug="0"
1276 gcc_target_cpu="mc68000"
1277 ignore_undefined_symbols="-ius"
1280 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1286 aros_target_arch="mac"
1287 aros_shared_default="no"
1288 case "$target_cpu" in
1290 aros_target_cpu="m68k"
1291 aros_object_format="m68kelf"
1292 aros_flavour="mac68knative"
1293 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1294 aros_default_wbwidth=512
1295 aros_default_wbheight=384
1296 aros_default_wbdepth=8
1297 aros_target_ar_flags="cru"
1298 aros_compiler_libs="-lgcc1"
1299 aros_shared_default=no
1300 aros_shared_cflags="-fpic"
1301 aros_shared_aflags=""
1302 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1303 aros_kernel_ldflags="-Wl,-rpath,./lib"
1304 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
1305 aros_debug_aflags=""
1306 aros_debug_ldflags="$aros_symbols_debug"
1307 aros_mungwall_debug="0"
1308 aros_modules_debug="0"
1309 gcc_target_cpu="mc68000"
1310 ignore_undefined_symbols="-ius"
1313 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1319 AC_MSG_ERROR([Unsupported target architecture $target])
1323 # FIXME: for cross-compiling this should point to another location
1324 if test "$aros_flavour" = "emulation"; then
1325 aros_kernel_includes="-isystem /usr/include"
1327 if test "$aros_flavour" = "emulcompat"; then
1328 aros_kernel_includes="-isystem /usr/include"
1331 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1332 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1333 if test "$with_portssrcdir" = "default"; then
1334 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1336 AROS_PORTSSRCDIR="$with_portssrcdir"
1338 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1340 AC_MSG_CHECKING([which bootloader to use])
1341 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1342 if test "$target_bootloader" = "none"; then
1343 aros_target_bootloader=""
1345 aros_target_bootloader="$target_bootloader"
1347 AC_MSG_RESULT($target_bootloader)
1349 AC_MSG_CHECKING([which icon-set to use])
1350 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1351 if test "$target_iconset" = "default"; then
1352 aros_target_iconset="Gorilla"
1353 target_iconset="default (Gorilla)"
1355 aros_target_iconset="$target_iconset"
1357 AC_MSG_RESULT($target_iconset)
1359 AC_MSG_CHECKING([which GUI Theme to use])
1360 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1361 if test "$target_guitheme" = "default"; then
1362 aros_target_guitheme="Ice"
1364 aros_target_guitheme="$target_guitheme"
1366 AC_MSG_RESULT($aros_target_guitheme)
1368 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1371 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1374 if test "$aros_host_cpu" == "x86_64" ; then
1375 if test "$aros_target_cpu" == "i386" ; then
1376 if test "$aros_target_arch" != "mingw32"; then
1382 # Set prefix for target compiler etc. if we're cross-compiling
1383 # (should possibly be earlier but needs to be after AC_PROG_CC)
1384 if test "$cross_compiling" = "yes" ; then
1385 if test "$target_tool_prefix" = ""; then
1386 target_tool_prefix=${target_cpu}-elf-
1388 CC=${target_tool_prefix}gcc
1389 dnl CPP is needed for AC_CHECK_HEADER to work correctly
1390 CPP=${target_tool_prefix}cpp
1391 if test "$target_tool_version" != "default"; then
1392 CC="$CC-$target_tool_version"
1393 CPP="$CC-$target_tool_version"
1395 AC_PATH_PROG(CC,$CC)
1396 AROS_REQUIRED(gcc,$CC)
1398 CC="$CC $target_tool_flags"
1400 #-----------------------------------------------------------------------------
1402 # Disable pointer-signedness warnings if the compiler recognises the option
1404 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1405 save_cflags="$CFLAGS"
1406 CFLAGS="$CFLAGS -Wno-pointer-sign"
1407 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1408 AC_MSG_RESULT($use_no_sign_warning)
1409 if test "x-$use_no_sign_warning" = "x-yes" ; then
1410 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1412 CFLAGS="$save_cflags"
1414 #-----------------------------------------------------------------------------
1416 # Find all the tools we need to compile. This could be cross-compiling
1417 # though! If that is the case we use the GNU form of the target and
1418 # simply add this to the front of the binary name. This is rather simple,
1419 # but it should work under most circumstances.
1421 # The default tools are to use the same as the host, but only if the
1422 # host and target CPU are the same. With GCC this is normally enough.
1426 aros_shared_ld="$aros_host_ld"
1428 aros_target_mkdep="$aros_host_mkdep"
1429 aros_target_incl_def="$aros_host_incl"
1431 aros_kernel_cc="$CC"
1433 # The default tools executables to be linked to.
1434 if test "$aros_target_cc" != ""; then
1435 AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1436 AROS_REQUIRED(gcc,$aros_target_cc)
1438 if test "$aros_target_ld" != ""; then
1439 AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1440 AROS_REQUIRED(ld,$aros_target_ld)
1443 if test "$crosstools" != "yes"; then
1444 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1445 AROS_REQUIRED(as,$aros_target_as_ln)
1446 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1447 AROS_REQUIRED(ld,$aros_kernel_ld)
1448 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1449 AROS_REQUIRED(ar,$aros_target_ar_ln)
1450 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1451 AROS_REQUIRED(nm,$aros_target_nm_ln)
1452 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1453 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1454 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1455 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1456 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1457 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1458 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1459 AROS_REQUIRED(strip,$aros_target_strip_ln)
1460 if test "$aros_target_cxx" != ""; then
1461 AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1462 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1463 # AROS_REQUIRED(c++,$aros_target_cxx)
1466 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1470 # Build crosstools if we have no C++ - temporary thing
1471 if test "$aros_target_cxx" = ""; then
1472 crosstools_target=tools-crosstools
1475 if test "$rescomp" != ""; then
1476 if test "$cross_compiling" = "yes" ; then
1477 rescomp=${target_tool_prefix}${rescomp}
1479 AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1480 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1483 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1484 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1485 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1486 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1487 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1488 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1489 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1491 # aros_cc_pre is a variable that is added to the front of the compiler name
1492 # in the generated aros-gcc shell script. We need this to enable the cache
1493 # to work across cleaned builds. Also, support DISTCC using the correct
1494 # environment variable.
1497 if test "x${DISTCC}" != "x" ; then
1498 if test "x${CCACHE}" != "x" ; then
1499 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1501 aros_cc_pre="${DISTCC} "
1504 if test "x${CCACHE}" != "x" ; then
1505 aros_cc_pre="${CCACHE} "
1509 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1511 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1512 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1513 AC_SUBST(aros_target_nix_ldflags,-nix)
1514 AC_SUBST(aros_target_detach_ldflags,-detach)
1515 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1518 if test "$aros_target_cc" = ""; then
1519 orig_target_cc=$aros_kernel_cc
1521 orig_target_cc=$aros_target_cc
1523 if test "$aros_target_ld" = ""; then
1524 orig_target_ld=$aros_kernel_ld
1526 orig_target_ld=$aros_target_ld
1528 if test "$GCC" = "yes"; then
1529 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1531 aros_target_cc="${prefix}-gcc"
1532 aros_target_as="${prefix}-as"
1533 aros_target_ld="${prefix}-ld"
1534 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1535 aros_target_objcopy=${prefix}-objcopy
1536 aros_target_objdump=${prefix}-objdump
1537 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1538 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1539 aros_kernel_nm="${prefix}-nm"
1540 aros_target_strip=${prefix}-strip
1542 # Find the system include path. We can suggest that an alternative is
1543 # used if we don't get it correct. The default is to use /usr/include.
1544 # Which is set in the aros_target_incl_def variable.
1546 AC_ARG_ENABLE(includes,
1547 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1548 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1550 if test "$aros_kernel_includes" != "" ; then
1551 dnl find out about the kernel cc's include path
1552 AC_MSG_CHECKING([for the kernel compiler's include path])
1553 if test "$aros_kernel_cc_includes" = "" ; then
1554 #try to guess where the directory is
1555 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1556 if ! test -d $aros_kernel_cc_includes; then
1557 #the directory doesn't exist, we need to do some more work
1558 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1560 #these are the headers we're looling for
1561 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1562 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1566 for h in $headers; do
1567 #which other headers each of the above headers needs?
1568 deps=$(echo "#include <$h>" | \
1569 $aros_kernel_cc -E -M - 2>/dev/null | \
1570 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1572 #copy all the needed headers to a directory beneath gendir
1575 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1576 sed -n "s,^.*/include\(/.*\),\1,p")
1577 ! test -d $dir && mkdir -p $dir
1578 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1583 AC_MSG_RESULT($aros_kernel_cc_includes)
1584 aros_kernel_includes="$aros_kernel_includes -isystem $aros_kernel_cc_includes"
1587 dnl find out about the target cc's include path
1588 AC_MSG_CHECKING([for the target compiler's include path])
1589 if test "$aros_target_cc_includes" = "" ; then
1590 #try to guess where the directory is
1591 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1592 if ! test -d $aros_target_cc_includes; then
1593 #the directory doesn't exist, we need to do some more work
1594 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1596 #these are the headers we're looling for
1597 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1598 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1602 for h in $headers; do
1603 #which other headers each of the above headers needs?
1604 deps=$(echo "#include <$h>" | \
1605 $orig_target_cc -E -M - 2>/dev/null | \
1606 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1608 #copy all the needed headers to a directory beneath gendir
1611 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1612 sed -n "s,^.*/include\(/.*\),\1,p")
1613 ! test -d $dir && mkdir -p $dir
1614 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1619 AC_MSG_RESULT($aros_target_cc_includes)
1622 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1623 # On GCC >= 4.0 -iquote should be used
1627 save_cflags="$CFLAGS"
1629 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1630 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1631 AC_MSG_RESULT($has_iquote)
1632 if test "x-$has_iquote" = "x-yes" ; then
1633 host_cflags_iquote=-iquote
1634 host_cflags_iquote_end=
1636 host_cflags_iquote=-I
1637 host_cflags_iquote_end=-I-
1639 kernel_cflags_iquote=$host_cflags_iquote
1640 kernel_cflags_iquote_end=$host_cflags_iquote_end
1641 if test "x-$cross_compiling" = "x-yes"; then
1642 CC="$aros_kernel_cc"
1643 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1644 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1645 AC_MSG_RESULT($use_no_stack_protector)
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 kernel_cflags_iquote=-iquote
1651 kernel_cflags_iquote_end=
1653 kernel_cflags_iquote=-I
1654 kernel_cflags_iquote_end=-I-
1657 aros_cflags_iquote=$kernel_cflags_iquote
1658 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1659 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1660 CC="$orig_target_cc"
1661 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1662 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1663 AC_MSG_RESULT($has_iquote)
1664 if test "x-$has_iquote" = "x-yes" ; then
1665 aros_cflags_iquote=-iquote
1666 aros_cflags_iquote_end=
1668 aros_cflags_iquote=-I
1669 aros_cflags_iquote_end=-I-
1672 if test "x-$use_no_stack_protector" = "x-yes" ; then
1673 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1676 #-----------------------------------------------------------------------------
1678 # Check if we can explicitly choose older version of symbol hashing
1680 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1681 CC="$aros_kernel_cc"
1682 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1683 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1684 AC_MSG_RESULT($use_hash_style)
1685 if test "x-$use_hash_style" = "x-yes" ; then
1686 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1689 CFLAGS="$save_cflags"
1691 AC_SUBST(host_cflags_iquote)
1692 AC_SUBST(host_cflags_iquote_end)
1693 AC_SUBST(kernel_cflags_iquote)
1694 AC_SUBST(kernel_cflags_iquote_end)
1695 AC_SUBST(aros_cflags_iquote)
1696 AC_SUBST(aros_cflags_iquote_end)
1699 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1700 AC_MSG_CHECKING([for default resolution of WBScreen])
1701 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1702 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1703 if test "$resolution" = "yes" ; then
1706 if test "$resolution" = "no" ; then
1709 if test "$resolution" != "none" ; then
1710 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1711 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1712 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1714 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1715 aros_cv_default_wbwidth=$aros_default_wbwidth
1716 aros_cv_default_wbheight=$aros_default_wbheight
1717 aros_cv_default_wbdepth=$aros_default_wbdepth
1719 dnl See if the user wants the serial debug output for native flavour
1720 AC_MSG_CHECKING([if serial debug is enabled])
1721 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)
1722 if test "$aros_serial_debug" = 0 ; then
1723 serial_debug_forced=""
1724 if test "$serial_debug" = "yes" ; then
1727 if test "$serial_debug" = "no" ; then
1731 serial_debug_forced="(forced)"
1732 serial_debug=$aros_serial_debug
1734 if test "$serial_debug" != "none" ; then
1735 aros_serial_debug=$serial_debug
1736 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1741 dnl See if the user wants the palm debug output hack for palm native flavour
1742 AC_MSG_CHECKING([if palm debug hack is enabled])
1743 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")
1744 if test "$palm_debug_hack" = "yes" ; then
1745 aros_palm_debug_hack="1"
1747 AC_MSG_RESULT($palm_debug_hack)
1750 dnl See if the user wants nesting supervisor activated for unix flavour
1751 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1752 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")
1753 if test "$nesting_supervisor" = "yes" ; then
1754 aros_nesting_supervisor="1"
1756 AC_MSG_RESULT($nesting_supervisor)
1759 dnl things specifically required for hosted flavours
1760 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1762 if test "x-$need_dlopen" != "x-no" ; then
1763 dnl some kind of dynamic library access system is required for hostlib.resource
1764 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1765 if test "x-$have_dl" = "x-no" ; then
1766 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1767 aros_host_ldflags="$aros_host_ldflags -ldl"],
1770 if test "x-$have_dl" = "x-no" ; then
1771 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1777 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1778 [build X11 hidd for hosted (default=auto)]),
1779 x11_hidd="$enableval",
1781 case "x-$x11_hidd" in
1782 x-yes|x-no|x-auto) ;;
1783 *) x11_hidd="auto" ;;
1789 if test "x-$x11_hidd" != "x-no" ; then
1795 for path in $x_libraries
1797 x_cflags="$x_cflags -L$path"
1800 for path in $x_includes
1802 x_cflags="$x_cflags -I$path"
1805 if test "x-$no_x" = "x-yes" ; then
1808 if test "x-$x11_hidd" != "x-auto" ; then
1809 dnl and they explicitly asked for it, bail out
1810 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1814 dnl found it, setup the metatarget
1815 x11_hidd_target=kernel-x11gfx-kobj
1818 dnl setup shared memory extensions
1819 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1820 [use X11 shared memory (default=auto)]),
1821 x11_hidd_shm="$enableval",
1822 x11_hidd_shm="auto")
1823 case "x-$x11_hidd_shm" in
1824 x-yes|x-no|x-auto) ;;
1825 *) x11_hidd_shm="auto" ;;
1831 if test "x-$x11_hidd_shm" != "x-no" ; then
1833 dnl system shm headers
1834 AC_CHECK_HEADERS(sys/ipc.h)
1835 AC_CHECK_HEADERS(sys/shm.h)
1838 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1840 dnl make sure X libs have shm functions
1841 save_cflags="$CFLAGS"
1842 CFLAGS="$CFLAGS $x_cflags"
1843 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1844 CFLAGS="$save_cflags"
1848 dnl detection done, prepare output
1849 if test "x-$have_xshm" = "x-yes" ; then
1852 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1853 dnl they explicitly asked for it, but we can't do it
1854 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1856 dnl otherwise just disable it
1861 dnl setup vidmode (fullscreen) extensions
1862 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1863 [use X11 vidmode extension (default=auto)]),
1864 x11_hidd_vidmode="$enableval",
1865 x11_hidd_vidmode="auto")
1866 case "x-$x11_hidd_vidmode" in
1867 x-yes|x-no|x-auto) ;;
1868 *) x11_hidd_vidmode="auto" ;;
1874 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1876 dnl make sure X libs have vidmode functions
1877 save_cflags="$CFLAGS"
1878 CFLAGS="$CFLAGS $x_cflags"
1879 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1880 CFLAGS="$save_cflags"
1883 dnl detection done, prepare output
1884 if test "x-$have_vidmode" = "x-yes" ; then
1885 dnl we can do vidmode
1886 DO_VIDMODE_SUPPORT="1"
1887 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1888 dnl they explicitly asked for it, but we can't do it
1889 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1891 dnl otherwise just disable it
1892 DO_VIDMODE_SUPPORT="0"
1896 aros_host_x11_includes=$x_includes
1897 aros_host_x11_libdirs=$x_libraries
1902 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1903 [build SDL hidd for hosted (default=auto)]),
1904 sdl_hidd="$enableval",
1906 case "x-$sdl_hidd" in
1907 x-yes|x-no|x-auto) ;;
1908 *) sdl_hidd="auto" ;;
1912 if test "x-$sdl_hidd" != "x-no" ; then
1915 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1917 if test "x-$have_sdl" != "x-yes" ; then
1920 if test "x-$sdl_hidd" != "x-auto" ; then
1921 dnl and they explicitly asked for it, bail out
1922 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1926 dnl found it, set up the metatarget
1927 sdl_hidd_target=kernel-hidd-sdl
1928 aros_host_sdl_cflags=SDL_CFLAGS
1929 aros_host_sdl_libs=SDL_LIBS
1934 AC_CHECK_HEADER(sys/soundcard.h)
1935 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
1936 oss_library_target=workbench-libs-oss-unix
1941 dnl See if the user wants dbus.library
1942 AC_MSG_CHECKING([if building of dbus.library is enabled])
1943 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1944 if test "$dbus" = "yes" ; then
1946 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1947 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1948 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1949 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1953 AC_MSG_RESULT($dbus)
1956 dnl --------------------------------------------------------------------
1957 dnl Configuration Output Section
1958 dnl --------------------------------------------------------------------
1963 AC_SUBST(aros_flavour)
1964 AC_SUBST(aros_flavour_uc)
1965 AC_SUBST(AROS_BUILDDIR)
1966 AC_SUBST(AROS_BUILDDIR_UNIX)
1968 AC_SUBST(AROS_PORTSSRCDIR)
1971 AC_SUBST(aros_cc_pre)
1972 AC_SUBST(aros_host_strip)
1973 AC_SUBST(aros_host_arch)
1974 AC_SUBST(aros_host_cpu)
1975 AC_SUBST(aros_host_cc)
1976 AC_SUBST(aros_host_ar)
1977 AC_SUBST(aros_host_ranlib)
1978 AC_SUBST(aros_host_ld)
1979 AC_SUBST(aros_host_make)
1980 AC_SUBST(aros_host_cflags)
1981 AC_SUBST(aros_host_ldflags)
1982 AC_SUBST(aros_host_debug)
1983 AC_SUBST(aros_host_mkdep)
1984 AC_SUBST(aros_host_mkargs)
1985 AC_SUBST(aros_host_exe_suffix)
1986 AC_SUBST(aros_host_lib_suffix)
1987 AC_SUBST(aros_tools_dir)
1988 AC_SUBST(aros_host_aclocal)
1989 AC_SUBST(aros_host_autoconf)
1990 AC_SUBST(aros_host_autoheader)
1991 AC_SUBST(aros_host_automake)
1994 AC_SUBST(aros_target_guitheme)
1995 AC_SUBST(aros_target_iconset)
1996 AC_SUBST(aros_target_bootloader)
1997 AC_SUBST(aros_target_arch)
1998 AC_SUBST(aros_target_family)
1999 AC_SUBST(aros_target_cpu)
2000 AC_SUBST(aros_target_variant)
2001 AC_SUBST(aros_target_suffix)
2002 AC_SUBST(aros_target_incl)
2003 AC_SUBST(aros_target_ar)
2004 AC_SUBST(aros_target_ranlib)
2005 AC_SUBST(aros_kernel_nm)
2006 AC_SUBST(orig_target_cc)
2007 AC_SUBST(aros_target_cc)
2008 AC_SUBST(aros_target_cxx)
2009 AC_SUBST(aros_kernel_cc)
2010 AC_SUBST(aros_target_as)
2011 AC_SUBST(orig_target_ld)
2012 AC_SUBST(aros_target_ld)
2013 AC_SUBST(aros_kernel_ld)
2014 AC_SUBST(aros_target_cc_includes)
2015 AC_SUBST(aros_target_cc_path)
2016 AC_SUBST(aros_target_objdump)
2017 AC_SUBST(aros_target_objcopy)
2018 AC_SUBST(aros_target_strip)
2019 AC_SUBST(aros_target_nm)
2020 AC_SUBST(aros_kernel_rescomp)
2021 AC_SUBST(aros_shared_default)
2022 AC_SUBST(aros_shared_ld)
2023 AC_SUBST(aros_object_format)
2024 AC_SUBST(aros_compiler_libs)
2025 AC_SUBST(aros_arch_libs)
2027 AC_SUBST(aros_config_cflags)
2028 AC_SUBST(aros_config_aflags)
2029 AC_SUBST(aros_config_ldflags)
2031 AC_SUBST(aros_shared_cflags)
2032 AC_SUBST(aros_shared_aflags)
2033 AC_SUBST(aros_shared_ldflags)
2034 AC_SUBST(aros_kernel_cflags)
2035 AC_SUBST(aros_kernel_includes)
2036 AC_SUBST(aros_kernel_objcflags)
2037 AC_SUBST(aros_kernel_ldflags)
2038 AC_SUBST(aros_debug_cflags)
2039 AC_SUBST(aros_debug_aflags)
2040 AC_SUBST(aros_debug_ldflags)
2041 AC_SUBST(aros_paranoia_cflags)
2042 AC_SUBST(aros_target_genmap)
2043 AC_SUBST(aros_target_strip_flags)
2045 AC_SUBST(crosstools_target)
2048 AC_SUBST(x11_hidd_target)
2049 AC_SUBST(sdl_hidd_target)
2050 AC_SUBST(oss_library_target)
2052 AC_SUBST(aros_default_wbwidth)
2053 AC_SUBST(aros_default_wbheight)
2054 AC_SUBST(aros_default_wbdepth)
2055 AC_SUBST(DO_XSHM_SUPPORT)
2056 AC_SUBST(DO_VIDMODE_SUPPORT)
2058 AC_SUBST(aros_host_x11_includes)
2059 AC_SUBST(aros_host_x11_libdirs)
2060 AC_SUBST(aros_host_sdl_cflags)
2061 AC_SUBST(aros_host_sdl_libs)
2063 # Native version related
2064 AC_SUBST(aros_serial_debug)
2066 # Palm native version related
2067 AC_SUBST(aros_palm_debug_hack)
2069 # Unix/Hosted version related
2070 AC_SUBST(aros_nesting_supervisor)
2073 AC_SUBST(aros_ios_platform)
2074 AC_SUBST(aros_ios_version)
2075 AC_SUBST(aros_ios_sdk)
2078 AC_SUBST(ENABLE_DBUS)
2079 AC_SUBST(DBUS_CFLAGS)
2080 AC_SUBST(DBUS_LIBFLAGS)
2081 AC_SUBST(KERNEL_DBUS_KOBJ)
2082 AC_SUBST(KERNEL_DBUS_INCLUDES)
2085 AC_SUBST(ENABLE_X11)
2088 AC_SUBST(aros_debug)
2089 AC_SUBST(aros_mungwall_debug)
2090 AC_SUBST(aros_stack_debug)
2091 AC_SUBST(aros_modules_debug)
2093 # Collect-aros stuff: "-ius" to ignore undefined symbols
2094 AC_SUBST(ignore_undefined_symbols)
2096 # C compiler related
2097 AC_SUBST(gcc_target_cpu)
2099 dnl Prepare for output, make up all the generated patches
2100 case "$aros_flavour" in
2101 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2102 aros_flavour="emulation" ;;
2103 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2104 aros_flavour="emulation" ;;
2105 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2106 aros_flavour="standalone";;
2107 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2108 aros_flavour="standalone";;
2109 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2110 aros_flavour="native" ;;
2111 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2112 aros_flavour="native" ;;
2113 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2114 aros_flavour="linklib" ;;
2115 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2116 aros_flavour="palmnative" ;;
2117 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2118 aros_flavour="mac68knative" ;;
2119 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2120 aros_flavour="ppcnative" ;;
2123 if test ! -d ${aros_inc_dir} ; then
2124 ${MKDIR} ${aros_inc_dir}
2126 if test ! -d ${aros_geninc_dir} ; then
2127 ${MKDIR} ${aros_geninc_dir}
2129 if test ! -d ${aros_hostcfg_dir} ; then
2130 ${MKDIR} ${aros_hostcfg_dir}
2132 if test ! -d ${aros_targetcfg_dir} ; then
2133 ${MKDIR} ${aros_targetcfg_dir}
2135 if test ! -d ${aros_tools_dir} ; then
2136 ${MKDIR} ${aros_tools_dir}
2138 if test ! -d ${aros_scripts_dir} ; then
2139 ${MKDIR} ${aros_scripts_dir}
2142 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2144 AC_CONFIG_COMMANDS([compiler_executable],
2146 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2148 prefix="${prefix}/${aros_target_cpu}-aros"
2149 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2153 chmod a+x ${prefix2}-gcc ${prefix2}-ld
2155 ln -sf ${prefix2}-gcc ${prefix}-gcc
2156 ln -sf ${prefix2}-ld ${prefix}-ld
2158 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix}-as
2159 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix}-nm
2160 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix}-ar
2161 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix}-ranlib
2162 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2163 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2164 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix}-strip
2166 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix2}-as
2167 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix2}-nm
2168 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix2}-ar
2169 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix2}-ranlib
2170 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2171 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2172 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix2}-strip
2175 aros_host_exe_suffix=${aros_host_exe_suffix}
2176 aros_tools_dir=${aros_tools_dir}
2177 aros_target_cpu=${aros_target_cpu}
2178 aros_target_arch=${aros_target_arch}
2179 aros_target_suffix=${aros_target_suffix}
2180 aros_target_nm_ln=${aros_target_nm_ln}
2181 aros_target_as_ln=${aros_target_as_ln}
2182 aros_target_ar_ln=${aros_target_ar_ln}
2183 aros_target_ranlib_ln=${aros_target_ranlib_ln}
2184 aros_target_objdump_ln=${aros_target_objdump_ln}
2185 aros_target_objcopy_ln=${aros_target_objcopy_ln}
2186 aros_target_strip_ln=${aros_target_strip_ln}
2189 AC_CONFIG_COMMANDS([genshared_executable],
2190 [chmod a+x ${aros_scripts_dir}/genshared],
2191 [aros_scripts_dir=${aros_scripts_dir}]
2193 AC_CONFIG_COMMANDS([genmf_executable],
2194 [chmod a+x ${aros_tools_dir}/genmf.py],
2195 [aros_tools_dir=${aros_tools_dir}]
2201 ${aros_inc_dir}/config.h:config/config.h.in
2202 ${aros_geninc_dir}/config.h:config/config.h.in
2203 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2204 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2206 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2207 ${aros_targetcfg_dir}/specs:config/specs.in
2208 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2209 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2210 ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
2211 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2212 tools/collect-aros/env.h
2217 dnl This is in order to not define SHARED_CFLAGS sometimes
2218 dnl We don't always do aros_shared_ar, aros_shared_cflags
2220 #XXX compatability...
2221 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2223 if test -n "$aros_shared_cflags" ; then
2224 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2225 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg