1 dnl Copyright © 1997-2006, The AROS Development Team. All rights reserved.
4 dnl Desc: Autoconf source for configuration file
8 # method of getting shared/non-shared ld/ar tool for target.
11 # ------------------------------------------------------------------------
12 # Here starts the first section of the configure.in file.
13 # ------------------------------------------------------------------------
17 AC_CONFIG_AUX_DIR(scripts/autoconf)
19 # Check what host we are running on.
20 # If a target is not suggested, we use this one.
21 # Note that what we call a target, Autoconf calls a host.
24 # The AROS target is slightly different to the normal GNU style
25 # format. We don't have the middle part, and we reverse the order
26 # of the $(CPU) and $(OS) bits.
28 # Don't strip the version of the target yet, it might be
29 # useful on some systems.
31 AC_MSG_CHECKING([for AROS style target])
33 if test "$target" = "NONE" ; then
34 target=$host_os-$host_cpu
37 if test "$target" = "" ; then
38 target=$host_os-$host_cpu
44 AC_MSG_RESULT($target)
46 #don't know where else to put this...
49 # Parse the target field into something useful.
51 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
52 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
55 dnl --------------------------------------------------------------------
56 dnl Set the default Workbench resolution
57 dnl --------------------------------------------------------------------
58 aros_default_wbwidth=800
59 aros_default_wbheight=600
60 aros_default_wbdepth=4
62 dnl --------------------------------------------------------------------
63 dnl Host Configuration Section
64 dnl --------------------------------------------------------------------
66 dnl The idea here is to find out all the information we need about the
67 dnl host. This means things like tools for building directory structures,
68 dnl copying files around and the like.
70 # The first step is to find the host binaries.
71 # Check for a compiler.
76 # Check for a compatible awk
77 AC_CHECK_PROGS(AWK,[gawk nawk])
78 AROS_REQUIRED(gawk,$AWK)
79 AROS_PROG(MMAKE,mmake)
81 # Perform some default variable assignments. Note all of these will be
82 # Regenerated from the script, so there is no need to cache them.
85 AROS_TOOL_CCPATH(aros_host_ld,ld)
86 AROS_REQUIRED(ld,$aros_host_ld)
88 aros_host_cflags=$CFLAGS
89 aros_host_ldflags=$LDFLAGS
90 aros_host_debug="-g -O0"
91 aros_host_mkdep="\$(TOP)/scripts/mkdep"
92 aros_host_mkargs="--no-print-directory"
93 aros_host_incl="/usr/include"
94 aros_host_exe_suffix="$EXEEXT"
95 aros_host_lib_suffix=""
97 AC_CHECK_PROGS(aros_host_aclocal,[aclocal aclocal19])
98 AC_CHECK_PROGS(aros_host_autoconf,[autoconf autoconf259 autoconf253])
99 AC_CHECK_PROGS(aros_host_autoheader,[autoheader autoheader259 autoheader253])
100 AC_CHECK_PROGS(aros_host_automake,[automake automake19])
102 case "$aros_host_cc" in
104 aros_host_cc_pipe="-pipe"
114 dnl Despite the name, this is really a host configuration variable.
115 aros_target_cc_includes=""
116 aros_target_cc_options=""
118 # This is the main host configuration section. It is where the host
119 # can change the values of any variables it needs to change. We do
120 # not look at anything that compiles to the target yet, we'll get
125 aros_host_arch="linux"
126 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
132 aros_host_cpu="x86_64"
141 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
142 aros_host_cpu="$host_cpu"
148 aros_host_cc="$aros_host_cc $aros_host_cc_pipe -I/usr/local/include"
149 aros_host_make="gmake"
150 aros_host_arch="freebsd"
153 aros_host_ldflags="$aros_host_ldflags -L/usr/local/lib -liconv"
155 dnl Need to override this here, it's just too hard later.
156 dnl This shouldn't be here at all...
157 dnl aros_target_cc_includes="/usr/include"
159 dnl FreeBSD 5.x (and later) has changed the default object format.
160 dnl The double [[]] is necessary to get around m4's quoting rules.
163 aros_object_format="elf_i386"
167 aros_object_format="elf_i386_fbsd"
174 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
175 aros_host_arch="darwin"
184 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
185 aros_host_cpu="$host_cpu"
189 aros_host_ldflags="$aros_host_ldflags -liconv"
194 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
195 aros_host_make="gmake"
196 aros_host_arch="netbsd"
205 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
206 aros_host_cpu="$host_cpu"
209 aros_host_lib_suffix=".0.0"
213 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
214 aros_host_make="gmake"
215 aros_host_arch="openbsd"
221 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
222 aros_host_cpu="$host_cpu"
228 aros_host_arch="solaris"
229 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
232 aros_host_cpu="sparc"
235 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
236 aros_host_cpu="$host_cpu"
242 aros_host_arch="morphos"
247 aros_host_arch="amiga"
252 TOUCH="/gg/bin/touch"
261 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
262 aros_host_cpu="$host_cpu"
268 aros_host_arch="cygwin"
269 aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
275 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
276 aros_host_cpu="$host_cpu"
281 AC_MSG_ERROR([Unsupported host architecture $host])
285 AROS_PROG(aros_host_ar,[ar],[cr])
286 AROS_REQUIRED(ar,$aros_host_ar)
287 AROS_PROG(aros_host_ranlib,ranlib)
288 AROS_REQUIRED(ranlib,$aros_host_ranlib)
289 AROS_PROG(aros_host_strip,strip)
290 AROS_REQUIRED(strip,$aros_host_strip)
292 AROS_PROG(RM,[rm],[-rf])
293 AROS_REQUIRED(rm,$RM)
295 AROS_REQUIRED(cp,$CP)
297 AROS_REQUIRED(mv,$MV)
298 AROS_PROG(ECHO,[echo])
299 AROS_REQUIRED(echo,$ECHO)
300 AROS_PROG(MKDIR,[mkdir],[-p])
301 AROS_REQUIRED(mkdir,$MKDIR)
302 AROS_PROG(TOUCH,[touch])
303 AROS_REQUIRED(touch,$TOUCH)
304 AROS_PROG(SORT,[sort])
305 AROS_REQUIRED(sort,$SORT)
306 AROS_PROG(UNIQ,[uniq])
307 AROS_REQUIRED(uniq,$UNIQ)
308 AROS_PROG(NOP,[true])
309 AROS_REQUIRED(true,$NOP)
311 AROS_REQUIRED(cat,$CAT)
312 AROS_PROG(BISON,[bison])
313 AROS_REQUIRED(bison,$BISON)
314 AROS_PROG(FLEX,[flex])
315 AROS_REQUIRED(flex,$FLEX)
316 AROS_PROG(PNGTOPNM,[pngtopnm])
317 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
318 AROS_PROG(PPMTOILBM,[ppmtoilbm])
319 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
321 AROS_REQUIRED(sed,$SED)
322 AROS_PROG(CHMOD,[chmod])
323 AROS_REQUIRED(chmod,$CHMOD)
325 AM_PATH_PYTHON(2.2.1)
332 dnl ---------------------------------------------------------------------------
333 dnl Look for things about the host system, good for hosted targets.
334 dnl ---------------------------------------------------------------------------
336 # Check for some includes for the X11 HIDD and the kernel
337 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
338 sys/mmap.h sys/mman.h sysexits.h \
339 sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
342 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
359 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
361 # Look for some functions
362 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
363 clone kse_create rfork_thread thr_create sa_register \
364 getcontext makecontext setcontext sigaltstack swapcontext])
369 dnl --------------------------------------------------------------------
370 dnl Target Configuration Section
371 dnl --------------------------------------------------------------------
373 dnl The target configuration section is responsible for setting up all
374 dnl the paths for includes, and tools required to build AROS to some
375 dnl particular target.
377 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
378 aros_config_aflags="-Wall -x assembler-with-cpp -c"
379 aros_config_ldflags=""
381 aros_shared_default=yes
383 aros_shared_cflags="-fPIC"
384 aros_shared_aflags=""
385 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
386 aros_kernel_ldflags="-Wl,-rpath,./lib"
388 aros_target_ar_flags="cr"
389 aros_target_nm_flags="-C -ul"
390 aros_target_strip_flags="--strip-unneeded -R.comment"
394 aros_target_genmap="-Wl,-Map -Xlinker"
396 # Native flavour stuff
398 aros_serial_debug="0"
400 # Palm native flavour stuff
401 aros_palm_debug_hack="0"
404 aros_nesting_supervisor="0"
406 # Collect-aros stuff: "-ius" to ignore undefined symbols
407 ignore_undefined_symbols=""
409 #-----------------------------------------------------------------------------
411 AC_MSG_CHECKING([whether ${CC} accepts -fno-stack-protector])
412 save_cflags="$CFLAGS"
413 CFLAGS="$CFLAGS -fno-stack-protector"
414 AC_TRY_COMPILE(,, use_no_stack_protector="yes", use_no_stack_protector="no")
415 AC_MSG_RESULT($use_no_stack_protector)
416 if test "x-$use_no_stack_protector" = "x-yes" ; then
417 aros_target_cc_options="-fno-stack-protector"
419 CFLAGS="$save_cflags"
421 #-----------------------------------------------------------------------------
423 AC_MSG_CHECKING([for type of build])
424 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")
426 if test "$build_type" = "nightly"; then
427 build_type_string="NIGHTLY"
428 elif test "$build_type" = "snapshot"; then
429 build_type_string="SNAPSHOT"
430 elif test "$build_type" = "milestone"; then
431 build_type_string="MILESTONE"
432 elif test "$build_type" = "release"; then
433 build_type_string="RELEASE"
435 build_type_string="PERSONAL"
436 build_type="personal"
439 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
441 AC_MSG_RESULT($build_type)
443 #-----------------------------------------------------------------------------
444 all_debug_types="messages stack mungwall modules symbols"
446 AC_MSG_CHECKING([which debug types to enable])
447 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)]),
448 debug="$enableval",debug="")
450 if test "$debug" = "" -o "$debug" = "no"; then
452 elif test "$debug" = "yes"; then
456 if test "$debug" = "all" ; then
457 debug=$all_debug_types
458 for d in $all_debug_types; do
459 export aros_${d}_debug="1"
462 for d in $all_debug_types; do
463 export aros_${d}_debug="0"
467 if test "$debug" != "none"; then
468 debug=`echo $debug | sed s/,/\ /g`
471 for d2 in $all_debug_types; do
472 if test "$d2" = "$d"; then
477 if test "$found" = "0"; then
478 AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
480 export aros_${d}_debug="1"
484 AC_MSG_RESULT($debug)
486 if test "$aros_messages_debug" = "1"; then
487 aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
489 aros_messages_debug=""
491 if test "$aros_symbols_debug" = "1"; then
492 aros_symbols_debug="-g"
494 aros_symbols_debug=""
497 # These are the flags to pass when compiling debugged programs
498 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
500 aros_debug_ldflags="$aros_symbols_debug"
502 #-----------------------------------------------------------------------------
503 # Checking for distcc and ccache.
505 # Always apply the transforms in this particular order. Basically you should
506 # always run 'ccache distcc compiler' in that order for the best performance.
508 AC_MSG_CHECKING([whether to enable distcc])
509 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
510 if test "$distcc" != "" -a "$distcc" != "no"; then
511 # AC_CHECK_PROG will print out the result in this case
512 AC_PATH_PROG(DISTCC,[distcc],distcc,)
517 AC_MSG_CHECKING([whether to enable ccache])
518 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
519 if test "$ccache" != "" -a "$ccache" != "no"; then
520 # AC_CHECK_PROG will print out the result in this case
521 AC_CHECK_PROG(CCACHE,[ccache],ccache,)
526 #-----------------------------------------------------------------------------
527 AC_MSG_CHECKING([what optimization flags to use])
528 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
529 if test "$optimization" = "unknown"; then
530 dnl default is -O2 for normal builds, -O0 for debug builds
531 if test "$debug" != "none"; then
537 aros_config_cflags="$aros_config_cflags $optimization"
538 AC_MSG_RESULT($optimization)
540 #-----------------------------------------------------------------------------
541 AC_MSG_CHECKING([what target variant to enable])
542 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")
543 if test "$target_variant" = "none"; then
544 aros_target_variant=""
545 aros_target_suffix=""
547 aros_target_variant="$target_variant"
548 aros_target_suffix="-$target_variant"
550 AC_MSG_RESULT($enableval)
552 #-----------------------------------------------------------------------------
553 # This is the target configuration switch.
556 aros_target_arch="linux"
557 case "$target_cpu" in
559 aros_target_cpu="m68k"
560 aros_object_format="m68kelf"
561 aros_flavour="emulcompat"
562 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
563 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
564 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
565 gcc_target_cpu="mc68000"
568 aros_target_cpu="i386"
569 aros_object_format="elf_i386"
570 aros_flavour="emulation"
571 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
572 aros_default_wbdepth=8
573 gcc_target_cpu="i386"
576 aros_target_cpu="x86_64"
577 aros_object_format="elf_x86_64"
578 aros_flavour="emulation"
579 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64 -D__linux__"
580 aros_default_wbdepth=8
581 gcc_target_cpu="x86_64"
584 aros_target_cpu="ppc"
585 aros_object_format="elf32ppc"
586 aros_flavour="emulation"
587 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
588 aros_default_wbdepth=8
592 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
598 aros_target_arch="pc"
599 aros_shared_default="no"
600 case "$target_cpu" in
602 aros_target_cpu="i386"
604 dnl If somebody hasn't already set the target object
605 dnl format, then use this value. Mostly to support
606 dnl FreeBSD cross-compilation.
607 dnl TODO: Remove when we always use our compiler.
609 if test "$aros_object_format" = "" ; then
610 aros_object_format="elf_i386"
612 aros_flavour="standalone"
613 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
614 aros_kernel_ldflags=""
615 aros_default_wbwidth=640
616 aros_default_wbheight=480
617 gcc_target_cpu="i386"
620 aros_target_cpu="x86_64"
621 if test "$aros_object_format" = "" ; then
622 aros_object_format="elf_x86_64"
624 aros_flavour="standalone"
625 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dx86_64"
626 aros_config_cflags="$aros_config_cflags -fno-asynchronous-unwind-tables"
627 aros_kernel_ldflags=""
628 aros_default_wbwidth=640
629 aros_default_wbheight=480
630 gcc_target_cpu="x86_64"
633 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
639 aros_target_arch="prep"
640 aros_shared_default="no"
641 aros_target_cpu="ppc"
642 aros_object_format="elf32ppc"
643 aros_flavour="ppcnative"
644 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
645 aros_kernel_ldflags=""
646 aros_default_wbwidth=640
647 aros_default_wbheight=480
649 case "$target_cpu" in
651 aros_target_cc="ppc-linux-gcc -pipe"
652 aros_target_ld="ppc-linux-ld"
653 aros_target_as="ppc-linux-as"
654 aros_target_ar="ppc-linux-ar"
655 aros_target_ranlib="ppc-linux-ranlib"
656 aros_target_nm="ppc-linux-nm"
657 aros_target_strip="ppc-linux-strip"
658 aros_target_objcopy="ppc-linux-objcopy"
659 aros_target_objdump="ppc-linux-objdump"
660 aros_shared_ld="ppc-linux-ld"
661 aros_kernel_ld="ppc-linux-ld"
669 aros_target_arch="freebsd"
670 aros_target_cpu="i386"
671 aros_flavour="emulation"
672 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
673 gcc_target_cpu="i386"
675 aros_target_strip_flags="-x"
679 aros_target_arch="darwin"
680 aros_target_cpu="i386"
681 aros_flavour="emulation"
682 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
683 gcc_target_cpu="i386"
685 aros_target_strip_flags="-x"
689 aros_target_arch="netbsd"
690 case "$target_cpu" in
692 aros_target_cpu="m68k"
693 aros_object_format="m68kelf"
694 aros_flavour="emulcompat"
695 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
696 gcc_target_cpu="mc68000"
699 aros_target_cpu="i386"
700 aros_object_format="elf_i386"
701 aros_flavour="emulation"
702 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
703 aros_default_wbdepth=8
704 gcc_target_cpu="i386"
707 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
710 aros_target_genmap="-Wl,-M -Xlinker >"
711 aros_flavour="emulation"
712 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
716 aros_target_arch="openbsd"
717 case "$target_cpu" in
719 aros_target_cpu="i386"
720 aros_object_format="elf_i386"
721 aros_flavour="emulation"
722 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
723 gcc_target_cpu="i386"
726 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
729 aros_target_genmap="-Wl,-M -Xlinker >"
730 aros_target_nm_flags="-u"
731 aros_flavour="emulation"
735 aros_target_arch="solaris"
736 case "$target_cpu" in
738 aros_target_cpu="sparc"
739 aros_object_format="elf_sparc"
740 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
741 gcc_target_cpu="sparc"
744 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
747 aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
748 aros_flavour="emulation"
752 aros_target_arch="morphos"
753 aros_shared_default="no"
754 aros_target_cpu="ppc"
755 aros_object_format="elf_ppc"
756 aros_flavour="nativecompat"
757 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
762 aros_target_arch="amiga"
763 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
764 aros_shared_default="no"
766 aros_config_cflags="$aros_config_cflags -fomit-frame-pointer -fbuiltin -ffreestanding"
768 case "$target_cpu" in
770 aros_target_cpu="m68k"
771 aros_object_format="m68kelf"
772 aros_flavour="nativecompat"
773 gcc_target_cpu="mc68000"
777 aros_flavour="native"
781 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
787 aros_target_arch="cygwin"
788 aros_shared_default="no"
789 case "$target_cpu" in
791 aros_target_cpu="i386"
792 aros_object_format="elf_i386"
793 aros_flavour="emulation"
794 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__CYGWIN32__"
795 aros_shared_cflags=""
796 aros_default_wbdepth=8
797 gcc_target_cpu="i386"
800 AC_MSG_ERROR("Unknown CPU for CygWin -- $target_cpu")
805 aros_target_arch="pp"
806 aros_shared_default="no"
807 case "$target_cpu" in
809 aros_target_cpu="m68k"
810 aros_object_format="m68kelf"
811 aros_flavour="palmnative"
812 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
813 aros_kernel_ldflags=""
814 aros_default_wbwidth=160
815 aros_default_wbheight=160
816 aros_default_wbdepth=1
817 aros_target_cc="m68k-elf-gcc -pipe"
818 aros_target_ld="$(which m68k-elf-ld)"
819 aros_target_as="m68k-elf-gcc -pipe"
820 aros_shared_ld="m68k-elf-gcc"
821 aros_kernel_ld="m68k-elf-gcc"
822 aros_target_ar="m68k-elf-ar"
823 aros_target_ar_flags="cru"
824 aros_target_ranlib="m68k-elf-ranlib"
825 aros_target_nm="m68k-elf-nm"
826 aros_target_objcopy="m68k-elf-objcopy"
827 aros_target_objdump="m68k-elf-objdump"
828 aros_compiler_libs="-lgcc1"
829 aros_shared_default=no
830 aros_shared_cflags="-fpic"
831 aros_shared_aflags=""
832 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
833 aros_kernel_ldflags="-Wl,-rpath,./lib"
834 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000 -Wa,-mc68000"
836 aros_debug_ldflags="$aros_symbols_debug"
837 aros_mungwall_debug="0"
838 aros_modules_debug="0"
839 gcc_target_cpu="mc68000"
840 ignore_undefined_symbols="-ius"
843 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
849 aros_target_arch="mac"
850 aros_shared_default="no"
851 case "$target_cpu" in
853 aros_target_cpu="m68k"
854 aros_object_format="m68kelf"
855 aros_flavour="mac68knative"
856 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
857 aros_default_wbwidth=512
858 aros_default_wbheight=384
859 aros_default_wbdepth=8
860 aros_target_cc="m68k-elf-gcc -pipe"
861 aros_target_ld="$(which m68k-elf-ld)"
862 aros_target_as="m68k-elf-gcc -pipe"
863 aros_shared_ld="m68k-elf-gcc"
864 aros_kernel_ld="m68k-elf-gcc"
865 aros_target_ar="m68k-elf-ar"
866 aros_target_ar_flags="cru"
867 aros_target_ranlib="m68k-elf-ranlib"
868 aros_target_nm="m68k-elf-nm"
869 aros_target_objcopy="m68k-elf-objcopy"
870 aros_target_objdump="m68k-elf-objdump"
871 aros_compiler_libs="-lgcc1"
872 aros_shared_default=no
873 aros_shared_cflags="-fpic"
874 aros_shared_aflags=""
875 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
876 aros_kernel_ldflags="-Wl,-rpath,./lib"
877 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug $aros_messages_debug -mc68000"
879 aros_debug_ldflags="$aros_symbols_debug"
880 aros_mungwall_debug="0"
881 aros_modules_debug="0"
882 gcc_target_cpu="mc68000"
883 ignore_undefined_symbols="-ius"
886 AC_MSG_ERROR("Unknown CPU for Mac68k -- $target_cpu")
892 AC_MSG_ERROR([Unsupported target architecture $target])
897 # Find out if we are cross-compiling (ie. if we can't use the host compiler
900 if test "$aros_host_cpu" != "$aros_target_cpu" ; then
903 if test "$aros_host_arch" == "darwin" ; then
907 # Set prefix for target compiler etc. if we're cross-compiling
908 # (should possibly be earlier but needs to be after AC_PROG_CC)
909 if test "$cross_compiling" = "yes" ; then
910 target_tool_prefix=${target_cpu}-elf-
911 CC=${target_tool_prefix}gcc
914 # Find all the tools we need to compile. This could be cross-compiling
915 # though! If that is the case we use the GNU form of the target and
916 # simply add this to the front of the binary name. This is rather simple,
917 # but it should work under most circumstances.
919 # The default tools are to use the same as the host, but only if the
920 # host and target CPU are the same. With GCC this is normally enough.
924 aros_shared_ld="$aros_host_ld"
926 aros_target_mkdep="$aros_host_mkdep"
927 aros_target_incl_def="$aros_host_incl"
929 AC_PATH_PROG(aros_kernel_cc,$CC)
931 # The default tools executables to be linked to.
932 AROS_TOOL_TARGET(aros_target_as_ln,as)
933 AROS_REQUIRED(as,$aros_target_as_ln)
934 AROS_TOOL_TARGET(aros_kernel_ld,ld)
935 AROS_REQUIRED(ld,$aros_kernel_ld)
936 AROS_TOOL_TARGET(aros_target_ar_ln,ar)
937 AROS_REQUIRED(ar,$aros_target_ar_ln)
938 AROS_TOOL_TARGET(aros_target_nm_ln,nm)
939 AROS_REQUIRED(nm,$aros_target_nm_ln)
940 AROS_TOOL_TARGET(aros_target_objcopy_ln,objcopy)
941 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
942 AROS_TOOL_TARGET(aros_target_objdump_ln,objdump)
943 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
944 AROS_TOOL_TARGET(aros_target_ranlib_ln,ranlib)
945 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
946 AROS_TOOL_TARGET(aros_target_strip_ln,strip)
947 AROS_REQUIRED(strip,$aros_target_strip_ln)
949 if test "$GCC" = "yes"; then
950 aros_target_cc_path=`$aros_kernel_cc -print-search-dirs | grep "programs: =" | cut -c 12-`
953 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
954 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
955 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
956 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
957 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
958 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
959 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
961 # aros_cc_pre is a variable that is added to the front of the compiler name
962 # in the generated aros-gcc shell script. We need this to enable the cache
963 # to work across cleaned builds. Also, support DISTCC using the correct
964 # environment variable.
967 if test "x${DISTCC}" != "x" ; then
968 if test "x${CCACHE}" != "x" ; then
969 aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
971 aros_cc_pre="${DISTCC} "
974 if test "x${CCACHE}" != "x" ; then
975 aros_cc_pre="${CCACHE} "
979 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
981 AC_SUBST(aros_target_nostdinc_cflags,-nostdinc)
982 AC_SUBST(aros_target_nostartup_ldflags,-nostartfiles)
983 AC_SUBST(aros_target_nix_ldflags,-nix)
984 AC_SUBST(aros_target_detach_ldflags,-detach)
985 AC_SUBST(aros_target_nostdlib_ldflags,-nostdlib)
988 aros_target_cc="${prefix}-gcc"
989 aros_target_as="${prefix}-as"
990 aros_target_ld="${prefix}-ld"
991 aros_target_ar="${prefix}-ar $aros_target_ar_flags"
992 aros_target_objcopy=${prefix}-objcopy
993 aros_target_objdump=${prefix}-objdump
994 aros_target_ranlib="${prefix}-ranlib $aros_target_ranlib_flags"
995 aros_target_nm="${prefix}-nm $aros_target_nm_flags"
996 aros_kernel_nm="${prefix}-nm"
997 aros_target_strip=${prefix}-strip
1000 # Find the system include path. We can suggest that an alternative is
1001 # used if we don't get it correct. The default is to use /usr/include.
1002 # Which is set in the aros_target_incl_def variable.
1004 AC_ARG_ENABLE(includes,
1005 AC_HELP_STRING([--enable-includes=dir],[Alternative system include directory]),
1006 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
1008 dnl find out about the target cc's include path
1009 AC_MSG_CHECKING([for the target compiler's include path])
1010 if test "$aros_target_cc_includes" = "" ; then
1011 #try to guess where the directory is
1012 aros_target_cc_includes=`dirname \`${aros_kernel_cc} -print-libgcc-file-name\``/include
1013 if ! test -d $aros_target_cc_includes; then
1014 #the directory doesn't exist, we need to do some more work
1015 aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
1017 #these are the headers we're looling for
1018 headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
1019 stddef.h xmmintrin.h iso646.h stdarg.h unwind.h \
1023 for h in $headers; do
1024 #which other headers each of the above headers needs?
1025 deps=$(echo "#include <$h>" | \
1026 $aros_host_cc -E -M - 2>/dev/null | \
1027 sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
1029 #copy all the needed headers to a directory beneath gendir
1032 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
1033 sed -n "s,^.*/include\(/.*\),\1,p")
1034 ! test -d $dir && mkdir -p $dir
1035 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
1040 AC_MSG_RESULT($aros_target_cc_includes)
1042 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
1043 AC_MSG_CHECKING([for default resolution of WBScreen])
1044 AC_ARG_WITH(resolution,AC_HELP_STRING([--with-resolution=XRESxYRESxDEPTH],[Default resolution of the initial WorkbenchScreen]),resolution=$withval,resolution=none)
1045 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
1046 if test "$resolution" = "yes" ; then
1049 if test "$resolution" = "no" ; then
1052 if test "$resolution" != "none" ; then
1053 aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
1054 aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
1055 aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
1057 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
1058 aros_cv_default_wbwidth=$aros_default_wbwidth
1059 aros_cv_default_wbheight=$aros_default_wbheight
1060 aros_cv_default_wbdepth=$aros_default_wbdepth
1062 dnl See if the user wants the BOCHS hack for native flavour
1063 AC_MSG_CHECKING([if bochs hack is enabled])
1064 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")
1065 if test "$bochs_hack" = "yes" ; then
1068 AC_MSG_RESULT($bochs_hack)
1070 dnl See if the user wants the serial debug output for native flavour
1071 AC_MSG_CHECKING([if serial debug is enabled])
1072 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)
1073 if test "$serial_debug" = "yes" ; then
1076 if test "$serial_debug" = "no" ; then
1079 if test "$serial_debug" != "none" ; then
1080 aros_serial_debug=$serial_debug
1081 AC_MSG_RESULT(on port $serial_debug)
1086 dnl See if the user wants the palm debug output hack for palm native flavour
1087 AC_MSG_CHECKING([if palm debug hack is enabled])
1088 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")
1089 if test "$palm_debug_hack" = "yes" ; then
1090 aros_palm_debug_hack="1"
1092 AC_MSG_RESULT($palm_debug_hack)
1095 dnl See if the user wants nesting supervisor activated for unix flavour
1096 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1097 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")
1098 if test "$nesting_supervisor" = "yes" ; then
1099 aros_nesting_supervisor="1"
1101 AC_MSG_RESULT($nesting_supervisor)
1104 dnl things specifically required for hosted flavours
1105 if test "x-$aros_flavour" = "x-emulation" -o "x-$aros_flavour" = "x-emulcompat" ; then
1107 dnl some kind of dynamic library access system is required for hostlib.resource
1108 AC_CHECK_FUNC(dlopen, have_dl="yes", have_dl="no")
1109 if test "x-$have_dl" = "x-no" ; then
1110 AC_CHECK_LIB(dl, dlopen, [have_dl="yes"
1111 aros_host_ldflags="$aros_host_ldflags -ldl"],
1114 if test "x-$have_dl" = "x-no" ; then
1115 AC_MSG_ERROR([dlopen() dynamic linker functions not available])
1120 AC_ARG_ENABLE(x11_hidd, AC_HELP_STRING([--enable-x11-hidd],
1121 [build X11 hidd for hosted (default=auto)]),
1122 x11_hidd="$enableval",
1124 case "x-$x11_hidd" in
1125 x-yes|x-no|x-auto) ;;
1126 *) x11_hidd="auto" ;;
1130 if test "x-$x11_hidd" != "x-no" ; then
1135 if test "x-$no_x" = "x-yes" ; then
1138 if test "x-$x11_hidd" != "x-auto" ; then
1139 dnl and they explicitly asked for it, bail out
1140 AC_MSG_ERROR([X11 libs/headers not found, cannot build X11 hidd as requested])
1144 dnl found it, setup the metatarget
1145 x11_hidd_target=kernel-x11gfx
1148 dnl setup shared memory extensions
1149 AC_ARG_ENABLE(x11_shm, AC_HELP_STRING([--enable-x11-shm],
1150 [use X11 shared memory (default=auto)]),
1151 x11_hidd_shm="$enableval",
1152 x11_hidd_shm="auto")
1153 case "x-$x11_hidd_shm" in
1154 x-yes|x-no|x-auto) ;;
1155 *) x11_hidd_shm="auto" ;;
1161 if test "x-$x11_hidd_shm" != "x-no" ; then
1163 dnl system shm headers
1164 AC_CHECK_HEADERS(sys/ipc.h)
1165 AC_CHECK_HEADERS(sys/shm.h)
1168 if test "x-$ac_cv_header_sys_ipc_h" = "x-yes" -a "x-$ac_cv_header_sys_shm_h" = "x-yes" ; then
1170 dnl make sure X libs have shm functions
1172 save_cflags="$CFLAGS"
1174 CFLAGS="$x_includes"
1175 AC_CHECK_LIB(Xext, XShmQueryExtension, have_xshm=yes)
1177 CFLAGS="$save_cflags"
1181 dnl detection done, prepare output
1182 if test "x-$have_xshm" = "x-yes" ; then
1185 elif test "x-$x11_hidd_shm" = "x-yes" ; then
1186 dnl they explicitly asked for it, but we can't do it
1187 AC_MSG_ERROR([X11 has no support for shared memory, cannot enable it as requested])
1189 dnl otherwise just disable it
1194 dnl setup vidmode (fullscreen) extensions
1195 AC_ARG_ENABLE(x11_vidmode, AC_HELP_STRING([--enable-x11-vidmode],
1196 [use X11 vidmode extension (default=auto)]),
1197 x11_hidd_vidmode="$enableval",
1198 x11_hidd_vidmode="auto")
1199 case "x-$x11_hidd_vidmode" in
1200 x-yes|x-no|x-auto) ;;
1201 *) x11_hidd_vidmode="auto" ;;
1207 if test "x-$x11_hidd_vidmode" != "x-no" ; then
1209 dnl make sure X libs have vidmode functions
1211 save_cflags="$CFLAGS"
1213 CFLAGS="$x_includes"
1214 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, have_vidmode=yes)
1216 CFLAGS="$save_cflags"
1219 dnl detection done, prepare output
1220 if test "x-$have_vidmode" = "x-yes" ; then
1221 dnl we can do vidmode
1222 DO_VIDMODE_SUPPORT="1"
1223 elif test "x-$x11_hidd_vidmode" = "x-yes" ; then
1224 dnl they explicitly asked for it, but we can't do it
1225 AC_MSG_ERROR([X11 vidmode extension not available, cannot enable it as requested])
1227 dnl otherwise just disable it
1228 DO_VIDMODE_SUPPORT="0"
1236 AC_ARG_ENABLE(sdl_hidd, AC_HELP_STRING([--enable-sdl-hidd],
1237 [build SDL hidd for hosted (default=auto)]),
1238 sdl_hidd="$enableval",
1240 case "x-$sdl_hidd" in
1241 x-yes|x-no|x-auto) ;;
1242 *) sdl_hidd="auto" ;;
1246 if test "x-$sdl_hidd" != "x-no" ; then
1249 AM_PATH_SDL([1.2.10], have_sdl="yes", have_sdl="no")
1251 if test "x-$have_sdl" != "x-yes" ; then
1254 if test "x-$sdl_hidd" != "x-auto" ; then
1255 dnl and they explicitly asked for it, bail out
1256 AC_MSG_ERROR([SDL libs/headers not found, cannot build SDL hidd as requested])
1260 dnl found it, setup the metatarget
1261 sdl_hidd_target=kernel-hidd-sdl
1268 dnl See if the user wants dbus.library
1269 AC_MSG_CHECKING([if building of dbus.library is enabled])
1270 AC_ARG_ENABLE(dbus,AC_HELP_STRING([--enable-dbus],[Enable DBUS support via dbus.library (default=no)]),dbus="yes",dbus="no")
1271 if test "$dbus" = "yes" ; then
1273 DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1274 DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1275 KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1276 KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1280 AC_MSG_RESULT($dbus)
1283 dnl --------------------------------------------------------------------
1284 dnl Configuration Output Section
1285 dnl --------------------------------------------------------------------
1290 AC_SUBST(aros_flavour)
1291 AC_SUBST(aros_flavour_uc)
1295 AC_SUBST(aros_cc_pre)
1296 AC_SUBST(aros_host_strip)
1297 AC_SUBST(aros_host_arch)
1298 AC_SUBST(aros_host_cpu)
1299 AC_SUBST(aros_host_cc)
1300 AC_SUBST(aros_host_ar)
1301 AC_SUBST(aros_host_ranlib)
1302 AC_SUBST(aros_host_ld)
1303 AC_SUBST(aros_host_make)
1304 AC_SUBST(aros_host_cflags)
1305 AC_SUBST(aros_host_ldflags)
1306 AC_SUBST(aros_host_debug)
1307 AC_SUBST(aros_host_mkdep)
1308 AC_SUBST(aros_host_mkargs)
1309 AC_SUBST(aros_host_exe_suffix)
1310 AC_SUBST(aros_host_lib_suffix)
1311 AC_SUBST(aros_tools_dir)
1312 AC_SUBST(aros_host_aclocal)
1313 AC_SUBST(aros_host_autoconf)
1314 AC_SUBST(aros_host_autoheader)
1315 AC_SUBST(aros_host_automake)
1318 AC_SUBST(aros_target_arch)
1319 AC_SUBST(aros_target_cpu)
1320 AC_SUBST(aros_target_variant)
1321 AC_SUBST(aros_target_suffix)
1322 AC_SUBST(aros_target_incl)
1323 AC_SUBST(aros_target_ar)
1324 AC_SUBST(aros_target_ranlib)
1325 AC_SUBST(aros_kernel_nm)
1326 AC_SUBST(aros_target_cc)
1327 AC_SUBST(aros_kernel_cc)
1328 AC_SUBST(aros_target_as)
1329 AC_SUBST(aros_target_ld)
1330 AC_SUBST(aros_kernel_ld)
1331 AC_SUBST(aros_target_cc_includes)
1332 AC_SUBST(aros_target_cc_options)
1333 AC_SUBST(aros_target_cc_path)
1334 AC_SUBST(aros_target_objdump)
1335 AC_SUBST(aros_target_objcopy)
1336 AC_SUBST(aros_target_strip)
1337 AC_SUBST(aros_target_nm)
1338 AC_SUBST(aros_shared_default)
1339 AC_SUBST(aros_shared_ld)
1340 AC_SUBST(aros_object_format)
1341 AC_SUBST(aros_compiler_libs)
1343 AC_SUBST(aros_config_cflags)
1344 AC_SUBST(aros_config_aflags)
1345 AC_SUBST(aros_config_ldflags)
1347 AC_SUBST(aros_shared_cflags)
1348 AC_SUBST(aros_shared_aflags)
1349 AC_SUBST(aros_shared_ldflags)
1350 AC_SUBST(aros_kernel_ldflags)
1351 AC_SUBST(aros_debug_cflags)
1352 AC_SUBST(aros_debug_aflags)
1353 AC_SUBST(aros_debug_ldflags)
1354 AC_SUBST(aros_target_genmap)
1355 AC_SUBST(aros_target_strip_flags)
1358 AC_SUBST(aros_gui_libdir)
1359 AC_SUBST(aros_gui_ldflags)
1360 AC_SUBST(aros_gui_libflags)
1361 AC_SUBST(aros_gui_incdir)
1362 AC_SUBST(aros_gui_ccflags)
1364 AC_SUBST(x11_hidd_target)
1365 AC_SUBST(sdl_hidd_target)
1367 AC_SUBST(aros_default_wbwidth)
1368 AC_SUBST(aros_default_wbheight)
1369 AC_SUBST(aros_default_wbdepth)
1370 AC_SUBST(DO_XSHM_SUPPORT)
1371 AC_SUBST(DO_VIDMODE_SUPPORT)
1373 # Native version related
1374 AC_SUBST(aros_bochs_hack)
1375 AC_SUBST(aros_serial_debug)
1377 # Palm native version related
1378 AC_SUBST(aros_palm_debug_hack)
1380 # Unix/Hosted version related
1381 AC_SUBST(aros_nesting_supervisor)
1384 AC_SUBST(ENABLE_DBUS)
1385 AC_SUBST(DBUS_CFLAGS)
1386 AC_SUBST(DBUS_LIBFLAGS)
1387 AC_SUBST(KERNEL_DBUS_KOBJ)
1388 AC_SUBST(KERNEL_DBUS_INCLUDES)
1391 AC_SUBST(aros_debug)
1392 AC_SUBST(aros_mungwall_debug)
1393 AC_SUBST(aros_stack_debug)
1394 AC_SUBST(aros_modules_debug)
1396 # Collect-aros stuff: "-ius" to ignore undefined symbols
1397 AC_SUBST(ignore_undefined_symbols)
1399 # C compiler related
1400 AC_SUBST(gcc_target_cpu)
1402 dnl Prepare for output, make up all the generated patches
1403 case "$aros_flavour" in
1404 emulation) aros_flavour_uc="AROS_FLAVOUR_EMULATION"
1405 aros_flavour="emulation" ;;
1406 emulcompat) aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
1407 aros_flavour="emulation" ;;
1408 standalone) aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
1409 aros_flavour="standalone";;
1410 native) aros_flavour_uc="AROS_FLAVOUR_NATIVE"
1411 aros_flavour="native" ;;
1412 nativecompat) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1413 aros_flavour="native" ;;
1414 linklib) aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
1415 aros_flavour="linklib" ;;
1416 palmnative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1417 aros_flavour="palmnative" ;;
1418 mac68knative) aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1419 aros_flavour="mac68knative" ;;
1420 ppcnative) aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1421 aros_flavour="ppcnative" ;;
1424 dnl XXX I guess this is some legacy stuff, since aros_gui_basedir isn't
1425 dnl defined anywhere
1427 dnl if test -z "$aros_gui_basedir" ; then
1429 dnl aros_gui_incdir="$x_includes"
1430 dnl if test -z "$x_includes" ; then
1431 dnl aros_gui_ccflags=""
1433 dnl aros_gui_ccflags="-I $x_includes"
1438 dnl if test -n "$aros_gui_basedir" ; then
1439 dnl aros_gui_libdir="${aros_gui_basedir}/lib"
1440 dnl aros_gui_incdir="${aros_gui_basedir}/include"
1443 dnl if test -n "$aros_gui_libdir" ; then
1444 dnl aros_gui_ldflags="-L ${aros_gui_libdir}"
1447 dnl if test -n "$aros_gui_incdir" ; then
1448 dnl aros_gui_ccflags="-I ${aros_gui_incdir}"
1450 dnl aros_gui_incdir="${aros_sysincludes}"
1451 dnl aros_gui_ccflags=""
1455 if test ! -d ${aros_inc_dir} ; then
1456 ${MKDIR} ${aros_inc_dir}
1458 if test ! -d ${aros_geninc_dir} ; then
1459 ${MKDIR} ${aros_geninc_dir}
1461 if test ! -d ${aros_hostcfg_dir} ; then
1462 ${MKDIR} ${aros_hostcfg_dir}
1464 if test ! -d ${aros_targetcfg_dir} ; then
1465 ${MKDIR} ${aros_targetcfg_dir}
1467 if test ! -d ${aros_tools_dir} ; then
1468 ${MKDIR} ${aros_tools_dir}
1470 if test ! -d ${aros_scripts_dir} ; then
1471 ${MKDIR} ${aros_scripts_dir}
1474 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
1476 AC_CONFIG_COMMANDS([compiler_executable],
1478 prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
1480 prefix="${prefix}/${aros_target_cpu}-aros"
1481 prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
1485 chmod a+x ${prefix2}-gcc ${prefix2}-ld
1487 ln -sf ${prefix2}-gcc ${prefix}-gcc
1488 ln -sf ${prefix2}-ld ${prefix}-ld
1490 ln -sf $aros_target_as_ln ${prefix}-as
1491 ln -sf $aros_target_nm_ln ${prefix}-nm
1492 ln -sf $aros_target_ar_ln ${prefix}-ar
1493 ln -sf $aros_target_ranlib_ln ${prefix}-ranlib
1494 ln -sf $aros_target_objcopy_ln ${prefix}-objcopy
1495 ln -sf $aros_target_objdump_ln ${prefix}-objdump
1496 ln -sf $aros_target_strip_ln ${prefix}-strip
1498 ln -sf $aros_target_as_ln ${prefix2}-as
1499 ln -sf $aros_target_nm_ln ${prefix2}-nm
1500 ln -sf $aros_target_ar_ln ${prefix2}-ar
1501 ln -sf $aros_target_ranlib_ln ${prefix2}-ranlib
1502 ln -sf $aros_target_objcopy_ln ${prefix2}-objcopy
1503 ln -sf $aros_target_objdump_ln ${prefix2}-objdump
1504 ln -sf $aros_target_strip_ln ${prefix2}-strip
1507 aros_tools_dir=${aros_tools_dir}
1508 aros_target_cpu=${aros_target_cpu}
1509 aros_target_arch=${aros_target_arch}
1510 aros_target_suffix=${aros_target_suffix}
1511 aros_target_nm_ln=${aros_target_nm_ln}
1512 aros_target_as_ln=${aros_target_as_ln}
1513 aros_target_ar_ln=${aros_target_ar_ln}
1514 aros_target_ranlib_ln=${aros_target_ranlib_ln}
1515 aros_target_objdump_ln=${aros_target_objdump_ln}
1516 aros_target_objcopy_ln=${aros_target_objcopy_ln}
1517 aros_target_strip_ln=${aros_target_strip_ln}
1520 AC_CONFIG_COMMANDS([genshared_executable],
1521 [chmod a+x ${aros_scripts_dir}/genshared],
1522 [aros_scripts_dir=${aros_scripts_dir}]
1524 AC_CONFIG_COMMANDS([genmf_executable],
1525 [chmod a+x ${aros_tools_dir}/genmf.py],
1526 [aros_tools_dir=${aros_tools_dir}]
1528 AC_CONFIG_COMMANDS([adflib_myaros.conf_executable],
1529 [chmod a+x tools/adflib/myconf.aros]
1535 ${aros_inc_dir}/config.h:config/config.h.in
1536 ${aros_geninc_dir}/config.h:config/config.h.in
1537 ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
1538 ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
1540 ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
1541 ${aros_targetcfg_dir}/specs:config/specs.in
1542 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
1543 ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
1544 ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
1545 ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
1546 tools/adflib/myconf.aros
1547 tools/collect-aros/env.h
1552 dnl This is in order to not define SHARED_CFLAGS sometimes
1553 dnl We don't always do aros_shared_ar, aros_shared_cflags
1555 #XXX compatability...
1556 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
1558 if test -n "$aros_shared_cflags" ; then
1559 echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
1560 echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg