Support for migration of volumes between packet handler instances. Allocate a
[AROS.git] / configure.in
blob727b5c83f2f2083935194d7d0046c805a6389a24
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 dnl Despite the name, this is really a host configuration variable.
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             *)
149                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
150                 aros_host_cpu="$host_cpu"
151                 ;;
152         esac
153         ;;
155     linux*)
156         aros_host_arch="linux"
157         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
158         case "$host_cpu" in
159             *i?86*)
160                 aros_host_cpu="i386"
161                 ;;
162             *x86_64*)
163                 aros_host_cpu="x86_64"
164                 ;;
165             *m68k*)
166                 aros_host_cpu="m68k"
167                 ;;
168             *powerpc*)
169                 aros_host_cpu="ppc"
170                 ;;
171             *arm*)
172                 aros_host_cpu="arm"
173                 ;;
174             *)
175                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
176                 aros_host_cpu="$host_cpu"
177                 ;;
178         esac
179         ;;
181     freebsd*)
182         aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
183         aros_host_make="gmake"
184         aros_host_arch="freebsd"
185         aros_host_cpu="i386"
187         aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
189         dnl Need to override this here, it's just too hard later.
190         dnl This shouldn't be here at all...
191         dnl aros_target_cc_includes="/usr/include"
193         dnl FreeBSD 5.x (and later) has changed the default object format.
194         dnl The double [[]] is necessary to get around m4's quoting rules.
195         case $host_os in
196             freebsd[[234]]*)
197                 aros_object_format="elf_i386"
198                 ;;
200             *)
201                 aros_object_format="elf_i386_fbsd"
202                 ;;
203         esac
205         ;;
207     darwin*)
208         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
209         aros_host_arch="darwin"
210         case "$host_cpu" in
211             *i?86*)
212                 aros_host_cpu="i386"
213                 ;;
214             *powerpc*)
215                 aros_host_cpu="ppc"
216                 ;;
217             *)
218                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
219                 aros_host_cpu="$host_cpu"
220                 ;;
221         esac
223         aros_host_ldflags="$aros_host_ldflags -liconv"
225         ;;
227     dragonfly*)
228         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
229         aros_host_make="gmake"
230         aros_host_arch="dragonfly"
231         case $host_cpu in
232             *i?86*)
233                 aros_host_cpu="i386"
234                 ;;
235             *amd64*)
236                 aros_host_cpu="x86_64"
237                 ;;
238             *)
239                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
240                 aros_host_cpu="$host_cpu"
241                 ;;
242         esac
243         ;;
245     netbsd*)
246         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
247         aros_host_make="gmake"
248         aros_host_arch="netbsd"
249         case "$host_cpu" in
250             *i?86*)
251                 aros_host_cpu="i386"
252                 ;;
253             *m68k*)
254                 aros_host_cpu="m68k"
255                 ;;
256             *)
257                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
258                 aros_host_cpu="$host_cpu"
259                 ;;
260         esac    
261         aros_host_lib_suffix=".0.0"
262         ;;
264     openbsd*)
265         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
266         aros_host_make="gmake"
267         aros_host_arch="openbsd"
268         case "$host_cpu" in
269             *i?86*)
270                 aros_host_cpu="i386"
271                 ;;
272             *)
273                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
274                 aros_host_cpu="$host_cpu"
275                 ;;
276         esac
277         ;;
278         
279     solaris*)
280         aros_host_arch="solaris"
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             *sparc*)
287                 aros_host_cpu="sparc"
288                 ;;
289             *)
290                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
291                 aros_host_cpu="$host_cpu"
292                 ;;
293         esac
294         ;;
296     morphos*)
297         aros_host_arch="morphos"
298         aros_host_cpu="ppc"
299         ;;
301     amiga*)
302         aros_host_arch="amiga"
303         SORT="/gg/bin/sort"
304         TEST="/gg/bin/test"
305         UNIQ="/gg/bin/uniq"
306         FOR="for"
307         TOUCH="/gg/bin/touch"
308         case "$host_cpu" in
309             *m68k*)
310                 aros_host_cpu="m68k"
311                 ;;
312             *powerpc*)
313                 aros_host_cpu="ppc"
314                 ;;
315             *)
316                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
317                 aros_host_cpu="$host_cpu"
318                 ;;
319         esac
320         ;;
322     cygwin*)
323         aros_host_arch="cygwin"
324         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
325         case "$host_cpu" in
326             *i?86*)
327                 aros_host_cpu="i386"
328                 ;;
329             *)
330                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
331                 aros_host_cpu="$host_cpu"
332                 ;;
333         esac
334         ;;
336     mingw32*)
337         aros_host_arch="mingw32"
338         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
339         case "$host_cpu" in
340             *i?86*)
341                 aros_host_cpu="i386"
342                 ;;
343             *)
344                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
345                 aros_host_cpu="$host_cpu"
346                 ;;
347         esac
348         ;;
349     *)
350         AC_MSG_ERROR([Unsupported host architecture $host])
351         ;;
352 esac
354 AROS_PROG(aros_host_ar,[ar],[cr])
355 AROS_REQUIRED(ar,$aros_host_ar)
356 AROS_PROG(aros_host_ranlib,ranlib)
357 AROS_REQUIRED(ranlib,$aros_host_ranlib)
358 AROS_PROG(aros_host_strip,strip)
359 AROS_REQUIRED(strip,$aros_host_strip)
361 AROS_PROG(RM,[rm],[-rf])
362 AROS_REQUIRED(rm,$RM)
363 AROS_PROG(CP,[cp])
364 AROS_REQUIRED(cp,$CP)
365 AROS_PROG(MV,[mv])
366 AROS_REQUIRED(mv,$MV)
367 AROS_PROG(ECHO,[echo])
368 AROS_REQUIRED(echo,$ECHO)
369 AROS_PROG(MKDIR,[mkdir],[-p])
370 AROS_REQUIRED(mkdir,$MKDIR)
371 AROS_PROG(TOUCH,[touch])
372 AROS_REQUIRED(touch,$TOUCH)
373 AROS_PROG(SORT,[sort])
374 AROS_REQUIRED(sort,$SORT)
375 AROS_PROG(UNIQ,[uniq])
376 AROS_REQUIRED(uniq,$UNIQ)
377 AROS_PROG(NOP,[true])
378 AROS_REQUIRED(true,$NOP)
379 AROS_PROG(CAT,[cat])
380 AROS_REQUIRED(cat,$CAT)
381 AROS_PROG(BISON,[bison])
382 AROS_REQUIRED(bison,$BISON)
383 AROS_PROG(FLEX,[flex])
384 AROS_REQUIRED(flex,$FLEX)
385 AROS_PROG(PNGTOPNM,[pngtopnm])
386 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
387 AROS_PROG(PPMTOILBM,[ppmtoilbm])
388 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
389 AROS_PROG(SED,[sed])
390 AROS_REQUIRED(sed,$SED)
391 AROS_PROG(CHMOD,[chmod])
392 AROS_REQUIRED(chmod,$CHMOD)
394 AM_PATH_PYTHON(2.2.1)
396 AC_SUBST(FOR, for)
397 AC_SUBST(IF, if)
398 AC_SUBST(TEST, test)
399 AC_SUBST(CMP, cmp)
401 dnl ---------------------------------------------------------------------------
402 dnl Look for things about the host system, good for hosted targets.
403 dnl ---------------------------------------------------------------------------
405 # Check for some includes for the X11 HIDD and the kernel
406 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
407     sys/mmap.h sys/mman.h sysexits.h \
408     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
411 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
413 AC_HEADER_DIRENT
414 AC_HEADER_STAT
415 AC_HEADER_STDC
416 AC_HEADER_SYS_WAIT
417 AC_HEADER_TIME
418 AC_STRUCT_ST_BLKSIZE
419 AC_STRUCT_ST_BLOCKS
420 AC_STRUCT_ST_RDEV
421 AC_STRUCT_TM
422 AC_STRUCT_TIMEZONE
423 AC_TYPE_OFF_T
424 AC_TYPE_PID_T
425 AC_TYPE_SIZE_T
426 AC_TYPE_UID_T
428 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
430 # Look for some functions
431 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
432     clone kse_create rfork_thread thr_create sa_register \
433     getcontext makecontext setcontext sigaltstack swapcontext])
435 AC_FUNC_MMAP
438 dnl --------------------------------------------------------------------
439 dnl Target Configuration Section
440 dnl --------------------------------------------------------------------
442 dnl The target configuration section is responsible for setting up all
443 dnl the paths for includes, and tools required to build AROS to some
444 dnl particular target.
446 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
447 aros_config_aflags="-Wall -x assembler-with-cpp -c"
448 aros_config_ldflags=""
450 aros_shared_default=yes
452 aros_shared_cflags="-fPIC"
453 aros_shared_aflags=""
454 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
455 aros_kernel_ldflags="-Wl,-rpath,./lib"
457 aros_target_ar_flags="cr"
458 aros_target_nm_flags="-C -ul"
459 aros_target_strip_flags="--strip-unneeded -R.comment"
461 aros_compiler_libs=
462 aros_arch_libs=
464 aros_target_genmap="-Wl,-Map -Xlinker"
466 # Native flavour stuff
467 aros_serial_debug="0"
469 # Palm native flavour stuff
470 aros_palm_debug_hack="0"
472 # Unix flavour stuff
473 aros_nesting_supervisor="0"
475 # Collect-aros stuff: "-ius" to ignore undefined symbols
476 ignore_undefined_symbols=""
478 #-----------------------------------------------------------------------------
481 # GCC 4.1+ has a stack protection feature that requires OS support. Ubuntu has
482 # it switched on by default, and we use the host compiler, so it compiles AROS
483 # code with this enabled resulting in link failures as we don't have support
484 # for it.
486 # We use two methods to disable it. For the host compiler (used to compile
487 # some hosted modules), we test to see if the compiler supports stack
488 # protection, and if it does we disable it in AROS_CONFIG_CFLAGS. This should
489 # work on all platforms.
491 # For the "cross" compiler we clear the "ssp_default" spec in config/specs.in
492 # (this is done unconditionally, as it should have no effect on compilers
493 # without the stack protection feature). This may be specific to the way that
494 # Ubuntu enables the feature, so may not work everywhere. My specs-fu isn't
495 # strong enough to disable it in a generic way though, so we'll live with it
496 # until another vendor ships GCC with it enabled in a different way, and deal
497 # with it then.
500 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
501 save_cflags="$CFLAGS"
502 CFLAGS="$CFLAGS -fno-stack-protector"
503 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
504 AC_MSG_RESULT($use_no_stack_protector)
505 if test "x-$use_no_stack_protector" = "x-yes" ; then
506     aros_host_cflags="$aros_host_cflags -fno-stack-protector"
508 CFLAGS="$save_cflags"
510 #-----------------------------------------------------------------------------
512 # Disable pointer-signedness warnings if the compiler recognises the option
513 # (this only works for the host compiler at the moment)
515 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
516 save_cflags="$CFLAGS"
517 CFLAGS="$CFLAGS -Wno-pointer-sign"
518 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
519 AC_MSG_RESULT($use_no_sign_warning)
520 if test "x-$use_no_sign_warning" = "x-yes" ; then
521     aros_host_cflags="$aros_host_cflags -Wno-pointer-sign"
523 CFLAGS="$save_cflags"
525 #-----------------------------------------------------------------------------
527 AC_MSG_CHECKING([for type of build])
528 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")
530 if test "$build_type" = "nightly"; then
531     build_type_string="NIGHTLY"
532 elif test "$build_type" = "snapshot"; then
533     build_type_string="SNAPSHOT"
534 elif test "$build_type" = "milestone"; then
535     build_type_string="MILESTONE"
536 elif test "$build_type" = "release"; then
537     build_type_string="RELEASE"
538 else
539     build_type_string="PERSONAL"
540     build_type="personal"
543 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
545 AC_MSG_RESULT($build_type)
547 #-----------------------------------------------------------------------------
548 all_debug_types="messages stack modules mungwall symbols"
550 AC_MSG_CHECKING([which debug types to enable])
551 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)]),
552  debug="$enableval",debug="")
554 if test "$debug" = "" -o "$debug" = "no"; then
555     debug="none"
556 elif test "$debug" = "yes"; then
557     debug="all"
560 if test "$debug" = "all" ; then
561     debug="messages stack modules symbols"
562     for d in $all_debug_types; do
563         export aros_${d}_debug="1"
564     done
565 else
566     for d in $all_debug_types; do
567         export aros_${d}_debug="0"
568     done
571 if test "$debug" != "none"; then
572     debug=`echo $debug | sed s/,/\ /g`
573     for d in $debug; do
574         found="0"
575         for d2 in $all_debug_types; do
576             if test "$d2" = "$d"; then
577                 found="1"
578                 break
579             fi
580         done
581         if test "$found" = "0"; then
582             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
583         fi
584         export aros_${d}_debug="1"
585     done
586     aros_debug="yes"
588 AC_MSG_RESULT($debug)
590 if test "$aros_messages_debug" = "1"; then
591     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
592 else
593     aros_messages_debug=""
595 if test "$aros_symbols_debug" = "1"; then
596     aros_symbols_debug="-g"
597 else
598     aros_symbols_debug=""
601 # These are the flags to pass when compiling debugged programs
602 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
603 aros_debug_aflags=""
604 aros_debug_ldflags="$aros_symbols_debug"
606 aros_crosstools="no"
608 #-----------------------------------------------------------------------------
609 #   Checking if we should build crosstools..
610 AC_MSG_CHECKING([whether to build crosstools])
611 AC_ARG_ENABLE(crosstools,AC_HELP_STRING([--enable-crosstools],[Build cross-compiler toolchains if necessary (default=no).]),crosstools="$enableval",crosstools="no")
612 if test "$crosstools" != "" -a "$crosstools" != "no"; then
613     AC_MSG_RESULT(yes)
614         aros_crosstools="yes"
615 else
616     AC_MSG_RESULT(no)
619 #-----------------------------------------------------------------------------
620 #   Checking for distcc and ccache.
622 #   Always apply the transforms in this particular order. Basically you should
623 #   always run 'ccache distcc compiler' in that order for the best performance.
625 AC_MSG_CHECKING([whether to enable distcc])
626 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
627 if test "$distcc" != "" -a "$distcc" != "no"; then
628     # AC_CHECK_PROG will print out the result in this case
629     AC_PATH_PROG(DISTCC,[distcc],distcc,)
630 else
631     AC_MSG_RESULT(no)
634 AC_MSG_CHECKING([whether to enable ccache])
635 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
636 if test "$ccache" != "" -a "$ccache" != "no"; then
637     # AC_CHECK_PROG will print out the result in this case
638     AC_CHECK_PROG(CCACHE,[ccache],ccache,)
639 else
640     AC_MSG_RESULT(no)
643 #-----------------------------------------------------------------------------
644 AC_MSG_CHECKING([what optimization flags to use])
645 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
646 if test "$optimization" = "unknown"; then
647     dnl default is -O2 for normal builds, -O0 for debug builds
648     if test "$debug" != "none"; then
649         optimization="-O0"
650     else
651         optimization="-O2"
652     fi
654 aros_config_cflags="$aros_config_cflags $optimization"
655 AC_MSG_RESULT($optimization)
657 #-----------------------------------------------------------------------------
658 AC_MSG_CHECKING([what target variant to enable])
659 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")
660 if test "$target_variant" = "none"; then
661     aros_target_variant=""
662     aros_target_suffix=""
663 else
664     aros_target_variant="$target_variant"
665     aros_target_suffix="-$target_variant"
667 AC_MSG_RESULT($enableval)
669 target_bootloader="none"
671 #-----------------------------------------------------------------------------
672 # This is the target configuration switch.
673 case "$target_os" in
674     linux*)
675         aros_target_arch="linux"
676         case "$target_cpu" in
677             *m68k*)
678                 aros_target_cpu="m68k"
679                 aros_object_format="m68kelf"
680                 aros_flavour="emulcompat"
681                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
682                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
683                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
684                 gcc_target_cpu="mc68000"
685                 ;;
686             *i?86*)
687                 aros_target_cpu="i386"
688                 aros_object_format="elf_i386"
689                 aros_flavour="emulation"
690                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
691                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
692                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
693                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
694                 aros_config_ldflags="-m32 -march=i486"
695                 aros_kernel_ldflags="-melf_i386"
696                 aros_default_wbdepth=8
697                 gcc_target_cpu="i386"
698                 ;;
699             *x86_64*)
700                 aros_target_cpu="x86_64"
701                 aros_object_format="elf_x86_64"
702                 aros_flavour="emulation"
703                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
704                 aros_config_cflags="$aros_config_cflags -mno-red-zone"
705                 aros_default_wbdepth=8
706                 gcc_target_cpu="x86_64"
707                 ;;
708             *powerpc*)
709                 aros_target_cpu="ppc"
710                 aros_object_format="elf32ppc"
711                 aros_flavour="emulation"
712                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
713                 aros_default_wbdepth=8
714                 gcc_target_cpu="ppc"
715                 ;;
716 # TODO
717 # Same as powerpc, but I need this for the nightly build to work again.
718 # Actually, the nightly should be made working with powerpc target.
719 # That just was too much work for the moment, another week or two.
720             *ppc*)
721                 aros_target_cpu="ppc"
722                 aros_object_format="elf32ppc"
723                 aros_flavour="emulation"
724                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
725                 aros_default_wbdepth=8
726                 gcc_target_cpu="ppc"
727                 ;;
728             *arm*)
729                 aros_target_cpu="arm"
730                 aros_object_format="armelf_linux_eabi"
731                 aros_flavour="emulation"
732                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm -D__linux__"
733                 gcc_target_cpu="arm"
734                 aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
735                 aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
736                 ;;
737             *)
738                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
739                 ;;
740         esac
741     ;;
743     pc)
744         aros_target_arch="pc"
745         aros_shared_default="no"
746         target_bootloader="grub2"
747         case "$target_cpu" in
748             *i?86*)
749                 aros_target_cpu="i386"
751                 dnl If somebody hasn't already set the target object
752                 dnl format, then use this value. Mostly to support
753                 dnl FreeBSD cross-compilation.
754                 dnl TODO: Remove when we always use our compiler.
756                 if test "$aros_object_format" = "" ; then
757                     aros_object_format="elf_i386"
758                 fi
759                 aros_flavour="standalone"
760                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
761                 aros_config_cflags="$aros_config_cflags -m32 -march=i486"
762                 aros_kernel_cflags="$aros_kernel_cflags -m32 -march=i486"
763                 aros_config_aflags="$aros_config_aflags -m32 -march=i486"
764                 aros_config_ldflags="-m32 -march=i486"
765                 aros_kernel_ldflags="-melf_i386"
766                 aros_default_wbwidth=640
767                 aros_default_wbheight=480
768                 gcc_target_cpu="i386"
769                 ;;
770             *x86_64*)
771                 aros_target_cpu="x86_64"
772                 aros_serial_debug=1
773                 if test "$aros_object_format" = "" ; then
774                     aros_object_format="elf_x86_64"
775                 fi
776                 aros_flavour="standalone"
777                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
778                 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables -mno-red-zone"
779                 aros_kernel_ldflags=""
780                 aros_default_wbwidth=640
781                 aros_default_wbheight=480
782                 gcc_target_cpu="x86_64"
783                 ;;
784             *)
785                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
786                 ;;
787         esac
788         ;;
790     prep)
791         aros_target_arch="prep"
792         aros_shared_default="no"
793         aros_target_cpu="ppc"
794         aros_object_format="elf32ppc"
795         aros_flavour="ppcnative"
796         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
797         aros_kernel_ldflags=""
798         aros_default_wbwidth=640
799         aros_default_wbheight=480
800         gcc_target_cpu="ppc"
801         ;;
803     freebsd*)
804         aros_target_arch="freebsd"
805         aros_target_cpu="i386"
806         aros_flavour="emulation"
807         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
808         gcc_target_cpu="i386"
810         aros_target_strip_flags="-x"
811         ;;
813     darwin*)
814         aros_target_arch="darwin"
815         aros_flavour="emulation"
816         dnl FIXME
817         dnl This test bypass was implemented for Darwin by port's author.
818         dnl I wonder why, since darwin port needs this function.
819         dnl I left it here just because port author did it.
820         need_dlopen="no"
821         case "$target_cpu" in
822                 *i?86*)
823                         aros_target_cpu="i386"
824                         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
825                         gcc_target_cpu="i386"
826                         aros_object_format="elf_i386"
827                         aros_target_strip_flags="-x"
828                         ;;
829                 *)
830                         AC_MSG_ERROR("Unsupported target CPU for darwin hosted flavour -- $target_cpu")
831                         ;;
832         esac
833         ;;
835     dragonfly*)
836         aros_target_arch="dragonfly"
837         aros_flavour="emulation"
838         case "$target_cpu" in
839             *i?86*)
840                 aros_target_cpu="i386"
841                 aros_object_format="elf_i386"
842                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__DragonFly__"
843                 ;;
844             *x86_64*)
845                 aros_target_cpu="x86_64"
846                 aros_object_format="elf_x86_64"
847                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__DragonFly__"
848                 ;;
849             *)
850                 AC_MSG_ERROR("Unknown CPU for DragonFly -- $target_cpu")
851                 ;;
852         esac
853         ;;
855     netbsd*)
856         aros_target_arch="netbsd"
857         case "$target_cpu" in
858             *m68k*)
859                 aros_target_cpu="m68k"
860                 aros_object_format="m68kelf"
861                 aros_flavour="emulcompat"
862                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
863                 gcc_target_cpu="mc68000"
864                 ;;
865             *i?86*)
866                 aros_target_cpu="i386"
867                 aros_object_format="elf_i386"
868                 aros_flavour="emulation"
869                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
870                 aros_default_wbdepth=8
871                 gcc_target_cpu="i386"
872                 ;;
873             *)
874                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
875                 ;;
876         esac
877         aros_target_genmap="-Wl,-M -Xlinker >"
878         aros_flavour="emulation"
879         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
880         ;;   
882     openbsd*)
883         aros_target_arch="openbsd"
884         case "$target_cpu" in
885             *i?86*)
886                 aros_target_cpu="i386"
887                 aros_object_format="elf_i386"
888                 aros_flavour="emulation"
889                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
890                 gcc_target_cpu="i386"
891                 ;;
892             *)
893                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
894                 ;;
895         esac
896         aros_target_genmap="-Wl,-M -Xlinker >"
897         aros_target_nm_flags="-u"
898         aros_flavour="emulation"
899         ;;
901     solaris*)
902         aros_target_arch="solaris"
903         case "$target_cpu" in
904            *i?86*)
905                aros_target_cpu="i386"
906                aros_object_format="elf_i386"
907                aros_flavour="emulation"
908                aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__Solaris__"
909                aros_default_wbdepth=8
910                gcc_target_cpu="i386"
911                ;;
912             *sparc*)
913                 aros_target_cpu="sparc"
914                 aros_object_format="elf_sparc"
915                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
916                 gcc_target_cpu="sparc"
917                 ;;
918             *)
919                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
920                 ;;
921         esac
922         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
923         aros_flavour="emulation"
924         ;;
926     morphos*)
927         aros_target_arch="morphos"
928         aros_shared_default="no"
929         aros_target_cpu="ppc"
930         aros_object_format="elf_ppc"
931         aros_flavour="nativecompat"
932         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
933         gcc_target_cpu="ppc"
934         ;;
936     sam440)
937         aros_target_arch="sam440"
938         aros_shared_default="no"
939         aros_target_cpu="ppc"
940         aros_object_format="elf32ppc"
941         aros_flavour="ppcnative"
942         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
943         aros_kernel_ldflags=""
944         aros_default_wbwidth=1024
945         aros_default_wbheight=768
946         aros_default_wbdepth=24
947         aros_config_cflags="$aros_config_cflags -mcpu=440fp -mno-toc -fno-asynchronous-unwind-tables"
948         gcc_target_cpu="powerpc"
949         ;;
951     efika)
952         aros_target_arch="efika"
953         aros_shared_default="no"
954         aros_target_cpu="arm"
955         aros_object_format="armelf_linux_eabi"
956         aros_flavour="standalone"
957         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
958         aros_kernel_ldflags=""
959         aros_default_wbwidth=1024
960         aros_default_wbheight=600
961         aros_arch_libs="-laeabi"
962         aros_config_cflags="$aros_config_cflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
963         aros_config_aflags="$aros_config_aflags -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-asynchronous-unwind-tables -fno-exceptions"
964         ;;
965         
966     chrp)
967     aros_target_arch="chrp"
968     aros_shared_default="no"
969     aros_target_cpu="ppc"
970     aros_object_format="elf32ppc"
971     aros_flavour="ppcnative"
972     aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
973     aros_kernel_ldflags=""
974     aros_default_wbwidth=640
975     aros_default_wbheight=480
976     aros_config_cflags="$aros_config_cflags -mno-toc -fno-asynchronous-unwind-tables"    
977     gcc_target_cpu="powerpc"
978         case "$aros_target_variant" in
979             efika)
980             aros_config_cflags="$aros_config_cflags -DBIG_ENDIAN_OHCI=1 -mcpu=603e"
981             ;;
982         esac
983     ;;
985     amiga*)
986         aros_target_arch="amiga"
987         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
988         aros_shared_default="no"
990         aros_config_cflags="$aros_config_cflags -fomit-frame-pointer -fbuiltin -ffreestanding"
992         case "$target_cpu" in
993             *m68k*)
994                 aros_target_cpu="m68k"
995                 aros_object_format="m68kelf"
996                 aros_flavour="nativecompat"
997                 gcc_target_cpu="mc68000"
998                 ;;
999             *ppc*)
1000                 aros_cpu="ppc"
1001                 aros_flavour="native"
1002                 gcc_target_cpu="ppc"
1003                 ;;
1004             *)
1005                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
1006                 ;;
1007         esac
1008         ;;
1010     mingw*)
1011         aros_target_arch="mingw32"
1012         aros_shared_default="no"
1013         aros_flavour="emulation"
1014         aros_shared_cflags=""
1015         need_dlopen="no"
1016         rescomp="windres"
1017         case "$target_cpu" in
1018             *i?86*)
1019                 aros_target_cpu="i386"
1020                 aros_object_format="elf_i386"
1021                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
1022                 aros_default_wbdepth=8
1023                 gcc_target_cpu="i386"
1024                 aros_target_cc="i386-aros-gcc"
1025                 aros_target_ld="i386-aros-ld"
1026                 aros_target_as="i386-aros-as"
1027                 aros_target_ar="i386-aros-ar"
1028                 aros_target_ranlib="i386-aros-ranlib"
1029                 aros_target_nm="i386-aros-nm"
1030                 aros_target_strip="i386-aros-strip"
1031                 aros_target_objcopy="i386-aros-objcopy"
1032                 aros_target_objdump="i386-aros-objdump"
1033                 target_tool_prefix="i386-mingw32-"
1034                 ;;
1035             *x86_64*)
1036                 aros_target_cpu="x86_64"
1037                 aros_object_format="elf_x86_64"
1038                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
1039                 aros_default_wbdepth=8
1040                 gcc_target_cpu="x86_64"
1041                 aros_target_cc="x86_64-aros-gcc"
1042                 aros_target_ld="x86_64-aros-ld"
1043                 aros_target_as="x86_64-aros-as"
1044                 aros_target_ar="x86_64-aros-ar"
1045                 aros_target_ranlib="x86_64-aros-ranlib"
1046                 aros_target_nm="x86_64-aros-nm"
1047                 aros_target_strip="x86_64-aros-strip"
1048                 aros_target_objcopy="x86_64-aros-objcopy"
1049                 aros_target_objdump="x86_64-aros-objdump"
1050                 target_tool_prefix="x86_64-w64-mingw32-"
1051                 ;;
1052             *arm*)
1053                 aros_target_cpu="arm"
1054                 aros_object_format="armelf_linux_eabi"
1055                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Darm"
1056                 aros_default_wbdepth=8
1057                 gcc_target_cpu="arm"
1058                 aros_target_cc="arm-elf-gcc"
1059                 aros_target_ld="arm-elf-ld"
1060                 aros_target_as="arm-elf-as"
1061                 aros_target_ar="arm-elf-ar"
1062                 aros_target_ranlib="arm-elf-ranlib"
1063                 aros_target_nm="arm-elf-nm"
1064                 aros_target_strip="arm-elf-strip"
1065                 aros_target_objcopy="arm-elf-objcopy"
1066                 aros_target_objdump="arm-elf-objdump"
1067                 target_tool_prefix="arm-mingw32ce-"
1068                 aros_default_wbwidth=160
1069                 aros_default_wbheight=160
1070                 ;;
1071             *)
1072                 AC_MSG_ERROR("Unknown CPU for Mingw32 -- $target_cpu")
1073                 ;;
1074         esac
1075         if test $host_os = "cygwin"; then
1076                 aros_kernel_cflags="-mno-cygwin"
1077         fi
1078     ;;
1079     pp*)
1080         aros_target_arch="pp"
1081         aros_shared_default="no"
1082         case "$target_cpu" in
1083             *m68k*)
1084                 aros_target_cpu="m68k"
1085                 aros_object_format="m68kelf"
1086                 aros_flavour="palmnative"
1087                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1088                 aros_default_wbwidth=160
1089                 aros_default_wbheight=160
1090                 aros_default_wbdepth=1
1091                 aros_target_ar_flags="cru"
1092                 aros_compiler_libs="-lgcc1"
1093                 aros_shared_default=no
1094                 aros_shared_cflags="-fpic"
1095                 aros_shared_aflags=""
1096                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1097                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1098                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
1099                 aros_debug_aflags=""
1100                 aros_debug_ldflags="$aros_symbols_debug"
1101                 aros_mungwall_debug="0"
1102                 aros_modules_debug="0"
1103                 gcc_target_cpu="mc68000"
1104                 ignore_undefined_symbols="-ius"
1105                 ;;
1106            *)
1107                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
1108                 ;;
1109         esac
1110         ;;
1112     mac*)
1113         aros_target_arch="mac"
1114         aros_shared_default="no"
1115         case "$target_cpu" in
1116             *m68k*)
1117                 aros_target_cpu="m68k"
1118                 aros_object_format="m68kelf"
1119                 aros_flavour="mac68knative"
1120                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
1121                 aros_default_wbwidth=512
1122                 aros_default_wbheight=384
1123                 aros_default_wbdepth=8
1124                 aros_target_ar_flags="cru"
1125                 aros_compiler_libs="-lgcc1"
1126                 aros_shared_default=no
1127                 aros_shared_cflags="-fpic"
1128                 aros_shared_aflags=""
1129                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
1130                 aros_kernel_ldflags="-Wl,-rpath,./lib"
1131                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000"
1132                 aros_debug_aflags=""
1133                 aros_debug_ldflags="$aros_symbols_debug"
1134                 aros_mungwall_debug="0"
1135                 aros_modules_debug="0"
1136                 gcc_target_cpu="mc68000"
1137                 ignore_undefined_symbols="-ius"
1138                 ;;
1139            *)
1140                 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
1141                 ;;
1142         esac
1143         ;;
1145     *)
1146         AC_MSG_ERROR([Unsupported target architecture $target])
1147         ;;
1148 esac
1150 AC_MSG_CHECKING([Where to download sourcecode for external ports])
1151 AC_ARG_WITH(portssources,AC_HELP_STRING([--with-portssources=DIR],[Where to download sourcecode for external ports]),with_portssrcdir=$withval,with_portssrcdir="default")
1152 if test "$with_portssrcdir" = "default"; then
1153     AROS_PORTSSRCDIR="$AROS_BUILDDIR_UNIX/bin/Sources"
1154 else
1155     AROS_PORTSSRCDIR="$with_portssrcdir"
1157 AC_MSG_RESULT($AROS_PORTSSRCDIR)
1159 AC_MSG_CHECKING([which bootloader to use])
1160 AC_ARG_WITH(bootloader,AC_HELP_STRING([--with-bootloader=NAME],[Use a specific bootloader]),target_bootloader=$withval,target_bootloader=$target_bootloader)
1161 if test "$target_bootloader" = "none"; then
1162     aros_target_bootloader=""
1163 else
1164     aros_target_bootloader="$target_bootloader"
1166 AC_MSG_RESULT($target_bootloader)
1168 AC_MSG_CHECKING([which icon-set to use])
1169 AC_ARG_WITH(iconset,AC_HELP_STRING([--with-iconset=NAME],[Use a specific Icon-set (default=Gorilla).]),target_iconset=$withval,target_iconset="default")
1170 if test "$target_iconset" = "default"; then
1171     aros_target_iconset="Gorilla"
1172     target_iconset="default (Gorilla)"
1173 else
1174     aros_target_iconset="$target_iconset"
1176 AC_MSG_RESULT($target_iconset)
1178 AC_MSG_CHECKING([which GUI Theme to use])
1179 AC_ARG_WITH(theme,AC_HELP_STRING([--with-theme=NAME],[Use a specific GUI Theme]),target_guitheme=$withval,target_guitheme="default")
1180 if test "$target_guitheme" = "default"; then
1181     aros_target_guitheme="Ice"
1182 else
1183     aros_target_guitheme="$target_guitheme"
1185 AC_MSG_RESULT($aros_target_guitheme)
1187 # Find out if we are cross-compiling (i.e. if we can't use the host compiler
1188 # for target code)
1189 cross_compiling=no
1190 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
1191     cross_compiling=yes
1193 if test "$aros_host_cpu" == "x86_64" ; then
1194     if test "$aros_target_cpu" == "i386" ; then
1195         if test "$aros_target_arch" != "mingw32"; then
1196             cross_compiling=no
1197         fi
1198     fi
1200 if test "$aros_host_arch" == "darwin" ; then
1201     cross_compiling=yes
1204 # Set prefix for target compiler etc. if we're cross-compiling
1205 # (should possibly be earlier but needs to be after AC_PROG_CC)
1206 if test "$cross_compiling" = "yes" ; then
1207     if test "$target_tool_prefix" = ""; then
1208         target_tool_prefix=${target_cpu}-elf-
1209     fi
1210     CC=${target_tool_prefix}gcc
1213 #-----------------------------------------------------------------------------
1215 # Disable pointer-signedness warnings if the compiler recognises the option
1217 AC_MSG_CHECKING([whether ${CC} accepts -Wno-pointer-sign])
1218 save_cflags="$CFLAGS"
1219 CFLAGS="$CFLAGS -Wno-pointer-sign"
1220 AC_TRY_COMPILE(,, use_no_sign_warning="yes", use_no_sign_warning="no")
1221 AC_MSG_RESULT($use_no_sign_warning)
1222 if test "x-$use_no_sign_warning" = "x-yes" ; then
1223     aros_config_cflags="$aros_config_cflags -Wno-pointer-sign"
1225 CFLAGS="$save_cflags"
1227 #-----------------------------------------------------------------------------
1229 # Find all the tools we need to compile. This could be cross-compiling
1230 # though! If that is the case we use the GNU form of the target and
1231 # simply add this to the front of the binary name. This is rather simple,
1232 # but it should work under most circumstances.
1234 # The default tools are to use the same as the host, but only if the
1235 # host and target CPU are the same. With GCC this is normally enough.
1238 aros_cc_pre=""
1239 aros_shared_ld="$aros_host_ld"
1241 aros_target_mkdep="$aros_host_mkdep"
1242 aros_target_incl_def="$aros_host_incl"
1244 aros_kernel_cc="$CC"
1246 # The default tools executables to be linked to.
1247 if test "$aros_target_cc" != ""; then
1248     AC_PATH_PROG(aros_target_cc,$aros_target_cc)
1249     AROS_REQUIRED(gcc,$aros_target_cc)
1251 if test "$aros_target_ld" != ""; then
1252     AC_PATH_PROG(aros_target_ld,$aros_target_ld)
1253     AROS_REQUIRED(ld,$aros_target_ld)
1256 if test "$crosstools" != "yes"; then
1257     AROS_TOOL_TARGET(aros_target_as_ln,as,$aros_target_as)
1258     AROS_REQUIRED(as,$aros_target_as_ln)
1259     AROS_TOOL_TARGET(aros_kernel_ld,ld,$aros_kernel_ld)
1260     AROS_REQUIRED(ld,$aros_kernel_ld)
1261     AROS_TOOL_TARGET(aros_target_ar_ln,ar,$aros_target_ar)
1262     AROS_REQUIRED(ar,$aros_target_ar_ln)
1263     AROS_TOOL_TARGET(aros_target_nm_ln,nm,$aros_target_nm)
1264     AROS_REQUIRED(nm,$aros_target_nm_ln)
1265     AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy,$aros_target_objcopy)
1266     AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
1267     AROS_TOOL_TARGET(aros_target_objdump_ln,objdump,$aros_target_objdump)
1268     AROS_REQUIRED(objdump,$aros_target_objdump_ln)
1269     AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib,$aros_target_ranlib)
1270     AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
1271     AROS_TOOL_TARGET(aros_target_strip_ln,strip,$aros_target_strip)
1272     AROS_REQUIRED(strip,$aros_target_strip_ln)
1275 if test "$rescomp" != ""; then
1276     if test "$cross_compiling" = "yes" ; then
1277         rescomp=${target_tool_prefix}${rescomp}
1278     fi
1279     AC_PATH_PROG(aros_kernel_rescomp,$rescomp)
1280     AROS_REQUIRED($rescomp,$aros_kernel_rescomp)
1283 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
1284 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
1285 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
1286 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
1287 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
1288 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
1289 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
1291 # aros_cc_pre is a variable that is added to the front of the compiler name
1292 # in the generated aros-gcc shell script. We need this to enable the cache
1293 # to work across cleaned builds. Also, support DISTCC using the correct
1294 # environment variable.
1297 if test "x${DISTCC}" != "x" ; then
1298     if test "x${CCACHE}" != "x" ; then
1299         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
1300     else
1301         aros_cc_pre="${DISTCC} "
1302     fi
1303 else
1304     if test "x${CCACHE}" != "x" ; then
1305         aros_cc_pre="${CCACHE} "
1306     fi
1309 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
1311 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
1312 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
1313 AC_SUBST(aros_target_nix_ldflags,-nix)
1314 AC_SUBST(aros_target_detach_ldflags,-detach)
1315 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
1317 # Target tools
1318 if test "$aros_target_cc" = ""; then
1319     orig_target_cc=$aros_kernel_cc
1320 else
1321     orig_target_cc=$aros_target_cc
1323 if test "$aros_target_ld" = ""; then
1324     orig_target_ld=$aros_kernel_ld
1325 else
1326     orig_target_ld=$aros_target_ld
1328 if test "$GCC" = "yes"; then
1329     aros_target_cc_path=`$orig_target_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
1331 aros_target_cc="${prefix}-gcc"
1332 aros_target_as="${prefix}-as"
1333 aros_target_ld="${prefix}-ld"
1334 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
1335 aros_target_objcopy=${prefix}-objcopy
1336 aros_target_objdump=${prefix}-objdump
1337 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
1338 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
1339 aros_kernel_nm="${prefix}-nm"
1340 aros_target_strip=${prefix}-strip
1342 # Find the system include path. We can suggest that an alternative is
1343 # used if we don't get it correct. The default is to use /usr/include.
1344 # Which is set in the aros_target_incl_def variable.
1346 AC_ARG_ENABLE(includes,
1347 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1348 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1350 dnl find out about the target cc's include path
1351 AC_MSG_CHECKING([for the target compiler's include path])
1352 if test "$aros_target_cc_includes" = "" ; then
1353     #try to guess where the directory is
1354     aros_target_cc_includes=`dirname \`${orig_target_cc} -print-libgcc-file-name\``/include
1355     if ! test -d $aros_target_cc_includes; then
1356         #the directory doesn't exist, we need to do some more work
1357         aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1358         
1359         #these are the headers we're looling for
1360         headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1361                  stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
1362                  zutil.h"
1364         dirs=
1365         for h in $headers; do
1366             #which other headers each of the above headers needs?
1367             deps=$(echo "#include <$h>" | \
1368                    $aros_host_cc -E -M - 2>/dev/null | \
1369                    sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1370             
1371             #copy all the needed headers to a directory beneath gendir
1372             for d in $deps; do
1373                 h=$(basename $d)
1374                 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1375                                                 sed -n "s,^.*/include\(/.*\),\1,p")
1376                 ! test -d $dir && mkdir -p $dir
1377                 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1378             done
1379         done        
1380     fi
1382 AC_MSG_RESULT($aros_target_cc_includes)
1385 # For GCC < 4.0 -I- is used for giving the search path for '#include "..."'
1386 # On GCC >= 4.0 -iquote should be used
1389 save_cc="$CC"
1390 save_cflags="$CFLAGS"
1391 CFLAGS="-iquote."
1392 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1393 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1394 AC_MSG_RESULT($has_iquote)
1395 if test "x-$has_iquote" = "x-yes" ; then
1396     host_cflags_iquote=-iquote
1397     host_cflags_iquote_end=
1398 else
1399     host_cflags_iquote=-I
1400     host_cflags_iquote_end=-I-
1402 kernel_cflags_iquote=$host_cflags_iquote
1403 kernel_cflags_iquote_end=$host_cflags_iquote_end
1404 if test "x-$cross_compiling" = "x-yes"; then
1405     CC="$aros_kernel_cc"
1406     AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
1407     AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
1408     AC_MSG_RESULT($use_no_stack_protector)
1409     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1410     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1411     AC_MSG_RESULT($has_iquote)
1412     if test "x-$has_iquote" = "x-yes" ; then
1413         kernel_cflags_iquote=-iquote
1414         kernel_cflags_iquote_end=
1415     else
1416         kernel_cflags_iquote=-I
1417         kernel_cflags_iquote_end=-I-
1418     fi
1420 aros_cflags_iquote=$kernel_cflags_iquote
1421 aros_cflags_iquote_end=$kernel_cflags_iquote_end
1422 if test "$orig_target_cc" != "$aros_kernel_cc"; then
1423     CC="$orig_target_cc"
1424     AC_MSG_CHECKING([whether ${CC} accepts -iquote])
1425     AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
1426     AC_MSG_RESULT($has_iquote)
1427     if test "x-$has_iquote" = "x-yes" ; then
1428         aros_cflags_iquote=-iquote
1429         aros_cflags_iquote_end=
1430     else
1431         aros_cflags_iquote=-I
1432         aros_cflags_iquote_end=-I-
1433     fi
1435 if test "x-$use_no_stack_protector" = "x-yes" ; then
1436     aros_kernel_cflags="$aros_kernel_cflags -fno-stack-protector"
1439 #-----------------------------------------------------------------------------
1441 # Check if we can explicitly choose older version of symbol hashing
1443 CFLAGS="save_cflags -Wl,--hash-style=sysv"
1444 CC="$aros_kernel_cc"
1445 AC_MSG_CHECKING([whether ${CC} accepts -Wl,--hash-style=sysv])
1446 AC_TRY_LINK(,, use_hash_style="yes", use_hash_style="no")
1447 AC_MSG_RESULT($use_hash_style)
1448 if test "x-$use_hash_style" = "x-yes" ; then
1449     aros_kernel_cflags="$aros_kernel_cflags -Wl,--hash-style=sysv"
1451 CC="$save_cc"
1452 CFLAGS="$save_cflags"
1454 AC_SUBST(host_cflags_iquote)
1455 AC_SUBST(host_cflags_iquote_end)
1456 AC_SUBST(kernel_cflags_iquote)
1457 AC_SUBST(kernel_cflags_iquote_end)
1458 AC_SUBST(aros_cflags_iquote)
1459 AC_SUBST(aros_cflags_iquote_end)
1462 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1463 AC_MSG_CHECKING([for default resolution of WBScreen])
1464 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1465 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1466 if test "$resolution" = "yes" ; then
1467     resolution="none"
1469 if test "$resolution" = "no" ; then
1470     resolution="none"
1472 if test "$resolution" != "none" ; then
1473     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1474     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1475     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1477 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1478 aros_cv_default_wbwidth=$aros_default_wbwidth
1479 aros_cv_default_wbheight=$aros_default_wbheight
1480 aros_cv_default_wbdepth=$aros_default_wbdepth
1482 dnl See if the user wants the serial debug output for native flavour
1483 AC_MSG_CHECKING([if serial debug is enabled])
1484 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)
1485 if test "$aros_serial_debug" = 0 ; then
1486     serial_debug_forced=""
1487     if test "$serial_debug" = "yes" ; then
1488         serial_debug="2"
1489     fi
1490     if test "$serial_debug" = "no" ; then
1491         serial_debug="none"
1492     fi
1493 else
1494     serial_debug_forced="(forced)"
1495     serial_debug=$aros_serial_debug
1497 if test "$serial_debug" != "none" ; then
1498     aros_serial_debug=$serial_debug
1499     AC_MSG_RESULT($serial_debug_forced on port $serial_debug)
1500 else
1501     AC_MSG_RESULT(no)
1504 dnl See if the user wants the palm debug output hack for palm native flavour
1505 AC_MSG_CHECKING([if palm debug hack is enabled])
1506 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")
1507 if test "$palm_debug_hack" = "yes" ; then
1508     aros_palm_debug_hack="1"
1510 AC_MSG_RESULT($palm_debug_hack)
1513 dnl See if the user wants nesting supervisor activated for unix flavour
1514 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1515 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")
1516 if test "$nesting_supervisor" = "yes" ; then
1517     aros_nesting_supervisor="1"
1519 AC_MSG_RESULT($nesting_supervisor)
1522 dnl things specifically required for hosted flavours
1523 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1525     if test "x-$need_dlopen" != "x-no" ; then
1526       dnl some kind of dynamic library access system is required for hostlib.resource
1527       AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1528       if test "x-$have_dl" = "x-no" ; then
1529           AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1530                                     aros_host_ldflags="$aros_host_ldflags -ldl"],
1531                                     have_dl="no")
1532       fi
1533       if test "x-$have_dl" = "x-no" ; then
1534           AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1535       fi
1536     fi
1539     dnl x11 hidd
1540     AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1541                                            [build X11 hidd for hosted (default=auto)]),
1542                                            x11_hidd="$enableval",
1543                                            x11_hidd="auto")
1544     case "x-$x11_hidd" in
1545         x-yes|x-no|x-auto)                 ;;
1546         *)                 x11_hidd="auto" ;;
1547     esac
1549     ENABLE_X11=0
1551     dnl they want it
1552     if test "x-$x11_hidd" != "x-no" ; then
1554         dnl find x11 stuff
1555         AC_PATH_X
1557         x_cflags=
1558         for path in $x_libraries
1559         do
1560             x_cflags="$x_cflags -L$path"
1561         done
1563         for path in $x_includes
1564         do
1565             x_cflags="$x_cflags -I$path"
1566         done
1567         
1568         if test "x-$no_x" = "x-yes" ; then
1570             dnl didn't find it
1571             if test "x-$x11_hidd" != "x-auto" ; then
1572                 dnl and they explicitly asked for it, bail out
1573                 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1574             fi
1575         
1576         else
1577             dnl found it, setup the metatarget
1578             x11_hidd_target=kernel-x11gfx-kobj
1579             ENABLE_X11=1
1581             dnl setup shared memory extensions
1582             AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1583                                                   [use X11 shared memory (default=auto)]),
1584                                                   x11_hidd_shm="$enableval",
1585                                                   x11_hidd_shm="auto")
1586             case "x-$x11_hidd_shm" in
1587                 x-yes|x-no|x-auto)                     ;;
1588                 *)                 x11_hidd_shm="auto" ;;
1589             esac
1591             have_xshm=no
1593             dnl they want it
1594             if test "x-$x11_hidd_shm" != "x-no" ; then
1596                 dnl system shm headers
1597                 AC_CHECK_HEADERS(sys/ipc.h)
1598                 AC_CHECK_HEADERS(sys/shm.h)
1600                 dnl got them
1601                 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1603                     dnl make sure X libs have shm functions
1604                     save_cflags="$CFLAGS"
1605                     CFLAGS="$CFLAGS $x_cflags"
1606                     AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1607                     CFLAGS="$save_cflags"
1608                 fi
1609             fi
1611             dnl detection done, prepare output
1612             if test "x-$have_xshm" = "x-yes" ; then
1613                 dnl we can do shm
1614                 DO_XSHM_SUPPORT="1"
1615             elif test "x-$x11_hidd_shm" = "x-yes" ; then
1616                 dnl they explicitly asked for it, but we can't do it
1617                 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1618             else
1619                 dnl otherwise just disable it
1620                 DO_XSHM_SUPPORT="0"
1621             fi
1623             
1624             dnl setup vidmode (fullscreen) extensions
1625             AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1626                                                       [use X11 vidmode extension (default=auto)]),
1627                                                       x11_hidd_vidmode="$enableval",
1628                                                       x11_hidd_vidmode="auto")
1629             case "x-$x11_hidd_vidmode" in
1630                 x-yes|x-no|x-auto)                         ;;
1631                 *)                 x11_hidd_vidmode="auto" ;;
1632             esac
1634             have_vidmode=no
1636             dnl they want it
1637             if test "x-$x11_hidd_vidmode" != "x-no" ; then
1639                 dnl make sure X libs have vidmode functions
1640                 save_cflags="$CFLAGS"
1641                 CFLAGS="$CFLAGS $x_cflags"
1642                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1643                 CFLAGS="$save_cflags"
1644             fi
1646             dnl detection done, prepare output
1647             if test "x-$have_vidmode" = "x-yes" ; then
1648                 dnl we can do vidmode
1649                 DO_VIDMODE_SUPPORT="1"
1650             elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1651                 dnl they explicitly asked for it, but we can't do it
1652                 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1653             else
1654                 dnl otherwise just disable it
1655                 DO_VIDMODE_SUPPORT="0"
1656             fi
1657         fi
1659         aros_host_x11_includes=$x_includes 
1660         aros_host_x11_libdirs=$x_libraries
1661     fi
1664     dnl sdl hidd
1665     AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1666                                            [build SDL hidd for hosted (default=auto)]),
1667                                            sdl_hidd="$enableval",
1668                                            sdl_hidd="auto")
1669     case "x-$sdl_hidd" in
1670         x-yes|x-no|x-auto)                 ;;
1671         *)                 sdl_hidd="auto" ;;
1672     esac
1674     dnl they want it
1675     if test "x-$sdl_hidd" != "x-no" ; then
1677         dnl find sdl
1678         AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1680         if test "x-$have_sdl" != "x-yes" ; then
1682             dnl didn't find it
1683             if test "x-$sdl_hidd" != "x-auto" ; then
1684                 dnl and they explicitly asked for it, bail out
1685                 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1686             fi
1688         else
1689             dnl found it, set up the metatarget
1690             sdl_hidd_target=kernel-hidd-sdl
1691             aros_host_sdl_cflags=SDL_CFLAGS
1692             aros_host_sdl_libs=SDL_LIBS
1693         fi
1694     fi
1699 dnl See if the user wants dbus.library
1700 AC_MSG_CHECKING([if building of dbus.library is enabled])
1701 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1702 if test "$dbus" = "yes" ; then
1703     ENABLE_DBUS=1
1704     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1705     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1706     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1707     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1708 else
1709     ENABLE_DBUS=0
1711 AC_MSG_RESULT($dbus)
1714 dnl --------------------------------------------------------------------
1715 dnl Configuration Output Section
1716 dnl --------------------------------------------------------------------
1718 # Generic
1719 AC_SUBST(aros_arch)
1720 AC_SUBST(aros_cpu)
1721 AC_SUBST(aros_flavour)
1722 AC_SUBST(aros_flavour_uc)
1723 AC_SUBST(AROS_BUILDDIR)
1724 AC_SUBST(AROS_BUILDDIR_UNIX)
1725 AC_SUBST(SRCDIR)
1726 AC_SUBST(AROS_PORTSSRCDIR)
1728 # Host related
1729 AC_SUBST(aros_cc_pre)
1730 AC_SUBST(aros_host_strip)
1731 AC_SUBST(aros_host_arch)
1732 AC_SUBST(aros_host_cpu)
1733 AC_SUBST(aros_host_cc)
1734 AC_SUBST(aros_host_ar)
1735 AC_SUBST(aros_host_ranlib)
1736 AC_SUBST(aros_host_ld)
1737 AC_SUBST(aros_host_make)
1738 AC_SUBST(aros_host_cflags)
1739 AC_SUBST(aros_host_ldflags)
1740 AC_SUBST(aros_host_debug)
1741 AC_SUBST(aros_host_mkdep)
1742 AC_SUBST(aros_host_mkargs)
1743 AC_SUBST(aros_host_exe_suffix)
1744 AC_SUBST(aros_host_lib_suffix)
1745 AC_SUBST(aros_tools_dir)
1746 AC_SUBST(aros_host_aclocal)
1747 AC_SUBST(aros_host_autoconf)
1748 AC_SUBST(aros_host_autoheader)
1749 AC_SUBST(aros_host_automake)
1751 # Target Related
1752 AC_SUBST(aros_target_guitheme)
1753 AC_SUBST(aros_target_iconset)
1754 AC_SUBST(aros_target_bootloader)
1755 AC_SUBST(aros_target_arch)
1756 AC_SUBST(aros_target_cpu)
1757 AC_SUBST(aros_target_variant)
1758 AC_SUBST(aros_target_suffix)
1759 AC_SUBST(aros_target_incl)
1760 AC_SUBST(aros_target_ar)
1761 AC_SUBST(aros_target_ranlib)
1762 AC_SUBST(aros_kernel_nm)
1763 AC_SUBST(orig_target_cc)
1764 AC_SUBST(aros_target_cc)
1765 AC_SUBST(aros_kernel_cc)
1766 AC_SUBST(aros_target_as)
1767 AC_SUBST(orig_target_ld)
1768 AC_SUBST(aros_target_ld)
1769 AC_SUBST(aros_kernel_ld)
1770 AC_SUBST(aros_target_cc_includes)
1771 AC_SUBST(aros_target_cc_path)
1772 AC_SUBST(aros_target_objdump)
1773 AC_SUBST(aros_target_objcopy)
1774 AC_SUBST(aros_target_strip)
1775 AC_SUBST(aros_target_nm)
1776 AC_SUBST(aros_kernel_rescomp)
1777 AC_SUBST(aros_shared_default)
1778 AC_SUBST(aros_shared_ld)
1779 AC_SUBST(aros_object_format)
1780 AC_SUBST(aros_compiler_libs)
1781 AC_SUBST(aros_arch_libs)
1783 AC_SUBST(aros_config_cflags)
1784 AC_SUBST(aros_config_aflags)
1785 AC_SUBST(aros_config_ldflags)
1787 AC_SUBST(aros_shared_cflags)
1788 AC_SUBST(aros_shared_aflags)
1789 AC_SUBST(aros_shared_ldflags)
1790 AC_SUBST(aros_kernel_cflags)
1791 AC_SUBST(aros_kernel_ldflags)
1792 AC_SUBST(aros_debug_cflags)
1793 AC_SUBST(aros_debug_aflags)
1794 AC_SUBST(aros_debug_ldflags)
1795 AC_SUBST(aros_target_genmap)
1796 AC_SUBST(aros_target_strip_flags)
1798 # Graphics Related
1799 AC_SUBST(x11_hidd_target)
1800 AC_SUBST(sdl_hidd_target)
1802 AC_SUBST(aros_default_wbwidth)
1803 AC_SUBST(aros_default_wbheight)
1804 AC_SUBST(aros_default_wbdepth)
1805 AC_SUBST(DO_XSHM_SUPPORT)
1806 AC_SUBST(DO_VIDMODE_SUPPORT)
1808 AC_SUBST(aros_host_x11_includes)
1809 AC_SUBST(aros_host_x11_libdirs)
1810 AC_SUBST(aros_host_sdl_cflags)
1811 AC_SUBST(aros_host_sdl_libs)
1813 # Native version related
1814 AC_SUBST(aros_serial_debug)
1816 # Palm native version related
1817 AC_SUBST(aros_palm_debug_hack)
1819 # Unix/Hosted version related
1820 AC_SUBST(aros_nesting_supervisor)
1822 # DBUS related
1823 AC_SUBST(ENABLE_DBUS)
1824 AC_SUBST(DBUS_CFLAGS)
1825 AC_SUBST(DBUS_LIBFLAGS)
1826 AC_SUBST(KERNEL_DBUS_KOBJ)
1827 AC_SUBST(KERNEL_DBUS_INCLUDES)
1829 #X11 related
1830 AC_SUBST(ENABLE_X11)
1832 # Debug related
1833 AC_SUBST(aros_debug)
1834 AC_SUBST(aros_mungwall_debug)
1835 AC_SUBST(aros_stack_debug)
1836 AC_SUBST(aros_modules_debug)
1838 # Collect-aros stuff: "-ius" to ignore undefined symbols
1839 AC_SUBST(ignore_undefined_symbols)
1841 # C compiler related
1842 AC_SUBST(gcc_target_cpu)
1844 dnl Prepare for output, make up all the generated patches
1845 case "$aros_flavour" in
1846 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
1847                 aros_flavour="emulation" ;;
1848 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
1849                 aros_flavour="emulation" ;;
1850 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
1851                 aros_flavour="standalone";;
1852 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
1853                 aros_flavour="native" ;;
1854 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1855                 aros_flavour="native" ;;
1856 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
1857                 aros_flavour="linklib" ;;
1858 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1859                 aros_flavour="palmnative" ;;
1860 mac68knative)   aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1861                 aros_flavour="mac68knative" ;;
1862 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_BINCOMPAT)"
1863                 aros_flavour="ppcnative" ;;
1864 esac
1866 if test ! -d ${aros_inc_dir} ; then
1867     ${MKDIR} ${aros_inc_dir}
1869 if test ! -d ${aros_geninc_dir} ; then
1870     ${MKDIR} ${aros_geninc_dir}
1872 if test ! -d ${aros_hostcfg_dir} ; then
1873     ${MKDIR} ${aros_hostcfg_dir}
1875 if test ! -d ${aros_targetcfg_dir} ; then
1876     ${MKDIR} ${aros_targetcfg_dir}
1878 if test ! -d ${aros_tools_dir} ; then
1879     ${MKDIR} ${aros_tools_dir}
1881 if test ! -d ${aros_scripts_dir} ; then
1882     ${MKDIR} ${aros_scripts_dir}
1885 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
1887 AC_CONFIG_COMMANDS([compiler_executable],
1888     [
1889         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
1890         mkdir -p $prefix
1891         prefix="${prefix}/${aros_target_cpu}-aros"
1892         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
1894         echo ${prefix}
1895         echo ${prefix2}
1896         chmod a+x ${prefix2}-gcc ${prefix2}-ld
1898         ln -sf ${prefix2}-gcc          ${prefix}-gcc
1899         ln -sf ${prefix2}-ld           ${prefix}-ld
1901         ln -sf $aros_target_as_ln$aros_host_exe_suffix      ${prefix}-as
1902         ln -sf $aros_target_nm_ln$aros_host_exe_suffix      ${prefix}-nm
1903         ln -sf $aros_target_ar_ln$aros_host_exe_suffix      ${prefix}-ar
1904         ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix  ${prefix}-ranlib
1905         ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix}-objcopy
1906         ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix}-objdump
1907         ln -sf $aros_target_strip_ln$aros_host_exe_suffix   ${prefix}-strip
1909         ln -sf $aros_target_as_ln$aros_host_exe_suffix      ${prefix2}-as
1910         ln -sf $aros_target_nm_ln$aros_host_exe_suffix      ${prefix2}-nm
1911         ln -sf $aros_target_ar_ln$aros_host_exe_suffix      ${prefix2}-ar
1912         ln -sf $aros_target_ranlib_ln$aros_host_exe_suffix  ${prefix2}-ranlib
1913         ln -sf $aros_target_objcopy_ln$aros_host_exe_suffix ${prefix2}-objcopy
1914         ln -sf $aros_target_objdump_ln$aros_host_exe_suffix ${prefix2}-objdump
1915         ln -sf $aros_target_strip_ln$aros_host_exe_suffix   ${prefix2}-strip
1916     ],
1917     [
1918         aros_host_exe_suffix=${aros_host_exe_suffix}
1919         aros_tools_dir=${aros_tools_dir}
1920         aros_target_cpu=${aros_target_cpu}
1921         aros_target_arch=${aros_target_arch}
1922         aros_target_suffix=${aros_target_suffix}
1923         aros_target_nm_ln=${aros_target_nm_ln}
1924         aros_target_as_ln=${aros_target_as_ln}
1925         aros_target_ar_ln=${aros_target_ar_ln}
1926         aros_target_ranlib_ln=${aros_target_ranlib_ln}
1927         aros_target_objdump_ln=${aros_target_objdump_ln}
1928         aros_target_objcopy_ln=${aros_target_objcopy_ln}
1929         aros_target_strip_ln=${aros_target_strip_ln}
1930     ]
1932 AC_CONFIG_COMMANDS([genshared_executable],
1933     [chmod a+x ${aros_scripts_dir}/genshared],
1934     [aros_scripts_dir=${aros_scripts_dir}]
1936 AC_CONFIG_COMMANDS([genmf_executable],
1937     [chmod a+x ${aros_tools_dir}/genmf.py],
1938     [aros_tools_dir=${aros_tools_dir}]
1941 AC_CONFIG_FILES(
1942     Makefile
1943     config/make.cfg
1944     ${aros_inc_dir}/config.h:config/config.h.in
1945     ${aros_geninc_dir}/config.h:config/config.h.in
1946     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
1947     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
1948     mmake.config
1949     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
1950     ${aros_targetcfg_dir}/specs:config/specs.in
1951     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
1952     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
1953     ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
1954     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
1955     tools/collect-aros/env.h
1958 AC_OUTPUT
1960 dnl This is in order to not define SHARED_CFLAGS sometimes
1961 dnl We don't always do aros_shared_ar, aros_shared_cflags
1963 #XXX compatability...
1964 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
1966 if test -n "$aros_shared_cflags" ; then
1967     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
1968     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg