huperlayers.library now uses autoopening of libraries
[AROS.git] / acinclude.m4
blobbe1e4821adf188f97e48eb9fe0b37ec34000bc98
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
7 AC_DEFUN(AROS_REQUIRED,
8 [if test "$2" = ""; then
9     AC_MSG_ERROR($1 is required to build AROS. Please install and run configure again.)
10 fi])
12 dnl AROS_PROG(var,prog,args)
13 AC_DEFUN(AROS_PROG,
14 [AC_CHECK_PROG([$1],[$2],[$2])
15 ifelse($3, ,, $1="$$1 $3")
16 AC_SUBST($1)])
18 dnl AROS_TOOL(var,prog,args)
19 dnl This will later on check the $target-$(tool) stuff, but at the
20 dnl moment it only does the same as AROS_PROG
21 dnl
22 AC_DEFUN(AROS_TOOL,
23 [AC_PATH_PROG([$1],[$2],[$2])
24 ifelse($3, ,, $1="$$1 $3")
25 AC_SUBST($1)])
27 dnl AROS_TOOL_CCPATH(var,prog)
28 dnl This will first look for the tool in the CC path and then in the
29 dnl normal path (CC path only supported for gcc at the moment)
30 AC_DEFUN(AROS_TOOL_CCPATH,
31 [if test "$GCC" = "yes"; then
32     aros_gcc_[$2]=`$CC -print-prog-name=[$2]`
33     AC_PATH_PROG([$1], [`basename $aros_gcc_[$2]`], , [`dirname $aros_gcc_[$2]`])
35 if test "$[$1]" = ""; then
36     AC_PATH_PROG([$1],[$2])
37 fi])
39 dnl AROS_TOOL_CC(var,prog,args)
40 dnl This is effectively the same as AROS_TOOL, but only does the 
41 dnl test when we are cross compiling.
42 dnl
43 AC_DEFUN(AROS_TOOL_CC,
44 [if test "$cross_compile" = "yes" ; then
45     AC_PATH_PROG([$1],[$2],[$2])
46 else
47     $1="$2"
49 ifelse($3, ,, $1="$$1 $3")
50 AC_SUBST($1)])
52 dnl AROS_CACHE_CHECK(message, var, check)
53 dnl This is similar to the AC_CACHE_CHECK macro, but it hides the
54 dnl prefix and stuff from the coders. We will get aros_$2 on the
55 dnl variable, and aros_cv_$2 on the cache variable.
56 AC_DEFUN(AROS_CACHE_CHECK,
57 [AC_MSG_CHECKING([$1])
58 AC_CACHE_VAL(aros_cv_[$2],
59 [$3
60 aros_cv_[$2]="[$]aros_[$2]"
62 aros_[$2]="[$]aros_cv_[$2]"
63 AC_MSG_RESULT([$]aros_$2)])