Build version 1 of all catalogs.
[AROS.git] / acinclude.m4
blobd20b4dbeb7a80c8c97d6da5f211396e49fb1946d
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 [req_avail=yes
11 if test "$2" = ""; then
12     req_avail=no
14 if test "$2" = "no"; then
15     req_avail=no
17 if test "$req_avail" = "no"; then
18     AC_MSG_ERROR([$1 is required to build AROS. Please install and run configure again.])
19 fi])
21 dnl AROS_PROG(var,prog,args)
22 dnl Checks if prog is on the path. If it is, sets var to "prog args".
23 dnl args is optional.
24 dnl
25 AC_DEFUN([AROS_PROG],
26 [AC_CHECK_PROG([$1],[$2],[$2 $3])])
28 dnl AROS_TOOL_CCPATH(var,prog)
29 dnl This will first look for the tool in the CC path and then in the
30 dnl normal path (CC path only supported for gcc at the moment)
31 AC_DEFUN([AROS_TOOL_CCPATH],
32 [if test "$GCC" = "yes"; then
33     aros_gcc_[$2]=`$CC -print-prog-name=[$2]`
34     AC_PATH_PROG([$1], [`basename $aros_gcc_[$2]`], , [`dirname $aros_gcc_[$2]`])
36 if test "$[$1]" = ""; then
37     AC_PATH_PROG([$1],[$2])
38 fi])
40 dnl AROS_TOOL_TARGET(var,prog,override)
41 dnl This is effectively the same as AROS_PROG, but adds the appropriate
42 dnl arch prefix when cross compiling. 
43 dnl
44 AC_DEFUN([AROS_TOOL_TARGET],
46 if test "$3" = ""; then
47     if test "$cross_compiling" = "yes" ; then
48         AC_PATH_PROG([$1],${target_tool_prefix}[$2])
49     else
50         AROS_TOOL_CCPATH($1, $2)
51     fi
52 else
53     AC_PATH_PROG($1, $3)
57 dnl AROS_KERNEL_TARGET(var,prog,override)
58 dnl This is effectively the same as AROS_PROG, but adds the appropriate
59 dnl arch prefix when cross compiling. 
60 dnl
61 AC_DEFUN([AROS_TOOL_KERNEL],
63 if test "$3" = ""; then
64     if test "$cross_compiling" = "yes" ; then
65         AC_PATH_PROG([$1],${kernel_tool_prefix}[$2])
66     else
67         AROS_TOOL_CCPATH($1, $2)
68     fi
69 else
70     AC_PATH_PROG($1, $3)
74 dnl AROS_CACHE_CHECK(message, var, check)
75 dnl This is similar to the AC_CACHE_CHECK macro, but it hides the
76 dnl prefix and stuff from the coders. We will get aros_$2 on the
77 dnl variable, and aros_cv_$2 on the cache variable.
78 AC_DEFUN([AROS_CACHE_CHECK],
79 [AC_MSG_CHECKING([$1])
80 AC_CACHE_VAL(aros_cv_[$2],
81 [$3
82 aros_cv_[$2]="[$]aros_[$2]"
84 aros_[$2]="[$]aros_cv_[$2]"
85 AC_MSG_RESULT([$]aros_$2)])