Autodoc formatting fixes.
[AROS.git] / acinclude.m4
blob25cfc980a2862e373608a442d4ee868a4b26c6ad
1 dnl Some autoconf macros for AROS
2 dnl
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.
8 dnl
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.])
12 fi])
14 dnl AROS_PROG(var,prog,args)
15 dnl Checks if prog is on the path. If it is, sets var to "prog args".
16 dnl args is optional.
17 dnl
18 AC_DEFUN([AROS_PROG],
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])
31 fi])
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. 
36 dnl
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])
42     else
43         AROS_TOOL_CCPATH($1, $2)
44     fi
45 else
46     AC_PATH_PROG($1, $3)
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. 
53 dnl
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])
59     else
60         AROS_TOOL_CCPATH($1, $2)
61     fi
62 else
63     AC_PATH_PROG($1, $3)
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],
74 [$3
75 aros_cv_[$2]="[$]aros_[$2]"
77 aros_[$2]="[$]aros_cv_[$2]"
78 AC_MSG_RESULT([$]aros_$2)])