rom/exec: Use flavour 'BINCOMPAT' instead of 'NATIVE' for Amigaisms
[AROS.git] / configure.in
blob9481eec1ca2ee8db3f58527a225f9115e4f323d6
1 dnl Copyright © 1997-2010, The AROS Development Team. All rights reserved.
2 dnl $Id$
3 dnl
4 dnl Desc: Autoconf source for configuration file
5 dnl Lang: english
7 #TODO
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 # ------------------------------------------------------------------------
15 AC_INIT(mmakefile)
16 AC_PREREQ(2.61)
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.
22 AC_CANONICAL_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
35     cross_compile=no
36 else
37     if test "$target" = "" ; then
38         target=$host_os-$host_cpu
39         cross_compile=no
40     else
41         cross_compile=yes
42     fi
44 AC_MSG_RESULT($target)
46 if test "$host_os" = "mingw32" ; then
47     PWDCMD="pwd -W"
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}`
58 SRCDIR=${srcpwd}
59 AC_MSG_RESULT($SRCDIR)
61 # Parse the target field into something useful.
62 changequote(<<,>>)
63 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
64 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
65 changequote([,])
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 --------------------------------------------------------------------
77 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.
84 AC_PROG_CC
85 AC_PROG_CC_STDC
86 AC_PROG_CPP
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.
96 aros_host_cc="$CC"
97 AROS_TOOL_CCPATH(aros_host_ld,ld)
98 AROS_REQUIRED(ld,$aros_host_ld)
99 aros_host_make="make"
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
118     *gcc*)
119         aros_host_cc_pipe="-pipe"
120         ;;
121     icc)
122         aros_host_cc_pipe=""
123         ;;
124     *)
125         aros_host_cc_pipe=""
126         ;;
127 esac
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
135 # to that later.
137 case "$host_os" in
138     aros*)
139         aros_host_arch="aros"
140         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
141         case "$host_cpu" in
142             *i?86*)
143                 aros_host_cpu="i386"
144                 ;;
145             *x86_64*)
146                 aros_host_cpu="x86_64"
147                 ;;
148             *powerpc*)
149                 aros_host_cpu="ppc"
150                 ;;
151             *)
152                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
153                 aros_host_cpu="$host_cpu"
154                 ;;
155         esac
156         ;;
158     linux*)
159         aros_host_arch="linux"
160         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
161         case "$host_cpu" in
162             *i?86*)
163                 aros_host_cpu="i386"
164                 ;;
165             *x86_64*)
166                 aros_host_cpu="x86_64"
167                 ;;
168             *m68k*)
169                 aros_host_cpu="m68k"
170                 ;;
171             *powerpc*)
172                 aros_host_cpu="ppc"
173                 ;;
174             *arm*)
175                 aros_host_cpu="arm"
176                 ;;
177             *)
178                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
179                 aros_host_cpu="$host_cpu"
180                 ;;
181         esac
182         ;;
184     freebsd*)
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"
188         aros_host_cpu="i386"
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.
194         case $host_os in
195             freebsd[[234]]*)
196                 aros_object_format="elf_i386"
197                 ;;
199             *)
200                 aros_object_format="elf_i386_fbsd"
201                 ;;
202         esac
204         ;;
206     darwin*)
207         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
208         aros_host_arch="darwin"
209         case "$host_cpu" in
210             *i?86*)
211                 aros_host_cpu="i386"
212                 ;;
213             *x86_64*)
214                 aros_host_cpu="x86_64"
215                 ;;
216             *powerpc*)
217                 aros_host_cpu="ppc"
218                 ;;
219             *)
220                 AC_MSG_WARN("Unknown CPU for Darwin host -- $host_cpu")
221                 aros_host_cpu="$host_cpu"
222                 ;;
223         esac
225         aros_host_ldflags="$aros_host_ldflags -liconv"
227         ;;
229     dragonfly*)
230         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
231         aros_host_make="gmake"
232         aros_host_arch="dragonfly"
233         case $host_cpu in
234             *i?86*)
235                 aros_host_cpu="i386"
236                 ;;
237             *amd64*)
238                 aros_host_cpu="x86_64"
239                 ;;
240             *)
241                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
242                 aros_host_cpu="$host_cpu"
243                 ;;
244         esac
245         ;;
247     netbsd*)
248         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
249         aros_host_make="gmake"
250         aros_host_arch="netbsd"
251         case "$host_cpu" in
252             *i?86*)
253                 aros_host_cpu="i386"
254                 ;;
255             *m68k*)
256                 aros_host_cpu="m68k"
257                 ;;
258             *)
259                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
260                 aros_host_cpu="$host_cpu"
261                 ;;
262         esac    
263         aros_host_lib_suffix=".0.0"
264         ;;
266     openbsd*)
267         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
268         aros_host_make="gmake"
269         aros_host_arch="openbsd"
270         case "$host_cpu" in
271             *i?86*)
272                 aros_host_cpu="i386"
273                 ;;
274             *)
275                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
276                 aros_host_cpu="$host_cpu"
277                 ;;
278         esac
279         ;;
280         
281     solaris*)
282         aros_host_arch="solaris"
283         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
284         case "$host_cpu" in
285             *i?86*)
286                 aros_host_cpu="i386"
287                 ;;
288             *sparc*)
289                 aros_host_cpu="sparc"
290                 ;;
291             *)
292                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
293                 aros_host_cpu="$host_cpu"
294                 ;;
295         esac
296         ;;
298     morphos*)
299         aros_host_arch="morphos"
300         aros_host_cpu="ppc"
301         ;;
303     amiga*)
304         aros_host_arch="amiga"
305         SORT="/gg/bin/sort"
306         TEST="/gg/bin/test"
307         UNIQ="/gg/bin/uniq"
308         FOR="for"
309         TOUCH="/gg/bin/touch"
310         case "$host_cpu" in
311             *m68k*)
312                 aros_host_cpu="m68k"
313                 ;;
314             *powerpc*)
315                 aros_host_cpu="ppc"
316                 ;;
317             *)
318                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
319                 aros_host_cpu="$host_cpu"
320                 ;;
321         esac
322         ;;
324     cygwin*)
325         aros_host_arch="cygwin"
326         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
327         case "$host_cpu" in
328             *i?86*)
329                 aros_host_cpu="i386"
330                 ;;
331             *)
332                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
333                 aros_host_cpu="$host_cpu"
334                 ;;
335         esac
336         ;;
338     mingw32*)
339         aros_host_arch="mingw32"
340         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
341         case "$host_cpu" in
342             *i?86*)
343                 aros_host_cpu="i386"
344                 ;;
345             *)
346                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
347                 aros_host_cpu="$host_cpu"
348                 ;;
349         esac
350         ;;
351     *)
352         AC_MSG_ERROR([Unsupported host architecture $host])
353         ;;
354 esac
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)
365 AROS_PROG(CP,[cp])
366 AROS_REQUIRED(cp,$CP)
367 AROS_PROG(MV,[mv])
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)
381 AROS_PROG(CAT,[cat])
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)
391 AROS_PROG(SED,[sed])
392 AROS_REQUIRED(sed,$SED)
393 AROS_PROG(CHMOD,[chmod])
394 AROS_REQUIRED(chmod,$CHMOD)
396 AM_PATH_PYTHON(2.5)
398 AC_SUBST(FOR, for)
399 AC_SUBST(IF, if)
400 AC_SUBST(TEST, test)
401 AC_SUBST(CMP, cmp)
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>])
415 AC_HEADER_DIRENT
416 AC_HEADER_STAT
417 AC_HEADER_STDC
418 AC_HEADER_SYS_WAIT
419 AC_HEADER_TIME
420 AC_STRUCT_ST_BLKSIZE
421 AC_STRUCT_ST_BLOCKS
422 AC_STRUCT_ST_RDEV
423 AC_STRUCT_TM
424 AC_STRUCT_TIMEZONE
425 AC_TYPE_OFF_T
426 AC_TYPE_PID_T
427 AC_TYPE_SIZE_T
428 AC_TYPE_UID_T
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])
437 AC_FUNC_MMAP
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"
463 aros_compiler_libs=
464 aros_arch_libs=
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"
474 # Unix flavour stuff
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
486 # for it.
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
499 # with it then.
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"
540 else
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
557     debug="none"
558 elif test "$debug" = "yes"; then
559     debug="all"
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"
566     done
567 else
568     for d in $all_debug_types; do
569         export aros_${d}_debug="0"
570     done
573 if test "$debug" != "none"; then
574     debug=`echo $debug | sed s/,/\ /g`
575     for d in $debug; do
576         found="0"
577         for d2 in $all_debug_types; do
578             if test "$d2" = "$d"; then
579                 found="1"
580                 break
581             fi
582         done
583         if test "$found" = "0"; then
584             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
585         fi
586         export aros_${d}_debug="1"
587     done
588     aros_debug="yes"
590 AC_MSG_RESULT($debug)
592 if test "$aros_messages_debug" = "1"; then
593     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
594 else
595     aros_messages_debug=""
597 if test "$aros_symbols_debug" = "1"; then
598     aros_symbols_debug="-g"
599 else
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"
605 aros_debug_aflags=""
606 aros_debug_ldflags="$aros_symbols_debug"
608 aros_crosstools="no"
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
615     AC_MSG_RESULT(yes)
616         aros_crosstools="yes"
617 else
618     AC_MSG_RESULT(no)
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,)
632 else
633     AC_MSG_RESULT(no)
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,)
641 else
642     AC_MSG_RESULT(no)
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
656         optimization="-O0"
657     else
658         optimization="-O2"
659     fi
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
668         paranoia_flags=""
669 else if test "$paranoia_flags" = "yes"; then
670         paranoia_flags="-Wall -Werror"
671 fi fi
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=""
698     enableval="none"
699 else
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.
709 case "$target_os" in
710     linux*)
711         aros_target_arch="linux"
712         aros_target_family="unix"
713         case "$target_cpu" in
714             *m68k*)
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"
722                 ;;
723             *i?86*)
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                 ;;
736             *x86_64*)
737                 aros_target_cpu="x86_64"
738                 aros_object_format="elf_x86_64"
739                 aros_flavour="emulation"
740                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
741                 aros_config_cflags="$aros_config_cflags -mno-red-zone"
742                 aros_default_wbdepth=8
743                 gcc_target_cpu="x86_64"
744                 ;;
745             *powerpc*)
746                 aros_target_cpu="ppc"
747                 aros_object_format="elf32ppc"
748                 aros_flavour="emulation"
749                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
750                 aros_default_wbdepth=8
751                 gcc_target_cpu="ppc"
752                 ;;
753 # TODO
754 # Same as powerpc, but I need this for the nightly build to work again.
755 # Actually, the nightly should be made working with powerpc target.
756 # That just was too much work for the moment, another week or two.
757             *ppc*)
758                 aros_target_cpu="ppc"
759                 aros_object_format="elf32ppc"
760                 aros_flavour="emulation"
761                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
762                 aros_default_wbdepth=8
763                 gcc_target_cpu="ppc"
764                 ;;
765             *arm*)
766                 aros_target_cpu="arm"
767                 aros_object_format="armelf_linux_eabi"
768                 aros_flavour="emulation"
769                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
770                 gcc_target_cpu="arm"
771                 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
772                 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
773                 ;;
774             *)
775                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
776                 ;;
777         esac
778     ;;
780     pc)
781         aros_target_arch="pc"
782         aros_shared_default="no"
783         target_bootloader="grub2"
784         case "$target_cpu" in
785             *i?86*)
786                 aros_target_cpu="i386"
788                 dnl If somebody hasn't already set the target object
789                 dnl format, then use this value. Mostly to support
790                 dnl FreeBSD cross-compilation.
791                 dnl TODO: Remove when we always use our compiler.
793                 if test "$aros_object_format" = "" ; then
794                     aros_object_format="elf_i386"
795                 fi
796                 aros_flavour="standalone"
797                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
798                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
799                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
800                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
801                 aros_config_ldflags="-m32 -march=i486"
802                 aros_kernel_ldflags="-melf_i386"
803                 aros_default_wbwidth=640
804                 aros_default_wbheight=480
805                 gcc_target_cpu="i386"
806                 ;;
807             *x86_64*)
808                 aros_target_cpu="x86_64"
809                 aros_serial_debug=1
810                 if test "$aros_object_format" = "" ; then
811                     aros_object_format="elf_x86_64"
812                 fi
813                 aros_flavour="standalone"
814                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
815                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
816                 aros_kernel_ldflags=""
817                 aros_default_wbwidth=640
818                 aros_default_wbheight=480
819                 gcc_target_cpu="x86_64"
820                 ;;
821             *)
822                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
823                 ;;
824         esac
825         ;;
827     prep)
828         aros_target_arch="prep"
829         aros_shared_default="no"
830         aros_target_cpu="ppc"
831         aros_object_format="elf32ppc"
832         aros_flavour="ppcnative"
833         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
834         aros_kernel_ldflags=""
835         aros_default_wbwidth=640
836         aros_default_wbheight=480
837         gcc_target_cpu="ppc"
838         ;;
840     freebsd*)
841         aros_target_arch="freebsd"
842         aros_target_family="unix"
843         aros_target_cpu="i386"
844         aros_flavour="emulation"
845         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
846         gcc_target_cpu="i386"
848         aros_target_strip_flags="-x"
849         ;;
851     darwin*)
852         aros_target_arch="darwin"
853         aros_target_family="unix"
854         aros_flavour="emulation"
855         case "$target_cpu" in
856             *i?86*)
857                 aros_target_cpu="i386"
858                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
859                 aros_kernel_cflags="$aros_kernel_cflags -m32"
860                 aros_kernel_ldflags="$aros_kernel_ldflags -m32"
861                 aros_default_wbdepth=8
862                 gcc_target_cpu="i386"
863                 aros_object_format="elf_i386"
864                 aros_target_strip_flags="-x"
865                 aros_target_cc="i386-aros-gcc"
866                 aros_target_cxx="i386-aros-g++"
867                 aros_target_ld="i386-aros-ld"
868                 aros_target_as="i386-aros-as"
869                 aros_target_ar="i386-aros-ar"
870                 aros_target_ranlib="i386-aros-ranlib"
871                 aros_target_nm="i386-aros-nm"
872                 aros_target_strip="i386-aros-strip"
873                 aros_target_objcopy="i386-aros-objcopy"
874                 aros_target_objdump="i386-aros-objdump"
875                 target_tool_prefix="i686-apple-darwin10-"
876                 ;;
877             *x86_64*)
878                 aros_target_cpu="x86_64"
879                 aros_object_format="elf_x86_64"
880                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
881                 aros_kernel_cflags="$aros_kernel_cflags -m64"
882                 aros_kernel_ldflags="$aros_kernel_ldflags -m64"
883                 aros_default_wbdepth=8
884                 gcc_target_cpu="x86_64"
885                 aros_target_cc="x86_64-aros-gcc"
886                 aros_target_cxx="x86_64-aros-g++"
887                 aros_target_ld="x86_64-aros-ld"
888                 aros_target_as="x86_64-aros-as"
889                 aros_target_ar="x86_64-aros-ar"
890                 aros_target_ranlib="x86_64-aros-ranlib"
891                 aros_target_nm="x86_64-aros-nm"
892                 aros_target_strip="x86_64-aros-strip"
893                 aros_target_objcopy="x86_64-aros-objcopy"
894                 aros_target_objdump="x86_64-aros-objdump"
895                 target_tool_prefix="i686-apple-darwin10-"
896                 ;;
897             *ppc*)
898                 aros_target_cpu="ppc"
899                 aros_object_format="elf32_ppc"
900                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
901                 aros_default_wbdepth=8
902                 gcc_target_cpu="ppc"
903                 aros_target_cc="ppc-aros-gcc"
904                 aros_target_cxx="ppc-aros-g++"
905                 aros_target_ld="ppc-aros-ld"
906                 aros_target_as="ppc-aros-as"
907                 aros_target_ar="ppc-aros-ar"
908                 aros_target_ranlib="ppc-aros-ranlib"
909                 aros_target_nm="ppc-aros-nm"
910                 aros_target_strip="ppc-aros-strip"
911                 aros_target_objcopy="ppc-aros-objcopy"
912                 aros_target_objdump="ppc-aros-objdump"
913                 target_tool_prefix="powerpc-apple-darwin10-"
914                 ;;
915             *)
916                 AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
917                 ;;
918         esac
919         ;;
921     ios*)
922         aros_target_arch="ios"
923         aros_target_family="unix"
924         aros_flavour="emulation"
925         # This is here because it may depend on iOS or SDK version
926         aros_kernel_objcflags="-fobjc-abi-version=2 -fobjc-legacy-dispatch"
927         case "$target_cpu" in
928             *i?86*)
929                 aros_ios_platform="iPhoneSimulator"
930                 aros_target_cpu="i386"
931                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
932                 aros_default_wbdepth=8
933                 gcc_target_cpu="i386"
934                 aros_object_format="elf_i386"
935                 aros_target_strip_flags="-x"
936                 aros_target_cc="i386-aros-gcc"
937                 aros_target_cxx="i386-aros-g++"
938                 aros_target_ld="i386-aros-ld"
939                 aros_target_as="i386-aros-as"
940                 aros_target_ar="i386-aros-ar"
941                 aros_target_ranlib="i386-aros-ranlib"
942                 aros_target_nm="i386-aros-nm"
943                 aros_target_strip="i386-aros-strip"
944                 aros_target_objcopy="i386-aros-objcopy"
945                 aros_target_objdump="i386-aros-objdump"
946                 target_tool_prefix="i686-apple-darwin10-"
947                 target_tool_flags="-m32"
948                 ;;
949             *arm*)
950                 aros_ios_platform="iPhoneOS"
951                 aros_target_cpu="arm"
952                 aros_object_format="armelf_linux_eabi"
953                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
954                 aros_config_cflags="$aros_config_cflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
955                 aros_config_aflags="$aros_config_aflags -march=armv6 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
956                 aros_arch_libs="-laeabi"
957                 aros_default_wbdepth=8
958                 gcc_target_cpu="arm"
959                 aros_kernel_ld="ld -arch armv6"
960                 aros_target_cc="arm-aros-gcc"
961                 aros_target_cxx="arm-aros-g++"
962                 aros_target_ld="arm-aros-ld"
963                 aros_target_as="arm-aros-as"
964                 aros_target_ar="arm-aros-ar"
965                 aros_target_ranlib="arm-aros-ranlib"
966                 aros_target_nm="arm-aros-nm"
967                 aros_target_strip="arm-aros-strip"
968                 aros_target_objcopy="arm-aros-objcopy"
969                 aros_target_objdump="arm-aros-objdump"
970                 target_tool_prefix="arm-apple-darwin10-" 
971                 aros_default_wbwidth=320
972                 aros_default_wbheight=480
973                 export PATH="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/usr/bin:$PATH"
974                 ;;
975             *)
976                 AC_MSG_ERROR("Unsupported target CPU for iOS hosted flavour -- $target_cpu")
977                 ;;
978         esac
979         aros_ios_sdk="$aros_xcode_path/Platforms/$aros_ios_platform.platform/Developer/SDKs/$aros_ios_platform$aros_ios_sdk.sdk"
980         target_tool_flags="$target_tool_flags --sysroot $aros_ios_sdk"
981         ;;
983     dragonfly*)
984         aros_target_arch="dragonfly"
985         aros_target_family="unix"
986         aros_flavour="emulation"
987         case "$target_cpu" in
988             *i?86*)
989                 aros_target_cpu="i386"
990                 aros_object_format="elf_i386"
991                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
992                 ;;
993             *x86_64*)
994                 aros_target_cpu="x86_64"
995                 aros_object_format="elf_x86_64"
996                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
997                 ;;
998             *)
999                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
1000                 ;;
1001         esac
1002         ;;
1004     netbsd*)
1005         aros_target_arch="netbsd"
1006         aros_target_family="unix"
1007         case "$target_cpu" in
1008             *m68k*)
1009                 aros_target_cpu="m68k"
1010                 aros_object_format="m68kelf"
1011                 aros_flavour="emulcompat"
1012                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
1013                 gcc_target_cpu="mc68000"
1014                 ;;
1015             *i?86*)
1016                 aros_target_cpu="i386"
1017                 aros_object_format="elf_i386"
1018                 aros_flavour="emulation"
1019                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
1020                 aros_default_wbdepth=8
1021                 gcc_target_cpu="i386"
1022                 ;;
1023             *)
1024                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
1025                 ;;
1026         esac
1027         aros_target_genmap="-Wl,-M -Xlinker >"
1028         aros_flavour="emulation"
1029         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1030         ;;   
1032     openbsd*)
1033         aros_target_arch="openbsd"
1034         aros_target_family="unix"
1035         case "$target_cpu" in
1036             *i?86*)
1037                 aros_target_cpu="i386"
1038                 aros_object_format="elf_i386"
1039                 aros_flavour="emulation"
1040                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
1041                 gcc_target_cpu="i386"
1042                 ;;
1043             *)
1044                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
1045                 ;;
1046         esac
1047         aros_target_genmap="-Wl,-M -Xlinker >"
1048         aros_target_nm_flags="-u"
1049         aros_flavour="emulation"
1050         ;;
1052     solaris*)
1053         aros_target_arch="solaris"
1054         aros_target_family="unix"
1055         case "$target_cpu" in
1056            *i?86*)
1057                aros_target_cpu="i386"
1058                aros_object_format="elf_i386"
1059                aros_flavour="emulation"
1060                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
1061                aros_default_wbdepth=8
1062                gcc_target_cpu="i386"
1063                ;;
1064             *sparc*)
1065                 aros_target_cpu="sparc"
1066                 aros_object_format="elf_sparc"
1067                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
1068                 gcc_target_cpu="sparc"
1069                 ;;
1070             *)
1071                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
1072                 ;;
1073         esac
1074         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
1075         aros_flavour="emulation"
1076         ;;
1078     morphos*)
1079         aros_target_arch="morphos"
1080         aros_shared_default="no"
1081         aros_target_cpu="ppc"
1082         aros_object_format="elf_ppc"
1083         aros_flavour="nativecompat"
1084         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1085         gcc_target_cpu="ppc"
1086         ;;
1088     sam440)
1089         aros_target_arch="sam440"
1090         aros_shared_default="no"
1091         aros_target_cpu="ppc"
1092         aros_object_format="elf32ppc"
1093         aros_flavour="ppcnative"
1094         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1095         aros_kernel_ldflags=""
1096         aros_default_wbwidth=1024
1097         aros_default_wbheight=768
1098         aros_default_wbdepth=24
1099         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
1100         gcc_target_cpu="powerpc"
1101         ;;
1103     efika)
1104         aros_target_arch="efika"
1105         aros_shared_default="no"
1106         aros_target_cpu="arm"
1107         aros_object_format="armelf_linux_eabi"
1108         aros_flavour="standalone"
1109         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1110         aros_kernel_ldflags=""
1111         aros_default_wbwidth=1024
1112         aros_default_wbheight=600
1113         aros_arch_libs="-laeabi"
1114         aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1115         aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions -fno-strict-aliasing"
1116         ;;
1117         
1118     chrp)
1119     aros_target_arch="chrp"
1120     aros_shared_default="no"
1121     aros_target_cpu="ppc"
1122     aros_object_format="elf32ppc"
1123     aros_flavour="ppcnative"
1124     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
1125     aros_kernel_ldflags=""
1126     aros_default_wbwidth=640
1127     aros_default_wbheight=480
1128     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
1129     gcc_target_cpu="powerpc"
1130         case "$aros_target_variant" in
1131             efika)
1132             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
1133             ;;
1134         esac
1135     ;;
1137     amiga*)
1138         aros_target_arch="amiga"
1139         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
1140         aros_shared_default="no"
1142         case "$target_cpu" in
1143             *m68k-eabi)
1144                 aros_target_cpu="m68k"
1145                 aros_object_format="m68kelf"
1146                 aros_flavour="standalone"
1147                 gcc_target_cpu="mc68000"
1148                 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1149                 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1150                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -${gcc_target_cpu}"
1151                 target_tool_prefix="m68k-elf-"
1152                 aros_target_nostdlib_ldflags="" # We always need -lgcc
1153                 aros_target_strip_flags="-R.comment"
1154                 ;;
1155             *m68k*)
1156                 aros_target_cpu="m68k"
1157                 aros_object_format="m68kelf"
1158                 aros_flavour="standcompat"
1159                 gcc_target_cpu="mc68000"
1160                 aros_config_cflags="$aros_config_cflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu} -fbuiltin"
1161                 aros_config_aflags="$aros_config_aflags -g3 -fno-strict-aliasing -ffreestanding -fomit-frame-pointer -${gcc_target_cpu}"
1162                 aros_paranoia_cflags="$aros_paranoia_cflags -Wno-volatile-register-var"
1163                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -${gcc_target_cpu}"
1164                 target_tool_prefix="m68k-elf-"
1165                 aros_target_nostdlib_ldflags="" # We always need -lgcc
1166                 aros_target_strip_flags="-R.comment"
1167                 ;;
1168             *ppc*)
1169                 aros_cpu="ppc"
1170                 aros_flavour="native"
1171                 gcc_target_cpu="ppc"
1172                 ;;
1173             *)
1174                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1175                 ;;
1176         esac
1177         ;;
1179     mingw*)
1180         aros_target_arch="mingw32"
1181         aros_shared_default="no"
1182         aros_flavour="emulation"
1183         aros_shared_cflags=""
1184         need_dlopen="no"
1185         rescomp="windres"
1186         case "$target_cpu" in
1187             *i?86*)
1188                 aros_target_cpu="i386"
1189                 aros_object_format="elf_i386"
1190                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1191                 aros_default_wbdepth=8
1192                 gcc_target_cpu="i386"
1193                 aros_target_cc="i386-aros-gcc"
1194                 aros_target_cxx="i386-aros-g++"
1195                 aros_target_ld="i386-aros-ld"
1196                 aros_target_as="i386-aros-as"
1197                 aros_target_ar="i386-aros-ar"
1198                 aros_target_ranlib="i386-aros-ranlib"
1199                 aros_target_nm="i386-aros-nm"
1200                 aros_target_strip="i386-aros-strip"
1201                 aros_target_objcopy="i386-aros-objcopy"
1202                 aros_target_objdump="i386-aros-objdump"
1203                 target_tool_prefix="i386-mingw32-"
1204                 ;;
1205             *x86_64*)
1206                 aros_target_cpu="x86_64"
1207                 aros_object_format="elf_x86_64"
1208                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1209                 aros_default_wbdepth=8
1210                 gcc_target_cpu="x86_64"
1211                 aros_target_cc="x86_64-aros-gcc"
1212                 aros_target_cxx="x86_64-aros-g++"
1213                 aros_target_ld="x86_64-aros-ld"
1214                 aros_target_as="x86_64-aros-as"
1215                 aros_target_ar="x86_64-aros-ar"
1216                 aros_target_ranlib="x86_64-aros-ranlib"
1217                 aros_target_nm="x86_64-aros-nm"
1218                 aros_target_strip="x86_64-aros-strip"
1219                 aros_target_objcopy="x86_64-aros-objcopy"
1220                 aros_target_objdump="x86_64-aros-objdump"
1221                 target_tool_prefix="x86_64-w64-mingw32-"
1222                 ;;
1223             *arm*)
1224                 aros_target_cpu="arm"
1225                 aros_object_format="armelf_linux_eabi"
1226                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1227                 aros_arch_libs="-laeabi"
1228                 aros_default_wbdepth=8
1229                 gcc_target_cpu="arm"
1230                 aros_target_cc="arm-aros-gcc"
1231                 aros_target_cxx="arm-aros-g++"
1232                 aros_target_ld="arm-aros-ld"
1233                 aros_target_as="arm-aros-as"
1234                 aros_target_ar="arm-aros-ar"
1235                 aros_target_ranlib="arm-aros-ranlib"
1236                 aros_target_nm="arm-aros-nm"
1237                 aros_target_strip="arm-aros-strip"
1238                 aros_target_objcopy="arm-aros-objcopy"
1239                 aros_target_objdump="arm-aros-objdump"
1240                 target_tool_prefix="arm-mingw32ce-"
1241                 aros_default_wbwidth=160
1242                 aros_default_wbheight=160
1243                 ;;
1244             *)
1245                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1246                 ;;
1247         esac
1248         if test $host_os = "cygwin"; then
1249                 aros_kernel_cflags="-mno-cygwin"
1250         fi
1251     ;;
1252     pp*)
1253         aros_target_arch="pp"
1254         aros_shared_default="no"
1255         case "$target_cpu" in
1256             *m68k*)
1257                 aros_target_cpu="m68k"
1258                 aros_object_format="m68kelf"
1259                 aros_flavour="palmnative"
1260                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1261                 aros_default_wbwidth=160
1262                 aros_default_wbheight=160
1263                 aros_default_wbdepth=1
1264                 aros_target_ar_flags="cru"
1265                 aros_compiler_libs="-lgcc1"
1266                 aros_shared_default=no
1267                 aros_shared_cflags="-fpic"
1268                 aros_shared_aflags=""
1269                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1270                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1271                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
1272                 aros_debug_aflags=""
1273                 aros_debug_ldflags="$aros_symbols_debug"
1274                 aros_mungwall_debug="0"
1275                 aros_modules_debug="0"
1276                 gcc_target_cpu="mc68000"
1277                 ignore_undefined_symbols="-ius"
1278                 ;;
1279            *)
1280                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1281                 ;;
1282         esac
1283         ;;
1285     mac*)
1286         aros_target_arch="mac"
1287         aros_shared_default="no"
1288         case "$target_cpu" in
1289             *m68k*)
1290                 aros_target_cpu="m68k"
1291                 aros_object_format="m68kelf"
1292                 aros_flavour="mac68knative"
1293                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1294                 aros_default_wbwidth=512
1295                 aros_default_wbheight=384
1296                 aros_default_wbdepth=8
1297                 aros_target_ar_flags="cru"
1298                 aros_compiler_libs="-lgcc1"
1299                 aros_shared_default=no
1300                 aros_shared_cflags="-fpic"
1301                 aros_shared_aflags=""
1302                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1303                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1304                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000"
1305                 aros_debug_aflags=""
1306                 aros_debug_ldflags="$aros_symbols_debug"
1307                 aros_mungwall_debug="0"
1308                 aros_modules_debug="0"
1309                 gcc_target_cpu="mc68000"
1310                 ignore_undefined_symbols="-ius"
1311                 ;;
1312            *)
1313                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1314                 ;;
1315         esac
1316         ;;
1318     *)
1319         AC_MSG_ERROR([Unsupported target architecture $target])
1320         ;;
1321 esac
1323 # FIXME: for cross-compiling this should point to another location
1324 if test "$aros_flavour" = "emulation"; then
1325     aros_kernel_includes="-isystem /usr/include"
1327 if test "$aros_flavour" = "emulcompat"; then
1328     aros_kernel_includes="-isystem /usr/include"
1331 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1332 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1333 if test "$with_portssrcdir" = "default"; then
1334     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1335 else
1336     AROS_PORTSSRCDIR="$with_portssrcdir"
1338 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1340 AC_MSG_CHECKING([which bootloader to use])
1341 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1342 if test "$target_bootloader" = "none"; then
1343     aros_target_bootloader=""
1344 else
1345     aros_target_bootloader="$target_bootloader"
1347 AC_MSG_RESULT($target_bootloader)
1349 AC_MSG_CHECKING([which icon-set to use])
1350 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1351 if test "$target_iconset" = "default"; then
1352     aros_target_iconset="Gorilla"
1353     target_iconset="default (Gorilla)"
1354 else
1355     aros_target_iconset="$target_iconset"
1357 AC_MSG_RESULT($target_iconset)
1359 AC_MSG_CHECKING([which GUI Theme to use])
1360 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1361 if test "$target_guitheme" = "default"; then
1362     aros_target_guitheme="Ice"
1363 else
1364     aros_target_guitheme="$target_guitheme"
1366 AC_MSG_RESULT($aros_target_guitheme)
1368 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1369 # for target code)
1370 cross_compiling=no
1371 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1372     cross_compiling=yes
1374 if test "$aros_host_cpu" == "x86_64" ; then
1375     if test "$aros_target_cpu" == "i386" ; then
1376         if test "$aros_target_arch" != "mingw32"; then
1377             cross_compiling=no
1378         fi
1379     fi
1382 # Set prefix for target compiler etc. if we're cross-compiling
1383 # (should possibly be earlier but needs to be after AC_PROG_CC)
1384 if test "$cross_compiling" = "yes" ; then
1385     if test "$target_tool_prefix" = ""; then
1386         target_tool_prefix=${target_cpu}-elf-
1387     fi
1388     CC=${target_tool_prefix}gcc
1389     if test "$target_tool_version" != "default"; then
1390         CC="$CC-$target_tool_version"
1391     fi
1392     AC_PATH_PROG(CC,$CC)
1393     AROS_REQUIRED(gcc,$CC)
1395 CC="$CC $target_tool_flags"
1397 #-----------------------------------------------------------------------------
1399 # Disable pointer-signedness warnings if the compiler recognises the option
1401 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1402 save_cflags="$CFLAGS"
1403 CFLAGS="$CFLAGS -Wno-pointer-sign"
1404 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1405 AC_MSG_RESULT($use_no_sign_warning)
1406 if test "x-$use_no_sign_warning" = "x-yes" ; then
1407     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1409 CFLAGS="$save_cflags"
1411 #-----------------------------------------------------------------------------
1413 # Find all the tools we need to compile. This could be cross-compiling
1414 # though! If that is the case we use the GNU form of the target and
1415 # simply add this to the front of the binary name. This is rather simple,
1416 # but it should work under most circumstances.
1418 # The default tools are to use the same as the host, but only if the
1419 # host and target CPU are the same. With GCC this is normally enough.
1422 aros_cc_pre=""
1423 aros_shared_ld="$aros_host_ld"
1425 aros_target_mkdep="$aros_host_mkdep"
1426 aros_target_incl_def="$aros_host_incl"
1428 aros_kernel_cc="$CC"
1430 # The default tools executables to be linked to.
1431 if test "$aros_target_cc" != ""; then
1432     AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1433     AROS_REQUIRED(gcc,$aros_target_cc)
1435 if test "$aros_target_ld" != ""; then
1436     AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1437     AROS_REQUIRED(ld,$aros_target_ld)
1440 if test "$crosstools" != "yes"; then
1441     AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1442     AROS_REQUIRED(as,$aros_target_as_ln)
1443     AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1444     AROS_REQUIRED(ld,$aros_kernel_ld)
1445     AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1446     AROS_REQUIRED(ar,$aros_target_ar_ln)
1447     AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1448     AROS_REQUIRED(nm,$aros_target_nm_ln)
1449     AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1450     AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1451     AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1452     AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1453     AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1454     AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1455     AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1456     AROS_REQUIRED(strip,$aros_target_strip_ln)
1457     if test "$aros_target_cxx" != ""; then
1458         AC_PATH_PROG(aros_target_cxx,$aros_target_cxx)
1459 # Temporarily disabled in order to let Mingw32-hosted nightly build to work
1460 #       AROS_REQUIRED(c++,$aros_target_cxx)
1461     fi
1462 else
1463 # Cancel preinstalled C++ compiler because it will be built as part of crosstools
1464     aros_target_cxx=""
1467 # Build crosstools if we have no C++ - temporary thing 
1468 if test "$aros_target_cxx" = ""; then
1469     crosstools_target=tools-crosstools
1472 if test "$rescomp" != ""; then
1473     if test "$cross_compiling" = "yes" ; then
1474         rescomp=${target_tool_prefix}${rescomp}
1475     fi
1476     AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1477     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1480 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1481 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1482 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1483 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1484 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1485 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1486 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1488 # aros_cc_pre is a variable that is added to the front of the compiler name
1489 # in the generated aros-gcc shell script. We need this to enable the cache
1490 # to work across cleaned builds. Also, support DISTCC using the correct
1491 # environment variable.
1494 if test "x${DISTCC}" != "x" ; then
1495     if test "x${CCACHE}" != "x" ; then
1496         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1497     else
1498         aros_cc_pre="${DISTCC} "
1499     fi
1500 else
1501     if test "x${CCACHE}" != "x" ; then
1502         aros_cc_pre="${CCACHE} "
1503     fi
1506 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1508 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1509 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1510 AC_SUBST(aros_target_nix_ldflags,-nix)
1511 AC_SUBST(aros_target_detach_ldflags,-detach)
1512 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1514 # Target tools
1515 if test "$aros_target_cc" = ""; then
1516     orig_target_cc=$aros_kernel_cc
1517 else
1518     orig_target_cc=$aros_target_cc
1520 if test "$aros_target_ld" = ""; then
1521     orig_target_ld=$aros_kernel_ld
1522 else
1523     orig_target_ld=$aros_target_ld
1525 if test "$GCC" = "yes"; then
1526     aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1528 aros_target_cc="${prefix}-gcc"
1529 aros_target_as="${prefix}-as"
1530 aros_target_ld="${prefix}-ld"
1531 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1532 aros_target_objcopy=${prefix}-objcopy
1533 aros_target_objdump=${prefix}-objdump
1534 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1535 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1536 aros_kernel_nm="${prefix}-nm"
1537 aros_target_strip=${prefix}-strip
1539 # Find the system include path. We can suggest that an alternative is
1540 # used if we don't get it correct. The default is to use /usr/include.
1541 # Which is set in the aros_target_incl_def variable.
1543 AC_ARG_ENABLE(includes,
1544 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1545 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1547 if test "$aros_kernel_includes" != "" ; then
1548     dnl find out about the kernel cc's include path
1549     AC_MSG_CHECKING([for the kernel compiler's include path])
1550     if test "$aros_kernel_cc_includes" = "" ; then
1551         #try to guess where the directory is
1552         aros_kernel_cc_includes=`dirname \`${aros_kernel_cc} ${aros_kernel_cflags} -print-libgcc-file-name\``/include
1553         if ! test -d $aros_kernel_cc_includes; then
1554             #the directory doesn't exist, we need to do some more work
1555             aros_kernel_cc_includes=${PWD}/${aros_gendir}/cc_include
1557             #these are the headers we're looling for
1558             headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1559                      stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1560                      zutil.h"
1562             dirs=
1563             for h in $headers; do
1564                 #which other headers each of the above headers needs?
1565                 deps=$(echo "#include <$h>" | \
1566                        $aros_kernel_cc -E -M - 2>/dev/null | \
1567                        sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1569                 #copy all the needed headers to a directory beneath gendir
1570                 for d in $deps; do
1571                     h=$(basename $d)
1572                     dir=${aros_kernel_cc_includes}$(echo $(dirname $d) | \
1573                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1574                     ! test -d $dir && mkdir -p $dir
1575                     ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1576                 done
1577             done            
1578         fi
1579     fi
1580     AC_MSG_RESULT($aros_kernel_cc_includes)
1581     aros_kernel_includes="$aros_kernel_includes -isystem $aros_kernel_cc_includes"
1584 dnl find out about the target cc's include path
1585 AC_MSG_CHECKING([for the target compiler's include path])
1586 if test "$aros_target_cc_includes" = "" ; then
1587     #try to guess where the directory is
1588     aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1589     if ! test -d $aros_target_cc_includes; then
1590         #the directory doesn't exist, we need to do some more work
1591         aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1592         
1593         #these are the headers we're looling for
1594         headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1595                  stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1596                  zutil.h"
1598         dirs=
1599         for h in $headers; do
1600             #which other headers each of the above headers needs?
1601             deps=$(echo "#include <$h>" | \
1602                    $orig_target_cc -E -M - 2>/dev/null | \
1603                    sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1604             
1605             #copy all the needed headers to a directory beneath gendir
1606             for d in $deps; do
1607                 h=$(basename $d)
1608                 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1609                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1610                 ! test -d $dir && mkdir -p $dir
1611                 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1612             done
1613         done        
1614     fi
1616 AC_MSG_RESULT($aros_target_cc_includes)
1619 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1620 # On GCC >= 4.0 -iquote should be used
1623 save_cc="$CC"
1624 save_cflags="$CFLAGS"
1625 CFLAGS="-iquote."
1626 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1627 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1628 AC_MSG_RESULT($has_iquote)
1629 if test "x-$has_iquote" = "x-yes" ; then
1630     host_cflags_iquote=-iquote
1631     host_cflags_iquote_end=
1632 else
1633     host_cflags_iquote=-I
1634     host_cflags_iquote_end=-I-
1636 kernel_cflags_iquote=$host_cflags_iquote
1637 kernel_cflags_iquote_end=$host_cflags_iquote_end
1638 if test "x-$cross_compiling" = "x-yes"; then
1639     CC="$aros_kernel_cc"
1640     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1641     AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1642     AC_MSG_RESULT($use_no_stack_protector)
1643     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1644     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1645     AC_MSG_RESULT($has_iquote)
1646     if test "x-$has_iquote" = "x-yes" ; then
1647         kernel_cflags_iquote=-iquote
1648         kernel_cflags_iquote_end=
1649     else
1650         kernel_cflags_iquote=-I
1651         kernel_cflags_iquote_end=-I-
1652     fi
1654 aros_cflags_iquote=$kernel_cflags_iquote
1655 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1656 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1657     CC="$orig_target_cc"
1658     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1659     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1660     AC_MSG_RESULT($has_iquote)
1661     if test "x-$has_iquote" = "x-yes" ; then
1662         aros_cflags_iquote=-iquote
1663         aros_cflags_iquote_end=
1664     else
1665         aros_cflags_iquote=-I
1666         aros_cflags_iquote_end=-I-
1667     fi
1669 if test "x-$use_no_stack_protector" = "x-yes" ; then
1670     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1673 #-----------------------------------------------------------------------------
1675 # Check if we can explicitly choose older version of symbol hashing
1677 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1678 CC="$aros_kernel_cc"
1679 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1680 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1681 AC_MSG_RESULT($use_hash_style)
1682 if test "x-$use_hash_style" = "x-yes" ; then
1683     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1685 CC="$save_cc"
1686 CFLAGS="$save_cflags"
1688 AC_SUBST(host_cflags_iquote)
1689 AC_SUBST(host_cflags_iquote_end)
1690 AC_SUBST(kernel_cflags_iquote)
1691 AC_SUBST(kernel_cflags_iquote_end)
1692 AC_SUBST(aros_cflags_iquote)
1693 AC_SUBST(aros_cflags_iquote_end)
1696 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1697 AC_MSG_CHECKING([for default resolution of WBScreen])
1698 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1699 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1700 if test "$resolution" = "yes" ; then
1701     resolution="none"
1703 if test "$resolution" = "no" ; then
1704     resolution="none"
1706 if test "$resolution" != "none" ; then
1707     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1708     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1709     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1711 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1712 aros_cv_default_wbwidth=$aros_default_wbwidth
1713 aros_cv_default_wbheight=$aros_default_wbheight
1714 aros_cv_default_wbdepth=$aros_default_wbdepth
1716 dnl See if the user wants the serial debug output for native flavour
1717 AC_MSG_CHECKING([if serial debug is enabled])
1718 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)
1719 if test "$aros_serial_debug" = 0 ; then
1720     serial_debug_forced=""
1721     if test "$serial_debug" = "yes" ; then
1722         serial_debug="2"
1723     fi
1724     if test "$serial_debug" = "no" ; then
1725         serial_debug="none"
1726     fi
1727 else
1728     serial_debug_forced="(forced)"
1729     serial_debug=$aros_serial_debug
1731 if test "$serial_debug" != "none" ; then
1732     aros_serial_debug=$serial_debug
1733     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1734 else
1735     AC_MSG_RESULT(no)
1738 dnl See if the user wants the palm debug output hack for palm native flavour
1739 AC_MSG_CHECKING([if palm debug hack is enabled])
1740 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")
1741 if test "$palm_debug_hack" = "yes" ; then
1742     aros_palm_debug_hack="1"
1744 AC_MSG_RESULT($palm_debug_hack)
1747 dnl See if the user wants nesting supervisor activated for unix flavour
1748 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1749 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")
1750 if test "$nesting_supervisor" = "yes" ; then
1751     aros_nesting_supervisor="1"
1753 AC_MSG_RESULT($nesting_supervisor)
1756 dnl things specifically required for hosted flavours
1757 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1759     if test "x-$need_dlopen" != "x-no" ; then
1760       dnl some kind of dynamic library access system is required for hostlib.resource
1761       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1762       if test "x-$have_dl" = "x-no" ; then
1763           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1764                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
1765                                     have_dl="no")
1766       fi
1767       if test "x-$have_dl" = "x-no" ; then
1768           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1769       fi
1770     fi
1773     dnl x11 hidd
1774     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1775                                            [build X11 hidd for hosted (default=auto)]),
1776                                            x11_hidd="$enableval",
1777                                            x11_hidd="auto")
1778     case "x-$x11_hidd" in
1779         x-yes|x-no|x-auto)                 ;;
1780         *)                 x11_hidd="auto" ;;
1781     esac
1783     ENABLE_X11=0
1785     dnl they want it
1786     if test "x-$x11_hidd" != "x-no" ; then
1788         dnl find x11 stuff
1789         AC_PATH_X
1791         x_cflags=
1792         for path in $x_libraries
1793         do
1794             x_cflags="$x_cflags -L$path"
1795         done
1797         for path in $x_includes
1798         do
1799             x_cflags="$x_cflags -I$path"
1800         done
1801         
1802         if test "x-$no_x" = "x-yes" ; then
1804             dnl didn't find it
1805             if test "x-$x11_hidd" != "x-auto" ; then
1806                 dnl and they explicitly asked for it, bail out
1807                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1808             fi
1809         
1810         else
1811             dnl found it, setup the metatarget
1812             x11_hidd_target=kernel-x11gfx-kobj
1813             ENABLE_X11=1
1815             dnl setup shared memory extensions
1816             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1817                                                   [use X11 shared memory (default=auto)]),
1818                                                   x11_hidd_shm="$enableval",
1819                                                   x11_hidd_shm="auto")
1820             case "x-$x11_hidd_shm" in
1821                 x-yes|x-no|x-auto)                     ;;
1822                 *)                 x11_hidd_shm="auto" ;;
1823             esac
1825             have_xshm=no
1827             dnl they want it
1828             if test "x-$x11_hidd_shm" != "x-no" ; then
1830                 dnl system shm headers
1831                 AC_CHECK_HEADERS(sys/ipc.h)
1832                 AC_CHECK_HEADERS(sys/shm.h)
1834                 dnl got them
1835                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1837                     dnl make sure X libs have shm functions
1838                     save_cflags="$CFLAGS"
1839                     CFLAGS="$CFLAGS $x_cflags"
1840                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1841                     CFLAGS="$save_cflags"
1842                 fi
1843             fi
1845             dnl detection done, prepare output
1846             if test "x-$have_xshm" = "x-yes" ; then
1847                 dnl we can do shm
1848                 DO_XSHM_SUPPORT="1"
1849             elif test "x-$x11_hidd_shm" = "x-yes" ; then
1850                 dnl they explicitly asked for it, but we can't do it
1851                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1852             else
1853                 dnl otherwise just disable it
1854                 DO_XSHM_SUPPORT="0"
1855             fi
1857             
1858             dnl setup vidmode (fullscreen) extensions
1859             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1860                                                       [use X11 vidmode extension (default=auto)]),
1861                                                       x11_hidd_vidmode="$enableval",
1862                                                       x11_hidd_vidmode="auto")
1863             case "x-$x11_hidd_vidmode" in
1864                 x-yes|x-no|x-auto)                         ;;
1865                 *)                 x11_hidd_vidmode="auto" ;;
1866             esac
1868             have_vidmode=no
1870             dnl they want it
1871             if test "x-$x11_hidd_vidmode" != "x-no" ; then
1873                 dnl make sure X libs have vidmode functions
1874                 save_cflags="$CFLAGS"
1875                 CFLAGS="$CFLAGS $x_cflags"
1876                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1877                 CFLAGS="$save_cflags"
1878             fi
1880             dnl detection done, prepare output
1881             if test "x-$have_vidmode" = "x-yes" ; then
1882                 dnl we can do vidmode
1883                 DO_VIDMODE_SUPPORT="1"
1884             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1885                 dnl they explicitly asked for it, but we can't do it
1886                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1887             else
1888                 dnl otherwise just disable it
1889                 DO_VIDMODE_SUPPORT="0"
1890             fi
1891         fi
1893         aros_host_x11_includes=$x_includes 
1894         aros_host_x11_libdirs=$x_libraries
1895     fi
1898     dnl sdl hidd
1899     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1900                                            [build SDL hidd for hosted (default=auto)]),
1901                                            sdl_hidd="$enableval",
1902                                            sdl_hidd="auto")
1903     case "x-$sdl_hidd" in
1904         x-yes|x-no|x-auto)                 ;;
1905         *)                 sdl_hidd="auto" ;;
1906     esac
1908     dnl they want it
1909     if test "x-$sdl_hidd" != "x-no" ; then
1911         dnl find sdl
1912         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1914         if test "x-$have_sdl" != "x-yes" ; then
1916             dnl didn't find it
1917             if test "x-$sdl_hidd" != "x-auto" ; then
1918                 dnl and they explicitly asked for it, bail out
1919                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1920             fi
1922         else
1923             dnl found it, set up the metatarget
1924             sdl_hidd_target=kernel-hidd-sdl
1925             aros_host_sdl_cflags=SDL_CFLAGS
1926             aros_host_sdl_libs=SDL_LIBS
1927         fi
1928     fi
1930     dnl oss.library
1931     AC_CHECK_HEADER(sys/soundcard.h)
1932     if test "x-$ac_cv_header_sys_soundcard_h" = "x-yes" ; then
1933         oss_library_target=workbench-libs-oss-unix
1934     fi
1938 dnl See if the user wants dbus.library
1939 AC_MSG_CHECKING([if building of dbus.library is enabled])
1940 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1941 if test "$dbus" = "yes" ; then
1942     ENABLE_DBUS=1
1943     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1944     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1945     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1946     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1947 else
1948     ENABLE_DBUS=0
1950 AC_MSG_RESULT($dbus)
1953 dnl --------------------------------------------------------------------
1954 dnl Configuration Output Section
1955 dnl --------------------------------------------------------------------
1957 # Generic
1958 AC_SUBST(aros_arch)
1959 AC_SUBST(aros_cpu)
1960 AC_SUBST(aros_flavour)
1961 AC_SUBST(aros_flavour_uc)
1962 AC_SUBST(AROS_BUILDDIR)
1963 AC_SUBST(AROS_BUILDDIR_UNIX)
1964 AC_SUBST(SRCDIR)
1965 AC_SUBST(AROS_PORTSSRCDIR)
1967 # Host related
1968 AC_SUBST(aros_cc_pre)
1969 AC_SUBST(aros_host_strip)
1970 AC_SUBST(aros_host_arch)
1971 AC_SUBST(aros_host_cpu)
1972 AC_SUBST(aros_host_cc)
1973 AC_SUBST(aros_host_ar)
1974 AC_SUBST(aros_host_ranlib)
1975 AC_SUBST(aros_host_ld)
1976 AC_SUBST(aros_host_make)
1977 AC_SUBST(aros_host_cflags)
1978 AC_SUBST(aros_host_ldflags)
1979 AC_SUBST(aros_host_debug)
1980 AC_SUBST(aros_host_mkdep)
1981 AC_SUBST(aros_host_mkargs)
1982 AC_SUBST(aros_host_exe_suffix)
1983 AC_SUBST(aros_host_lib_suffix)
1984 AC_SUBST(aros_tools_dir)
1985 AC_SUBST(aros_host_aclocal)
1986 AC_SUBST(aros_host_autoconf)
1987 AC_SUBST(aros_host_autoheader)
1988 AC_SUBST(aros_host_automake)
1990 # Target Related
1991 AC_SUBST(aros_target_guitheme)
1992 AC_SUBST(aros_target_iconset)
1993 AC_SUBST(aros_target_bootloader)
1994 AC_SUBST(aros_target_arch)
1995 AC_SUBST(aros_target_family)
1996 AC_SUBST(aros_target_cpu)
1997 AC_SUBST(aros_target_variant)
1998 AC_SUBST(aros_target_suffix)
1999 AC_SUBST(aros_target_incl)
2000 AC_SUBST(aros_target_ar)
2001 AC_SUBST(aros_target_ranlib)
2002 AC_SUBST(aros_kernel_nm)
2003 AC_SUBST(orig_target_cc)
2004 AC_SUBST(aros_target_cc)
2005 AC_SUBST(aros_target_cxx)
2006 AC_SUBST(aros_kernel_cc)
2007 AC_SUBST(aros_target_as)
2008 AC_SUBST(orig_target_ld)
2009 AC_SUBST(aros_target_ld)
2010 AC_SUBST(aros_kernel_ld)
2011 AC_SUBST(aros_target_cc_includes)
2012 AC_SUBST(aros_target_cc_path)
2013 AC_SUBST(aros_target_objdump)
2014 AC_SUBST(aros_target_objcopy)
2015 AC_SUBST(aros_target_strip)
2016 AC_SUBST(aros_target_nm)
2017 AC_SUBST(aros_kernel_rescomp)
2018 AC_SUBST(aros_shared_default)
2019 AC_SUBST(aros_shared_ld)
2020 AC_SUBST(aros_object_format)
2021 AC_SUBST(aros_compiler_libs)
2022 AC_SUBST(aros_arch_libs)
2024 AC_SUBST(aros_config_cflags)
2025 AC_SUBST(aros_config_aflags)
2026 AC_SUBST(aros_config_ldflags)
2028 AC_SUBST(aros_shared_cflags)
2029 AC_SUBST(aros_shared_aflags)
2030 AC_SUBST(aros_shared_ldflags)
2031 AC_SUBST(aros_kernel_cflags)
2032 AC_SUBST(aros_kernel_includes)
2033 AC_SUBST(aros_kernel_objcflags)
2034 AC_SUBST(aros_kernel_ldflags)
2035 AC_SUBST(aros_debug_cflags)
2036 AC_SUBST(aros_debug_aflags)
2037 AC_SUBST(aros_debug_ldflags)
2038 AC_SUBST(aros_paranoia_cflags)
2039 AC_SUBST(aros_target_genmap)
2040 AC_SUBST(aros_target_strip_flags)
2042 AC_SUBST(crosstools_target)
2044 # Graphics Related
2045 AC_SUBST(x11_hidd_target)
2046 AC_SUBST(sdl_hidd_target)
2047 AC_SUBST(oss_library_target)
2049 AC_SUBST(aros_default_wbwidth)
2050 AC_SUBST(aros_default_wbheight)
2051 AC_SUBST(aros_default_wbdepth)
2052 AC_SUBST(DO_XSHM_SUPPORT)
2053 AC_SUBST(DO_VIDMODE_SUPPORT)
2055 AC_SUBST(aros_host_x11_includes)
2056 AC_SUBST(aros_host_x11_libdirs)
2057 AC_SUBST(aros_host_sdl_cflags)
2058 AC_SUBST(aros_host_sdl_libs)
2060 # Native version related
2061 AC_SUBST(aros_serial_debug)
2063 # Palm native version related
2064 AC_SUBST(aros_palm_debug_hack)
2066 # Unix/Hosted version related
2067 AC_SUBST(aros_nesting_supervisor)
2069 # Apple iOS related
2070 AC_SUBST(aros_ios_platform)
2071 AC_SUBST(aros_ios_version)
2072 AC_SUBST(aros_ios_sdk)
2074 # DBUS related
2075 AC_SUBST(ENABLE_DBUS)
2076 AC_SUBST(DBUS_CFLAGS)
2077 AC_SUBST(DBUS_LIBFLAGS)
2078 AC_SUBST(KERNEL_DBUS_KOBJ)
2079 AC_SUBST(KERNEL_DBUS_INCLUDES)
2081 #X11 related
2082 AC_SUBST(ENABLE_X11)
2084 # Debug related
2085 AC_SUBST(aros_debug)
2086 AC_SUBST(aros_mungwall_debug)
2087 AC_SUBST(aros_stack_debug)
2088 AC_SUBST(aros_modules_debug)
2090 # Collect-aros stuff: "-ius" to ignore undefined symbols
2091 AC_SUBST(ignore_undefined_symbols)
2093 # C compiler related
2094 AC_SUBST(gcc_target_cpu)
2096 dnl Prepare for output, make up all the generated patches
2097 case "$aros_flavour" in
2098 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
2099                 aros_flavour="emulation" ;;
2100 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
2101                 aros_flavour="emulation" ;;
2102 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
2103                 aros_flavour="standalone";;
2104 standcompat)    aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2105                 aros_flavour="standalone";;
2106 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
2107                 aros_flavour="native" ;;
2108 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
2109                 aros_flavour="native" ;;
2110 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
2111                 aros_flavour="linklib" ;;
2112 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2113                 aros_flavour="palmnative" ;;
2114 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
2115                 aros_flavour="mac68knative" ;;
2116 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
2117                 aros_flavour="ppcnative" ;;
2118 esac
2120 if test ! -d ${aros_inc_dir} ; then
2121     ${MKDIR} ${aros_inc_dir}
2123 if test ! -d ${aros_geninc_dir} ; then
2124     ${MKDIR} ${aros_geninc_dir}
2126 if test ! -d ${aros_hostcfg_dir} ; then
2127     ${MKDIR} ${aros_hostcfg_dir}
2129 if test ! -d ${aros_targetcfg_dir} ; then
2130     ${MKDIR} ${aros_targetcfg_dir}
2132 if test ! -d ${aros_tools_dir} ; then
2133     ${MKDIR} ${aros_tools_dir}
2135 if test ! -d ${aros_scripts_dir} ; then
2136     ${MKDIR} ${aros_scripts_dir}
2139 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
2141 AC_CONFIG_COMMANDS([compiler_executable],
2142     [
2143         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
2144         mkdir -p $prefix
2145         prefix="${prefix}/${aros_target_cpu}-aros"
2146         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
2148         echo ${prefix}
2149         echo ${prefix2}
2150         chmod a+x ${prefix2}-gcc ${prefix2}-ld
2152         ln -sf ${prefix2}-gcc          ${prefix}-gcc
2153         ln -sf ${prefix2}-ld           ${prefix}-ld
2155         ln -sf $aros_target_as_ln$aros_host_exe_suffix      ${prefix}-as
2156         ln -sf $aros_target_nm_ln$aros_host_exe_suffix      ${prefix}-nm
2157         ln -sf $aros_target_ar_ln$aros_host_exe_suffix      ${prefix}-ar
2158         ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix  ${prefix}-ranlib
2159         ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
2160         ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
2161         ln -sf $aros_target_strip_ln$aros_host_exe_suffix   ${prefix}-strip
2163         ln -sf $aros_target_as_ln$aros_host_exe_suffix      ${prefix2}-as
2164         ln -sf $aros_target_nm_ln$aros_host_exe_suffix      ${prefix2}-nm
2165         ln -sf $aros_target_ar_ln$aros_host_exe_suffix      ${prefix2}-ar
2166         ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix  ${prefix2}-ranlib
2167         ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
2168         ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
2169         ln -sf $aros_target_strip_ln$aros_host_exe_suffix   ${prefix2}-strip
2170     ],
2171     [
2172         aros_host_exe_suffix=${aros_host_exe_suffix}
2173         aros_tools_dir=${aros_tools_dir}
2174         aros_target_cpu=${aros_target_cpu}
2175         aros_target_arch=${aros_target_arch}
2176         aros_target_suffix=${aros_target_suffix}
2177         aros_target_nm_ln=${aros_target_nm_ln}
2178         aros_target_as_ln=${aros_target_as_ln}
2179         aros_target_ar_ln=${aros_target_ar_ln}
2180         aros_target_ranlib_ln=${aros_target_ranlib_ln}
2181         aros_target_objdump_ln=${aros_target_objdump_ln}
2182         aros_target_objcopy_ln=${aros_target_objcopy_ln}
2183         aros_target_strip_ln=${aros_target_strip_ln}
2184     ]
2186 AC_CONFIG_COMMANDS([genshared_executable],
2187     [chmod a+x ${aros_scripts_dir}/genshared],
2188     [aros_scripts_dir=${aros_scripts_dir}]
2190 AC_CONFIG_COMMANDS([genmf_executable],
2191     [chmod a+x ${aros_tools_dir}/genmf.py],
2192     [aros_tools_dir=${aros_tools_dir}]
2195 AC_CONFIG_FILES(
2196     Makefile
2197     config/make.cfg
2198     ${aros_inc_dir}/config.h:config/config.h.in
2199     ${aros_geninc_dir}/config.h:config/config.h.in
2200     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
2201     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
2202     mmake.config
2203     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
2204     ${aros_targetcfg_dir}/specs:config/specs.in
2205     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
2206     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
2207     ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
2208     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
2209     tools/collect-aros/env.h
2212 AC_OUTPUT
2214 dnl This is in order to not define SHARED_CFLAGS sometimes
2215 dnl We don't always do aros_shared_ar, aros_shared_cflags
2217 #XXX compatability...
2218 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
2220 if test -n "$aros_shared_cflags" ; then
2221     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
2222     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg