Enabled AmberRAM for hosted.
[cake.git] / configure.in
blob0164fd09bdfd1e9eb4f532811ba453f57733c323
1 dnl Copyright © 1997-2008, 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 #don't know where else to put this...
47 AC_MSG_CHECKING([Building AROS in .. ])
48 AROS_BUILDDIR=$PWD
49 AC_MSG_RESULT($AROS_BUILDDIR)
51 AC_MSG_CHECKING([AROS Source in .. ])
52 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
53 AROS_SRCDIR=${srcpwd}
54 AC_MSG_RESULT($AROS_SRCDIR)
56 # Parse the target field into something useful.
57 changequote(<<,>>)
58 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
59 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
60 changequote([,])
62 dnl --------------------------------------------------------------------
63 dnl Set the default Workbench resolution
64 dnl --------------------------------------------------------------------
65 aros_default_wbwidth=800
66 aros_default_wbheight=600
67 aros_default_wbdepth=4
69 dnl --------------------------------------------------------------------
70 dnl Host Configuration Section
71 dnl --------------------------------------------------------------------
72 dnl
73 dnl The idea here is to find out all the information we need about the
74 dnl host. This means things like tools for building directory structures,
75 dnl copying files around and the like.
77 # The first step is to find the host binaries.
78 # Check for a compiler.
79 AC_PROG_CC
80 AC_PROG_CC_STDC
81 AC_PROG_CPP
83 # Check for a compatible awk
84 AC_CHECK_PROGS(AWK,[gawk nawk])
85 AROS_REQUIRED(gawk,$AWK)
86 AROS_PROG(MMAKE,mmake)
88 # Perform some default variable assignments. Note all of these will be
89 # Regenerated from the script, so there is no need to cache them.
91 aros_host_cc="$CC"
92 AROS_TOOL_CCPATH(aros_host_ld,ld)
93 AROS_REQUIRED(ld,$aros_host_ld)
94 aros_host_make="make"
95 aros_host_cflags=$CFLAGS
96 aros_host_ldflags=$LDFLAGS
97 aros_host_debug="-g -O0"
98 aros_host_mkdep="\$(TOP)/scripts/mkdep"
99 aros_host_mkargs="--no-print-directory"
100 aros_host_incl="/usr/include"
101 aros_host_exe_suffix="$EXEEXT"
102 aros_host_lib_suffix=""
104 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19 aclocal-1.9])
105 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
106 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
107 AC_CHECK_PROGS(aros_host_automake,[automake automake19 automake-1.9])
109 AROS_REQUIRED(aclocal/aclocal19/aclocal-1.9, $aros_host_aclocal)
110 AROS_REQUIRED(automake/automake19/automake-1.9, $aros_host_automake)
112 case "$aros_host_cc" in
113     *gcc*)
114         aros_host_cc_pipe="-pipe"
115         ;;
116     icc)
117         aros_host_cc_pipe=""
118         ;;
119     *)
120         aros_host_cc_pipe=""
121         ;;
122 esac
124 dnl Despite the name, this is really a host configuration variable.
125 aros_target_cc_includes=""
127 # This is the main host configuration section. It is where the host
128 # can change the values of any variables it needs to change. We do
129 # not look at anything that compiles to the target yet, we'll get
130 # to that later.
132 case "$host_os" in
133     linux*)
134         aros_host_arch="linux"
135         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
136         case "$host_cpu" in
137             *i?86*)
138                 aros_host_cpu="i386"
139                 ;;
140             *x86_64*)
141                 aros_host_cpu="x86_64"
142                 ;;
143             *m68k*)
144                 aros_host_cpu="m68k"
145                 ;;
146             *powerpc*)
147                 aros_host_cpu="ppc"
148                 ;;
149             *)
150                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
151                 aros_host_cpu="$host_cpu"
152                 ;;
153         esac
154         ;;
156     freebsd*)
157         aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
158         aros_host_make="gmake"
159         aros_host_arch="freebsd"
160         aros_host_cpu="i386"
162         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
164         dnl Need to override this here, it's just too hard later.
165         dnl This shouldn't be here at all...
166         dnl aros_target_cc_includes="/usr/include"
168         dnl FreeBSD 5.x (and later) has changed the default object format.
169         dnl The double [[]] is necessary to get around m4's quoting rules.
170         case $host_os in
171             freebsd[[234]]*)
172                 aros_object_format="elf_i386"
173                 ;;
175             *)
176                 aros_object_format="elf_i386_fbsd"
177                 ;;
178         esac
180         ;;
182     darwin*)
183         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
184         aros_host_arch="darwin"
185         case "$host_cpu" in
186             *i?86*)
187                 aros_host_cpu="i386"
188                 ;;
189             *powerpc*)
190                 aros_host_cpu="ppc"
191                 ;;
192             *)
193                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
194                 aros_host_cpu="$host_cpu"
195                 ;;
196         esac
198         aros_host_ldflags="$aros_host_ldflags -liconv"
200         ;;
202     netbsd*)
203         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
204         aros_host_make="gmake"
205         aros_host_arch="netbsd"
206         case "$host_cpu" in
207             *i?86*)
208                 aros_host_cpu="i386"
209                 ;;
210             *m68k*)
211                 aros_host_cpu="m68k"
212                 ;;
213             *)
214                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
215                 aros_host_cpu="$host_cpu"
216                 ;;
217         esac    
218         aros_host_lib_suffix=".0.0"
219         ;;
221     openbsd*)
222         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
223         aros_host_make="gmake"
224         aros_host_arch="openbsd"
225         case "$host_cpu" in
226             *i?86*)
227                 aros_host_cpu="i386"
228                 ;;
229             *)
230                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
231                 aros_host_cpu="$host_cpu"
232                 ;;
233         esac
234         ;;
235         
236     solaris*)
237         aros_host_arch="solaris"
238         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
239         case "$host_cpu" in
240             *i?86*)
241                 aros_host_cpu="i386"
242                 ;;
243             *sparc*)
244                 aros_host_cpu="sparc"
245                 ;;
246             *)
247                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
248                 aros_host_cpu="$host_cpu"
249                 ;;
250         esac
251         ;;
253     morphos*)
254         aros_host_arch="morphos"
255         aros_host_cpu="ppc"
256         ;;
258     amiga*)
259         aros_host_arch="amiga"
260         SORT="/gg/bin/sort"
261         TEST="/gg/bin/test"
262         UNIQ="/gg/bin/uniq"
263         FOR="for"
264         TOUCH="/gg/bin/touch"
265         case "$host_cpu" in
266             *m68k*)
267                 aros_host_cpu="m68k"
268                 ;;
269             *powerpc*)
270                 aros_host_cpu="ppc"
271                 ;;
272             *)
273                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
274                 aros_host_cpu="$host_cpu"
275                 ;;
276         esac
277         ;;
279     cygwin*)
280         aros_host_arch="cygwin"
281         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
282         case "$host_cpu" in
283             *i?86*)
284                 aros_host_cpu="i386"
285                 ;;
286             *)
287                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
288                 aros_host_cpu="$host_cpu"
289                 ;;
290         esac
291         ;;
293     mingw32*)
294         aros_host_arch="mingw32"
295         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
296         case "$host_cpu" in
297             *i?86*)
298                 aros_host_cpu="i386"
299                 ;;
300             *)
301                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
302                 aros_host_cpu="$host_cpu"
303                 ;;
304         esac
305         ;;
306     *)
307         AC_MSG_ERROR([Unsupported host architecture $host])
308         ;;
309 esac
311 AROS_PROG(aros_host_ar,[ar],[cr])
312 AROS_REQUIRED(ar,$aros_host_ar)
313 AROS_PROG(aros_host_ranlib,ranlib)
314 AROS_REQUIRED(ranlib,$aros_host_ranlib)
315 AROS_PROG(aros_host_strip,strip)
316 AROS_REQUIRED(strip,$aros_host_strip)
318 AROS_PROG(RM,[rm],[-rf])
319 AROS_REQUIRED(rm,$RM)
320 AROS_PROG(CP,[cp])
321 AROS_REQUIRED(cp,$CP)
322 AROS_PROG(MV,[mv])
323 AROS_REQUIRED(mv,$MV)
324 AROS_PROG(ECHO,[echo])
325 AROS_REQUIRED(echo,$ECHO)
326 AROS_PROG(MKDIR,[mkdir],[-p])
327 AROS_REQUIRED(mkdir,$MKDIR)
328 AROS_PROG(TOUCH,[touch])
329 AROS_REQUIRED(touch,$TOUCH)
330 AROS_PROG(SORT,[sort])
331 AROS_REQUIRED(sort,$SORT)
332 AROS_PROG(UNIQ,[uniq])
333 AROS_REQUIRED(uniq,$UNIQ)
334 AROS_PROG(NOP,[true])
335 AROS_REQUIRED(true,$NOP)
336 AROS_PROG(CAT,[cat])
337 AROS_REQUIRED(cat,$CAT)
338 AROS_PROG(BISON,[bison])
339 AROS_REQUIRED(bison,$BISON)
340 AROS_PROG(FLEX,[flex])
341 AROS_REQUIRED(flex,$FLEX)
342 AROS_PROG(PNGTOPNM,[pngtopnm])
343 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
344 AROS_PROG(PPMTOILBM,[ppmtoilbm])
345 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
346 AROS_PROG(SED,[sed])
347 AROS_REQUIRED(sed,$SED)
348 AROS_PROG(CHMOD,[chmod])
349 AROS_REQUIRED(chmod,$CHMOD)
351 AM_PATH_PYTHON(2.2.1)
353 AC_SUBST(FOR, for)
354 AC_SUBST(IF, if)
355 AC_SUBST(TEST, test)
356 AC_SUBST(CMP, cmp)
358 dnl ---------------------------------------------------------------------------
359 dnl Look for things about the host system, good for hosted targets.
360 dnl ---------------------------------------------------------------------------
362 # Check for some includes for the X11 HIDD and the kernel
363 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
364     sys/mmap.h sys/mman.h sysexits.h \
365     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
368 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
370 AC_HEADER_DIRENT
371 AC_HEADER_STAT
372 AC_HEADER_STDC
373 AC_HEADER_SYS_WAIT
374 AC_HEADER_TIME
375 AC_STRUCT_ST_BLKSIZE
376 AC_STRUCT_ST_BLOCKS
377 AC_STRUCT_ST_RDEV
378 AC_STRUCT_TM
379 AC_STRUCT_TIMEZONE
380 AC_TYPE_OFF_T
381 AC_TYPE_PID_T
382 AC_TYPE_SIZE_T
383 AC_TYPE_UID_T
385 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
387 # Look for some functions
388 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
389     clone kse_create rfork_thread thr_create sa_register \
390     getcontext makecontext setcontext sigaltstack swapcontext])
392 AC_FUNC_MMAP
395 dnl --------------------------------------------------------------------
396 dnl Target Configuration Section
397 dnl --------------------------------------------------------------------
399 dnl The target configuration section is responsible for setting up all
400 dnl the paths for includes, and tools required to build AROS to some
401 dnl particular target.
403 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
404 aros_config_aflags="-Wall -x assembler-with-cpp -c"
405 aros_config_ldflags=""
407 aros_shared_default=yes
409 aros_shared_cflags="-fPIC"
410 aros_shared_aflags=""
411 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
412 aros_kernel_ldflags="-Wl,-rpath,./lib"
414 aros_target_ar_flags="cr"
415 aros_target_nm_flags="-C -ul"
416 aros_target_strip_flags="--strip-unneeded -R.comment"
418 aros_compiler_libs=
420 aros_target_genmap="-Wl,-Map -Xlinker"
422 # Native flavour stuff
423 aros_bochs_hack="0"
424 aros_serial_debug="0"
426 # Palm native flavour stuff
427 aros_palm_debug_hack="0"
429 # Unix flavour stuff
430 aros_nesting_supervisor="0"
432 # Collect-aros stuff: "-ius" to ignore undefined symbols
433 ignore_undefined_symbols=""
435 #-----------------------------------------------------------------------------
438 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
439 # it switched on by default, and we use the host compiler, so it compiles AROS
440 # code with this enabled resulting in link failures as we don't have support
441 # for it.
443 # We use two methods to disable it. For the host compiler (used to compile
444 # some hosted modules), we test to see if the compiler supports stack
445 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
446 # work on all platforms.
448 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
449 # (this is done unconditionally, as it should have no effect on compilers
450 # without the stack protection feature). This may be specific to the way that
451 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
452 # strong enough to disable it in a generic way though, so we'll live with it
453 # until another vendor ships GCC with it enabled in a different way, and deal
454 # with it then.
457 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
458 save_cflags="$CFLAGS"
459 CFLAGS="$CFLAGS -fno-stack-protector"
460 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
461 AC_MSG_RESULT($use_no_stack_protector)
462 if test "x-$use_no_stack_protector" = "x-yes" ; then
463     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
465 CFLAGS="$save_cflags"
468 #-----------------------------------------------------------------------------
470 # Disable pointer-signedness warnings if the compiler recognises the option
471 # (this only works for the host compiler at the moment)
473 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
474 save_cflags="$CFLAGS"
475 CFLAGS="$CFLAGS -Wno-pointer-sign"
476 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
477 AC_MSG_RESULT($use_no_sign_warning)
478 if test "x-$use_no_sign_warning" = "x-yes" ; then
479     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
481 CFLAGS="$save_cflags"
483 #-----------------------------------------------------------------------------
485 AC_MSG_CHECKING([for type of build])
486 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")
488 if test "$build_type" = "nightly"; then
489     build_type_string="NIGHTLY"
490 elif test "$build_type" = "snapshot"; then
491     build_type_string="SNAPSHOT"
492 elif test "$build_type" = "milestone"; then
493     build_type_string="MILESTONE"
494 elif test "$build_type" = "release"; then
495     build_type_string="RELEASE"
496 else
497     build_type_string="PERSONAL"
498     build_type="personal"
501 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
503 AC_MSG_RESULT($build_type)
505 #-----------------------------------------------------------------------------
506 all_debug_types="messages stack mungwall modules symbols"
508 AC_MSG_CHECKING([which debug types to enable])
509 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)]),
510  debug="$enableval",debug="")
512 if test "$debug" = "" -o "$debug" = "no"; then
513     debug="none"
514 elif test "$debug" = "yes"; then
515     debug="all"
518 if test "$debug" = "all" ; then
519     debug=$all_debug_types
520     for d in $all_debug_types; do
521         export aros_${d}_debug="1"
522     done
523 else
524     for d in $all_debug_types; do
525         export aros_${d}_debug="0"
526     done
529 if test "$debug" != "none"; then
530     debug=`echo $debug | sed s/,/\ /g`
531     for d in $debug; do
532         found="0"
533         for d2 in $all_debug_types; do
534             if test "$d2" = "$d"; then
535                 found="1"
536                 break
537             fi
538         done
539         if test "$found" = "0"; then
540             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
541         fi
542         export aros_${d}_debug="1"
543     done
544     aros_debug="yes"
546 AC_MSG_RESULT($debug)
548 if test "$aros_messages_debug" = "1"; then
549     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
550 else
551     aros_messages_debug=""
553 if test "$aros_symbols_debug" = "1"; then
554     aros_symbols_debug="-g"
555 else
556     aros_symbols_debug=""
559 # These are the flags to pass when compiling debugged programs
560 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
561 aros_debug_aflags=""
562 aros_debug_ldflags="$aros_symbols_debug"
564 #-----------------------------------------------------------------------------
565 #   Checking for distcc and ccache.
567 #   Always apply the transforms in this particular order. Basically you should
568 #   always run 'ccache distcc compiler' in that order for the best performance.
570 AC_MSG_CHECKING([whether to enable distcc])
571 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
572 if test "$distcc" != "" -a "$distcc" != "no"; then
573     # AC_CHECK_PROG will print out the result in this case
574     AC_PATH_PROG(DISTCC,[distcc],distcc,)
575 else
576     AC_MSG_RESULT(no)
579 AC_MSG_CHECKING([whether to enable ccache])
580 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
581 if test "$ccache" != "" -a "$ccache" != "no"; then
582     # AC_CHECK_PROG will print out the result in this case
583     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
584 else
585     AC_MSG_RESULT(no)
588 #-----------------------------------------------------------------------------
589 AC_MSG_CHECKING([what optimization flags to use])
590 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
591 if test "$optimization" = "unknown"; then
592     dnl default is -O2 for normal builds, -O0 for debug builds
593     if test "$debug" != "none"; then
594         optimization="-O0"
595     else
596         optimization="-O2"
597     fi
599 aros_config_cflags="$aros_config_cflags $optimization"
600 AC_MSG_RESULT($optimization)
602 #-----------------------------------------------------------------------------
603 AC_MSG_CHECKING([what target variant to enable])
604 AC_ARG_ENABLE(target_variant,AC_HELP_STRING([--enable-target-variant=NAME],[Enable a specific target variant(default=none)]),target_variant=$enableval,target_variant="none")
605 if test "$target_variant" = "none"; then
606     aros_target_variant=""
607     aros_target_suffix=""
608 else
609     aros_target_variant="$target_variant"
610     aros_target_suffix="-$target_variant"
612 AC_MSG_RESULT($enableval)
614 target_bootloader="none"
616 #-----------------------------------------------------------------------------
617 # This is the target configuration switch.
618 case "$target_os" in
619     linux*)
620         aros_target_arch="linux"
621         case "$target_cpu" in
622             *m68k*)
623                 aros_target_cpu="m68k"
624                 aros_object_format="m68kelf"
625                 aros_flavour="emulcompat"
626                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
627                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
628                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
629                 gcc_target_cpu="mc68000"
630                 ;;
631             *i?86*)
632                 aros_target_cpu="i386"
633                 aros_object_format="elf_i386"
634                 aros_flavour="emulation"
635                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
636                 aros_default_wbdepth=8
637                 gcc_target_cpu="i386"
638                 ;;
639             *x86_64*)
640                 aros_target_cpu="x86_64"
641                 aros_object_format="elf_x86_64"
642                 aros_flavour="emulation"
643                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
644                 aros_config_cflags="$aros_config_cflags -mno-red-zone"
645                 aros_default_wbdepth=8
646                 gcc_target_cpu="x86_64"
647                 ;;
648             *powerpc*)
649                 aros_target_cpu="ppc"
650                 aros_object_format="elf32ppc"
651                 aros_flavour="emulation"
652                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
653                 aros_default_wbdepth=8
654                 gcc_target_cpu="ppc"
655                 ;;
656 # TODO
657 # Same as powerpc, but I need this for the nightly build to work again.
658 # Actually, the nightly should be made working with powerpc target.
659 # That just was too much work for the moment, another week or two.
660             *ppc*)
661                 aros_target_cpu="ppc"
662                 aros_object_format="elf32ppc"
663                 aros_flavour="emulation"
664                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
665                 aros_default_wbdepth=8
666                 gcc_target_cpu="ppc"
667                 ;;
668             *)
669                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
670                 ;;
671         esac
672     ;;
674     pc)
675         aros_target_arch="pc"
676         aros_shared_default="no"
677         target_bootloader="grub"
678         case "$target_cpu" in
679             *i?86*)
680                 aros_target_cpu="i386"
682                 dnl If somebody hasn't already set the target object
683                 dnl format, then use this value. Mostly to support
684                 dnl FreeBSD cross-compilation.
685                 dnl TODO: Remove when we always use our compiler.
687                 if test "$aros_object_format" = "" ; then
688                     aros_object_format="elf_i386"
689                 fi
690                 aros_flavour="standalone"
691                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
692                 aros_kernel_ldflags=""
693                 aros_default_wbwidth=640
694                 aros_default_wbheight=480
695                 gcc_target_cpu="i386"
696                 ;;
697             *x86_64*)
698                 aros_target_cpu="x86_64"
699                 aros_serial_debug=1
700                 if test "$aros_object_format" = "" ; then
701                     aros_object_format="elf_x86_64"
702                 fi
703                 aros_flavour="standalone"
704                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
705                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
706                 aros_kernel_ldflags=""
707                 aros_default_wbwidth=640
708                 aros_default_wbheight=480
709                 gcc_target_cpu="x86_64"
710                 ;;
711             *)
712                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
713                 ;;
714         esac
715         ;;
717     prep)
718         aros_target_arch="prep"
719         aros_shared_default="no"
720         aros_target_cpu="ppc"
721         aros_object_format="elf32ppc"
722         aros_flavour="ppcnative"
723         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
724         aros_kernel_ldflags=""
725         aros_default_wbwidth=640
726         aros_default_wbheight=480
727         gcc_target_cpu="ppc"
728         ;;
730     freebsd*)
731         aros_target_arch="freebsd"
732         aros_target_cpu="i386"
733         aros_flavour="emulation"
734         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
735         gcc_target_cpu="i386"
737         aros_target_strip_flags="-x"
738         ;;
740     darwin*)
741         aros_target_arch="darwin"
742         aros_flavour="emulation"
743         case "$target_cpu" in
744                 *i?86*)
745                         aros_target_cpu="i386"
746                         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
747                         gcc_target_cpu="i386"
748                         aros_object_format="elf_i386"
749                         aros_target_strip_flags="-x"
750                         ;;
751                 *)
752                         AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
753                         ;;
754         esac
755         ;;
756     netbsd*)
757         aros_target_arch="netbsd"
758         case "$target_cpu" in
759             *m68k*)
760                 aros_target_cpu="m68k"
761                 aros_object_format="m68kelf"
762                 aros_flavour="emulcompat"
763                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
764                 gcc_target_cpu="mc68000"
765                 ;;
766             *i?86*)
767                 aros_target_cpu="i386"
768                 aros_object_format="elf_i386"
769                 aros_flavour="emulation"
770                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
771                 aros_default_wbdepth=8
772                 gcc_target_cpu="i386"
773                 ;;
774             *)
775                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
776                 ;;
777         esac
778         aros_target_genmap="-Wl,-M -Xlinker >"
779         aros_flavour="emulation"
780         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
781         ;;   
783     openbsd*)
784         aros_target_arch="openbsd"
785         case "$target_cpu" in
786             *i?86*)
787                 aros_target_cpu="i386"
788                 aros_object_format="elf_i386"
789                 aros_flavour="emulation"
790                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
791                 gcc_target_cpu="i386"
792                 ;;
793             *)
794                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
795                 ;;
796         esac
797         aros_target_genmap="-Wl,-M -Xlinker >"
798         aros_target_nm_flags="-u"
799         aros_flavour="emulation"
800         ;;
802     solaris*)
803         aros_target_arch="solaris"
804         case "$target_cpu" in
805            *i?86*)
806                aros_target_cpu="i386"
807                aros_object_format="elf_i386"
808                aros_flavour="emulation"
809                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
810                aros_default_wbdepth=8
811                gcc_target_cpu="i386"
812                ;;
813             *sparc*)
814                 aros_target_cpu="sparc"
815                 aros_object_format="elf_sparc"
816                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
817                 gcc_target_cpu="sparc"
818                 ;;
819             *)
820                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
821                 ;;
822         esac
823         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
824         aros_flavour="emulation"
825         ;;
827     morphos*)
828         aros_target_arch="morphos"
829         aros_shared_default="no"
830         aros_target_cpu="ppc"
831         aros_object_format="elf_ppc"
832         aros_flavour="nativecompat"
833         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
834         gcc_target_cpu="ppc"
835         ;;
837     sam440)
838         aros_target_arch="sam440"
839         aros_shared_default="no"
840         aros_target_cpu="ppc"
841         aros_object_format="elf32ppc"
842         aros_flavour="ppcnative"
843         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
844         aros_kernel_ldflags=""
845         aros_default_wbwidth=640
846         aros_default_wbheight=480
847         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
848         gcc_target_cpu="powerpc"
849         ;;
851     amiga*)
852         aros_target_arch="amiga"
853         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
854         aros_shared_default="no"
856         aros_config_cflags="$aros_config_cflags -fomit-frame-pointer -fbuiltin -ffreestanding"
858         case "$target_cpu" in
859             *m68k*)
860                 aros_target_cpu="m68k"
861                 aros_object_format="m68kelf"
862                 aros_flavour="nativecompat"
863                 gcc_target_cpu="mc68000"
864                 ;;
865             *ppc*)
866                 aros_cpu="ppc"
867                 aros_flavour="native"
868                 gcc_target_cpu="ppc"
869                 ;;
870             *)
871                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
872                 ;;
873         esac
874         ;;
876     cygwin*)
877         aros_target_arch="cygwin"
878         aros_shared_default="no"
879         case "$target_cpu" in
880             *i?86*)
881                 aros_target_cpu="i386"
882                 aros_object_format="elf_i386"
883                 aros_flavour="emulation"
884                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__CYGWIN32__"
885                 aros_shared_cflags=""
886                 aros_default_wbdepth=8
887                 gcc_target_cpu="i386"
888                 aros_target_cc="i386-aros-gcc"
889                 aros_target_ld="i386-aros-ld"
890                 aros_target_as="i386-aros-as"
891                 aros_target_ar="i386-aros-ar"
892                 aros_target_ranlib="i386-aros-ranlib"
893                 aros_target_nm="i386-aros-nm"
894                 aros_target_strip="i386-aros-strip"
895                 aros_target_objcopy="i386-aros-objcopy"
896                 aros_target_objdump="i386-aros-objdump"
897                 ;;
898             *)
899                 AC_MSG_ERROR("Unknown CPU for CygWin -- $target_cpu")
900                 ;;
901         esac
902     ;;
904     mingw32*)
905         aros_target_arch="mingw32"
906         aros_shared_default="no"
907         case "$target_cpu" in
908             *i?86*)
909                 aros_target_cpu="i386"
910                 aros_object_format="elf_i386"
911                 aros_flavour="emulation"
912                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
913                 aros_shared_cflags=""
914                 aros_default_wbdepth=8
915                 gcc_target_cpu="i386"
916                 aros_target_cc="i386-aros-gcc"
917                 aros_target_ld="i386-aros-ld"
918                 aros_target_as="i386-aros-as"
919                 aros_target_ar="i386-aros-ar"
920                 aros_target_ranlib="i386-aros-ranlib"
921                 aros_target_nm="i386-aros-nm"
922                 aros_target_strip="i386-aros-strip"
923                 aros_target_objcopy="i386-aros-objcopy"
924                 aros_target_objdump="i386-aros-objdump"
925                 ;;
926             *)
927                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
928                 ;;
929         esac
930         if test $host_os = "cygwin"; then
931                 aros_kernel_cflags="-mno-cygwin"
932         fi
933     ;;
934     pp*)
935         aros_target_arch="pp"
936         aros_shared_default="no"
937         case "$target_cpu" in
938             *m68k*)
939                 aros_target_cpu="m68k"
940                 aros_object_format="m68kelf"
941                 aros_flavour="palmnative"
942                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
943                 aros_kernel_ldflags=""
944                 aros_default_wbwidth=160
945                 aros_default_wbheight=160
946                 aros_default_wbdepth=1
947                 aros_target_ar_flags="cru"
948                 aros_compiler_libs="-lgcc1"
949                 aros_shared_default=no
950                 aros_shared_cflags="-fpic"
951                 aros_shared_aflags=""
952                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
953                 aros_kernel_ldflags="-Wl,-rpath,./lib"
954                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
955                 aros_debug_aflags=""
956                 aros_debug_ldflags="$aros_symbols_debug"
957                 aros_mungwall_debug="0"
958                 aros_modules_debug="0"
959                 gcc_target_cpu="mc68000"
960                 ignore_undefined_symbols="-ius"
961                 ;;
962            *)
963                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
964                 ;;
965         esac
966         ;;
968     mac*)
969         aros_target_arch="mac"
970         aros_shared_default="no"
971         case "$target_cpu" in
972             *m68k*)
973                 aros_target_cpu="m68k"
974                 aros_object_format="m68kelf"
975                 aros_flavour="mac68knative"
976                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
977                 aros_default_wbwidth=512
978                 aros_default_wbheight=384
979                 aros_default_wbdepth=8
980                 aros_target_ar_flags="cru"
981                 aros_compiler_libs="-lgcc1"
982                 aros_shared_default=no
983                 aros_shared_cflags="-fpic"
984                 aros_shared_aflags=""
985                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
986                 aros_kernel_ldflags="-Wl,-rpath,./lib"
987                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000"
988                 aros_debug_aflags=""
989                 aros_debug_ldflags="$aros_symbols_debug"
990                 aros_mungwall_debug="0"
991                 aros_modules_debug="0"
992                 gcc_target_cpu="mc68000"
993                 ignore_undefined_symbols="-ius"
994                 ;;
995            *)
996                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
997                 ;;
998         esac
999         ;;
1001     *)
1002         AC_MSG_ERROR([Unsupported target architecture $target])
1003         ;;
1004 esac
1006 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1007 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1008 if test "$with_portssrcdir" = "default"; then
1009     AROS_PORTSSRCDIR="$AROS_BUILDDIR/bin/Sources"
1010 else
1011     AROS_PORTSSRCDIR="$with_portssrcdir"
1013 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1015 AC_MSG_CHECKING([which bootloader to use])
1016 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1017 if test "$target_bootloader" = "none"; then
1018     aros_target_bootloader=""
1019 else
1020     aros_target_bootloader="$target_bootloader"
1022 AC_MSG_RESULT($target_bootloader)
1024 # Check LZO when compiling the grub2 bootloader on i386/x86_64.
1025 aros_liblzo_check="no"
1026 case "$aros_target_bootloader" in
1027     grub2*)
1028     case "$target_cpu" in
1029         *i?86*)
1030         aros_liblzo_check="yes"
1031         ;;
1032         *x86_64*)
1033         aros_liblzo_check="yes"  
1034         ;;
1035         *)
1036         ;;
1037     esac
1038   
1039     ;;
1040    *)
1041     ;;
1042 esac
1044 if test "$aros_liblzo_check" = "yes"; then
1045     # There are three possibilities. LZO version 2 installed with the name
1046     # liblzo2, with the name liblzo, and LZO version 1.  
1047     AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],  
1048     AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
1049                 AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
1050                 AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
1052     AC_SUBST(LIBLZO)
1053     LIBS="$LIBS $LIBLZO"
1054     AC_CHECK_FUNC(lzo1x_999_compress, ,
1055                 [AC_MSG_ERROR([LZO1X-999 must be enabled])])
1057     # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
1058     AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
1061 AC_MSG_CHECKING([which GUI Theme to use])
1062 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1063 if test "$target_guitheme" = "default"; then
1064     aros_target_guitheme="Ice"
1065 else
1066     aros_target_guitheme="$target_guitheme"
1068 AC_MSG_RESULT($aros_target_guitheme)
1070 # Find out if we are cross-compiling (ie. if we can't use the host compiler
1071 # for target code)
1072 cross_compiling=no
1073 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1074     cross_compiling=yes
1076 if test "$aros_host_arch" == "darwin" ; then
1077     cross_compiling=yes
1080 # Set prefix for target compiler etc. if we're cross-compiling
1081 # (should possibly be earlier but needs to be after AC_PROG_CC)
1082 if test "$cross_compiling" = "yes" ; then
1083     target_tool_prefix=${target_cpu}-elf-
1084     CC=${target_tool_prefix}gcc
1087 # Find all the tools we need to compile. This could be cross-compiling
1088 # though! If that is the case we use the GNU form of the target and
1089 # simply add this to the front of the binary name. This is rather simple,
1090 # but it should work under most circumstances.
1092 # The default tools are to use the same as the host, but only if the
1093 # host and target CPU are the same. With GCC this is normally enough.
1096 aros_cc_pre=""
1097 aros_shared_ld="$aros_host_ld"
1099 aros_target_mkdep="$aros_host_mkdep"
1100 aros_target_incl_def="$aros_host_incl"
1102 AC_PATH_PROG(aros_kernel_cc,$CC)
1104 # The default tools executables to be linked to.
1105 if test "$aros_target_cc" != ""; then
1106     AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1107     AROS_REQUIRED(gcc,$aros_target_cc)
1109 if test "$aros_target_ld" != ""; then
1110     AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1111     AROS_REQUIRED(ld,$aros_target_ld)
1113 AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1114 AROS_REQUIRED(as,$aros_target_as_ln)
1115 AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1116 AROS_REQUIRED(ld,$aros_kernel_ld)
1117 AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1118 AROS_REQUIRED(ar,$aros_target_ar_ln)
1119 AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1120 AROS_REQUIRED(nm,$aros_target_nm_ln)
1121 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1122 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1123 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1124 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1125 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1126 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1127 AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1128 AROS_REQUIRED(strip,$aros_target_strip_ln)
1130 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1131 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1132 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1133 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1134 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1135 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1136 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1138 # aros_cc_pre is a variable that is added to the front of the compiler name
1139 # in the generated aros-gcc shell script. We need this to enable the cache
1140 # to work across cleaned builds. Also, support DISTCC using the correct
1141 # environment variable.
1144 if test "x${DISTCC}" != "x" ; then
1145     if test "x${CCACHE}" != "x" ; then
1146         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1147     else
1148         aros_cc_pre="${DISTCC} "
1149     fi
1150 else
1151     if test "x${CCACHE}" != "x" ; then
1152         aros_cc_pre="${CCACHE} "
1153     fi
1156 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1158 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1159 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1160 AC_SUBST(aros_target_nix_ldflags,-nix)
1161 AC_SUBST(aros_target_detach_ldflags,-detach)
1162 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1164 # Target tools
1165 if test "$aros_target_cc" = ""; then
1166     orig_target_cc=$aros_kernel_cc
1167 else
1168     orig_target_cc=$aros_target_cc
1170 if test "$aros_target_ld" = ""; then
1171     orig_target_ld=$aros_kernel_ld
1172 else
1173     orig_target_ld=$aros_target_ld
1175 if test "$GCC" = "yes"; then
1176     aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1178 aros_target_cc="${prefix}-gcc"
1179 aros_target_as="${prefix}-as"
1180 aros_target_ld="${prefix}-ld"
1181 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1182 aros_target_objcopy=${prefix}-objcopy
1183 aros_target_objdump=${prefix}-objdump
1184 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1185 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1186 aros_kernel_nm="${prefix}-nm"
1187 aros_target_strip=${prefix}-strip
1189 # Find the system include path. We can suggest that an alternative is
1190 # used if we don't get it correct. The default is to use /usr/include.
1191 # Which is set in the aros_target_incl_def variable.
1193 AC_ARG_ENABLE(includes,
1194 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1195 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1197 dnl find out about the target cc's include path
1198 AC_MSG_CHECKING([for the target compiler's include path])
1199 if test "$aros_target_cc_includes" = "" ; then
1200     #try to guess where the directory is
1201     aros_target_cc_includes=`dirname \`${aros_kernel_cc} -print-libgcc-file-name\``/include
1202     if ! test -d $aros_target_cc_includes; then
1203         #the directory doesn't exist, we need to do some more work
1204         aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1205         
1206         #these are the headers we're looling for
1207         headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1208                  stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1209                  zutil.h"
1211         dirs=
1212         for h in $headers; do
1213             #which other headers each of the above headers needs?
1214             deps=$(echo "#include <$h>" | \
1215                    $aros_host_cc -E -M - 2>/dev/null | \
1216                    sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1217             
1218             #copy all the needed headers to a directory beneath gendir
1219             for d in $deps; do
1220                 h=$(basename $d)
1221                 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1222                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1223                 ! test -d $dir && mkdir -p $dir
1224                 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1225             done
1226         done        
1227     fi
1229 AC_MSG_RESULT($aros_target_cc_includes)
1232 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1233 # On GCC >= 4.0 -iquote should be used
1236 save_cc="$CC"
1237 save_cflags="$CFLAGS"
1238 CC="$aros_kernel_cc"
1239 CFLAGS="-iquote."
1240 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1241 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1242 AC_MSG_RESULT($has_iquote)
1243 if test "x-$has_iquote" = "x-yes" ; then
1244     aros_cflags_iquote=-iquote
1245     aros_cflags_iquote_end=
1246 else
1247     aros_cflags_iquote=-I
1248     aros_cflags_iquote_end=-I-
1250 CC="$save_cc"
1251 CFLAGS="$save_cflags"
1253 AC_SUBST(aros_cflags_iquote)
1254 AC_SUBST(aros_cflags_iquote_end)
1257 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1258 AC_MSG_CHECKING([for default resolution of WBScreen])
1259 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1260 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1261 if test "$resolution" = "yes" ; then
1262     resolution="none"
1264 if test "$resolution" = "no" ; then
1265     resolution="none"
1267 if test "$resolution" != "none" ; then
1268     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1269     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1270     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1272 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1273 aros_cv_default_wbwidth=$aros_default_wbwidth
1274 aros_cv_default_wbheight=$aros_default_wbheight
1275 aros_cv_default_wbdepth=$aros_default_wbdepth
1277 dnl See if the user wants the BOCHS hack for native flavour
1278 AC_MSG_CHECKING([if bochs hack is enabled])
1279 AC_ARG_ENABLE(bochs_hack,AC_HELP_STRING([--enable-bochs-hack],[Enable hacks to make BOCHS (partly) work (default=no)]),bochs_hack="yes",bochs_hack="no")
1280 if test "$bochs_hack" = "yes" ; then
1281     aros_bochs_hack="1"
1283 AC_MSG_RESULT($bochs_hack)
1285 dnl See if the user wants the serial debug output for native flavour
1286 AC_MSG_CHECKING([if serial debug is enabled])
1287 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)
1288 if test "$aros_serial_debug" = 0 ; then
1289     serial_debug_forced=""
1290     if test "$serial_debug" = "yes" ; then
1291         serial_debug="2"
1292     fi
1293     if test "$serial_debug" = "no" ; then
1294         serial_debug="none"
1295     fi
1296 else
1297     serial_debug_forced="(forced)"
1298     serial_debug=$aros_serial_debug
1300 if test "$serial_debug" != "none" ; then
1301     aros_serial_debug=$serial_debug
1302     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1303 else
1304     AC_MSG_RESULT(no)
1307 dnl See if the user wants the palm debug output hack for palm native flavour
1308 AC_MSG_CHECKING([if palm debug hack is enabled])
1309 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")
1310 if test "$palm_debug_hack" = "yes" ; then
1311     aros_palm_debug_hack="1"
1313 AC_MSG_RESULT($palm_debug_hack)
1316 dnl See if the user wants nesting supervisor activated for unix flavour
1317 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1318 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")
1319 if test "$nesting_supervisor" = "yes" ; then
1320     aros_nesting_supervisor="1"
1322 AC_MSG_RESULT($nesting_supervisor)
1325 dnl things specifically required for hosted flavours
1326 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1328     if test "x-$aros_host_arch" != "x-darwin" ; then
1329       dnl some kind of dynamic library access system is required for hostlib.resource
1330       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1331       if test "x-$have_dl" = "x-no" ; then
1332           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1333                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
1334                                     have_dl="no")
1335       fi
1336       if test "x-$have_dl" = "x-no" ; then
1337           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1338       fi
1339     fi
1342     dnl x11 hidd
1343     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1344                                            [build X11 hidd for hosted (default=auto)]),
1345                                            x11_hidd="$enableval",
1346                                            x11_hidd="auto")
1347     case "x-$x11_hidd" in
1348         x-yes|x-no|x-auto)                 ;;
1349         *)                 x11_hidd="auto" ;;
1350     esac
1352     dnl they want it
1353     if test "x-$x11_hidd" != "x-no" ; then
1355         dnl find x11 stuff
1356         AC_PATH_X
1358         x_cflags=
1359         for path in $x_libraries
1360         do
1361             x_cflags="$x_cflags -L$path"
1362         done
1364         for path in $x_includes
1365         do
1366             x_cflags="$x_cflags -I$path"
1367         done
1368         
1369         if test "x-$no_x" = "x-yes" ; then
1371             dnl didn't find it
1372             if test "x-$x11_hidd" != "x-auto" ; then
1373                 dnl and they explicitly asked for it, bail out
1374                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1375             fi
1376         
1377         else
1378             dnl found it, setup the metatarget
1379             x11_hidd_target=kernel-x11gfx
1382             dnl setup shared memory extensions
1383             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1384                                                   [use X11 shared memory (default=auto)]),
1385                                                   x11_hidd_shm="$enableval",
1386                                                   x11_hidd_shm="auto")
1387             case "x-$x11_hidd_shm" in
1388                 x-yes|x-no|x-auto)                     ;;
1389                 *)                 x11_hidd_shm="auto" ;;
1390             esac
1392             have_xshm=no
1394             dnl they want it
1395             if test "x-$x11_hidd_shm" != "x-no" ; then
1397                 dnl system shm headers
1398                 AC_CHECK_HEADERS(sys/ipc.h)
1399                 AC_CHECK_HEADERS(sys/shm.h)
1401                 dnl got them
1402                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1404                     dnl make sure X libs have shm functions
1405                     save_cflags="$CFLAGS"
1406                     CFLAGS="$CFLAGS $x_cflags"
1407                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1408                     CFLAGS="$save_cflags"
1409                 fi
1410             fi
1412             dnl detection done, prepare output
1413             if test "x-$have_xshm" = "x-yes" ; then
1414                 dnl we can do shm
1415                 DO_XSHM_SUPPORT="1"
1416             elif test "x-$x11_hidd_shm" = "x-yes" ; then
1417                 dnl they explicitly asked for it, but we can't do it
1418                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1419             else
1420                 dnl otherwise just disable it
1421                 DO_XSHM_SUPPORT="0"
1422             fi
1424             
1425             dnl setup vidmode (fullscreen) extensions
1426             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1427                                                       [use X11 vidmode extension (default=auto)]),
1428                                                       x11_hidd_vidmode="$enableval",
1429                                                       x11_hidd_vidmode="auto")
1430             case "x-$x11_hidd_vidmode" in
1431                 x-yes|x-no|x-auto)                         ;;
1432                 *)                 x11_hidd_vidmode="auto" ;;
1433             esac
1435             have_vidmode=no
1437             dnl they want it
1438             if test "x-$x11_hidd_vidmode" != "x-no" ; then
1440                 dnl make sure X libs have vidmode functions
1441                 save_cflags="$CFLAGS"
1442                 CFLAGS="$CFLAGS $x_cflags"
1443                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1444                 CFLAGS="$save_cflags"
1445             fi
1447             dnl detection done, prepare output
1448             if test "x-$have_vidmode" = "x-yes" ; then
1449                 dnl we can do vidmode
1450                 DO_VIDMODE_SUPPORT="1"
1451             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1452                 dnl they explicitly asked for it, but we can't do it
1453                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1454             else
1455                 dnl otherwise just disable it
1456                 DO_VIDMODE_SUPPORT="0"
1457             fi
1458         fi
1460         aros_host_x11_includes=$x_includes 
1461         aros_host_x11_libdirs=$x_libraries
1462     fi
1465     dnl sdl hidd
1466     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1467                                            [build SDL hidd for hosted (default=auto)]),
1468                                            sdl_hidd="$enableval",
1469                                            sdl_hidd="auto")
1470     case "x-$sdl_hidd" in
1471         x-yes|x-no|x-auto)                 ;;
1472         *)                 sdl_hidd="auto" ;;
1473     esac
1475     dnl they want it
1476     if test "x-$sdl_hidd" != "x-no" ; then
1478         dnl find sdl
1479         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1481         if test "x-$have_sdl" != "x-yes" ; then
1483             dnl didn't find it
1484             if test "x-$sdl_hidd" != "x-auto" ; then
1485                 dnl and they explicitly asked for it, bail out
1486                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1487             fi
1489         else
1490             dnl found it, setup the metatarget
1491             sdl_hidd_target=kernel-hidd-sdl
1492             aros_host_sdl_cflags=SDL_CFLAGS
1493             aros_host_sdl_libs=SDL_LIBS
1494         fi
1495     fi
1500 dnl See if the user wants dbus.library
1501 AC_MSG_CHECKING([if building of dbus.library is enabled])
1502 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1503 if test "$dbus" = "yes" ; then
1504     ENABLE_DBUS=1
1505     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1506     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1507     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1508     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1509 else
1510     ENABLE_DBUS=0
1512 AC_MSG_RESULT($dbus)
1515 dnl --------------------------------------------------------------------
1516 dnl Configuration Output Section
1517 dnl --------------------------------------------------------------------
1519 # Generic
1520 AC_SUBST(aros_arch)
1521 AC_SUBST(aros_cpu)
1522 AC_SUBST(aros_flavour)
1523 AC_SUBST(aros_flavour_uc)
1524 AC_SUBST(AROS_BUILDDIR)
1525 AC_SUBST(AROS_SRCDIR)
1526 AC_SUBST(AROS_PORTSSRCDIR)
1528 # Host related
1529 AC_SUBST(aros_cc_pre)
1530 AC_SUBST(aros_host_strip)
1531 AC_SUBST(aros_host_arch)
1532 AC_SUBST(aros_host_cpu)
1533 AC_SUBST(aros_host_cc)
1534 AC_SUBST(aros_host_ar)
1535 AC_SUBST(aros_host_ranlib)
1536 AC_SUBST(aros_host_ld)
1537 AC_SUBST(aros_host_make)
1538 AC_SUBST(aros_host_cflags)
1539 AC_SUBST(aros_host_ldflags)
1540 AC_SUBST(aros_host_debug)
1541 AC_SUBST(aros_host_mkdep)
1542 AC_SUBST(aros_host_mkargs)
1543 AC_SUBST(aros_host_exe_suffix)
1544 AC_SUBST(aros_host_lib_suffix)
1545 AC_SUBST(aros_tools_dir)
1546 AC_SUBST(aros_host_aclocal)
1547 AC_SUBST(aros_host_autoconf)
1548 AC_SUBST(aros_host_autoheader)
1549 AC_SUBST(aros_host_automake)
1551 # Target Related
1552 AC_SUBST(aros_target_guitheme)
1553 AC_SUBST(aros_target_bootloader)
1554 AC_SUBST(aros_target_arch)
1555 AC_SUBST(aros_target_cpu)
1556 AC_SUBST(aros_target_variant)
1557 AC_SUBST(aros_target_suffix)
1558 AC_SUBST(aros_target_incl)
1559 AC_SUBST(aros_target_ar)
1560 AC_SUBST(aros_target_ranlib)
1561 AC_SUBST(aros_kernel_nm)
1562 AC_SUBST(orig_target_cc)
1563 AC_SUBST(aros_target_cc)
1564 AC_SUBST(aros_kernel_cc)
1565 AC_SUBST(aros_target_as)
1566 AC_SUBST(orig_target_ld)
1567 AC_SUBST(aros_target_ld)
1568 AC_SUBST(aros_kernel_ld)
1569 AC_SUBST(aros_target_cc_includes)
1570 AC_SUBST(aros_target_cc_path)
1571 AC_SUBST(aros_target_objdump)
1572 AC_SUBST(aros_target_objcopy)
1573 AC_SUBST(aros_target_strip)
1574 AC_SUBST(aros_target_nm)
1575 AC_SUBST(aros_shared_default)
1576 AC_SUBST(aros_shared_ld)
1577 AC_SUBST(aros_object_format)
1578 AC_SUBST(aros_compiler_libs)
1580 AC_SUBST(aros_config_cflags)
1581 AC_SUBST(aros_config_aflags)
1582 AC_SUBST(aros_config_ldflags)
1584 AC_SUBST(aros_shared_cflags)
1585 AC_SUBST(aros_shared_aflags)
1586 AC_SUBST(aros_shared_ldflags)
1587 AC_SUBST(aros_kernel_cflags)
1588 AC_SUBST(aros_kernel_ldflags)
1589 AC_SUBST(aros_debug_cflags)
1590 AC_SUBST(aros_debug_aflags)
1591 AC_SUBST(aros_debug_ldflags)
1592 AC_SUBST(aros_target_genmap)
1593 AC_SUBST(aros_target_strip_flags)
1595 # Graphics Related
1596 AC_SUBST(x11_hidd_target)
1597 AC_SUBST(sdl_hidd_target)
1599 AC_SUBST(aros_default_wbwidth)
1600 AC_SUBST(aros_default_wbheight)
1601 AC_SUBST(aros_default_wbdepth)
1602 AC_SUBST(DO_XSHM_SUPPORT)
1603 AC_SUBST(DO_VIDMODE_SUPPORT)
1605 AC_SUBST(aros_host_x11_includes)
1606 AC_SUBST(aros_host_x11_libdirs)
1607 AC_SUBST(aros_host_sdl_cflags)
1608 AC_SUBST(aros_host_sdl_libs)
1610 # Native version related
1611 AC_SUBST(aros_bochs_hack)
1612 AC_SUBST(aros_serial_debug)
1614 # Palm native version related
1615 AC_SUBST(aros_palm_debug_hack)
1617 # Unix/Hosted version related
1618 AC_SUBST(aros_nesting_supervisor)
1620 # DBUS related
1621 AC_SUBST(ENABLE_DBUS)
1622 AC_SUBST(DBUS_CFLAGS)
1623 AC_SUBST(DBUS_LIBFLAGS)
1624 AC_SUBST(KERNEL_DBUS_KOBJ)
1625 AC_SUBST(KERNEL_DBUS_INCLUDES)
1627 # Debug related
1628 AC_SUBST(aros_debug)
1629 AC_SUBST(aros_mungwall_debug)
1630 AC_SUBST(aros_stack_debug)
1631 AC_SUBST(aros_modules_debug)
1633 # Collect-aros stuff: "-ius" to ignore undefined symbols
1634 AC_SUBST(ignore_undefined_symbols)
1636 # C compiler related
1637 AC_SUBST(gcc_target_cpu)
1639 dnl Prepare for output, make up all the generated patches
1640 case "$aros_flavour" in
1641 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
1642                 aros_flavour="emulation" ;;
1643 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
1644                 aros_flavour="emulation" ;;
1645 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
1646                 aros_flavour="standalone";;
1647 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
1648                 aros_flavour="native" ;;
1649 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1650                 aros_flavour="native" ;;
1651 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
1652                 aros_flavour="linklib" ;;
1653 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1654                 aros_flavour="palmnative" ;;
1655 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1656                 aros_flavour="mac68knative" ;;
1657 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
1658                 aros_flavour="ppcnative" ;;
1659 esac
1661 if test ! -d ${aros_inc_dir} ; then
1662     ${MKDIR} ${aros_inc_dir}
1664 if test ! -d ${aros_geninc_dir} ; then
1665     ${MKDIR} ${aros_geninc_dir}
1667 if test ! -d ${aros_hostcfg_dir} ; then
1668     ${MKDIR} ${aros_hostcfg_dir}
1670 if test ! -d ${aros_targetcfg_dir} ; then
1671     ${MKDIR} ${aros_targetcfg_dir}
1673 if test ! -d ${aros_tools_dir} ; then
1674     ${MKDIR} ${aros_tools_dir}
1676 if test ! -d ${aros_scripts_dir} ; then
1677     ${MKDIR} ${aros_scripts_dir}
1680 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
1682 AC_CONFIG_COMMANDS([compiler_executable],
1683     [
1684         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
1685         mkdir -p $prefix
1686         prefix="${prefix}/${aros_target_cpu}-aros"
1687         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
1689         echo ${prefix}
1690         echo ${prefix2}
1691         chmod a+x ${prefix2}-gcc ${prefix2}-ld
1693         ln -sf ${prefix2}-gcc          ${prefix}-gcc
1694         ln -sf ${prefix2}-ld           ${prefix}-ld
1696         ln -sf $aros_target_as_ln      ${prefix}-as
1697         ln -sf $aros_target_nm_ln      ${prefix}-nm
1698         ln -sf $aros_target_ar_ln      ${prefix}-ar
1699         ln -sf $aros_target_ranlib_ln  ${prefix}-ranlib
1700         ln -sf $aros_target_objcopy_ln ${prefix}-objcopy
1701         ln -sf $aros_target_objdump_ln ${prefix}-objdump
1702         ln -sf $aros_target_strip_ln   ${prefix}-strip
1704         ln -sf $aros_target_as_ln      ${prefix2}-as
1705         ln -sf $aros_target_nm_ln      ${prefix2}-nm
1706         ln -sf $aros_target_ar_ln      ${prefix2}-ar
1707         ln -sf $aros_target_ranlib_ln  ${prefix2}-ranlib
1708         ln -sf $aros_target_objcopy_ln ${prefix2}-objcopy
1709         ln -sf $aros_target_objdump_ln ${prefix2}-objdump
1710         ln -sf $aros_target_strip_ln   ${prefix2}-strip
1711     ],
1712     [
1713         aros_tools_dir=${aros_tools_dir}
1714         aros_target_cpu=${aros_target_cpu}
1715         aros_target_arch=${aros_target_arch}
1716         aros_target_suffix=${aros_target_suffix}
1717         aros_target_nm_ln=${aros_target_nm_ln}
1718         aros_target_as_ln=${aros_target_as_ln}
1719         aros_target_ar_ln=${aros_target_ar_ln}
1720         aros_target_ranlib_ln=${aros_target_ranlib_ln}
1721         aros_target_objdump_ln=${aros_target_objdump_ln}
1722         aros_target_objcopy_ln=${aros_target_objcopy_ln}
1723         aros_target_strip_ln=${aros_target_strip_ln}
1724     ]
1726 AC_CONFIG_COMMANDS([genshared_executable],
1727     [chmod a+x ${aros_scripts_dir}/genshared],
1728     [aros_scripts_dir=${aros_scripts_dir}]
1730 AC_CONFIG_COMMANDS([genmf_executable],
1731     [chmod a+x ${aros_tools_dir}/genmf.py],
1732     [aros_tools_dir=${aros_tools_dir}]
1734 AC_CONFIG_COMMANDS([adflib_myaros.conf_executable],
1735     [chmod a+x tools/adflib/myconf.aros]
1738 AC_CONFIG_FILES(
1739     Makefile
1740     rom/mmakefile
1741     config/make.cfg
1742     ${aros_inc_dir}/config.h:config/config.h.in
1743     ${aros_geninc_dir}/config.h:config/config.h.in
1744     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
1745     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
1746     mmake.config
1747     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
1748     ${aros_targetcfg_dir}/specs:config/specs.in
1749     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
1750     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
1751     ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
1752     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
1753     tools/adflib/myconf.aros
1754     tools/collect-aros/env.h
1757 AC_OUTPUT
1759 dnl This is in order to not define SHARED_CFLAGS sometimes
1760 dnl We don't always do aros_shared_ar, aros_shared_cflags
1762 #XXX compatability...
1763 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
1765 if test -n "$aros_shared_cflags" ; then
1766     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
1767     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg