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"
327 android_build_os="windows"
328 android_tool="android.bat"
329 default_android_sdk="/cygdrive/c/android-sdk-windows-1.6_r1"
336 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
337 aros_host_cpu="$host_cpu"
343 aros_host_arch="mingw32"
344 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
345 android_build_os="windows"
346 android_tool="android.bat"
347 default_android_sdk="/c/android-sdk-windows-1.6_r1"
354 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
355 aros_host_cpu="$host_cpu"
360 AC_MSG_ERROR([Unsupported host architecture $host])
364 AROS_PROG(aros_host_ar,[ar],[cr])
365 AROS_REQUIRED(ar,$aros_host_ar)
366 AROS_PROG(aros_host_ranlib,ranlib)
367 AROS_REQUIRED(ranlib,$aros_host_ranlib)
368 AROS_PROG(aros_host_strip,strip)
369 AROS_REQUIRED(strip,$aros_host_strip)
371 AROS_PROG(RM,[rm],[-rf])
372 AROS_REQUIRED(rm,$RM)
374 AROS_REQUIRED(cp,$CP)
376 AROS_REQUIRED(mv,$MV)
377 AROS_PROG(ECHO,[echo])
378 AROS_REQUIRED(echo,$ECHO)
379 AROS_PROG(MKDIR,[mkdir],[-p])
380 AROS_REQUIRED(mkdir,$MKDIR)
381 AROS_PROG(TOUCH,[touch])
382 AROS_REQUIRED(touch,$TOUCH)
383 AROS_PROG(SORT,[sort])
384 AROS_REQUIRED(sort,$SORT)
385 AROS_PROG(UNIQ,[uniq])
386 AROS_REQUIRED(uniq,$UNIQ)
387 AROS_PROG(NOP,[true])
388 AROS_REQUIRED(true,$NOP)
390 AROS_REQUIRED(cat,$CAT)
391 AROS_PROG(BISON,[bison])
392 AROS_REQUIRED(bison,$BISON)
393 AROS_PROG(FLEX,[flex])
394 AROS_REQUIRED(flex,$FLEX)
395 AROS_PROG(PNGTOPNM,[pngtopnm])
396 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
397 AROS_PROG(PPMTOILBM,[ppmtoilbm])
398 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
400 AROS_REQUIRED(sed,$SED)
401 AROS_PROG(CHMOD,[chmod])
402 AROS_REQUIRED(chmod,$CHMOD)
411 dnl ---------------------------------------------------------------------------
412 dnl Look for things about the host system, good for hosted targets.
413 dnl ---------------------------------------------------------------------------
415 # Check for some includes for the X11 HIDD and the kernel
416 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
417 sys/mmap.h sys/mman.h sysexits.h \
418 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
421 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
438 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
440 # Look for some functions
441 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
442 clone kse_create rfork_thread thr_create sa_register \
443 getcontext makecontext setcontext sigaltstack swapcontext])
448 dnl --------------------------------------------------------------------
449 dnl Target Configuration Section
450 dnl --------------------------------------------------------------------
452 dnl The target configuration section is responsible for setting up all
453 dnl the paths for includes, and tools required to build AROS to some
454 dnl particular target.
456 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
457 aros_config_aflags="-Wall -x assembler-with-cpp -c"
458 aros_config_ldflags=""
460 aros_shared_default=yes
462 aros_shared_cflags="-fPIC"
463 aros_shared_aflags=""
464 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
465 aros_kernel_ldflags="-Wl,-rpath,./lib"
467 aros_target_ar_flags="cr"
468 aros_target_nm_flags="-C -ul"
469 aros_target_strip_flags="--strip-unneeded -R.comment"
474 aros_target_genmap="-Wl,-Map -Xlinker"
476 # Native flavour stuff
477 aros_serial_debug="0"
479 # Palm native flavour stuff
480 aros_palm_debug_hack="0"
483 aros_nesting_supervisor="0"
485 # Collect-aros stuff: "-ius" to ignore undefined symbols
486 ignore_undefined_symbols=""
488 # Check for X11 by default
491 #-----------------------------------------------------------------------------
494 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
495 # it switched on by default, and we use the host compiler, so it compiles AROS
496 # code with this enabled resulting in link failures as we don't have support
499 # We use two methods to disable it. For the host compiler (used to compile
500 # some hosted modules), we test to see if the compiler supports stack
501 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
502 # work on all platforms.
504 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
505 # (this is done unconditionally, as it should have no effect on compilers
506 # without the stack protection feature). This may be specific to the way that
507 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
508 # strong enough to disable it in a generic way though, so we'll live with it
509 # until another vendor ships GCC with it enabled in a different way, and deal
513 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
514 save_cflags="$CFLAGS"
515 CFLAGS="$CFLAGS -fno-stack-protector"
516 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
517 AC_MSG_RESULT($use_no_stack_protector)
518 if test "x-$use_no_stack_protector" = "x-yes" ; then
519 aros_host_cflags="$aros_host_cflags -fno-stack-protector"
521 CFLAGS="$save_cflags"
523 #-----------------------------------------------------------------------------
525 # Disable pointer-signedness warnings if the compiler recognises the option
526 # (this only works for the host compiler at the moment)
528 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
529 save_cflags="$CFLAGS"
530 CFLAGS="$CFLAGS -Wno-pointer-sign"
531 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
532 AC_MSG_RESULT($use_no_sign_warning)
533 if test "x-$use_no_sign_warning" = "x-yes" ; then
534 aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
536 CFLAGS="$save_cflags"
538 #-----------------------------------------------------------------------------
540 AC_MSG_CHECKING([for type of build])
541 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")
543 if test "$build_type" = "nightly"; then
544 build_type_string="NIGHTLY"
545 elif test "$build_type" = "snapshot"; then
546 build_type_string="SNAPSHOT"
547 elif test "$build_type" = "milestone"; then
548 build_type_string="MILESTONE"
549 elif test "$build_type" = "release"; then
550 build_type_string="RELEASE"
552 build_type_string="PERSONAL"
553 build_type="personal"
556 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
558 AC_MSG_RESULT($build_type)
560 #-----------------------------------------------------------------------------
561 all_debug_types="messages stack modules mungwall symbols"
563 AC_MSG_CHECKING([which debug types to enable])
564 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)]),
565 debug="$enableval",debug="")
567 if test "$debug" = "" -o "$debug" = "no"; then
569 elif test "$debug" = "yes"; then
573 if test "$debug" = "all" ; then
574 debug="messages stack modules symbols"
575 for d in $all_debug_types; do
576 export aros_${d}_debug="1"
579 for d in $all_debug_types; do
580 export aros_${d}_debug="0"
584 if test "$debug" != "none"; then
585 debug=`echo $debug | sed s/,/\ /g`
588 for d2 in $all_debug_types; do
589 if test "$d2" = "$d"; then
594 if test "$found" = "0"; then
595 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
597 export aros_${d}_debug="1"
601 AC_MSG_RESULT($debug)
603 if test "$aros_messages_debug" = "1"; then
604 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
606 aros_messages_debug=""
608 if test "$aros_symbols_debug" = "1"; then
609 aros_symbols_debug="-g"
611 aros_symbols_debug=""
614 # These are the flags to pass when compiling debugged programs
615 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
617 aros_debug_ldflags="$aros_symbols_debug"
621 #-----------------------------------------------------------------------------
622 # Checking if we should build crosstools..
623 AC_MSG_CHECKING([whether to build crosstools])
624 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--enable-crosstools],[Build cross-compiler toolchains if necessary (default=no).]),crosstools="$enableval",crosstools="no")
625 if test "$crosstools" != "" -a "$crosstools" != "no"; then
627 aros_crosstools="yes"
632 #-----------------------------------------------------------------------------
633 # Checking for distcc and ccache.
635 # Always apply the transforms in this particular order. Basically you should
636 # always run 'ccache distcc compiler' in that order for the best performance.
638 AC_MSG_CHECKING([whether to enable distcc])
639 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
640 if test "$distcc" != "" -a "$distcc" != "no"; then
641 # AC_CHECK_PROG will print out the result in this case
642 AC_PATH_PROG(DISTCC,[distcc],distcc,)
647 AC_MSG_CHECKING([whether to enable ccache])
648 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
649 if test "$ccache" != "" -a "$ccache" != "no"; then
650 # AC_CHECK_PROG will print out the result in this case
651 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
656 #-----------------------------------------------------------------------------
657 AC_MSG_CHECKING([what specific gcc version to use])
658 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")
659 AC_MSG_RESULT($target_tool_version)
661 #-----------------------------------------------------------------------------
662 AC_MSG_CHECKING([what optimization flags to use])
663 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
664 if test "$optimization" = "unknown"; then
665 dnl default is -O2 for normal builds, -O0 for debug builds
666 if test "$debug" != "none"; then
672 aros_config_cflags="$aros_config_cflags $optimization"
673 AC_MSG_RESULT($optimization)
675 #-----------------------------------------------------------------------------
676 AC_MSG_CHECKING([what paranoia flags to use])
677 AC_ARG_WITH(paranoia,AC_HELP_STRING([--with-paranoia=FLAGS],[CC flags to enable paranoia]),[paranoia_flags="$withval"],[paranoia_flags="default"])
678 if test "$paranoia_flags" = "default"; then
680 else if test "$paranoia_flags" = "yes"; then
681 paranoia_flags="-Wall -Werror"
683 AC_MSG_RESULT($paranoia_flags)
684 aros_paranoia_cflags="$paranoia_flags"
686 #-----------------------------------------------------------------------------
687 AC_MSG_CHECKING([what target variant to enable])
688 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="")
689 if test "$target_variant" = ""; then
690 aros_target_variant=""
691 aros_target_suffix=""
694 aros_target_variant="$target_variant"
695 aros_target_suffix="-$target_variant"
697 AC_MSG_RESULT($enableval)
699 target_bootloader="none"
701 #-----------------------------------------------------------------------------
702 case "$aros_target_variant" in
704 AC_MSG_CHECKING([XCode path])
705 AC_ARG_WITH(xcode,AC_HELP_STRING([--with-xcode=PATH],[Specify XCode path for iOS targets (default=/Developer).]),aros_xcode_path="$withval",aros_xcode_path="/Developer")
706 AC_MSG_RESULT($aros_xcode_path)
708 AC_MSG_CHECKING([for minimum supported iOS version])
709 AC_ARG_WITH(ios-version,AC_HELP_STRING([--with-ios-version=VERSION],[Specify minimum supported iOS version (default=3.0).]),aros_ios_version="$withval",aros_ios_version="3.0")
710 AC_MSG_RESULT($aros_ios_version)
712 AC_MSG_CHECKING([what iOS SDK version to use])
713 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")
714 AC_MSG_RESULT($aros_ios_sdk)
719 AC_MSG_CHECKING([Android SDK path])
720 AC_ARG_WITH(sdk,AC_HELP_STRING([--with-sdk=PATH],[Specify Android SDK path (default=$default_android_sdk).]),aros_android_sdk="$withval",aros_android_sdk=$default_android_sdk)
721 AC_MSG_RESULT($aros_android_sdk)
723 AC_MSG_CHECKING([Android NDK path])
724 AC_ARG_WITH(ndk,AC_HELP_STRING([--with-ndk=PATH],[Specify Android NDK path (default=$default_android_ndk).]),aros_android_ndk="$withval",aros_android_ndk="")
725 AC_MSG_RESULT($aros_android_ndk)
727 AC_MSG_CHECKING([what Android version to use])
728 AC_ARG_WITH(android-version,AC_HELP_STRING([--with-android-version=VERSION],[Use Android platform VERSION (default=2.2).]),aros_android_version="$withval",aros_android_version="2.2")
729 AC_MSG_RESULT($aros_android_version)
731 export PATH="$aros_android_sdk/tools:$PATH"
732 AC_PATH_PROG(android_tool, $android_tool)
733 AROS_REQUIRED(android,$android_tool)
735 dnl MSYS bash can't run .bat files directly, then need to be started via cmd.exe
736 if test $host_os = "mingw32"; then
737 android_tool="cmd //c $android_tool"
743 #-----------------------------------------------------------------------------
744 # This is the target configuration switch.
747 aros_target_arch="linux"
748 aros_target_family="unix"
749 case "$target_cpu" in
751 aros_target_cpu="m68k"
752 aros_object_format="m68kelf"
753 aros_flavour="emulcompat"
754 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
755 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
756 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
757 gcc_target_cpu="mc68000"
760 aros_target_cpu="i386"
761 aros_object_format="elf_i386"
762 aros_flavour="emulation"
763 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
764 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
765 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
766 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
767 aros_config_ldflags="-m32 -march=i486"
768 aros_kernel_ldflags="-melf_i386"
769 aros_default_wbdepth=8
770 gcc_target_cpu="i386"
771 pci_hidd_target="hidd-pci-linux"
774 aros_target_cpu="x86_64"
775 aros_object_format="elf_x86_64"
776 aros_flavour="emulation"
777 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
778 aros_config_cflags="$aros_config_cflags -mno-red-zone"
779 aros_default_wbdepth=8
780 gcc_target_cpu="x86_64"
781 pci_hidd_target="hidd-pci-linux"
784 aros_target_cpu="ppc"
785 aros_object_format="elf32ppc"
786 aros_flavour="emulation"
787 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
788 aros_default_wbdepth=8
792 # Same as powerpc, but I need this for the nightly build to work again.
793 # Actually, the nightly should be made working with powerpc target.
794 # That just was too much work for the moment, another week or two.
796 aros_target_cpu="ppc"
797 aros_object_format="elf32ppc"
798 aros_flavour="emulation"
799 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
800 aros_default_wbdepth=8
804 aros_target_cpu="arm"
805 aros_object_format="armelf_linux_eabi"
806 aros_flavour="emulation"
807 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
809 aros_config_cflags="$aros_config_cflags -marm -march=armv6 -mfpu=vfp -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
810 aros_config_aflags="$aros_config_aflags -marm -march=armv6 -mfpu=vfp -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
811 aros_arch_libs="-laeabi"
814 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
817 case "$aros_target_variant" in
819 case "$aros_android_version" in
821 aros_android_level=android-8
824 aros_android_level=android-9
827 aros_default_wbwidth=320
828 aros_default_wbheight=480
829 dnl Android gcc and AROS gcc use different enums size, so we use AROS gcc
830 aros_target_cc="arm-aros-gcc"
831 aros_target_cxx="arm-aros-g++"
832 aros_target_ld="arm-aros-ld"
833 aros_target_as="arm-aros-as"
834 aros_target_ar="arm-aros-ar"
835 aros_target_ranlib="arm-aros-ranlib"
836 aros_target_nm="arm-aros-nm"
837 aros_target_strip="arm-aros-strip"
838 aros_target_objcopy="arm-aros-objcopy"
839 aros_target_objdump="arm-aros-objdump"
840 if test "$aros_android_ndk" = ""; then
841 aros_kernel_cflags="-mandroid"
842 aros_kernel_ldflags="-mandroid"
845 export PATH="$aros_android_ndk/toolchains/arm-linux-androideabi-$target_tool_version/prebuilt/$android_build_os/bin:$PATH"
846 aros_android_ndk="$aros_android_ndk/platforms/$aros_android_level/arch-arm"
847 aros_kernel_cflags="--sysroot $aros_android_ndk -mandroid"
848 aros_kernel_ldflags="--sysroot $aros_android_ndk -mandroid"
849 CFLAGS="$CFLAGS --sysroot $aros_android_ndk -mandroid"
850 aros_kernel_includes="-isystem $aros_android_ndk/usr/include"
853 target_tool_prefix="arm-linux-androideabi-"
859 aros_target_arch="pc"
860 aros_shared_default="no"
861 target_bootloader="grub2"
862 case "$target_cpu" in
864 aros_target_cpu="i386"
866 dnl If somebody hasn't already set the target object
867 dnl format, then use this value. Mostly to support
868 dnl FreeBSD cross-compilation.
869 dnl TODO: Remove when we always use our compiler.
871 if test "$aros_object_format" = "" ; then
872 aros_object_format="elf_i386"
874 aros_flavour="standalone"
875 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
876 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
877 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
878 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
879 aros_config_ldflags="-m32 -march=i486"
880 aros_kernel_ldflags="-melf_i386"
881 aros_default_wbwidth=640
882 aros_default_wbheight=480
883 gcc_target_cpu="i386"
886 aros_target_cpu="x86_64"
888 if test "$aros_object_format" = "" ; then
889 aros_object_format="elf_x86_64"
891 aros_flavour="standalone"
892 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
893 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
894 aros_kernel_ldflags=""
895 aros_default_wbwidth=640
896 aros_default_wbheight=480
897 gcc_target_cpu="x86_64"
900 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
906 aros_target_arch="prep"
907 aros_shared_default="no"
908 aros_target_cpu="ppc"
909 aros_object_format="elf32ppc"
910 aros_flavour="ppcnative"
911 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
912 aros_kernel_ldflags=""
913 aros_default_wbwidth=640
914 aros_default_wbheight=480
919 aros_target_arch="freebsd"
920 aros_target_family="unix"
921 aros_target_cpu="i386"
922 aros_flavour="emulation"
923 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
924 gcc_target_cpu="i386"
926 aros_target_strip_flags="-x"
930 aros_target_arch="darwin"
931 aros_target_family="unix"
932 aros_flavour="emulation"
933 case "$target_cpu" in
935 aros_ios_platform="iPhoneSimulator"
936 aros_target_cpu="i386"
937 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
938 aros_kernel_ldflags=""
939 aros_macosx_version="10.4"
940 aros_default_wbdepth=8
941 gcc_target_cpu="i386"
942 aros_object_format="elf_i386"
943 aros_target_strip_flags="-x"
944 aros_target_cc="i386-aros-gcc"
945 aros_target_cxx="i386-aros-g++"
946 aros_target_ld="i386-aros-ld"
947 aros_target_as="i386-aros-as"
948 aros_target_ar="i386-aros-ar"
949 aros_target_ranlib="i386-aros-ranlib"
950 aros_target_nm="i386-aros-nm"
951 aros_target_strip="i386-aros-strip"
952 aros_target_objcopy="i386-aros-objcopy"
953 aros_target_objdump="i386-aros-objdump"
954 target_tool_prefix="i686-apple-darwin10-"
955 target_tool_flags="-m32"
958 aros_target_cpu="x86_64"
959 aros_object_format="elf_x86_64"
960 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
961 aros_macosx_version="10.6"
962 aros_kernel_cflags="-m64"
963 aros_kernel_ldflags="-m64"
964 aros_default_wbdepth=8
965 gcc_target_cpu="x86_64"
967 aros_target_cc="x86_64-aros-gcc"
968 aros_target_cxx="x86_64-aros-g++"
969 aros_target_ld="x86_64-aros-ld"
970 aros_target_as="x86_64-aros-as"
971 aros_target_ar="x86_64-aros-ar"
972 aros_target_ranlib="x86_64-aros-ranlib"
973 aros_target_nm="x86_64-aros-nm"
974 aros_target_strip="x86_64-aros-strip"
975 aros_target_objcopy="x86_64-aros-objcopy"
976 aros_target_objdump="x86_64-aros-objdump"
977 target_tool_prefix="i686-apple-darwin10-"
980 aros_target_cpu="ppc"
981 aros_object_format="elf32ppc"
982 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
983 aros_kernel_ldflags=""
984 aros_macosx_version="10.0"
985 aros_default_wbdepth=8
987 aros_kernel_ld="ld -arch ppc"
988 aros_target_cc="ppc-aros-gcc"
989 aros_target_cxx="ppc-aros-g++"
990 aros_target_ld="ppc-aros-ld"
991 aros_target_as="ppc-aros-as"
992 aros_target_ar="ppc-aros-ar"
993 aros_target_ranlib="ppc-aros-ranlib"
994 aros_target_nm="ppc-aros-nm"
995 aros_target_strip="ppc-aros-strip"
996 aros_target_objcopy="ppc-aros-objcopy"
997 aros_target_objdump="ppc-aros-objdump"
998 target_tool_prefix="powerpc-apple-darwin10-"
1001 aros_ios_platform="iPhoneOS"
1002 aros_target_cpu="arm"
1003 aros_object_format="armelf_linux_eabi"
1004 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1005 aros_config_cflags="$aros_config_cflags -marm -march=armv6 -mfpu=vfp -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
1006 aros_config_aflags="$aros_config_aflags -marm -march=armv6 -mfpu=vfp -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
1007 aros_arch_libs="-laeabi"
1008 aros_default_wbdepth=8
1009 gcc_target_cpu="arm"
1010 aros_kernel_ld="ld -arch armv6"
1011 aros_target_cc="arm-aros-gcc"
1012 aros_target_cxx="arm-aros-g++"
1013 aros_target_ld="arm-aros-ld"
1014 aros_target_as="arm-aros-as"
1015 aros_target_ar="arm-aros-ar"
1016 aros_target_ranlib="arm-aros-ranlib"
1017 aros_target_nm="arm-aros-nm"
1018 aros_target_strip="arm-aros-strip"
1019 aros_target_objcopy="arm-aros-objcopy"
1020 aros_target_objdump="arm-aros-objdump"
1021 target_tool_prefix="arm-apple-darwin10-"
1022 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
1025 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
1028 case "$aros_target_variant" in
1030 aros_default_wbwidth=320
1031 aros_default_wbheight=480
1032 aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
1033 target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
1034 aros_kernel_includes="-isystem $aros_ios_sdk/usr/include"
1036 # This is here because it may depend on iOS or SDK version
1037 aros_kernel_cflags="$aros_kernel_cflags -miphoneos-version-min=$aros_ios_version"
1038 aros_kernel_ldflags="$aros_kernel_ldflags -miphoneos-version-min=$aros_ios_version"
1039 aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
1042 aros_kernel_cflags="$aros_kernel_cflags -mmacosx-version-min=$aros_macosx_version"
1043 aros_kernel_ldflags="$aros_kernel_ldflags -mmacosx-version-min=$aros_macosx_version"
1049 aros_target_arch="dragonfly"
1050 aros_target_family="unix"
1051 aros_flavour="emulation"
1052 case "$target_cpu" in
1054 aros_target_cpu="i386"
1055 aros_object_format="elf_i386"
1056 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
1059 aros_target_cpu="x86_64"
1060 aros_object_format="elf_x86_64"
1061 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
1064 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1070 aros_target_arch="netbsd"
1071 aros_target_family="unix"
1072 case "$target_cpu" in
1074 aros_target_cpu="m68k"
1075 aros_object_format="m68kelf"
1076 aros_flavour="emulcompat"
1077 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1078 gcc_target_cpu="mc68000"
1081 aros_target_cpu="i386"
1082 aros_object_format="elf_i386"
1083 aros_flavour="emulation"
1084 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1085 aros_default_wbdepth=8
1086 gcc_target_cpu="i386"
1089 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1092 aros_target_genmap="-Wl,-M -Xlinker >"
1093 aros_flavour="emulation"
1094 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1098 aros_target_arch="openbsd"
1099 aros_target_family="unix"
1100 case "$target_cpu" in
1102 aros_target_cpu="i386"
1103 aros_object_format="elf_i386"
1104 aros_flavour="emulation"
1105 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1106 gcc_target_cpu="i386"
1109 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1112 aros_target_genmap="-Wl,-M -Xlinker >"
1113 aros_target_nm_flags="-u"
1114 aros_flavour="emulation"
1118 aros_target_arch="solaris"
1119 aros_target_family="unix"
1120 case "$target_cpu" in
1122 aros_target_cpu="i386"
1123 aros_object_format="elf_i386"
1124 aros_flavour="emulation"
1125 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1126 aros_default_wbdepth=8
1127 gcc_target_cpu="i386"
1130 aros_target_cpu="sparc"
1131 aros_object_format="elf_sparc"
1132 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1133 gcc_target_cpu="sparc"
1136 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1139 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1140 aros_flavour="emulation"
1144 aros_target_arch="morphos"
1145 aros_shared_default="no"
1146 aros_target_cpu="ppc"
1147 aros_object_format="elf_ppc"
1148 aros_flavour="nativecompat"
1149 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1150 gcc_target_cpu="ppc"
1154 aros_target_arch="sam440"
1155 aros_shared_default="no"
1156 aros_target_cpu="ppc"
1157 aros_object_format="elf32ppc"
1158 aros_flavour="ppcnative"
1159 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1160 aros_kernel_ldflags=""
1161 aros_default_wbwidth=1024
1162 aros_default_wbheight=768
1163 aros_default_wbdepth=24
1164 aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1165 gcc_target_cpu="powerpc"
1169 aros_target_arch="efika"
1170 aros_shared_default="no"
1171 aros_target_cpu="arm"
1172 aros_object_format="armelf_linux_eabi"
1173 aros_flavour="standalone"
1174 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1175 aros_kernel_ldflags=""
1176 aros_default_wbwidth=1024
1177 aros_default_wbheight=600
1178 aros_arch_libs="-laeabi"
1179 aros_config_cflags="$aros_config_cflags -marm -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1180 aros_config_aflags="$aros_config_aflags -marm -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1184 aros_target_arch="chrp"
1185 aros_shared_default="no"
1186 aros_target_cpu="ppc"
1187 aros_object_format="elf32ppc"
1188 aros_flavour="ppcnative"
1189 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1190 aros_kernel_ldflags=""
1191 aros_default_wbwidth=640
1192 aros_default_wbheight=480
1193 aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"
1194 gcc_target_cpu="powerpc"
1195 case "$aros_target_variant" in
1197 aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1203 aros_target_arch="amiga"
1204 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1205 aros_shared_default="no"
1207 case "$target_cpu" in
1210 aros_target_cpu="m68k"
1211 aros_object_format="m68kelf"
1212 aros_flavour="standcompat"
1213 gcc_target_cpu="m68000"
1214 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin -Wno-volatile-register-var -DAROS_CREATE_ROM -DAROS_DOS_PACKETS"
1215 aros_config_aflags="$aros_config_aflags -g3 -${gcc_target_cpu}"
1216 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1217 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -${gcc_target_cpu}"
1218 target_tool_prefix="m68k-elf-"
1219 # Needed to get the correct multilib
1220 aros_config_ldflags="-${gcc_target_cpu}"
1221 aros_debug_ldflags="-${gcc_target_cpu}"
1222 aros_shared_ldflags="-${gcc_target_cpu}"
1223 aros_kernel_ldflags="-${gcc_target_cpu}"
1224 aros_target_nostdlib_ldflags="-${gcc_target_cpu}"
1225 aros_target_strip_flags="-R.comment --strip-debug"
1226 aros_default_wbwidth=640
1227 aros_default_wbheight=480
1231 aros_flavour="native"
1232 gcc_target_cpu="ppc"
1235 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1241 aros_target_arch="mingw32"
1242 aros_shared_default="no"
1243 aros_flavour="emulation"
1244 aros_shared_cflags=""
1247 case "$target_cpu" in
1249 aros_target_cpu="i386"
1250 aros_object_format="elf_i386"
1251 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1252 aros_default_wbdepth=8
1253 gcc_target_cpu="i386"
1254 aros_target_cc="i386-aros-gcc"
1255 aros_target_cxx="i386-aros-g++"
1256 aros_target_ld="i386-aros-ld"
1257 aros_target_as="i386-aros-as"
1258 aros_target_ar="i386-aros-ar"
1259 aros_target_ranlib="i386-aros-ranlib"
1260 aros_target_nm="i386-aros-nm"
1261 aros_target_strip="i386-aros-strip"
1262 aros_target_objcopy="i386-aros-objcopy"
1263 aros_target_objdump="i386-aros-objdump"
1264 target_tool_prefix="i386-mingw32-"
1267 aros_target_cpu="x86_64"
1268 aros_object_format="elf_x86_64"
1269 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1270 aros_default_wbdepth=8
1271 gcc_target_cpu="x86_64"
1272 aros_target_cc="x86_64-aros-gcc"
1273 aros_target_cxx="x86_64-aros-g++"
1274 aros_target_ld="x86_64-aros-ld"
1275 aros_target_as="x86_64-aros-as"
1276 aros_target_ar="x86_64-aros-ar"
1277 aros_target_ranlib="x86_64-aros-ranlib"
1278 aros_target_nm="x86_64-aros-nm"
1279 aros_target_strip="x86_64-aros-strip"
1280 aros_target_objcopy="x86_64-aros-objcopy"
1281 aros_target_objdump="x86_64-aros-objdump"
1282 target_tool_prefix="x86_64-w64-mingw32-"
1285 aros_target_cpu="arm"
1286 aros_object_format="armelf_linux_eabi"
1287 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1288 aros_arch_libs="-laeabi"
1289 aros_default_wbdepth=8
1290 gcc_target_cpu="arm"
1291 aros_target_cc="arm-aros-gcc"
1292 aros_target_cxx="arm-aros-g++"
1293 aros_target_ld="arm-aros-ld"
1294 aros_target_as="arm-aros-as"
1295 aros_target_ar="arm-aros-ar"
1296 aros_target_ranlib="arm-aros-ranlib"
1297 aros_target_nm="arm-aros-nm"
1298 aros_target_strip="arm-aros-strip"
1299 aros_target_objcopy="arm-aros-objcopy"
1300 aros_target_objdump="arm-aros-objdump"
1301 target_tool_prefix="arm-mingw32ce-"
1302 aros_default_wbwidth=160
1303 aros_default_wbheight=160
1306 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1309 if test $host_os = "cygwin"; then
1310 aros_kernel_cflags="-mno-cygwin"
1314 aros_target_arch="pp"
1315 aros_shared_default="no"
1316 case "$target_cpu" in
1318 aros_target_cpu="m68k"
1319 aros_object_format="m68kelf"
1320 aros_flavour="palmnative"
1321 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1322 aros_default_wbwidth=160
1323 aros_default_wbheight=160
1324 aros_default_wbdepth=1
1325 aros_target_ar_flags="cru"
1326 aros_compiler_libs="-lgcc1"
1327 aros_shared_default=no
1328 aros_shared_cflags="-fpic"
1329 aros_shared_aflags=""
1330 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1331 aros_kernel_ldflags="-Wl,-rpath,./lib"
1332 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
1333 aros_debug_aflags=""
1334 aros_debug_ldflags="$aros_symbols_debug"
1335 aros_mungwall_debug="0"
1336 aros_modules_debug="0"
1337 gcc_target_cpu="mc68000"
1338 ignore_undefined_symbols="-ius"
1341 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1347 aros_target_arch="mac"
1348 aros_shared_default="no"
1349 case "$target_cpu" in
1351 aros_target_cpu="m68k"
1352 aros_object_format="m68kelf"
1353 aros_flavour="mac68knative"
1354 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1355 aros_default_wbwidth=512
1356 aros_default_wbheight=384
1357 aros_default_wbdepth=8
1358 aros_target_ar_flags="cru"
1359 aros_compiler_libs="-lgcc1"
1360 aros_shared_default=no
1361 aros_shared_cflags="-fpic"
1362 aros_shared_aflags=""
1363 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1364 aros_kernel_ldflags="-Wl,-rpath,./lib"
1365 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
1366 aros_debug_aflags=""
1367 aros_debug_ldflags="$aros_symbols_debug"
1368 aros_mungwall_debug="0"
1369 aros_modules_debug="0"
1370 gcc_target_cpu="mc68000"
1371 ignore_undefined_symbols="-ius"
1374 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1380 AC_MSG_ERROR([Unsupported target architecture $target])
1384 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1385 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1386 if test "$with_portssrcdir" = "default"; then
1387 AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1389 AROS_PORTSSRCDIR="$with_portssrcdir"
1391 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1393 AC_MSG_CHECKING([which bootloader to use])
1394 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1395 if test "$target_bootloader" = "none"; then
1396 aros_target_bootloader=""
1398 aros_target_bootloader="$target_bootloader"
1400 AC_MSG_RESULT($target_bootloader)
1402 AC_MSG_CHECKING([which icon-set to use])
1403 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1404 if test "$target_iconset" = "default"; then
1405 aros_target_iconset="Gorilla"
1406 target_iconset="default (Gorilla)"
1408 aros_target_iconset="$target_iconset"
1410 AC_MSG_RESULT($target_iconset)
1412 AC_MSG_CHECKING([which GUI Theme to use])
1413 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1414 if test "$target_guitheme" = "default"; then
1415 aros_target_guitheme="Ice"
1417 aros_target_guitheme="$target_guitheme"
1419 AC_MSG_RESULT($aros_target_guitheme)
1421 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1424 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1427 if test "$aros_host_cpu" == "x86_64" ; then
1428 if test "$aros_target_cpu" == "i386" ; then
1429 if test "$aros_target_arch" != "mingw32"; then
1434 if test "$aros_host_arch" == "darwin" ; then
1435 if test "$aros_target_arch" != "darwin" ; then
1440 # Set prefix for target compiler etc. if we're cross-compiling
1441 # (should possibly be earlier but needs to be after AC_PROG_CC)
1442 if test "$cross_compiling" = "yes" ; then
1443 if test "$target_tool_prefix" = ""; then
1444 target_tool_prefix=${target_cpu}-elf-
1446 CC=${target_tool_prefix}gcc
1447 dnl CPP is needed for AC_CHECK_HEADER to work correctly
1448 CPP=${target_tool_prefix}cpp
1449 if test "$target_tool_version" != "default"; then
1450 CC="$CC-$target_tool_version"
1451 CPP="$CC-$target_tool_version"
1453 AC_PATH_PROG(CC,$CC)
1454 AROS_REQUIRED(gcc,$CC)
1456 CC="$CC $target_tool_flags"
1458 #-----------------------------------------------------------------------------
1460 # Disable pointer-signedness warnings if the compiler recognises the option
1462 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1463 save_cflags="$CFLAGS"
1464 CFLAGS="$CFLAGS -Wno-pointer-sign"
1465 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1466 AC_MSG_RESULT($use_no_sign_warning)
1467 if test "x-$use_no_sign_warning" = "x-yes" ; then
1468 aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1470 CFLAGS="$save_cflags"
1472 #-----------------------------------------------------------------------------
1474 # Find all the tools we need to compile. This could be cross-compiling
1475 # though! If that is the case we use the GNU form of the target and
1476 # simply add this to the front of the binary name. This is rather simple,
1477 # but it should work under most circumstances.
1479 # The default tools are to use the same as the host, but only if the
1480 # host and target CPU are the same. With GCC this is normally enough.
1484 aros_shared_ld="$aros_host_ld"
1486 aros_target_mkdep="$aros_host_mkdep"
1487 aros_target_incl_def="$aros_host_incl"
1489 aros_kernel_cc="$CC"
1491 # The default tools executables to be linked to.
1492 if test "$aros_target_cc" != ""; then
1493 AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1494 AROS_REQUIRED(gcc,$aros_target_cc)
1496 if test "$aros_target_ld" != ""; then
1497 AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1498 AROS_REQUIRED(ld,$aros_target_ld)
1501 if test "$crosstools" != "yes"; then
1502 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1503 AROS_REQUIRED(as,$aros_target_as_ln)
1504 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1505 AROS_REQUIRED(ld,$aros_kernel_ld)
1506 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1507 AROS_REQUIRED(ar,$aros_target_ar_ln)
1508 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1509 AROS_REQUIRED(nm,$aros_target_nm_ln)
1510 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1511 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1512 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1513 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1514 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1515 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1516 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1517 AROS_REQUIRED(strip,$aros_target_strip_ln)
1518 if test "$aros_target_cxx" != ""; then
1519 AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1520 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1521 # AROS_REQUIRED(c++,$aros_target_cxx)
1524 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1528 # Build crosstools if we have no C++ - temporary thing
1529 if test "$aros_target_cxx" = ""; then
1530 crosstools_target=tools-crosstools
1533 if test "$rescomp" != ""; then
1534 if test "$cross_compiling" = "yes" ; then
1535 rescomp=${target_tool_prefix}${rescomp}
1537 AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1538 AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1541 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1542 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1543 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1544 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1545 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1546 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1547 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1549 # aros_cc_pre is a variable that is added to the front of the compiler name
1550 # in the generated aros-gcc shell script. We need this to enable the cache
1551 # to work across cleaned builds. Also, support DISTCC using the correct
1552 # environment variable.
1555 if test "x${DISTCC}" != "x" ; then
1556 if test "x${CCACHE}" != "x" ; then
1557 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1559 aros_cc_pre="${DISTCC} "
1562 if test "x${CCACHE}" != "x" ; then
1563 aros_cc_pre="${CCACHE} "
1567 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1569 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1570 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1571 AC_SUBST(aros_target_nix_ldflags,-nix)
1572 AC_SUBST(aros_target_detach_ldflags,-detach)
1573 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1576 if test "$aros_target_cc" = ""; then
1577 orig_target_cc=$aros_kernel_cc
1579 orig_target_cc=$aros_target_cc
1581 if test "$aros_target_ld" = ""; then
1582 orig_target_ld=$aros_kernel_ld
1584 orig_target_ld=$aros_target_ld
1586 if test "$GCC" = "yes"; then
1587 aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1589 aros_target_cc="${prefix}-gcc"
1590 aros_target_as="${prefix}-as"
1591 aros_target_ld="${prefix}-ld"
1592 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1593 aros_target_objcopy=${prefix}-objcopy
1594 aros_target_objdump=${prefix}-objdump
1595 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1596 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1597 aros_kernel_nm="${prefix}-nm"
1598 aros_target_strip=${prefix}-strip
1600 # Find the system include path. We can suggest that an alternative is
1601 # used if we don't get it correct. The default is to use /usr/include.
1602 # Which is set in the aros_target_incl_def variable.
1604 AC_ARG_ENABLE(includes,
1605 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1606 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1608 if test "$aros_kernel_includes" = ""; then
1609 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1610 # FIXME: for cross-compiling this should point to another location
1611 aros_kernel_includes="-isystem $aros_target_incl"
1615 if test "$aros_kernel_includes" != "" ; then
1616 dnl find out about the kernel cc's include path
1617 AC_MSG_CHECKING([for the kernel compiler's include path])
1618 if test "$aros_kernel_cc_includes" = "" ; then
1619 # Try to guess where the directory is.
1620 aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1621 if test -d $aros_kernel_cc_includes; then
1622 # Check if there is also an include-fixed directory and add it
1623 # to kernel compiler's include path as it may contain some of
1624 # the headers we need.
1625 if test -d "$aros_kernel_cc_includes"-fixed; then
1626 aros_kernel_cc_includes+=" -isystem $aros_kernel_cc_includes"-fixed
1629 # The directory doesn't exist, we need to do some more work.
1630 aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1632 # These are the headers we're looking for.
1633 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1634 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1638 for h in $headers; do
1639 # Which other headers are needed by each of the above?
1640 deps=$(echo "#include <$h>" | \
1641 $aros_kernel_cc -E -M - 2>/dev/null | \
1642 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1644 # Copy all the needed headers to a directory beneath gendir.
1647 dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1648 sed -n "s,^.*/include\(/.*\),\1,p")
1649 ! test -d $dir && mkdir -p $dir
1650 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1655 AC_MSG_RESULT($aros_kernel_cc_includes)
1656 # Adding -nostdinc to kernel includes as they are always used together.
1657 aros_kernel_includes="$aros_kernel_includes $aros_target_nostdinc_cflags -isystem $aros_kernel_cc_includes"
1660 dnl find out about the target cc's include path
1661 AC_MSG_CHECKING([for the target compiler's include path])
1662 if test "$aros_target_cc_includes" = "" ; then
1663 #try to guess where the directory is
1664 aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1665 if ! test -d $aros_target_cc_includes; then
1666 #the directory doesn't exist, we need to do some more work
1667 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1669 #these are the headers we're looling for
1670 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1671 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1675 for h in $headers; do
1676 #which other headers each of the above headers needs?
1677 deps=$(echo "#include <$h>" | \
1678 $orig_target_cc -E -M - 2>/dev/null | \
1679 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1681 #copy all the needed headers to a directory beneath gendir
1684 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1685 sed -n "s,^.*/include\(/.*\),\1,p")
1686 ! test -d $dir && mkdir -p $dir
1687 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1692 AC_MSG_RESULT($aros_target_cc_includes)
1695 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1696 # On GCC >= 4.0 -iquote should be used
1700 save_cflags="$CFLAGS"
1702 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1703 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1704 AC_MSG_RESULT($has_iquote)
1705 if test "x-$has_iquote" = "x-yes" ; then
1706 host_cflags_iquote=-iquote
1707 host_cflags_iquote_end=
1709 host_cflags_iquote=-I
1710 host_cflags_iquote_end=-I-
1712 kernel_cflags_iquote=$host_cflags_iquote
1713 kernel_cflags_iquote_end=$host_cflags_iquote_end
1714 if test "x-$cross_compiling" = "x-yes"; then
1715 CC="$aros_kernel_cc"
1716 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1717 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1718 AC_MSG_RESULT($use_no_stack_protector)
1719 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1720 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1721 AC_MSG_RESULT($has_iquote)
1722 if test "x-$has_iquote" = "x-yes" ; then
1723 kernel_cflags_iquote=-iquote
1724 kernel_cflags_iquote_end=
1726 kernel_cflags_iquote=-I
1727 kernel_cflags_iquote_end=-I-
1730 aros_cflags_iquote=$kernel_cflags_iquote
1731 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1732 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1733 CC="$orig_target_cc"
1734 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1735 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1736 AC_MSG_RESULT($has_iquote)
1737 if test "x-$has_iquote" = "x-yes" ; then
1738 aros_cflags_iquote=-iquote
1739 aros_cflags_iquote_end=
1741 aros_cflags_iquote=-I
1742 aros_cflags_iquote_end=-I-
1745 if test "x-$use_no_stack_protector" = "x-yes" ; then
1746 aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1749 #-----------------------------------------------------------------------------
1751 # Check if we can explicitly choose older version of symbol hashing
1753 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1754 CC="$aros_kernel_cc"
1755 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1756 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1757 AC_MSG_RESULT($use_hash_style)
1758 if test "x-$use_hash_style" = "x-yes" ; then
1759 aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1762 CFLAGS="$save_cflags"
1764 AC_SUBST(host_cflags_iquote)
1765 AC_SUBST(host_cflags_iquote_end)
1766 AC_SUBST(kernel_cflags_iquote)
1767 AC_SUBST(kernel_cflags_iquote_end)
1768 AC_SUBST(aros_cflags_iquote)
1769 AC_SUBST(aros_cflags_iquote_end)
1772 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1773 AC_MSG_CHECKING([for default resolution of WBScreen])
1774 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1775 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1776 if test "$resolution" = "yes" ; then
1779 if test "$resolution" = "no" ; then
1782 if test "$resolution" != "none" ; then
1783 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1784 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1785 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1787 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1788 aros_cv_default_wbwidth=$aros_default_wbwidth
1789 aros_cv_default_wbheight=$aros_default_wbheight
1790 aros_cv_default_wbdepth=$aros_default_wbdepth
1792 dnl See if the user wants the serial debug output for native flavour
1793 AC_MSG_CHECKING([if serial debug is enabled])
1794 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)
1795 if test "$aros_serial_debug" = 0 ; then
1796 serial_debug_forced=""
1797 if test "$serial_debug" = "yes" ; then
1800 if test "$serial_debug" = "no" ; then
1804 serial_debug_forced="(forced)"
1805 serial_debug=$aros_serial_debug
1807 if test "$serial_debug" != "none" ; then
1808 aros_serial_debug=$serial_debug
1809 AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1814 dnl See if the user wants the palm debug output hack for palm native flavour
1815 AC_MSG_CHECKING([if palm debug hack is enabled])
1816 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")
1817 if test "$palm_debug_hack" = "yes" ; then
1818 aros_palm_debug_hack="1"
1820 AC_MSG_RESULT($palm_debug_hack)
1823 dnl See if the user wants nesting supervisor activated for unix flavour
1824 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1825 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")
1826 if test "$nesting_supervisor" = "yes" ; then
1827 aros_nesting_supervisor="1"
1829 AC_MSG_RESULT($nesting_supervisor)
1831 dnl See if the user wants to disable MMU support
1832 dnl This can be overriden on per-target basis,
1833 dnl set $aros_enable_mmu to "yes" or "no" to do this
1834 if test "$aros_enable_mmu" = "" ; then
1835 AC_MSG_CHECKING([if MMU support is enabled])
1836 dnl Enabled by default
1837 AC_ARG_ENABLE(mmu,AC_HELP_STRING([--disable-mmu],[Disable MMU support (default=enabled)]),aros_enable_mmu=$enableval,aros_enable_mmu="yes")
1838 if test "$aros_enable_mmu" = "" ; then
1839 aros_enable_mmu="yes"
1841 AC_MSG_RESULT($aros_enable_mmu)
1843 if test "$aros_enable_mmu" = "no" ; then
1850 dnl things specifically required for hosted flavours
1851 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1853 if test "x-$need_dlopen" != "x-no" ; then
1854 dnl some kind of dynamic library access system is required for hostlib.resource
1855 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1856 if test "x-$have_dl" = "x-no" ; then
1857 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1858 aros_host_ldflags="$aros_host_ldflags -ldl"],
1861 if test "x-$have_dl" = "x-no" ; then
1862 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1868 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1869 [build X11 hidd for hosted (default=auto)]),
1870 x11_hidd="$enableval",
1871 x11_hidd="$need_x11")
1872 case "x-$x11_hidd" in
1873 x-yes|x-no|x-auto) ;;
1874 *) x11_hidd="$need_x11" ;;
1880 if test "x-$x11_hidd" != "x-no" ; then
1886 for path in $x_libraries
1888 x_cflags="$x_cflags -L$path"
1891 for path in $x_includes
1893 x_cflags="$x_cflags -I$path"
1896 if test "x-$no_x" = "x-yes" ; then
1899 if test "x-$x11_hidd" != "x-auto" ; then
1900 dnl and they explicitly asked for it, bail out
1901 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1905 dnl found it, setup the metatarget
1906 x11_hidd_target=kernel-x11gfx-kobj
1909 dnl setup shared memory extensions
1910 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1911 [use X11 shared memory (default=auto)]),
1912 x11_hidd_shm="$enableval",
1913 x11_hidd_shm="auto")
1914 case "x-$x11_hidd_shm" in
1915 x-yes|x-no|x-auto) ;;
1916 *) x11_hidd_shm="auto" ;;
1922 if test "x-$x11_hidd_shm" != "x-no" ; then
1924 dnl system shm headers
1925 AC_CHECK_HEADERS(sys/ipc.h)
1926 AC_CHECK_HEADERS(sys/shm.h)
1929 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1931 dnl make sure X libs have shm functions
1932 save_cflags="$CFLAGS"
1933 CFLAGS="$CFLAGS $x_cflags"
1934 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1935 CFLAGS="$save_cflags"
1939 dnl detection done, prepare output
1940 if test "x-$have_xshm" = "x-yes" ; then
1943 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1944 dnl they explicitly asked for it, but we can't do it
1945 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1947 dnl otherwise just disable it
1952 dnl setup vidmode (fullscreen) extensions
1953 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1954 [use X11 vidmode extension (default=auto)]),
1955 x11_hidd_vidmode="$enableval",
1956 x11_hidd_vidmode="auto")
1957 case "x-$x11_hidd_vidmode" in
1958 x-yes|x-no|x-auto) ;;
1959 *) x11_hidd_vidmode="auto" ;;
1965 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1967 dnl make sure X libs have vidmode functions
1968 save_cflags="$CFLAGS"
1969 CFLAGS="$CFLAGS $x_cflags"
1970 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1971 CFLAGS="$save_cflags"
1974 dnl detection done, prepare output
1975 if test "x-$have_vidmode" = "x-yes" ; then
1976 dnl we can do vidmode
1977 DO_VIDMODE_SUPPORT="1"
1978 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1979 dnl they explicitly asked for it, but we can't do it
1980 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1982 dnl otherwise just disable it
1983 DO_VIDMODE_SUPPORT="0"
1987 aros_host_x11_includes=$x_includes
1988 aros_host_x11_libdirs=$x_libraries
1993 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1994 [build SDL hidd for hosted (default=auto)]),
1995 sdl_hidd="$enableval",
1997 case "x-$sdl_hidd" in
1998 x-yes|x-no|x-auto) ;;
1999 *) sdl_hidd="auto" ;;
2003 if test "x-$sdl_hidd" != "x-no" ; then
2006 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
2008 if test "x-$have_sdl" != "x-yes" ; then
2011 if test "x-$sdl_hidd" != "x-auto" ; then
2012 dnl and they explicitly asked for it, bail out
2013 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
2017 dnl found it, set up the metatarget
2018 sdl_hidd_target=kernel-hidd-sdl
2019 aros_host_sdl_cflags=SDL_CFLAGS
2020 aros_host_sdl_libs=SDL_LIBS
2025 AC_CHECK_HEADER(sys/soundcard.h)
2026 if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
2027 oss_library_target=workbench-libs-oss-unix
2032 dnl See if the user wants dbus.library
2033 AC_MSG_CHECKING([if building of dbus.library is enabled])
2034 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
2035 if test "$dbus" = "yes" ; then
2037 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
2038 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
2039 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
2040 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
2044 AC_MSG_RESULT($dbus)
2047 dnl --------------------------------------------------------------------
2048 dnl Configuration Output Section
2049 dnl --------------------------------------------------------------------
2054 AC_SUBST(aros_flavour)
2055 AC_SUBST(aros_flavour_uc)
2056 AC_SUBST(AROS_BUILDDIR)
2057 AC_SUBST(AROS_BUILDDIR_UNIX)
2059 AC_SUBST(AROS_PORTSSRCDIR)
2062 AC_SUBST(aros_cc_pre)
2063 AC_SUBST(aros_host_strip)
2064 AC_SUBST(aros_host_arch)
2065 AC_SUBST(aros_host_cpu)
2066 AC_SUBST(aros_host_cc)
2067 AC_SUBST(aros_host_ar)
2068 AC_SUBST(aros_host_ranlib)
2069 AC_SUBST(aros_host_ld)
2070 AC_SUBST(aros_host_make)
2071 AC_SUBST(aros_host_cflags)
2072 AC_SUBST(aros_host_ldflags)
2073 AC_SUBST(aros_host_debug)
2074 AC_SUBST(aros_host_mkdep)
2075 AC_SUBST(aros_host_mkargs)
2076 AC_SUBST(aros_host_exe_suffix)
2077 AC_SUBST(aros_host_lib_suffix)
2078 AC_SUBST(aros_tools_dir)
2079 AC_SUBST(aros_host_aclocal)
2080 AC_SUBST(aros_host_autoconf)
2081 AC_SUBST(aros_host_autoheader)
2082 AC_SUBST(aros_host_automake)
2085 AC_SUBST(aros_target_guitheme)
2086 AC_SUBST(aros_target_iconset)
2087 AC_SUBST(aros_target_bootloader)
2088 AC_SUBST(aros_target_arch)
2089 AC_SUBST(aros_target_family)
2090 AC_SUBST(aros_target_cpu)
2091 AC_SUBST(aros_target_variant)
2092 AC_SUBST(aros_target_suffix)
2093 AC_SUBST(aros_target_incl)
2094 AC_SUBST(aros_target_ar)
2095 AC_SUBST(aros_target_ranlib)
2096 AC_SUBST(aros_kernel_nm)
2097 AC_SUBST(orig_target_cc)
2098 AC_SUBST(aros_target_cc)
2099 AC_SUBST(aros_target_cxx)
2100 AC_SUBST(aros_kernel_cc)
2101 AC_SUBST(aros_target_as)
2102 AC_SUBST(orig_target_ld)
2103 AC_SUBST(aros_target_ld)
2104 AC_SUBST(aros_kernel_ld)
2105 AC_SUBST(aros_target_cc_includes)
2106 AC_SUBST(aros_target_cc_path)
2107 AC_SUBST(aros_target_objdump)
2108 AC_SUBST(aros_target_objcopy)
2109 AC_SUBST(aros_target_strip)
2110 AC_SUBST(aros_target_nm)
2111 AC_SUBST(aros_kernel_rescomp)
2112 AC_SUBST(aros_shared_default)
2113 AC_SUBST(aros_shared_ld)
2114 AC_SUBST(aros_object_format)
2115 AC_SUBST(aros_compiler_libs)
2116 AC_SUBST(aros_arch_libs)
2118 AC_SUBST(aros_config_cflags)
2119 AC_SUBST(aros_config_aflags)
2120 AC_SUBST(aros_config_ldflags)
2122 AC_SUBST(aros_shared_cflags)
2123 AC_SUBST(aros_shared_aflags)
2124 AC_SUBST(aros_shared_ldflags)
2125 AC_SUBST(aros_kernel_cflags)
2126 AC_SUBST(aros_kernel_includes)
2127 AC_SUBST(aros_kernel_objcflags)
2128 AC_SUBST(aros_kernel_ldflags)
2129 AC_SUBST(aros_debug_cflags)
2130 AC_SUBST(aros_debug_aflags)
2131 AC_SUBST(aros_debug_ldflags)
2132 AC_SUBST(aros_paranoia_cflags)
2133 AC_SUBST(aros_target_genmap)
2134 AC_SUBST(aros_target_strip_flags)
2136 AC_SUBST(crosstools_target)
2139 AC_SUBST(x11_hidd_target)
2140 AC_SUBST(sdl_hidd_target)
2141 AC_SUBST(pci_hidd_target)
2142 AC_SUBST(oss_library_target)
2144 AC_SUBST(aros_default_wbwidth)
2145 AC_SUBST(aros_default_wbheight)
2146 AC_SUBST(aros_default_wbdepth)
2147 AC_SUBST(DO_XSHM_SUPPORT)
2148 AC_SUBST(DO_VIDMODE_SUPPORT)
2150 AC_SUBST(aros_host_x11_includes)
2151 AC_SUBST(aros_host_x11_libdirs)
2152 AC_SUBST(aros_host_sdl_cflags)
2153 AC_SUBST(aros_host_sdl_libs)
2155 # Native version related
2156 AC_SUBST(aros_serial_debug)
2158 # Palm native version related
2159 AC_SUBST(aros_palm_debug_hack)
2161 # Unix/Hosted version related
2162 AC_SUBST(aros_nesting_supervisor)
2165 AC_SUBST(aros_enable_mmu)
2168 AC_SUBST(aros_ios_platform)
2169 AC_SUBST(aros_ios_version)
2170 AC_SUBST(aros_ios_sdk)
2173 AC_SUBST(android_tool)
2174 AC_SUBST(aros_android_level)
2177 AC_SUBST(ENABLE_DBUS)
2178 AC_SUBST(DBUS_CFLAGS)
2179 AC_SUBST(DBUS_LIBFLAGS)
2180 AC_SUBST(KERNEL_DBUS_KOBJ)
2181 AC_SUBST(KERNEL_DBUS_INCLUDES)
2184 AC_SUBST(ENABLE_X11)
2187 AC_SUBST(aros_debug)
2188 AC_SUBST(aros_mungwall_debug)
2189 AC_SUBST(aros_stack_debug)
2190 AC_SUBST(aros_modules_debug)
2192 # Collect-aros stuff: "-ius" to ignore undefined symbols
2193 AC_SUBST(ignore_undefined_symbols)
2195 # C compiler related
2196 AC_SUBST(gcc_target_cpu)
2198 dnl Prepare for output, make up all the generated patches
2199 case "$aros_flavour" in
2200 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2201 aros_flavour="emulation" ;;
2202 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2203 aros_flavour="emulation" ;;
2204 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2205 aros_flavour="standalone";;
2206 standcompat) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2207 aros_flavour="standalone";;
2208 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2209 aros_flavour="native" ;;
2210 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2211 aros_flavour="native" ;;
2212 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2213 aros_flavour="linklib" ;;
2214 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2215 aros_flavour="palmnative" ;;
2216 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2217 aros_flavour="mac68knative" ;;
2218 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2219 aros_flavour="ppcnative" ;;
2222 if test ! -d ${aros_inc_dir} ; then
2223 ${MKDIR} ${aros_inc_dir}
2225 if test ! -d ${aros_geninc_dir} ; then
2226 ${MKDIR} ${aros_geninc_dir}
2228 if test ! -d ${aros_hostcfg_dir} ; then
2229 ${MKDIR} ${aros_hostcfg_dir}
2231 if test ! -d ${aros_targetcfg_dir} ; then
2232 ${MKDIR} ${aros_targetcfg_dir}
2234 if test ! -d ${aros_tools_dir} ; then
2235 ${MKDIR} ${aros_tools_dir}
2237 if test ! -d ${aros_scripts_dir} ; then
2238 ${MKDIR} ${aros_scripts_dir}
2241 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2243 AC_CONFIG_COMMANDS([compiler_executable],
2245 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2247 prefix="${prefix}/${aros_target_cpu}-aros"
2248 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2252 chmod a+x ${prefix2}-gcc ${prefix2}-ld
2254 ln -sf ${prefix2}-gcc ${prefix}-gcc
2255 ln -sf ${prefix2}-ld ${prefix}-ld
2257 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix}-as
2258 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix}-nm
2259 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix}-ar
2260 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix}-ranlib
2261 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2262 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2263 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix}-strip
2265 ln -sf $aros_target_as_ln$aros_host_exe_suffix ${prefix2}-as
2266 ln -sf $aros_target_nm_ln$aros_host_exe_suffix ${prefix2}-nm
2267 ln -sf $aros_target_ar_ln$aros_host_exe_suffix ${prefix2}-ar
2268 ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix ${prefix2}-ranlib
2269 ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2270 ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2271 ln -sf $aros_target_strip_ln$aros_host_exe_suffix ${prefix2}-strip
2274 aros_host_exe_suffix=${aros_host_exe_suffix}
2275 aros_tools_dir=${aros_tools_dir}
2276 aros_target_cpu=${aros_target_cpu}
2277 aros_target_arch=${aros_target_arch}
2278 aros_target_suffix=${aros_target_suffix}
2279 aros_target_nm_ln=${aros_target_nm_ln}
2280 aros_target_as_ln=${aros_target_as_ln}
2281 aros_target_ar_ln=${aros_target_ar_ln}
2282 aros_target_ranlib_ln=${aros_target_ranlib_ln}
2283 aros_target_objdump_ln=${aros_target_objdump_ln}
2284 aros_target_objcopy_ln=${aros_target_objcopy_ln}
2285 aros_target_strip_ln=${aros_target_strip_ln}
2288 AC_CONFIG_COMMANDS([genshared_executable],
2289 [chmod a+x ${aros_scripts_dir}/genshared],
2290 [aros_scripts_dir=${aros_scripts_dir}]
2292 AC_CONFIG_COMMANDS([genmf_executable],
2293 [chmod a+x ${aros_tools_dir}/genmf.py],
2294 [aros_tools_dir=${aros_tools_dir}]
2300 ${aros_inc_dir}/config.h:config/config.h.in
2301 ${aros_geninc_dir}/config.h:config/config.h.in
2302 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2303 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2305 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2306 ${aros_targetcfg_dir}/specs:config/specs.in
2307 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2308 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2309 ${aros_scripts_dir}/genshared:compiler/library_template_c/source/lib_source/genshared.in
2310 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2311 tools/collect-aros/env.h
2312 ${aros_gendir}/arch/all-android/bootstrap/app/default.properties:arch/all-android/bootstrap/app/default.properties.in
2317 dnl This is in order to not define SHARED_CFLAGS sometimes
2318 dnl We don't always do aros_shared_ar, aros_shared_cflags
2320 #XXX compatability...
2321 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2323 if test -n "$aros_shared_cflags" ; then
2324 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2325 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg