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"
777 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
783 aros_target_arch="pc"
784 aros_shared_default="no"
785 target_bootloader="grub2"
786 case "$target_cpu" in
788 aros_target_cpu="i386"
790 dnl If somebody hasn't already set the target object
791 dnl format, then use this value. Mostly to support
792 dnl FreeBSD cross-compilation.
793 dnl TODO: Remove when we always use our compiler.
795 if test "$aros_object_format" = "" ; then
796 aros_object_format="elf_i386"
798 aros_flavour="standalone"
799 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
800 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
801 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
802 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
803 aros_config_ldflags="-m32 -march=i486"
804 aros_kernel_ldflags="-melf_i386"
805 aros_default_wbwidth=640
806 aros_default_wbheight=480
807 gcc_target_cpu="i386"
810 aros_target_cpu="x86_64"
812 if test "$aros_object_format" = "" ; then
813 aros_object_format="elf_x86_64"
815 aros_flavour="standalone"
816 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
817 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
818 aros_kernel_ldflags=""
819 aros_default_wbwidth=640
820 aros_default_wbheight=480
821 gcc_target_cpu="x86_64"
824 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
830 aros_target_arch="prep"
831 aros_shared_default="no"
832 aros_target_cpu="ppc"
833 aros_object_format="elf32ppc"
834 aros_flavour="ppcnative"
835 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
836 aros_kernel_ldflags=""
837 aros_default_wbwidth=640
838 aros_default_wbheight=480
843 aros_target_arch="freebsd"
844 aros_target_family="unix"
845 aros_target_cpu="i386"
846 aros_flavour="emulation"
847 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
848 gcc_target_cpu="i386"
850 aros_target_strip_flags="-x"
854 aros_target_arch="darwin"
855 aros_target_family="unix"
856 aros_flavour="emulation"
857 case "$target_cpu" in
859 aros_target_cpu="i386"
860 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
861 aros_kernel_cflags="$aros_kernel_cflags -m32"
862 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
863 aros_default_wbdepth=8
864 gcc_target_cpu="i386"
865 aros_object_format="elf_i386"
866 aros_target_strip_flags="-x"
867 aros_target_cc="i386-aros-gcc"
868 aros_target_cxx="i386-aros-g++"
869 aros_target_ld="i386-aros-ld"
870 aros_target_as="i386-aros-as"
871 aros_target_ar="i386-aros-ar"
872 aros_target_ranlib="i386-aros-ranlib"
873 aros_target_nm="i386-aros-nm"
874 aros_target_strip="i386-aros-strip"
875 aros_target_objcopy="i386-aros-objcopy"
876 aros_target_objdump="i386-aros-objdump"
877 target_tool_prefix="i686-apple-darwin10-"
880 aros_target_cpu="x86_64"
881 aros_object_format="elf_x86_64"
882 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
883 aros_kernel_cflags="$aros_kernel_cflags -m64"
884 aros_kernel_ldflags="$aros_kernel_ldflags -m64"
885 aros_default_wbdepth=8
886 gcc_target_cpu="x86_64"
887 aros_target_cc="x86_64-aros-gcc"
888 aros_target_cxx="x86_64-aros-g++"
889 aros_target_ld="x86_64-aros-ld"
890 aros_target_as="x86_64-aros-as"
891 aros_target_ar="x86_64-aros-ar"
892 aros_target_ranlib="x86_64-aros-ranlib"
893 aros_target_nm="x86_64-aros-nm"
894 aros_target_strip="x86_64-aros-strip"
895 aros_target_objcopy="x86_64-aros-objcopy"
896 aros_target_objdump="x86_64-aros-objdump"
897 target_tool_prefix="i686-apple-darwin10-"
900 aros_target_cpu="ppc"
901 aros_object_format="elf32_ppc"
902 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
903 aros_default_wbdepth=8
905 aros_target_cc="ppc-aros-gcc"
906 aros_target_cxx="ppc-aros-g++"
907 aros_target_ld="ppc-aros-ld"
908 aros_target_as="ppc-aros-as"
909 aros_target_ar="ppc-aros-ar"
910 aros_target_ranlib="ppc-aros-ranlib"
911 aros_target_nm="ppc-aros-nm"
912 aros_target_strip="ppc-aros-strip"
913 aros_target_objcopy="ppc-aros-objcopy"
914 aros_target_objdump="ppc-aros-objdump"
915 target_tool_prefix="powerpc-apple-darwin10-"
918 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
924 aros_target_arch="ios"
925 aros_target_family="unix"
926 aros_flavour="emulation"
927 # This is here because it may depend on iOS or SDK version
928 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
929 case "$target_cpu" in
931 aros_ios_platform="iPhoneSimulator"
932 aros_target_cpu="i386"
933 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
934 aros_default_wbdepth=8
935 gcc_target_cpu="i386"
936 aros_object_format="elf_i386"
937 aros_target_strip_flags="-x"
938 aros_target_cc="i386-aros-gcc"
939 aros_target_cxx="i386-aros-g++"
940 aros_target_ld="i386-aros-ld"
941 aros_target_as="i386-aros-as"
942 aros_target_ar="i386-aros-ar"
943 aros_target_ranlib="i386-aros-ranlib"
944 aros_target_nm="i386-aros-nm"
945 aros_target_strip="i386-aros-strip"
946 aros_target_objcopy="i386-aros-objcopy"
947 aros_target_objdump="i386-aros-objdump"
948 target_tool_prefix="i686-apple-darwin10-"
949 target_tool_flags="-m32"
952 aros_ios_platform="iPhoneOS"
953 aros_target_cpu="arm"
954 aros_object_format="armelf_linux_eabi"
955 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
956 aros_config_cflags="$aros_config_cflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
957 aros_config_aflags="$aros_config_aflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
958 aros_arch_libs="-laeabi"
959 aros_default_wbdepth=8
961 aros_kernel_ld="ld -arch armv6"
962 aros_target_cc="arm-aros-gcc"
963 aros_target_cxx="arm-aros-g++"
964 aros_target_ld="arm-aros-ld"
965 aros_target_as="arm-aros-as"
966 aros_target_ar="arm-aros-ar"
967 aros_target_ranlib="arm-aros-ranlib"
968 aros_target_nm="arm-aros-nm"
969 aros_target_strip="arm-aros-strip"
970 aros_target_objcopy="arm-aros-objcopy"
971 aros_target_objdump="arm-aros-objdump"
972 target_tool_prefix="arm-apple-darwin10-"
973 aros_default_wbwidth=320
974 aros_default_wbheight=480
975 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
978 AC_MSG_ERROR("Unsupported target CPU for iOS hosted flavour -- $target_cpu")
981 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
982 target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
986 aros_target_arch="dragonfly"
987 aros_target_family="unix"
988 aros_flavour="emulation"
989 case "$target_cpu" in
991 aros_target_cpu="i386"
992 aros_object_format="elf_i386"
993 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
996 aros_target_cpu="x86_64"
997 aros_object_format="elf_x86_64"
998 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1001 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1007 aros_target_arch="netbsd"
1008 aros_target_family="unix"
1009 case "$target_cpu" in
1011 aros_target_cpu="m68k"
1012 aros_object_format="m68kelf"
1013 aros_flavour="emulcompat"
1014 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1015 gcc_target_cpu="mc68000"
1018 aros_target_cpu="i386"
1019 aros_object_format="elf_i386"
1020 aros_flavour="emulation"
1021 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1022 aros_default_wbdepth=8
1023 gcc_target_cpu="i386"
1026 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1029 aros_target_genmap="-Wl,-M -Xlinker >"
1030 aros_flavour="emulation"
1031 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1035 aros_target_arch="openbsd"
1036 aros_target_family="unix"
1037 case "$target_cpu" in
1039 aros_target_cpu="i386"
1040 aros_object_format="elf_i386"
1041 aros_flavour="emulation"
1042 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1043 gcc_target_cpu="i386"
1046 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1049 aros_target_genmap="-Wl,-M -Xlinker >"
1050 aros_target_nm_flags="-u"
1051 aros_flavour="emulation"
1055 aros_target_arch="solaris"
1056 aros_target_family="unix"
1057 case "$target_cpu" in
1059 aros_target_cpu="i386"
1060 aros_object_format="elf_i386"
1061 aros_flavour="emulation"
1062 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1063 aros_default_wbdepth=8
1064 gcc_target_cpu="i386"
1067 aros_target_cpu="sparc"
1068 aros_object_format="elf_sparc"
1069 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1070 gcc_target_cpu="sparc"
1073 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1076 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1077 aros_flavour="emulation"
1081 aros_target_arch="morphos"
1082 aros_shared_default="no"
1083 aros_target_cpu="ppc"
1084 aros_object_format="elf_ppc"
1085 aros_flavour="nativecompat"
1086 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1087 gcc_target_cpu="ppc"
1091 aros_target_arch="sam440"
1092 aros_shared_default="no"
1093 aros_target_cpu="ppc"
1094 aros_object_format="elf32ppc"
1095 aros_flavour="ppcnative"
1096 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1097 aros_kernel_ldflags=""
1098 aros_default_wbwidth=1024
1099 aros_default_wbheight=768
1100 aros_default_wbdepth=24
1101 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1102 gcc_target_cpu="powerpc"
1106 aros_target_arch="efika"
1107 aros_shared_default="no"
1108 aros_target_cpu="arm"
1109 aros_object_format="armelf_linux_eabi"
1110 aros_flavour="standalone"
1111 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1112 aros_kernel_ldflags=""
1113 aros_default_wbwidth=1024
1114 aros_default_wbheight=600
1115 aros_arch_libs="-laeabi"
1116 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"
1117 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"
1121 aros_target_arch="chrp"
1122 aros_shared_default="no"
1123 aros_target_cpu="ppc"
1124 aros_object_format="elf32ppc"
1125 aros_flavour="ppcnative"
1126 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1127 aros_kernel_ldflags=""
1128 aros_default_wbwidth=640
1129 aros_default_wbheight=480
1130 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1131 gcc_target_cpu="powerpc"
1132 case "$aros_target_variant" in
1134 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1140 aros_target_arch="amiga"
1141 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1142 aros_shared_default="no"
1144 case "$target_cpu" in
1146 aros_target_cpu="m68k"
1147 aros_object_format="m68kelf"
1148 aros_flavour="standalone"
1149 gcc_target_cpu="mc68000"
1150 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1151 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1152 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1153 target_tool_prefix="m68k-elf-"
1154 aros_target_nostdlib_ldflags="" # We always need -lgcc
1155 aros_target_strip_flags="-R.comment"
1158 aros_target_cpu="m68k"
1159 aros_object_format="m68kelf"
1160 aros_flavour="standcompat"
1161 gcc_target_cpu="mc68000"
1162 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var"
1163 aros_config_aflags="$aros_config_aflags -g3 -${gcc_target_cpu}"
1164 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1165 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1166 target_tool_prefix="m68k-elf-"
1167 aros_target_nostdlib_ldflags="" # We always need -lgcc
1168 aros_target_strip_flags="-R.comment"
1172 aros_flavour="native"
1173 gcc_target_cpu="ppc"
1176 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1182 aros_target_arch="mingw32"
1183 aros_shared_default="no"
1184 aros_flavour="emulation"
1185 aros_shared_cflags=""
1188 case "$target_cpu" in
1190 aros_target_cpu="i386"
1191 aros_object_format="elf_i386"
1192 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1193 aros_default_wbdepth=8
1194 gcc_target_cpu="i386"
1195 aros_target_cc="i386-aros-gcc"
1196 aros_target_cxx="i386-aros-g++"
1197 aros_target_ld="i386-aros-ld"
1198 aros_target_as="i386-aros-as"
1199 aros_target_ar="i386-aros-ar"
1200 aros_target_ranlib="i386-aros-ranlib"
1201 aros_target_nm="i386-aros-nm"
1202 aros_target_strip="i386-aros-strip"
1203 aros_target_objcopy="i386-aros-objcopy"
1204 aros_target_objdump="i386-aros-objdump"
1205 target_tool_prefix="i386-mingw32-"
1208 aros_target_cpu="x86_64"
1209 aros_object_format="elf_x86_64"
1210 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1211 aros_default_wbdepth=8
1212 gcc_target_cpu="x86_64"
1213 aros_target_cc="x86_64-aros-gcc"
1214 aros_target_cxx="x86_64-aros-g++"
1215 aros_target_ld="x86_64-aros-ld"
1216 aros_target_as="x86_64-aros-as"
1217 aros_target_ar="x86_64-aros-ar"
1218 aros_target_ranlib="x86_64-aros-ranlib"
1219 aros_target_nm="x86_64-aros-nm"
1220 aros_target_strip="x86_64-aros-strip"
1221 aros_target_objcopy="x86_64-aros-objcopy"
1222 aros_target_objdump="x86_64-aros-objdump"
1223 target_tool_prefix="x86_64-w64-mingw32-"
1226 aros_target_cpu="arm"
1227 aros_object_format="armelf_linux_eabi"
1228 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1229 aros_arch_libs="-laeabi"
1230 aros_default_wbdepth=8
1231 gcc_target_cpu="arm"
1232 aros_target_cc="arm-aros-gcc"
1233 aros_target_cxx="arm-aros-g++"
1234 aros_target_ld="arm-aros-ld"
1235 aros_target_as="arm-aros-as"
1236 aros_target_ar="arm-aros-ar"
1237 aros_target_ranlib="arm-aros-ranlib"
1238 aros_target_nm="arm-aros-nm"
1239 aros_target_strip="arm-aros-strip"
1240 aros_target_objcopy="arm-aros-objcopy"
1241 aros_target_objdump="arm-aros-objdump"
1242 target_tool_prefix="arm-mingw32ce-"
1243 aros_default_wbwidth=160
1244 aros_default_wbheight=160
1247 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1250 if test $host_os = "cygwin"; then
1251 aros_kernel_cflags="-mno-cygwin"
1255 aros_target_arch="pp"
1256 aros_shared_default="no"
1257 case "$target_cpu" in
1259 aros_target_cpu="m68k"
1260 aros_object_format="m68kelf"
1261 aros_flavour="palmnative"
1262 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1263 aros_default_wbwidth=160
1264 aros_default_wbheight=160
1265 aros_default_wbdepth=1
1266 aros_target_ar_flags="cru"
1267 aros_compiler_libs="-lgcc1"
1268 aros_shared_default=no
1269 aros_shared_cflags="-fpic"
1270 aros_shared_aflags=""
1271 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1272 aros_kernel_ldflags="-Wl,-rpath,./lib"
1273 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1274 aros_debug_aflags=""
1275 aros_debug_ldflags="$aros_symbols_debug"
1276 aros_mungwall_debug="0"
1277 aros_modules_debug="0"
1278 gcc_target_cpu="mc68000"
1279 ignore_undefined_symbols="-ius"
1282 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1288 aros_target_arch="mac"
1289 aros_shared_default="no"
1290 case "$target_cpu" in
1292 aros_target_cpu="m68k"
1293 aros_object_format="m68kelf"
1294 aros_flavour="mac68knative"
1295 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1296 aros_default_wbwidth=512
1297 aros_default_wbheight=384
1298 aros_default_wbdepth=8
1299 aros_target_ar_flags="cru"
1300 aros_compiler_libs="-lgcc1"
1301 aros_shared_default=no
1302 aros_shared_cflags="-fpic"
1303 aros_shared_aflags=""
1304 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1305 aros_kernel_ldflags="-Wl,-rpath,./lib"
1306 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
1307 aros_debug_aflags=""
1308 aros_debug_ldflags="$aros_symbols_debug"
1309 aros_mungwall_debug="0"
1310 aros_modules_debug="0"
1311 gcc_target_cpu="mc68000"
1312 ignore_undefined_symbols="-ius"
1315 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1321 AC_MSG_ERROR([Unsupported target architecture $target])
1325 # FIXME: for cross-compiling this should point to another location
1326 if test "$aros_flavour" = "emulation"; then
1327 aros_kernel_includes="-isystem /usr/include"
1329 if test "$aros_flavour" = "emulcompat"; then
1330 aros_kernel_includes="-isystem /usr/include"
1333 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1334 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1335 if test "$with_portssrcdir" = "default"; then
1336 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1338 AROS_PORTSSRCDIR="$with_portssrcdir"
1340 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1342 AC_MSG_CHECKING([which bootloader to use])
1343 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1344 if test "$target_bootloader" = "none"; then
1345 aros_target_bootloader=""
1347 aros_target_bootloader="$target_bootloader"
1349 AC_MSG_RESULT($target_bootloader)
1351 AC_MSG_CHECKING([which icon-set to use])
1352 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1353 if test "$target_iconset" = "default"; then
1354 aros_target_iconset="Gorilla"
1355 target_iconset="default (Gorilla)"
1357 aros_target_iconset="$target_iconset"
1359 AC_MSG_RESULT($target_iconset)
1361 AC_MSG_CHECKING([which GUI Theme to use])
1362 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1363 if test "$target_guitheme" = "default"; then
1364 aros_target_guitheme="Ice"
1366 aros_target_guitheme="$target_guitheme"
1368 AC_MSG_RESULT($aros_target_guitheme)
1370 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1373 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1376 if test "$aros_host_cpu" == "x86_64" ; then
1377 if test "$aros_target_cpu" == "i386" ; then
1378 if test "$aros_target_arch" != "mingw32"; then
1384 # Set prefix for target compiler etc. if we're cross-compiling
1385 # (should possibly be earlier but needs to be after AC_PROG_CC)
1386 if test "$cross_compiling" = "yes" ; then
1387 if test "$target_tool_prefix" = ""; then
1388 target_tool_prefix=${target_cpu}-elf-
1390 CC=${target_tool_prefix}gcc
1391 dnl CPP is needed for AC_CHECK_HEADER to work correctly
1392 CPP=${target_tool_prefix}cpp
1393 if test "$target_tool_version" != "default"; then
1394 CC="$CC-$target_tool_version"
1395 CPP="$CC-$target_tool_version"
1397 AC_PATH_PROG(CC,$CC)
1398 AROS_REQUIRED(gcc,$CC)
1400 CC="$CC $target_tool_flags"
1402 #-----------------------------------------------------------------------------
1404 # Disable pointer-signedness warnings if the compiler recognises the option
1406 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1407 save_cflags="$CFLAGS"
1408 CFLAGS="$CFLAGS -Wno-pointer-sign"
1409 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1410 AC_MSG_RESULT($use_no_sign_warning)
1411 if test "x-$use_no_sign_warning" = "x-yes" ; then
1412 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1414 CFLAGS="$save_cflags"
1416 #-----------------------------------------------------------------------------
1418 # Find all the tools we need to compile. This could be cross-compiling
1419 # though! If that is the case we use the GNU form of the target and
1420 # simply add this to the front of the binary name. This is rather simple,
1421 # but it should work under most circumstances.
1423 # The default tools are to use the same as the host, but only if the
1424 # host and target CPU are the same. With GCC this is normally enough.
1428 aros_shared_ld="$aros_host_ld"
1430 aros_target_mkdep="$aros_host_mkdep"
1431 aros_target_incl_def="$aros_host_incl"
1433 aros_kernel_cc="$CC"
1435 # The default tools executables to be linked to.
1436 if test "$aros_target_cc" != ""; then
1437 AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1438 AROS_REQUIRED(gcc,$aros_target_cc)
1440 if test "$aros_target_ld" != ""; then
1441 AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1442 AROS_REQUIRED(ld,$aros_target_ld)
1445 if test "$crosstools" != "yes"; then
1446 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1447 AROS_REQUIRED(as,$aros_target_as_ln)
1448 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1449 AROS_REQUIRED(ld,$aros_kernel_ld)
1450 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1451 AROS_REQUIRED(ar,$aros_target_ar_ln)
1452 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1453 AROS_REQUIRED(nm,$aros_target_nm_ln)
1454 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1455 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1456 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1457 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1458 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1459 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1460 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1461 AROS_REQUIRED(strip,$aros_target_strip_ln)
1462 if test "$aros_target_cxx" != ""; then
1463 AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1464 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1465 # AROS_REQUIRED(c++,$aros_target_cxx)
1468 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1472 # Build crosstools if we have no C++ - temporary thing
1473 if test "$aros_target_cxx" = ""; then
1474 crosstools_target=tools-crosstools
1477 if test "$rescomp" != ""; then
1478 if test "$cross_compiling" = "yes" ; then
1479 rescomp=${target_tool_prefix}${rescomp}
1481 AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1482 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1485 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1486 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1487 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1488 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1489 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1490 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1491 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1493 # aros_cc_pre is a variable that is added to the front of the compiler name
1494 # in the generated aros-gcc shell script. We need this to enable the cache
1495 # to work across cleaned builds. Also, support DISTCC using the correct
1496 # environment variable.
1499 if test "x${DISTCC}" != "x" ; then
1500 if test "x${CCACHE}" != "x" ; then
1501 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1503 aros_cc_pre="${DISTCC} "
1506 if test "x${CCACHE}" != "x" ; then
1507 aros_cc_pre="${CCACHE} "
1511 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1513 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1514 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1515 AC_SUBST(aros_target_nix_ldflags,-nix)
1516 AC_SUBST(aros_target_detach_ldflags,-detach)
1517 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1520 if test "$aros_target_cc" = ""; then
1521 orig_target_cc=$aros_kernel_cc
1523 orig_target_cc=$aros_target_cc
1525 if test "$aros_target_ld" = ""; then
1526 orig_target_ld=$aros_kernel_ld
1528 orig_target_ld=$aros_target_ld
1530 if test "$GCC" = "yes"; then
1531 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1533 aros_target_cc="${prefix}-gcc"
1534 aros_target_as="${prefix}-as"
1535 aros_target_ld="${prefix}-ld"
1536 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1537 aros_target_objcopy=${prefix}-objcopy
1538 aros_target_objdump=${prefix}-objdump
1539 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1540 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1541 aros_kernel_nm="${prefix}-nm"
1542 aros_target_strip=${prefix}-strip
1544 # Find the system include path. We can suggest that an alternative is
1545 # used if we don't get it correct. The default is to use /usr/include.
1546 # Which is set in the aros_target_incl_def variable.
1548 AC_ARG_ENABLE(includes,
1549 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1550 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1552 if test "$aros_kernel_includes" != "" ; then
1553 dnl find out about the kernel cc's include path
1554 AC_MSG_CHECKING([for the kernel compiler's include path])
1555 if test "$aros_kernel_cc_includes" = "" ; then
1556 # Try to guess where the directory is.
1557 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1558 if ! test -d $aros_kernel_cc_includes; then
1559 # The directory doesn't exist, we need to do some more work.
1560 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1562 # These are the headers we're looking for.
1563 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1564 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1568 for h in $headers; do
1569 # Which other headers are needed by each of the above?
1570 deps=$(echo "#include <$h>" | \
1571 $aros_kernel_cc -E -M - 2>/dev/null | \
1572 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1574 # Copy all the needed headers to a directory beneath gendir.
1577 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1578 sed -n "s,^.*/include\(/.*\),\1,p")
1579 ! test -d $dir && mkdir -p $dir
1580 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1585 AC_MSG_RESULT($aros_kernel_cc_includes)
1586 # Adding -nostdinc to kernel includes as they are always used together.
1587 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1590 dnl find out about the target cc's include path
1591 AC_MSG_CHECKING([for the target compiler's include path])
1592 if test "$aros_target_cc_includes" = "" ; then
1593 #try to guess where the directory is
1594 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1595 if ! test -d $aros_target_cc_includes; then
1596 #the directory doesn't exist, we need to do some more work
1597 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1599 #these are the headers we're looling for
1600 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1601 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1605 for h in $headers; do
1606 #which other headers each of the above headers needs?
1607 deps=$(echo "#include <$h>" | \
1608 $orig_target_cc -E -M - 2>/dev/null | \
1609 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1611 #copy all the needed headers to a directory beneath gendir
1614 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1615 sed -n "s,^.*/include\(/.*\),\1,p")
1616 ! test -d $dir && mkdir -p $dir
1617 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1622 AC_MSG_RESULT($aros_target_cc_includes)
1625 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1626 # On GCC >= 4.0 -iquote should be used
1630 save_cflags="$CFLAGS"
1632 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1633 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1634 AC_MSG_RESULT($has_iquote)
1635 if test "x-$has_iquote" = "x-yes" ; then
1636 host_cflags_iquote=-iquote
1637 host_cflags_iquote_end=
1639 host_cflags_iquote=-I
1640 host_cflags_iquote_end=-I-
1642 kernel_cflags_iquote=$host_cflags_iquote
1643 kernel_cflags_iquote_end=$host_cflags_iquote_end
1644 if test "x-$cross_compiling" = "x-yes"; then
1645 CC="$aros_kernel_cc"
1646 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1647 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1648 AC_MSG_RESULT($use_no_stack_protector)
1649 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1650 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1651 AC_MSG_RESULT($has_iquote)
1652 if test "x-$has_iquote" = "x-yes" ; then
1653 kernel_cflags_iquote=-iquote
1654 kernel_cflags_iquote_end=
1656 kernel_cflags_iquote=-I
1657 kernel_cflags_iquote_end=-I-
1660 aros_cflags_iquote=$kernel_cflags_iquote
1661 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1662 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1663 CC="$orig_target_cc"
1664 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1665 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1666 AC_MSG_RESULT($has_iquote)
1667 if test "x-$has_iquote" = "x-yes" ; then
1668 aros_cflags_iquote=-iquote
1669 aros_cflags_iquote_end=
1671 aros_cflags_iquote=-I
1672 aros_cflags_iquote_end=-I-
1675 if test "x-$use_no_stack_protector" = "x-yes" ; then
1676 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1679 #-----------------------------------------------------------------------------
1681 # Check if we can explicitly choose older version of symbol hashing
1683 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1684 CC="$aros_kernel_cc"
1685 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1686 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1687 AC_MSG_RESULT($use_hash_style)
1688 if test "x-$use_hash_style" = "x-yes" ; then
1689 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1692 CFLAGS="$save_cflags"
1694 AC_SUBST(host_cflags_iquote)
1695 AC_SUBST(host_cflags_iquote_end)
1696 AC_SUBST(kernel_cflags_iquote)
1697 AC_SUBST(kernel_cflags_iquote_end)
1698 AC_SUBST(aros_cflags_iquote)
1699 AC_SUBST(aros_cflags_iquote_end)
1702 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1703 AC_MSG_CHECKING([for default resolution of WBScreen])
1704 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1705 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1706 if test "$resolution" = "yes" ; then
1709 if test "$resolution" = "no" ; then
1712 if test "$resolution" != "none" ; then
1713 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1714 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1715 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1717 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1718 aros_cv_default_wbwidth=$aros_default_wbwidth
1719 aros_cv_default_wbheight=$aros_default_wbheight
1720 aros_cv_default_wbdepth=$aros_default_wbdepth
1722 dnl See if the user wants the serial debug output for native flavour
1723 AC_MSG_CHECKING([if serial debug is enabled])
1724 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)
1725 if test "$aros_serial_debug" = 0 ; then
1726 serial_debug_forced=""
1727 if test "$serial_debug" = "yes" ; then
1730 if test "$serial_debug" = "no" ; then
1734 serial_debug_forced="(forced)"
1735 serial_debug=$aros_serial_debug
1737 if test "$serial_debug" != "none" ; then
1738 aros_serial_debug=$serial_debug
1739 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1744 dnl See if the user wants the palm debug output hack for palm native flavour
1745 AC_MSG_CHECKING([if palm debug hack is enabled])
1746 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")
1747 if test "$palm_debug_hack" = "yes" ; then
1748 aros_palm_debug_hack="1"
1750 AC_MSG_RESULT($palm_debug_hack)
1753 dnl See if the user wants nesting supervisor activated for unix flavour
1754 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1755 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")
1756 if test "$nesting_supervisor" = "yes" ; then
1757 aros_nesting_supervisor="1"
1759 AC_MSG_RESULT($nesting_supervisor)
1762 dnl things specifically required for hosted flavours
1763 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1765 if test "x-$need_dlopen" != "x-no" ; then
1766 dnl some kind of dynamic library access system is required for hostlib.resource
1767 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1768 if test "x-$have_dl" = "x-no" ; then
1769 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1770 aros_host_ldflags="$aros_host_ldflags -ldl"],
1773 if test "x-$have_dl" = "x-no" ; then
1774 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1780 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1781 [build X11 hidd for hosted (default=auto)]),
1782 x11_hidd="$enableval",
1784 case "x-$x11_hidd" in
1785 x-yes|x-no|x-auto) ;;
1786 *) x11_hidd="auto" ;;
1792 if test "x-$x11_hidd" != "x-no" ; then
1798 for path in $x_libraries
1800 x_cflags="$x_cflags -L$path"
1803 for path in $x_includes
1805 x_cflags="$x_cflags -I$path"
1808 if test "x-$no_x" = "x-yes" ; then
1811 if test "x-$x11_hidd" != "x-auto" ; then
1812 dnl and they explicitly asked for it, bail out
1813 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1817 dnl found it, setup the metatarget
1818 x11_hidd_target=kernel-x11gfx-kobj
1821 dnl setup shared memory extensions
1822 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1823 [use X11 shared memory (default=auto)]),
1824 x11_hidd_shm="$enableval",
1825 x11_hidd_shm="auto")
1826 case "x-$x11_hidd_shm" in
1827 x-yes|x-no|x-auto) ;;
1828 *) x11_hidd_shm="auto" ;;
1834 if test "x-$x11_hidd_shm" != "x-no" ; then
1836 dnl system shm headers
1837 AC_CHECK_HEADERS(sys/ipc.h)
1838 AC_CHECK_HEADERS(sys/shm.h)
1841 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1843 dnl make sure X libs have shm functions
1844 save_cflags="$CFLAGS"
1845 CFLAGS="$CFLAGS $x_cflags"
1846 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1847 CFLAGS="$save_cflags"
1851 dnl detection done, prepare output
1852 if test "x-$have_xshm" = "x-yes" ; then
1855 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1856 dnl they explicitly asked for it, but we can't do it
1857 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1859 dnl otherwise just disable it
1864 dnl setup vidmode (fullscreen) extensions
1865 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1866 [use X11 vidmode extension (default=auto)]),
1867 x11_hidd_vidmode="$enableval",
1868 x11_hidd_vidmode="auto")
1869 case "x-$x11_hidd_vidmode" in
1870 x-yes|x-no|x-auto) ;;
1871 *) x11_hidd_vidmode="auto" ;;
1877 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1879 dnl make sure X libs have vidmode functions
1880 save_cflags="$CFLAGS"
1881 CFLAGS="$CFLAGS $x_cflags"
1882 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1883 CFLAGS="$save_cflags"
1886 dnl detection done, prepare output
1887 if test "x-$have_vidmode" = "x-yes" ; then
1888 dnl we can do vidmode
1889 DO_VIDMODE_SUPPORT="1"
1890 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1891 dnl they explicitly asked for it, but we can't do it
1892 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1894 dnl otherwise just disable it
1895 DO_VIDMODE_SUPPORT="0"
1899 aros_host_x11_includes=$x_includes
1900 aros_host_x11_libdirs=$x_libraries
1905 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1906 [build SDL hidd for hosted (default=auto)]),
1907 sdl_hidd="$enableval",
1909 case "x-$sdl_hidd" in
1910 x-yes|x-no|x-auto) ;;
1911 *) sdl_hidd="auto" ;;
1915 if test "x-$sdl_hidd" != "x-no" ; then
1918 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1920 if test "x-$have_sdl" != "x-yes" ; then
1923 if test "x-$sdl_hidd" != "x-auto" ; then
1924 dnl and they explicitly asked for it, bail out
1925 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1929 dnl found it, set up the metatarget
1930 sdl_hidd_target=kernel-hidd-sdl
1931 aros_host_sdl_cflags=SDL_CFLAGS
1932 aros_host_sdl_libs=SDL_LIBS
1937 AC_CHECK_HEADER(sys/soundcard.h)
1938 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
1939 oss_library_target=workbench-libs-oss-unix
1944 dnl See if the user wants dbus.library
1945 AC_MSG_CHECKING([if building of dbus.library is enabled])
1946 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1947 if test "$dbus" = "yes" ; then
1949 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1950 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1951 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1952 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1956 AC_MSG_RESULT($dbus)
1959 dnl --------------------------------------------------------------------
1960 dnl Configuration Output Section
1961 dnl --------------------------------------------------------------------
1966 AC_SUBST(aros_flavour)
1967 AC_SUBST(aros_flavour_uc)
1968 AC_SUBST(AROS_BUILDDIR)
1969 AC_SUBST(AROS_BUILDDIR_UNIX)
1971 AC_SUBST(AROS_PORTSSRCDIR)
1974 AC_SUBST(aros_cc_pre)
1975 AC_SUBST(aros_host_strip)
1976 AC_SUBST(aros_host_arch)
1977 AC_SUBST(aros_host_cpu)
1978 AC_SUBST(aros_host_cc)
1979 AC_SUBST(aros_host_ar)
1980 AC_SUBST(aros_host_ranlib)
1981 AC_SUBST(aros_host_ld)
1982 AC_SUBST(aros_host_make)
1983 AC_SUBST(aros_host_cflags)
1984 AC_SUBST(aros_host_ldflags)
1985 AC_SUBST(aros_host_debug)
1986 AC_SUBST(aros_host_mkdep)
1987 AC_SUBST(aros_host_mkargs)
1988 AC_SUBST(aros_host_exe_suffix)
1989 AC_SUBST(aros_host_lib_suffix)
1990 AC_SUBST(aros_tools_dir)
1991 AC_SUBST(aros_host_aclocal)
1992 AC_SUBST(aros_host_autoconf)
1993 AC_SUBST(aros_host_autoheader)
1994 AC_SUBST(aros_host_automake)
1997 AC_SUBST(aros_target_guitheme)
1998 AC_SUBST(aros_target_iconset)
1999 AC_SUBST(aros_target_bootloader)
2000 AC_SUBST(aros_target_arch)
2001 AC_SUBST(aros_target_family)
2002 AC_SUBST(aros_target_cpu)
2003 AC_SUBST(aros_target_variant)
2004 AC_SUBST(aros_target_suffix)
2005 AC_SUBST(aros_target_incl)
2006 AC_SUBST(aros_target_ar)
2007 AC_SUBST(aros_target_ranlib)
2008 AC_SUBST(aros_kernel_nm)
2009 AC_SUBST(orig_target_cc)
2010 AC_SUBST(aros_target_cc)
2011 AC_SUBST(aros_target_cxx)
2012 AC_SUBST(aros_kernel_cc)
2013 AC_SUBST(aros_target_as)
2014 AC_SUBST(orig_target_ld)
2015 AC_SUBST(aros_target_ld)
2016 AC_SUBST(aros_kernel_ld)
2017 AC_SUBST(aros_target_cc_includes)
2018 AC_SUBST(aros_target_cc_path)
2019 AC_SUBST(aros_target_objdump)
2020 AC_SUBST(aros_target_objcopy)
2021 AC_SUBST(aros_target_strip)
2022 AC_SUBST(aros_target_nm)
2023 AC_SUBST(aros_kernel_rescomp)
2024 AC_SUBST(aros_shared_default)
2025 AC_SUBST(aros_shared_ld)
2026 AC_SUBST(aros_object_format)
2027 AC_SUBST(aros_compiler_libs)
2028 AC_SUBST(aros_arch_libs)
2030 AC_SUBST(aros_config_cflags)
2031 AC_SUBST(aros_config_aflags)
2032 AC_SUBST(aros_config_ldflags)
2034 AC_SUBST(aros_shared_cflags)
2035 AC_SUBST(aros_shared_aflags)
2036 AC_SUBST(aros_shared_ldflags)
2037 AC_SUBST(aros_kernel_cflags)
2038 AC_SUBST(aros_kernel_includes)
2039 AC_SUBST(aros_kernel_objcflags)
2040 AC_SUBST(aros_kernel_ldflags)
2041 AC_SUBST(aros_debug_cflags)
2042 AC_SUBST(aros_debug_aflags)
2043 AC_SUBST(aros_debug_ldflags)
2044 AC_SUBST(aros_paranoia_cflags)
2045 AC_SUBST(aros_target_genmap)
2046 AC_SUBST(aros_target_strip_flags)
2048 AC_SUBST(crosstools_target)
2051 AC_SUBST(x11_hidd_target)
2052 AC_SUBST(sdl_hidd_target)
2053 AC_SUBST(pci_hidd_target)
2054 AC_SUBST(oss_library_target)
2056 AC_SUBST(aros_default_wbwidth)
2057 AC_SUBST(aros_default_wbheight)
2058 AC_SUBST(aros_default_wbdepth)
2059 AC_SUBST(DO_XSHM_SUPPORT)
2060 AC_SUBST(DO_VIDMODE_SUPPORT)
2062 AC_SUBST(aros_host_x11_includes)
2063 AC_SUBST(aros_host_x11_libdirs)
2064 AC_SUBST(aros_host_sdl_cflags)
2065 AC_SUBST(aros_host_sdl_libs)
2067 # Native version related
2068 AC_SUBST(aros_serial_debug)
2070 # Palm native version related
2071 AC_SUBST(aros_palm_debug_hack)
2073 # Unix/Hosted version related
2074 AC_SUBST(aros_nesting_supervisor)
2077 AC_SUBST(aros_ios_platform)
2078 AC_SUBST(aros_ios_version)
2079 AC_SUBST(aros_ios_sdk)
2082 AC_SUBST(ENABLE_DBUS)
2083 AC_SUBST(DBUS_CFLAGS)
2084 AC_SUBST(DBUS_LIBFLAGS)
2085 AC_SUBST(KERNEL_DBUS_KOBJ)
2086 AC_SUBST(KERNEL_DBUS_INCLUDES)
2089 AC_SUBST(ENABLE_X11)
2092 AC_SUBST(aros_debug)
2093 AC_SUBST(aros_mungwall_debug)
2094 AC_SUBST(aros_stack_debug)
2095 AC_SUBST(aros_modules_debug)
2097 # Collect-aros stuff: "-ius" to ignore undefined symbols
2098 AC_SUBST(ignore_undefined_symbols)
2100 # C compiler related
2101 AC_SUBST(gcc_target_cpu)
2103 dnl Prepare for output, make up all the generated patches
2104 case "$aros_flavour" in
2105 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2106 aros_flavour="emulation" ;;
2107 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2108 aros_flavour="emulation" ;;
2109 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2110 aros_flavour="standalone";;
2111 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2112 aros_flavour="standalone";;
2113 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2114 aros_flavour="native" ;;
2115 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2116 aros_flavour="native" ;;
2117 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2118 aros_flavour="linklib" ;;
2119 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2120 aros_flavour="palmnative" ;;
2121 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2122 aros_flavour="mac68knative" ;;
2123 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2124 aros_flavour="ppcnative" ;;
2127 if test ! -d ${aros_inc_dir} ; then
2128 ${MKDIR} ${aros_inc_dir}
2130 if test ! -d ${aros_geninc_dir} ; then
2131 ${MKDIR} ${aros_geninc_dir}
2133 if test ! -d ${aros_hostcfg_dir} ; then
2134 ${MKDIR} ${aros_hostcfg_dir}
2136 if test ! -d ${aros_targetcfg_dir} ; then
2137 ${MKDIR} ${aros_targetcfg_dir}
2139 if test ! -d ${aros_tools_dir} ; then
2140 ${MKDIR} ${aros_tools_dir}
2142 if test ! -d ${aros_scripts_dir} ; then
2143 ${MKDIR} ${aros_scripts_dir}
2146 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2148 AC_CONFIG_COMMANDS([compiler_executable],
2150 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2152 prefix="${prefix}/${aros_target_cpu}-aros"
2153 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2157 chmod a+x ${prefix2}-gcc ${prefix2}-ld
2159 ln -sf ${prefix2}-gcc ${prefix}-gcc
2160 ln -sf ${prefix2}-ld ${prefix}-ld
2162 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix}-as
2163 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix}-nm
2164 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix}-ar
2165 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix}-ranlib
2166 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2167 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2168 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix}-strip
2170 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix2}-as
2171 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix2}-nm
2172 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix2}-ar
2173 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix2}-ranlib
2174 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2175 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2176 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix2}-strip
2179 aros_host_exe_suffix=${aros_host_exe_suffix}
2180 aros_tools_dir=${aros_tools_dir}
2181 aros_target_cpu=${aros_target_cpu}
2182 aros_target_arch=${aros_target_arch}
2183 aros_target_suffix=${aros_target_suffix}
2184 aros_target_nm_ln=${aros_target_nm_ln}
2185 aros_target_as_ln=${aros_target_as_ln}
2186 aros_target_ar_ln=${aros_target_ar_ln}
2187 aros_target_ranlib_ln=${aros_target_ranlib_ln}
2188 aros_target_objdump_ln=${aros_target_objdump_ln}
2189 aros_target_objcopy_ln=${aros_target_objcopy_ln}
2190 aros_target_strip_ln=${aros_target_strip_ln}
2193 AC_CONFIG_COMMANDS([genshared_executable],
2194 [chmod a+x ${aros_scripts_dir}/genshared],
2195 [aros_scripts_dir=${aros_scripts_dir}]
2197 AC_CONFIG_COMMANDS([genmf_executable],
2198 [chmod a+x ${aros_tools_dir}/genmf.py],
2199 [aros_tools_dir=${aros_tools_dir}]
2205 ${aros_inc_dir}/config.h:config/config.h.in
2206 ${aros_geninc_dir}/config.h:config/config.h.in
2207 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2208 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2210 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2211 ${aros_targetcfg_dir}/specs:config/specs.in
2212 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2213 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2214 ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
2215 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2216 tools/collect-aros/env.h
2221 dnl This is in order to not define SHARED_CFLAGS sometimes
2222 dnl We don't always do aros_shared_ar, aros_shared_cflags
2224 #XXX compatability...
2225 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2227 if test -n "$aros_shared_cflags" ; then
2228 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2229 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg