1 dnl Some autoconf macros for AROS
3 dnl Search for a file, and place the result into the cache.
5 dnl AROS_REQUIRED(name,var)
6 dnl Checks if var is defined, and aborts otherwise. name is just for
7 dnl presentation to the user.
9 AC_DEFUN(AROS_REQUIRED,
10 [if test "$2" = ""; then
11 AC_MSG_ERROR([$1 is required to build AROS. Please install and run configure again.])
14 dnl AROS_PROG(var,prog,args)
15 dnl Checks if prog is on the path. If it is, sets var to "prog args".
19 [AC_CHECK_PROG([$1],[$2],[$2 $3])])
21 dnl AROS_TOOL_CCPATH(var,prog)
22 dnl This will first look for the tool in the CC path and then in the
23 dnl normal path (CC path only supported for gcc at the moment)
24 AC_DEFUN(AROS_TOOL_CCPATH,
25 [if test "$GCC" = "yes"; then
26 aros_gcc_[$2]=`$CC -print-prog-name=[$2]`
27 AC_PATH_PROG([$1], [`basename $aros_gcc_[$2]`], , [`dirname $aros_gcc_[$2]`])
29 if test "$[$1]" = ""; then
30 AC_PATH_PROG([$1],[$2])
33 dnl AROS_TOOL_TARGET(var,prog,override)
34 dnl This is effectively the same as AROS_PROG, but adds the appropriate
35 dnl arch prefix when cross compiling.
37 AC_DEFUN(AROS_TOOL_TARGET,
39 if test "$3" = ""; then
40 if test "$cross_compiling" = "yes" ; then
41 AC_PATH_PROG([$1],${target_tool_prefix}[$2])
43 AROS_TOOL_CCPATH($1, $2)
50 dnl AROS_KERNEL_TARGET(var,prog,override)
51 dnl This is effectively the same as AROS_PROG, but adds the appropriate
52 dnl arch prefix when cross compiling.
54 AC_DEFUN(AROS_TOOL_KERNEL,
56 if test "$3" = ""; then
57 if test "$cross_compiling" = "yes" ; then
58 AC_PATH_PROG([$1],${kernel_tool_prefix}[$2])
60 AROS_TOOL_CCPATH($1, $2)
67 dnl AROS_CACHE_CHECK(message, var, check)
68 dnl This is similar to the AC_CACHE_CHECK macro, but it hides the
69 dnl prefix and stuff from the coders. We will get aros_$2 on the
70 dnl variable, and aros_cv_$2 on the cache variable.
71 AC_DEFUN(AROS_CACHE_CHECK,
72 [AC_MSG_CHECKING([$1])
73 AC_CACHE_VAL(aros_cv_[$2],
75 aros_cv_[$2]="[$]aros_[$2]"
77 aros_[$2]="[$]aros_cv_[$2]"
78 AC_MSG_RESULT([$]aros_$2)])