Converted aroscheckbox gadget to %build_module and genmodule.
[AROS.git] / configure.in
blob1ee5650794cb133fe1e2425c371e83559df1173a
1 dnl Copyright (C) 1997-2003 AROS - The Amiga Research OS
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.
9 # ar, ranlib, strip, nm for target
12 # ------------------------------------------------------------------------
13 # Here starts the first section of the configure.in file.
14 # ------------------------------------------------------------------------
16 AC_INIT(mmakefile)
17 AC_PREREQ(2.53)
18 AC_CONFIG_AUX_DIR(scripts/autoconf)
20 # Check what host we are running on.
21 # If a target is not suggested, we use this one.
22 AC_CANONICAL_HOST
24 # The AROS target is slightly different to the normal GNU style
25 # format. We don't have the middle part, and we reverse the order
26 # of the $(CPU) and $(OS) bits.
28 # Don't strip the version of the target yet, it might be
29 # useful on some systems.
31 AC_MSG_CHECKING([for AROS style target])
33 if test "$target" = "NONE" ; then
34     target=$host_os-$host_cpu
35     cross_compile=no
36 else
37     if test "$target" = "" ; then
38         target=$host_os-$host_cpu
39         cross_compile=no
40     else
41         cross_compile=yes
42     fi
44 AC_MSG_RESULT($target)
46 #don't know where else to put this...
47 TOPDIR=$PWD
49 # Parse the target field into something useful.
50 changequote(<<,>>)
51 target_os=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\1/'`
52 target_cpu=`echo $target | sed 's/^\([^-]*\)-\(.*\)$/\2/'`
53 changequote([,])
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 --------------------------------------------------------------------
65 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.
72 AC_PROG_CC
73 AC_PROG_CC_STDC
74 AC_PROG_CPP
76 # We don't yet support cross-compiling, but we may later on.
77 AC_CYGWIN
78 AC_EXEEXT
79 AC_OBJEXT
81 # Check for gawk and mmake.
82 AC_CHECK_PROGS(AWK,[gawk nawk])
83 AC_SUBST(AWK)
84 AROS_REQUIRED(gawk,$AWK)
85 AROS_PROG(MMAKE,mmake)
87 # Perform some default variable assignments. Note all of these will be
88 # Regenerated from the script, so there is no need to cache them.
90 aros_host_cc="$CC"
91 AROS_TOOL_CCPATH(aros_host_ld,ld)
92 AROS_REQUIRED(ld,$aros_host_ld)
93 aros_host_make="make"
94 aros_host_cflags=$CFLAGS
95 aros_host_ldflags=$LDFLAGS
96 aros_host_debug="-g -O0"
97 aros_host_mkdep="\$(TOP)/scripts/mkdep"
98 aros_host_mkargs="--no-print-directory"
99 aros_host_incl="/usr/include"
100 aros_host_exe_suffix="$EXEEXT"
101 aros_host_lib_suffix=""
103 case "$CC" in
104     *gcc*)
105         aros_host_cc_pipe="-pipe"
106         ;;
107     icc)
108         aros_host_cc_pipe=""
109         ;;
110     *)
111         aros_host_cc_pipe=""
112         ;;
113 esac
115 dnl Despite the name, this is really a host configuration variable.
116 aros_target_cc_includes=""
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
121 # to that later.
123 case "$host_os" in
124     linux*)
125         aros_host_arch="linux"
126         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
127         case "$host_cpu" in
128             *i?86*)
129                 aros_host_cpu="i386"
130                 ;;
131             *m68k*)
132                 aros_host_cpu="m68k"
133                 ;;
134             *powerpc*)
135                 aros_host_cpu="ppc"
136                 ;;
137             *)
138                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
139                 aros_host_cpu="$host_cpu"
140                 ;;
141         esac
142         ;;
144     freebsd*)
145         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
146         aros_host_make="gmake"
147         aros_host_arch="freebsd"
148         aros_host_cpu="i386"
150         dnl Need to override this here, it's just too hard later.
151         dnl This shouldn't be here at all...
152         dnl aros_target_cc_includes="/usr/include"
154         dnl FreeBSD 5.x has changed the default object format.
155         dnl The double [[]] is necessary to get around m4's quoting rules.
156         case $host_os in
157             freebsd[[56]]*)
158                 aros_object_format="elf_i386_fbsd"
159                 ;;
161             *)
162                 aros_object_format="elf_i386"
163         esac
165         ;;
167     netbsd*)
168         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
169         aros_host_make="gmake"
170         aros_host_arch="netbsd"
171         case "$host_cpu" in
172             *i?86*)
173                 aros_host_cpu="i386"
174                 ;;
175             *m68k*)
176                 aros_host_cpu="m68k"
177                 ;;
178             *)
179                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
180                 aros_host_cpu="$host_cpu"
181                 ;;
182         esac    
183         aros_host_lib_suffix=".0.0"
184         ;;
186     openbsd*)
187         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
188         aros_host_make="gmake"
189         aros_host_arch="openbsd"
190         case "$host_cpu" in
191             *i?86*)
192                 aros_host_cpu="i386"
193                 ;;
194             *)
195                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
196                 aros_host_cpu="$host_cpu"
197                 ;;
198         esac
199         ;;
200         
201     solaris*)
202         aros_host_arch="solaris"
203         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
204         case "$host_cpu" in
205             *sparc*)
206                 aros_host_cpu="sparc"
207                 ;;
208             *)
209                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
210                 aros_host_cpu="$host_cpu"
211                 ;;
212         esac
213         ;;
215     morphos*)
216         aros_host_cc="$aros_host_cc"
217         aros_host_arch="morphos"
218         aros_host_cpu="ppc"
219         ;;
221     amiga*)
222         aros_host_arch="amiga"
223         SORT="/gg/bin/sort"
224         TEST="/gg/bin/test"
225         UNIQ="/gg/bin/uniq"
226         FOR="for"
227         TOUCH="/gg/bin/touch"
228         case "$host_cpu" in
229             *m68k*)
230                 aros_host_cpu="m68k"
231                 ;;
232             *powerpc*)
233                 aros_host_cpu="ppc"
234                 ;;
235             *)
236                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
237                 aros_host_cpu="$host_cpu"
238                 ;;
239         esac
240         ;;
242     cygwin*)
243         aros_host_arch="cygwin"
244         aros_host_cc="$aros_host_cc $aros_host_cc_pipe"
245         case "$host_cpu" in
246             *i?86*)
247                 aros_host_cpu="i386"
248                 ;;
249             *)
250                 AC_MSG_WARN("Unknown CPU for host -- $host_cpu")
251                 aros_host_cpu="$host_cpu"
252                 ;;
253         esac
254         ;;
255     *)
256         AC_MSG_ERROR([Unsupported host architecture $host])
257         ;;
258 esac
260 AROS_PROG(HOST_AR,[ar],[cr])
261 AROS_REQUIRED(ar,$HOST_AR)
262 AROS_PROG(HOST_RANLIB,ranlib)
264 AROS_PROG(RM,[rm],[-rf])
265 AROS_REQUIRED(rm,$RM)
266 AROS_PROG(CP,[cp])
267 AROS_REQUIRED(cp,$CP)
268 AROS_PROG(MV,[mv])
269 AROS_REQUIRED(mv,$MV)
270 AROS_PROG(ECHO,[echo])
271 AROS_REQUIRED(echo,$ECHO)
272 AROS_PROG(MKDIR,[mkdir],[-p])
273 AROS_REQUIRED(mkdir,$MKDIR)
274 AROS_PROG(TOUCH,[touch])
275 AROS_REQUIRED(touch,$TOUCH)
276 AROS_PROG(SORT,[sort])
277 AROS_REQUIRED(sort,$SORT)
278 AROS_PROG(UNIQ,[uniq])
279 AROS_REQUIRED(uniq,$UNIQ)
280 AROS_PROG(NOP,[true])
281 AROS_REQUIRED(true,$NOP)
282 AROS_PROG(CAT,[cat])
283 AROS_REQUIRED(cat,$CAT)
284 AROS_PROG(BISON,[bison])
285 AROS_REQUIRED(bison,$BISON)
286 AROS_PROG(PNGTOPNM,[pngtopnm])
287 AROS_REQUIRED(pngtopnm,$PNGTOPNM)
288 AROS_PROG(PPMTOILBM,[ppmtoilbm])
289 AROS_REQUIRED(ppmtoilbm,$PPMTOILBM)
290 AROS_PROG(STRIP,[strip])
291 AROS_REQUIRED(strip,$STRIP)
292 AROS_PROG(SED,[sed])
293 AROS_REQUIRED(sed,$SED)
294 AROS_PROG(CHMOD,[chmod])
295 AROS_REQUIRED(chmod,$CHMOD)
297 AM_PATH_PYTHON(2.2.1)
299 FOR=for
300 IF=if
301 TEST=test
302 AC_SUBST(FOR)
303 AC_SUBST(IF)
304 AC_SUBST(TEST)
306 dnl ---------------------------------------------------------------------------
307 dnl Look for things about the host system, good for hosted targets.
308 dnl ---------------------------------------------------------------------------
310 # Check for some includes for the X11 HIDD and the kernel
311 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h \
312     sys/mmap.h sys/mman.h sysexits.h \
313     sys/statfs.h sys/statvfs.h sys/vfs.h sys/param.h \
316 AC_CHECK_HEADERS([sys/mount.h],,,[#include <sys/param.h>])
318 AC_HEADER_DIRENT
319 AC_HEADER_STAT
320 AC_HEADER_STDC
321 AC_HEADER_SYS_WAIT
322 AC_HEADER_TIME
323 AC_STRUCT_ST_BLKSIZE
324 AC_STRUCT_ST_BLOCKS
325 AC_STRUCT_ST_RDEV
326 AC_STRUCT_TM
327 AC_STRUCT_TIMEZONE
328 AC_TYPE_OFF_T
329 AC_TYPE_PID_T
330 AC_TYPE_SIZE_T
331 AC_TYPE_UID_T
333 AC_CHECK_MEMBERS(struct tm.tm_gmtoff)
335 # Look for some functions
336 AC_CHECK_FUNCS([getpagesize kqueue statfs statvfs \
337     clone kse_create rfork_thread thr_create sa_register \
338     getcontext makecontext setcontext sigaltstack swapcontext])
340 AC_FUNC_MMAP
342 # Find X
343 AC_PATH_X
346 dnl --------------------------------------------------------------------
347 dnl Target Configuration Section
348 dnl --------------------------------------------------------------------
350 dnl The target configuration section is responsible for setting up all
351 dnl the paths for includes, and tools required to build AROS to some
352 dnl particular target.
354 # Find all the tools we need to compile. This could be cross-compiling
355 # though! If that is the case we use the GNU form of the target and
356 # simply add this to the front of the binary name. This is rather simple,
357 # but it should work under most circumstances.
359 # The default tools are to use the same as the host, but only if the
360 # host and target CPU are the same. With GCC this is normally enough.
363 aros_cc_pre=""
364 aros_target_cc="$aros_host_cc"
365 aros_target_as="$aros_host_cc"
366 aros_shared_ld="$aros_host_ld"
367 aros_kernel_ld="$aros_host_ld"
368 aros_target_ld="$aros_host_ld"
370 aros_target_mkdep="$aros_host_mkdep"
371 aros_target_incl_def="$aros_host_incl"
373 # The default tools executables to be linked at.
374 AROS_TOOL_CCPATH(aros_target_ar_ln,ar)
375 AROS_REQUIRED(ar,$aros_target_ar_ln)
376 AROS_TOOL_CCPATH(aros_target_nm_ln,nm)
377 AROS_REQUIRED(nm,$aros_target_nm_ln)
378 AROS_TOOL_CCPATH(aros_target_objcopy_ln,objcopy)
379 AROS_REQUIRED(objcopy,$aros_target_objcopy_ln)
380 AROS_TOOL_CCPATH(aros_target_objdump_ln,objdump)
381 AROS_REQUIRED(objdump,$aros_target_objdump_ln)
382 AROS_TOOL_CCPATH(aros_target_ranlib_ln,ranlib)
383 AROS_REQUIRED(ranlib,$aros_target_ranlib_ln)
384 AROS_TOOL_CCPATH(aros_target_strip_ln,strip)
385 AROS_REQUIRED(strip,$aros_target_strip_ln)
387 if test "$GCC" = "yes"; then
388     aros_target_cc_path=`$CC -print-search-dirs | grep "programs: =" | cut -c 12-`
391 # It is necessary to clear the include and link paths for target
392 # commands. This should help clear up problems when cross compiling.
393 aros_config_cflags="-Wall -Werror-implicit-function-declaration"
394 aros_config_aflags="-Wall -x assembler-with-cpp"
395 aros_config_ldflags=""
397 aros_shared_default=yes
399 aros_shared_cflags="-fPIC"
400 aros_shared_aflags=""
401 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
402 aros_kernel_ldflags="-Wl,-rpath,./lib"
404 aros_compiler_libs=
406 aros_target_genmap="-Wl,-Map -Xlinker"
408 # Native flavour stuff
409 aros_bochs_hack="0"
410 aros_serial_debug="0"
412 # Palm native flavour stuff
413 aros_palm_debug_hack="0"
415 # Unix flavour stuff
416 aros_nesting_supervisor="0"
418 # Collect-aros stuff: "-ius" to ignore undefined symbols
419 ignore_undefined_symbols=""
421 # X11 Xshm
422 DO_XSHM_SUPPORT="1"
425 #-----------------------------------------------------------------------------
427 AC_MSG_CHECKING([for type of build])
428 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")
430 if test "$build_type" = "nightly"; then
431     build_type_string="NIGHTLY"
432 elif test "$build_type" = "snapshot"; then
433     build_type_string="SNAPSHOT"
434 elif test "$build_type" = "milestone"; then
435     build_type_string="MILESTONE"
436 elif test "$build_type" = "release"; then
437     build_type_string="RELEASE"
438 else
439     build_type_string="PERSONAL"
440     build_type="personal"
443 aros_config_cflags="$aros_config_cflags -DAROS_BUILD_TYPE=AROS_BUILD_TYPE_$build_type_string"
445 AC_MSG_RESULT($build_type)
447 #-----------------------------------------------------------------------------
448 all_debug_types="messages stack mungwall modules symbols"
450 AC_MSG_CHECKING([which debug types to enable])
451 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)]),
452  debug="$enableval",debug="")
454 if test "$debug" = "" -o "$debug" = "no"; then
455     debug="none"
456 elif test "$debug" = "yes"; then
457     debug="all"
460 if test "$debug" = "all" ; then
461     debug=$all_debug_types
462     for d in $all_debug_types; do
463         export aros_${d}_debug="1"
464     done
465 else
466     for d in $all_debug_types; do
467         export aros_${d}_debug="0"
468     done
471 if test "$debug" != "none"; then
472     debug=`echo $debug | sed s/,/\ /g`
473     for d in $debug; do
474         found="0"
475         for d2 in $all_debug_types; do
476             if test "$d2" = "$d"; then
477                 found="1"
478                 break
479             fi
480         done
481         if test "$found" = "0"; then
482             AC_MSG_ERROR([unrecognized debug type "$d". Available types are: all none $all_debug_types])
483         fi
484         export aros_${d}_debug="1"
485     done
486     aros_debug="yes"
488 AC_MSG_RESULT($debug)
490 if test "$aros_messages_debug" = "1"; then
491     aros_messages_debug="-DADEBUG=1 -DMDEBUG=1"
492 else
493     aros_messages_debug=""
495 if test "$aros_symbols_debug" = "1"; then
496     aros_symbols_debug="-g"
497 else
498     aros_symbols_debug=""
501 # These are the flags to pass when compiling debugged programs
502 aros_debug_cflags="$aros_symbols_debug $aros_messages_debug"
503 aros_debug_aflags=""
504 aros_debug_ldflags="$aros_symbols_debug"
506 #-----------------------------------------------------------------------------
507 #   Checking for distcc and ccache.
509 #   Always apply the transforms in this particular order. Basically you should
510 #   always run 'ccache distcc compiler' in that order for the best performance.
512 AC_MSG_CHECKING([whether to enable distcc])
513 AC_ARG_ENABLE(distcc,AC_HELP_STRING([--enable-distcc],[Use distcc as a front end to the compiler (default=no).]),distcc="$enableval",distcc="no")
514 if test "$distcc" != "" -a "$distcc" != "no"; then
515     # AC_CHECK_PROG will print out the result in this case
516     AC_PATH_PROG(DISTCC,[distcc],distcc,no)
517 else
518     AC_MSG_RESULT(no)
521 AC_MSG_CHECKING([whether to enable ccache])
522 AC_ARG_ENABLE(ccache,AC_HELP_STRING([--enable-ccache],[Use ccache as a front end to the compiler (default=no).]),ccache="$enableval",ccache="no")
523 if test "$ccache" != "" -a "$ccache" != "no"; then
524     # AC_CHECK_PROG will print out the result in this case
525     AC_CHECK_PROG(CCACHE,[ccache],ccache,no)
526 else
527     AC_MSG_RESULT(no)
530 #-----------------------------------------------------------------------------
531 AC_MSG_CHECKING([what optimization flags to use])
532 AC_ARG_WITH(optimization,AC_HELP_STRING([--with-optimization=FLAGS],[Use optimization flags FLAGS (default=-O2).]),optimization="$withval",optimization="unknown")
533 if test "$optimization" = "unknown"; then
534     dnl default is -O2 for normal builds, -O0 for debug builds
535     if test "$debug" != "none"; then
536         optimization="-O0"
537     else
538         optimization="-O2"
539     fi
541 aros_config_cflags="$aros_config_cflags $optimization"
542 AC_MSG_RESULT($optimization)
544 #-----------------------------------------------------------------------------
545 AC_MSG_CHECKING([what target variant to enable])
546 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")
547 if test "$target_variant" = "none"; then
548     aros_target_variant=""
549     aros_target_suffix=""
550 else
551     aros_target_variant="$target_variant"
552     aros_target_suffix="-$target_variant"
554 AC_MSG_RESULT($enableval)
556 #-----------------------------------------------------------------------------
557 # This is the target configuration switch.
558 case "$target_os" in
559     linux*)
560         aros_target_arch="linux"
561         case "$target_cpu" in
562             *m68k*)
563                 aros_target_cpu="m68k"
564                 aros_object_format="m68kelf"
565                 aros_flavour="emulcompat"
566                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__linux__"
567                 aros_shared_ldflags="-Wl,-T,\$(TOP)/config/linux/m68k/script.so"
568                 aros_kernel_ldflags="-Wl,-rpath,./lib,-T,\$(TOP)/config/linux/m68k/script.normal"
569                 gcc_target_cpu="mc68000"
570                 ;;
571             *i?86*)
572                 aros_target_cpu="i386"
573                 aros_object_format="elf_i386"
574                 aros_flavour="emulation"
575                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__linux__"
576                 aros_default_wbdepth=8
577                 gcc_target_cpu="i386"
578                 ;;
579             *powerpc*)
580                 aros_target_cpu="ppc"
581                 aros_object_format="elf32ppc"
582                 aros_flavour="emulation"
583                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc -D__linux__"
584                 aros_default_wbdepth=8
585                 aros_compiler_libs="-lgcc"
586                 gcc_target_cpu="ppc"
587                 ;;
588             *)
589                 AC_MSG_ERROR("Unknown CPU for Linux -- $target_cpu")
590                 ;;
591         esac
592     ;;
594     pc)
595         aros_target_arch="pc"
596         aros_shared_default="no"
597         case "$target_cpu" in
598             *i?86*)
599                 aros_target_cpu="i386"
601                 dnl If somebody hasn't already set the target object
602                 dnl format, then use this value. Mostly to support
603                 dnl FreeBSD cross-compilation.
604                 dnl TODO: Remove when we always use our compiler.
606                 if test "$aros_object_format" = "" ; then
607                     aros_object_format="elf_i386"
608                 fi
609                 aros_flavour="standalone"
610                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
611                 aros_kernel_ldflags=""
612                 aros_default_wbwidth=640
613                 aros_default_wbheight=480
614                 gcc_target_cpu="i386"
615                 ;;
616             *)
617                 AC_MSG_ERROR("Unknown native CPU -- $target_cpu")
618                 ;;
619         esac
620         ;;
622     prep)
623         aros_target_arch="prep"
624         aros_shared_default="no"
625         aros_target_cpu="ppc"
626         aros_object_format="elf32ppc"
627         aros_flavour="ppcnative"
628         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
629         aros_kernel_ldflags=""
630         aros_default_wbwidth=640
631         aros_default_wbheight=480
632         gcc_target_cpu="ppc"
633         case "$target_cpu" in
634             *cross*)
635                 aros_target_cc="ppc-linux-gcc -pipe"
636                 aros_target_ld="ppc-linux-ld"
637                 aros_target_as="ppc-linux-as"
638                 aros_target_ar="ppc-linux-ar"
639                 aros_target_ranlib="ppc-linux-ranlib"
640                 aros_target_nm="ppc-linux-nm"
641                 aros_target_strip="ppc-linux-strip"
642                 aros_target_objcopy="ppc-linux-objcopy"
643                 aros_target_objdump="ppc-linux-objdump"
644                 aros_shared_ld="ppc-linux-ld"
645                 aros_kernel_ld="ppc-linux-ld"
646                 ;;
647             *)
648                 ;;
649         esac
650         ;;
652     freebsd*)
653         aros_target_arch="freebsd"
654         aros_target_cpu="i386"
655         aros_flavour="emulation"
656         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
657         gcc_target_cpu="i386"
659         strip_args="-x"
660         ;;
662     netbsd*)
663         aros_target_arch="netbsd"
664         case "$target_cpu" in
665             *m68k*)
666                 aros_target_cpu="m68k"
667                 aros_object_format="m68kelf"
668                 aros_flavour="emulcompat"
669                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D__mc68000 -D__NetBSD__"
670                 gcc_target_cpu="mc68000"
671                 ;;
672             *i?86*)
673                 aros_target_cpu="i386"
674                 aros_object_format="elf_i386"
675                 aros_flavour="emulation"
676                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__NetBSD__"
677                 aros_default_wbdepth=8
678                 gcc_target_cpu="i386"
679                 ;;
680             *)
681                 AC_MSG_ERROR("Unknown CPU for NetBSD -- $target_cpu")
682                 ;;
683         esac
684         aros_target_genmap="-Wl,-M -Xlinker >"
685         aros_flavour="emulation"
686         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386"
687         ;;   
689     openbsd*)
690         aros_target_arch="openbsd"
691         case "$target_cpu" in
692             *i?86*)
693                 aros_target_cpu="i386"
694                 aros_object_format="elf_i386"
695                 aros_flavour="emulation"
696                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__OpenBSD__"
697                 gcc_target_cpu="i386"
698                 ;;
699             *)
700                 AC_MSG_ERROR("Unknown CPU for OpenBSD -- $target_cpu")
701                 ;;
702         esac
703         aros_target_genmap="-Wl,-M -Xlinker >"
704         aros_target_nm_flags="-u"
705         aros_flavour="emulation"
706         ;;
708     solaris*)
709         aros_target_arch="solaris"
710         case "$target_cpu" in
711             *sparc*)
712                 aros_target_cpu="sparc"
713                 aros_object_format="elf_sparc"
714                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dsparc -D__Solaris__"
715                 gcc_target_cpu="sparc"
716                 ;;
717             *)
718                 AC_MSG_ERROR("Unknown CPU for Solaris -- $target_cpu")
719                 ;;
720         esac
721         aros_config_cflags="$aros_config_cflags -D$aros_target_cpu"
722         aros_flavour="emulation"
723         ;;
725     morphos*)
726         aros_target_arch="morphos"
727         aros_shared_default="no"
728         aros_target_cpu="ppc"
729         aros_object_format="elf_ppc"
730         aros_flavour="nativecompat"
731         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dppc"
732         gcc_target_cpu="ppc"
733         ;;
735     amiga*)
736         aros_target_arch="amiga"
737         aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -D_AMIGA -DAMIGA"
738         aros_shared_default="no"
740         aros_config_cflags="$aros_config_cflags -fomit-frame-pointer -fbuiltin -ffreestanding"
742         case "$target_cpu" in
743             *m68k*)
744                 aros_target_cpu="m68k"
745                 aros_object_format="m68kelf"
746                 aros_flavour="nativecompat"
747                 gcc_target_cpu="mc68000"
748                 ;;
749             *ppc*)
750                 aros_cpu="ppc"
751                 aros_flavour="native"
752                 gcc_target_cpu="ppc"
753                 ;;
754             *)
755                 AC_MSG_ERROR("Unknown CPU for Amiga $target_cpu")
756                 ;;
757         esac
758         ;;
760     cygwin*)
761         aros_target_arch="cygwin"
762         aros_shared_default="no"
763         case "$target_cpu" in
764             *i?86*)
765                 aros_target_cpu="i386"
766                 aros_object_format="elf_i386"
767                 aros_flavour="emulation"
768                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Di386 -D__CYGWIN32__"
769                 aros_shared_cflags=""
770                 aros_default_wbdepth=8
771                 gcc_target_cpu="i386"
772                 ;;
773             *)
774                 AC_MSG_ERROR("Unknown CPU for CygWin -- $target_cpu")
775                 ;;
776         esac
777     ;;
778     pp*)
779         aros_target_arch="pp"
780         aros_shared_default="no"
781         case "$target_cpu" in
782             *m68k*)
783                 aros_target_cpu="m68k"
784                 aros_object_format="m68kelf"
785                 aros_flavour="palmnative"
786                 aros_target_mkdep="$aros_target_mkdep -D__GNUC__ -Dm68k"
787                 aros_kernel_ldflags=""
788                 aros_default_wbwidth=160
789                 aros_default_wbheight=160
790                 aros_default_wbdepth=1
791                 aros_target_cc="m68k-elf-gcc -pipe"
792                 aros_target_ld="$(which m68k-elf-ld)"
793                 aros_target_as="m68k-elf-gcc -pipe"
794                 aros_shared_ld="m68k-elf-gcc"
795                 aros_kernel_ld="m68k-elf-gcc"
796                 aros_target_ar="m68k-elf-ar"
797                 aros_target_ar_flags="cru"
798                 aros_target_ranlib="m68k-elf-ranlib"
799                 aros_target_nm="m68k-elf-nm"
800                 aros_target_objcopy="m68k-elf-objcopy"
801                 aros_target_objdump="m68k-elf-objdump"
802                 aros_compiler_libs="-lgcc1"
803                 aros_shared_default=no
804                 aros_shared_cflags="-fpic"
805                 aros_shared_aflags=""
806                 aros_shared_ldflags="-Wl,-rpath,./lib -shared"
807                 aros_kernel_ldflags="-Wl,-rpath,./lib"
808                 aros_debug_cflags="-Wall -Werror-implicit-function-declaration $aros_symbols_debug  $aros_messages_debug -mc68000 -Wa,-mc68000"
809                 aros_debug_aflags=""
810                 aros_debug_ldflags="$aros_symbols_debug"
811                 aros_mungwall_debug="0"
812                 aros_modules_debug="0"
813                 gcc_target_cpu="mc68000"
814                 ignore_undefined_symbols="-ius"
815                 ;;
816            *)
817                 AC_MSG_ERROR("Unknown CPU for PalmPilot -- $target_cpu")
818                 ;;
819         esac
820         ;;
822     *)
823         AC_MSG_ERROR([Unsupported target architecture $target])
824         ;;
825 esac
827 aros_hostcfg_dir="bin/${aros_host_arch}-${aros_host_cpu}/gen/config"
828 aros_targetcfg_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/config"
829 aros_inc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/AROS/Development/include/aros"
830 aros_gendir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen"
831 aros_geninc_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/include/aros"
832 aros_tools_dir="bin/${aros_host_arch}-${aros_host_cpu}/tools"
833 aros_scripts_dir="bin/${aros_target_arch}-${aros_target_cpu}${aros_target_suffix}/gen/scripts"
835 # aros_cc_pre is a variable that is added to the front of the compiler name
836 # in the generated aros-gcc shell script. We need this to enable the cache
837 # to work across cleaned builds. Also, support DISTCC using the correct
838 # environment variable.
841 if test "x${DISTCC}" != "x" ; then
842     if test "x${CCACHE}" != "x" ; then
843         aros_cc_pre="env CCACHE_PREFIX=${DISTCC} ${CCACHE} "
844     else
845         aros_cc_pre="${DISTCC} "
846     fi
847 else
848     if test "x${CCACHE}" != "x" ; then
849         aros_cc_pre="${CCACHE} "
850     fi
853 prefix="${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
855 TARGET_CC="${prefix}-gcc"
856 TARGET_AS="$TARGET_CC"
857 TARGET_LD="${prefix}-ld"
858 aros_target_ld="${prefix}-ld"
860 NOSTDINC_CFLAGS=-nostdinc
862 NOSTARTUP_LDFLAGS=-nostartfiles
863 NIX_LDFLAGS=-nix
864 DETACH_LDFLAGS=-detach
865 NOSTDLIB_LDFLAGS=-nostdlib
867 AROS_TOOL_CC(SHARED_LD,$aros_shared_ld)
868 AROS_TOOL_CC(KERNEL_LD,$aros_kernel_ld)
870 # The default tools
871 aros_target_ar=${prefix}-ar
872 aros_target_ar_flags="cr"
873 aros_target_nm=${prefix}-nm
874 aros_target_nm_flags="-C -ul"
875 aros_target_objcopy=${prefix}-objcopy
876 aros_target_objdump=${prefix}-objdump
877 aros_target_ranlib=${prefix}-ranlib
878 aros_target_strip="${prefix}-strip --strip-unneeded -R.comment"
880 prefix="\$(TOOLDIR)/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros"
881 AR="${prefix}-ar $aros_target_ar_flags"
882 RANLIB="${prefix}-ranlib $aros_target_ranlib_flags"
883 NM="${prefix}-nm $aros_target_nm_flags"
884 NM_PLAIN="${prefix}-nm"
885 STRIP="${prefix}-strip $aros_target_strip_flags"
886 OBJDUMP="${prefix}-objdump"
887 OBJCOPY="${prefix}-objcopy"
889 AC_SUBST(TARGET_CC)
890 AC_SUBST(TARGET_AS)
891 AC_SUBST(TARGET_LD)
892 AC_SUBST(NOSTDINC_CFLAGS)
893 AC_SUBST(NOSTARTUP_LDFLAGS)
894 AC_SUBST(NIX_LDFLAGS)
895 AC_SUBST(DETACH_LDFLAGS)
896 AC_SUBST(NOSTDLIB_LDFLAGS)
897 AC_SUBST(aros_cc_pre)
898 AC_SUBST(AR)
899 AC_SUBST(RANLIB)
900 AC_SUBST(NM)
901 AC_SUBST(NM_PLAIN)
902 AC_SUBST(STRIP)
903 AC_SUBST(OBJDUMP)
904 AC_SUBST(OBJCOPY)
906 #-----------------------------------------------------------------------------
907 # See if we can compile SHM support
908 HAVE_XSHM_SUPPORT=0
909 if [[ "x$no_x" != "xyes" -a "x$ac_cv_header_sys_ipc_h" = "xyes" -a "x$ac_cv_header_sys_shm_h" = "xyes" ]]; then
910   AC_MSG_CHECKING(whether the X11 MIT-SHM extension can be compiled in)
911   if test -z "$x_includes" ; then
912     CFLAGS=""
913   else
914     CFLAGS="-I $x_includes"
915   fi
916   LIBS="-L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext"
917   AC_TRY_LINK([
918 #include <sys/types.h>
919 #include <X11/Xlib.h>
920 #include <X11/Xutil.h>
921 #include <X11/keysym.h>
922 #include <X11/cursorfont.h>
923 #include <sys/ipc.h>
924 #include <sys/shm.h>
925 #include <X11/extensions/XShm.h>],[
926 static XShmSegmentInfo shminfo;
927 static Display *display;
928 XShmAttach(display, &shminfo);
929 XSync(display,0);
930 shmctl(shminfo.shmid, IPC_RMID, 0);
932 HAVE_XSHM_SUPPORT=1
933 AC_MSG_RESULT(yes),
934 HAVE_XSHM_SUPPORT=0
935 AC_MSG_RESULT(no))
939 # Find the system include path. We can suggest that an alternative is
940 # used if we don't get it correct. The default is to use /usr/include.
941 # Which is set in the aros_target_incl_def variable.
943 AC_ARG_ENABLE(includes,
944 [  --enable-includes=dir   Alternative system include directory],
945 [aros_target_incl=$enable_includes], [aros_target_incl=$aros_target_incl_def])
947 dnl find out about the target cc's include path
948 AC_MSG_CHECKING([for the target compiler's include path])
949 if test "$aros_target_cc_includes" = "" ; then
950     #try to guess where the directory is
951     aros_target_cc_includes=`dirname \`${aros_target_cc} -print-libgcc-file-name\``/include
952     if ! test -d $aros_target_cc_includes; then
953         #the directory doesn't exist, we need to do some more work
954         aros_target_cc_includes=${PWD}/${aros_gendir}/cc_include
955         
956         #these are the headers we're looling for
957         headers="limits.h mmintrin.h stdbool.h syslimits.h float.h \
958                  stddef.h xmmintrin.h iso646.h stdarg.h unwind.h   \
959                  zutil.h"
961         dirs=
962         for h in $headers; do
963             #which other headers each of the above headers needs?
964             deps=$(echo "#include <$h>" | \
965                    $aros_host_cc -E -M - 2>/dev/null | \
966                    sed 's/^.*://; s/\\$/ /g; s/[[ \t]]\+/ /g')
967             
968             #copy all the needed headers to a directory beneath gendir
969             for d in $deps; do
970                 h=$(basename $d)
971                 dir=${aros_target_cc_includes}$(echo $(dirname $d) | \
972                                                 sed -n "s,^.*/include\(/.*\),\1,p")
973                 ! test -d $dir && mkdir -p $dir
974                 ! test -f $dir/$h && { cp $d $dir; chmod u+w $dir/$h; }
975             done
976         done        
977     fi
979 AC_MSG_RESULT($aros_target_cc_includes)
981 dnl Check if user specified --with-resolution=XRESxYRESxDEPTH
982 AC_MSG_CHECKING([for default resolution of WBScreen])
983 AC_ARG_WITH(resolution,[  --with-resolution=XRESxYRESxDEPTH        Default resolution of the initial WorkbenchScreen],resolution=$withval,resolution=none)
984 # We require an argument, so map --with/--without ("yes"/"no") to "none" specified
985 if test "$resolution" = "yes" ; then
986     resolution="none"
988 if test "$resolution" = "no" ; then
989     resolution="none"
991 if test "$resolution" != "none" ; then
992     aros_default_wbwidth=`echo $resolution | cut -d'x' -f1`
993     aros_default_wbheight=`echo $resolution | cut -d'x' -f2`
994     aros_default_wbdepth=`echo $resolution | cut -d'x' -f3`
996 AC_MSG_RESULT($aros_default_wbwidth x $aros_default_wbheight x $aros_default_wbdepth)
997 aros_cv_default_wbwidth=$aros_default_wbwidth
998 aros_cv_default_wbheight=$aros_default_wbheight
999 aros_cv_default_wbdepth=$aros_default_wbdepth
1001 dnl See if the user wants the BOCHS hack for native flavour
1002 AC_MSG_CHECKING([if bochs hack is enabled])
1003 AC_ARG_ENABLE(bochs_hack,[  --enable-bochs-hack     Enable hacks to make BOCHS (partly) work (default=no)],bochs_hack="yes",bochs_hack="no")
1004 if test "$bochs_hack" = "yes" ; then
1005     aros_bochs_hack="1"
1007 AC_MSG_RESULT($bochs_hack)
1009 dnl See if the user wants the serial debug output for native flavour
1010 AC_MSG_CHECKING([if serial debug is enabled])
1011 AC_ARG_WITH(serial-debug,[  --with-serial-debug   Enable serial debug output in native (default=no)],serial_debug=$withval,serial_debug=none)
1012 if test "$serial_debug" = "yes" ; then
1013     serial_debug="2"
1015 if test "$serial_debug" = "no" ; then
1016     serial_debug="none"
1018 if test "$serial_debug" != "none" ; then
1019     aros_serial_debug=$serial_debug
1020     AC_MSG_RESULT(on port $serial_debug)
1021 else
1022     AC_MSG_RESULT(no)
1025 dnl See if the user wants the palm debug output hack for palm native flavour
1026 AC_MSG_CHECKING([if palm debug hack is enabled])
1027 AC_ARG_ENABLE(palm_debug_hack,[  --enable-palm-debug-hack   Enable palm debug output hack in palm native (default=no)],palm_debug_hack="yes",palm_debug_hack="no")
1028 if test "$palm_debug_hack" = "yes" ; then
1029     aros_palm_debug_hack="1"
1031 AC_MSG_RESULT($palm_debug_hack)
1034 dnl See if the user wants nesting supervisor activated for unix flavour
1035 AC_MSG_CHECKING([if nesting supervisor support is enabled])
1036 AC_ARG_ENABLE(nesting_supervisor,[  --enable-nesting-supervisor   Enable nesting supervisor support in unix (default=no)],nesting_supervisor="yes",nesting_supervisor="no")
1037 if test "$nesting_supervisor" = "yes" ; then
1038     aros_nesting_supervisor="1"
1040 AC_MSG_RESULT($nesting_supervisor)
1044 if test "$HAVE_XSHM_SUPPORT" = "1" ; then
1045   dnl See if the user wants the X11 MIT-SHM extension to be enabled
1046   AC_MSG_CHECKING([if X11 MIT-SHM extension is enabled])
1047   AC_ARG_ENABLE(xshm_extension,[  --enable-xshm-extension Enable X11 MIT-SHM extension [default=yes]],xshm_extension="$enableval",xshm_extension="yes")
1048   if test "$xshm_extension" = "no" ; then
1049       DO_XSHM_SUPPORT="0"
1050   fi
1051   AC_MSG_RESULT($xshm_extension)
1052 else
1053   DO_XSHM_SUPPORT="0"
1058 dnl See if the user wants dbus.library
1059 AC_MSG_CHECKING([if building of dbus.library is enabled])
1060 AC_ARG_ENABLE(dbus,[  --enable-dbus           Enable DBUS support via dbus.library (default=no)],dbus="yes",dbus="no")
1061 if test "$dbus" = "yes" ; then
1062     ENABLE_DBUS=1
1063     DBUS_CFLAGS=`pkg-config --cflags dbus-1`
1064     DBUS_LIBFLAGS=`pkg-config --libs dbus-1`
1065     KERNEL_DBUS_KOBJ=kernel-dbus-kobj
1066     KERNEL_DBUS_INCLUDES=kernel-dbus-includes
1067 else
1068     ENABLE_DBUS=0
1070 AC_MSG_RESULT($dbus)
1073 dnl --------------------------------------------------------------------
1074 dnl Configuration Output Section
1075 dnl --------------------------------------------------------------------
1077 # Generic
1078 AC_SUBST(aros_arch)
1079 AC_SUBST(aros_cpu)
1080 AC_SUBST(aros_flavour)
1081 AC_SUBST(aros_flavour_uc)
1082 AC_SUBST(TOPDIR)
1084 # Host related
1085 AC_SUBST(aros_host_arch)
1086 AC_SUBST(aros_host_cpu)
1087 AC_SUBST(aros_host_cc)
1088 AC_SUBST(aros_host_ld)
1089 AC_SUBST(aros_host_make)
1090 AC_SUBST(aros_host_cflags)
1091 AC_SUBST(aros_host_ldflags)
1092 AC_SUBST(aros_host_debug)
1093 AC_SUBST(aros_host_mkdep)
1094 AC_SUBST(aros_host_mkargs)
1095 AC_SUBST(aros_host_exe_suffix)
1096 AC_SUBST(aros_host_lib_suffix)
1097 AC_SUBST(aros_tools_dir)
1099 # Target Related
1100 AC_SUBST(aros_target_arch)
1101 AC_SUBST(aros_target_cpu)
1102 AC_SUBST(aros_target_variant)
1103 AC_SUBST(aros_target_suffix)
1104 AC_SUBST(aros_target_incl)
1105 AC_SUBST(aros_target_cc)
1106 AC_SUBST(aros_target_cc_includes)
1107 AC_SUBST(aros_target_cc_path)
1108 AC_SUBST(aros_target_objdump)
1109 AC_SUBST(aros_target_objcopy)
1110 AC_SUBST(aros_target_strip)
1111 AC_SUBST(aros_target_as)
1112 AC_SUBST(aros_target_nm)
1113 AC_SUBST(aros_shared_default)
1114 AC_SUBST(aros_object_format)
1115 AC_SUBST(aros_compiler_libs)
1117 AC_SUBST(aros_config_cflags)
1118 AC_SUBST(aros_config_aflags)
1119 AC_SUBST(aros_target_ld)
1120 AC_SUBST(aros_config_ldflags)
1122 AC_SUBST(aros_shared_cflags)
1123 AC_SUBST(aros_shared_aflags)
1124 AC_SUBST(aros_shared_ldflags)
1125 AC_SUBST(aros_kernel_ldflags)
1126 AC_SUBST(aros_debug_cflags)
1127 AC_SUBST(aros_debug_aflags)
1128 AC_SUBST(aros_debug_ldflags)
1129 AC_SUBST(aros_target_genmap)
1131 # Graphics Related
1132 AC_SUBST(aros_gui_libdir)
1133 AC_SUBST(aros_gui_ldflags)
1134 AC_SUBST(aros_gui_libflags)
1135 AC_SUBST(aros_gui_incdir)
1136 AC_SUBST(aros_gui_ccflags)
1138 AC_SUBST(aros_default_wbwidth)
1139 AC_SUBST(aros_default_wbheight)
1140 AC_SUBST(aros_default_wbdepth)
1141 AC_SUBST(DO_XSHM_SUPPORT)
1143 # Native version related
1144 AC_SUBST(aros_bochs_hack)
1145 AC_SUBST(aros_serial_debug)
1147 # Palm native version related
1148 AC_SUBST(aros_palm_debug_hack)
1150 # Unix/Hosted version related
1151 AC_SUBST(aros_nesting_supervisor)
1153 # DBUS related
1154 AC_SUBST(ENABLE_DBUS)
1155 AC_SUBST(DBUS_CFLAGS)
1156 AC_SUBST(DBUS_LIBFLAGS)
1157 AC_SUBST(KERNEL_DBUS_KOBJ)
1158 AC_SUBST(KERNEL_DBUS_INCLUDES)
1160 # Debug related
1161 AC_SUBST(aros_debug)
1162 AC_SUBST(aros_mungwall_debug)
1163 AC_SUBST(aros_stack_debug)
1164 AC_SUBST(aros_modules_debug)
1166 # Collect-aros stuff: "-ius" to ignore undefined symbols
1167 AC_SUBST(ignore_undefined_symbols)
1169 # C compiler related
1170 AC_SUBST(gcc_target_cpu)
1172 dnl Prepare for output, make up all the generated patches
1173 case "$aros_flavour" in
1174 emulation)      aros_flavour_uc="AROS_FLAVOUR_EMULATION"
1175                 aros_flavour="emulation" ;;
1176 emulcompat)     aros_flavour_uc="(AROS_FLAVOUR_EMULATION|AROS_FLAVOUR_BINCOMPAT)"
1177                 aros_flavour="emulation" ;;
1178 standalone)     aros_flavour_uc="AROS_FLAVOUR_STANDALONE"
1179                 aros_flavour="standalone";;
1180 native)         aros_flavour_uc="AROS_FLAVOUR_NATIVE"
1181                 aros_flavour="native" ;;
1182 nativecompat)   aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1183                 aros_flavour="native" ;;
1184 linklib)        aros_flavour_uc="AROS_FLAVOUR_LINKLIB"
1185                 aros_flavour="linklib" ;;
1186 palmnative)     aros_flavour_uc="(AROS_FLAVOUR_STANDALONE|AROS_FLAVOUR_EMULATION)"
1187                 aros_flavour="palmnative" ;;
1188 ppcnative)      aros_flavour_uc="(AROS_FLAVOUR_NATIVE|AROS_FLAVOUR_BINCOMPAT)"
1189                 aros_flavour="ppcnative" ;;
1190 esac
1192 if test -z "$aros_gui_basedir" ; then
1193     dnl Use X as the default GUI
1194     aros_gui_libdir="$x_libraries"
1195     if test -z "$x_libraries" ; then
1196         aros_gui_ldflags=""
1197     else
1198         aros_gui_ldflags="-L $x_libraries"
1199     fi
1200     if test "$HAVE_XSHM_SUPPORT" = "1" ; then
1201       aros_gui_libflags="-lX11 -lXext"
1202     else
1203       aros_gui_libflags="-lX11"
1204     fi
1205     aros_gui_incdir="$x_includes"
1206     if test -z "$x_includes" ; then
1207         aros_gui_ccflags=""
1208     else
1209         aros_gui_ccflags="-I $x_includes"
1210     fi
1211 else
1212     if test -n "$aros_gui_basedir" ; then
1213         aros_gui_libdir="${aros_gui_basedir}/lib"
1214         aros_gui_incdir="${aros_gui_basedir}/include"
1215     fi
1217     if test -n "$aros_gui_libdir" ; then
1218         aros_gui_ldflags="-L ${aros_gui_libdir}"
1219     fi
1221     if test -n "$aros_gui_incdir" ; then
1222         aros_gui_ccflags="-I ${aros_gui_incdir}"
1223     else
1224         aros_gui_incdir="${aros_sysincludes}"
1225         aros_gui_ccflags=""
1226     fi
1229 if test ! -d ${aros_inc_dir} ; then
1230     ${MKDIR} ${aros_inc_dir}
1232 if test ! -d ${aros_geninc_dir} ; then
1233     ${MKDIR} ${aros_geninc_dir}
1235 if test ! -d ${aros_hostcfg_dir} ; then
1236     ${MKDIR} ${aros_hostcfg_dir}
1238 if test ! -d ${aros_targetcfg_dir} ; then
1239     ${MKDIR} ${aros_targetcfg_dir}
1241 if test ! -d ${aros_tools_dir} ; then
1242     ${MKDIR} ${aros_tools_dir}
1244 if test ! -d ${aros_scripts_dir} ; then
1245     ${MKDIR} ${aros_scripts_dir}
1248 AC_CONFIG_HEADERS(${aros_geninc_dir}/host-conf.h:config/host-conf.h.in)
1250 AC_CONFIG_COMMANDS([compiler_executable],
1251     [
1252         prefix=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}
1253         mkdir -p $prefix
1254         prefix="${prefix}/${aros_target_cpu}-aros"
1255         prefix2=${PWD}/${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros
1257         echo ${prefix}
1258         echo ${prefix2}
1259         chmod a+x ${prefix2}-gcc ${prefix2}-ld
1260         
1261         ln -sf ${prefix2}-gcc          ${prefix}-gcc
1262         ln -sf ${prefix2}-ld           ${prefix}-ld
1263         
1264         ln -sf $aros_target_nm_ln      ${prefix}-nm
1265         ln -sf $aros_target_ar_ln      ${prefix}-ar
1266         ln -sf $aros_target_ranlib_ln  ${prefix}-ranlib
1267         ln -sf $aros_target_objcopy_ln ${prefix}-objcopy
1268         ln -sf $aros_target_objdump_ln ${prefix}-objdump
1269         ln -sf $aros_target_strip_ln   ${prefix}-strip
1270     
1271         ln -sf $aros_target_nm_ln      ${prefix2}-nm
1272         ln -sf $aros_target_ar_ln      ${prefix2}-ar
1273         ln -sf $aros_target_ranlib_ln  ${prefix2}-ranlib
1274         ln -sf $aros_target_objcopy_ln ${prefix2}-objcopy
1275         ln -sf $aros_target_objdump_ln ${prefix2}-objdump
1276         ln -sf $aros_target_strip_ln   ${prefix2}-strip
1277     ],
1278     [
1279         aros_tools_dir=${aros_tools_dir}
1280         aros_target_cpu=${aros_target_cpu}
1281         aros_target_arch=${aros_target_arch}
1282         aros_target_suffix=${aros_target_suffix}
1283         aros_target_nm_ln=${aros_target_nm_ln}
1284         aros_target_ar_ln=${aros_target_ar_ln}
1285         aros_target_ranlib_ln=${aros_target_ranlib_ln}
1286         aros_target_objdump_ln=${aros_target_objdump_ln}
1287         aros_target_objcopy_ln=${aros_target_objcopy_ln}
1288         aros_target_strip_ln=${aros_target_strip_ln}
1289     ]
1291 AC_CONFIG_COMMANDS([genshared_executable],
1292     [chmod a+x ${aros_scripts_dir}/genshared],
1293     [aros_scripts_dir=${aros_scripts_dir}]
1295 AC_CONFIG_COMMANDS([genmf_executable],
1296     [chmod a+x ${aros_tools_dir}/genmf.py],
1297     [aros_tools_dir=${aros_tools_dir}]
1299 AC_CONFIG_COMMANDS([adflib_myaros.conf_executable],
1300     [chmod a+x tools/adflib/myconf.aros]
1303 AC_CONFIG_FILES(
1304     Makefile
1305     rom/mmakefile
1306     ${aros_inc_dir}/config.h:config/config.h.in
1307     ${aros_geninc_dir}/config.h:config/config.h.in
1308     ${aros_hostcfg_dir}/host.cfg:config/host.cfg.in
1309     ${aros_targetcfg_dir}/target.cfg:config/target.cfg.in
1310     mmake.config
1311     ${aros_targetcfg_dir}/make.defaults:config/make.defaults.in
1312     ${aros_targetcfg_dir}/specs:config/specs.in
1313     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-gcc:scripts/aros-gcc.in
1314     ${aros_tools_dir}/${aros_target_cpu}-${aros_target_arch}${aros_target_suffix}-aros-ld:scripts/aros-ld.in
1315     ${aros_scripts_dir}/genshared:compiler/c_lib/source/lib_source/genshared.in
1316     ${aros_tools_dir}/genmf.py:tools/genmf/genmf.py
1317     tools/adflib/myconf.aros
1320 AC_OUTPUT
1321          
1322 dnl This is in order to not defined SHARED_CFLAGS sometimes
1323 dnl We don't always do aros_shared_ar, aros_shared_cflags
1325 #XXX compatability...
1326 aros_shared_ar="$aros_shared_ld $aros_shared_ldflags -o"
1328 if test -n "$aros_shared_cflags" ; then
1329     echo "SHARED_CFLAGS := $aros_shared_cflags" >> ${aros_hostcfg_dir}/host.cfg
1330     echo "SHARED_AR := $aros_shared_ar" >> ${aros_hostcfg_dir}/host.cfg