initial attempt at polish localization.
[AROS.git] / acinclude.m4
blob1f2652965d6c9ecc5630398f1f216086f0e1d53a
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_PATH_PROG(var,prog,args)
29 dnl Like AROS_PROG but gets the full path
30 dnl
31 AC_DEFUN([AROS_PATH_PROG],
32 [AC_PATH_PROG([$1],[$2],[$2 $3])])
34 dnl AROS_BUILDCMD(var,prog,ext)
35 dnl appends the cmd part of prog with ext
36 dnl
37 AC_DEFUN([AROS_BUILDCMD],
38 [if test "$3" != ""; then
39     if test "$2" != ""; then
40         ac_prog_args=`expr "X$2" : '[[^ ]]* \(.*\)'`
41         ac_prog_cmd=`expr "X$2" : '^\S*'`
42         $1="$ac_prog_cmd[$]$3 $ac_prog_args"
43     fi
44 fi])
46 dnl AROS_TOOL_CCPATH(var,prog,override)
47 dnl This will first look for the tool in the CC path and then in the
48 dnl normal path (CC path only supported for gcc at the moment)
49 AC_DEFUN([AROS_TOOL_CCPATH],
51 if test "$3" = ""; then
52     ac_tool_[$2]=[$2]
53 else
54     ac_tool_[$2]=[$3]
56 if test "$GCC" = "yes"; then
57     aros_gcc_[$2]=`$CC -print-prog-name=$ac_tool_[$2]`
58     AC_PATH_PROG([$1], [`basename $aros_gcc_[$2]`], , [`dirname $aros_gcc_[$2]`])
60 if test "$[$1]" = ""; then
61     AC_PATH_PROGS([$1],[$ac_tool_[$2]])
65 dnl AROS_TOOL_TARGET(var,prog,override)
66 dnl This is effectively the same as AROS_PROG, but adds the appropriate
67 dnl arch prefix when cross compiling. 
68 dnl
69 AC_DEFUN([AROS_TOOL_TARGET],
71 if test "$3" = ""; then
72     if test "$cross_compiling" = "yes" ; then
73         AC_PATH_PROG([$1],${target_tool_prefix}[$2])
74     else
75         AROS_TOOL_CCPATH($1, $2)
76     fi
77 else
78     ac_tool_optarg=`expr "X$3" : '[[^ ]]* \(.*\)'`
79     AC_PATH_PROG($1, $3)
80     $1="[$]$1 $ac_tool_optarg"
84 dnl AROS_TOOL_KERNEL(var,prog,override)
85 dnl This is effectively the same as AROS_PROG, but adds the appropriate
86 dnl arch prefix when cross compiling. 
87 dnl
88 AC_DEFUN([AROS_TOOL_KERNEL],
90 if test "$3" = ""; then
91     if test "$cross_compiling" = "yes" ; then
92         AC_PATH_PROG([$1],${kernel_tool_prefix}[$2])
93     else
94         AROS_TOOL_CCPATH($1, $2)
95     fi
96 else
97     ac_tool_optarg=`expr "X$3" : '[[^ ]]* \(.*\)'`
98     AC_PATH_PROG($1, $3)
99     $1="[$]$1 $ac_tool_optarg"
103 dnl AROS_CACHE_CHECK(message, var, check)
104 dnl This is similar to the AC_CACHE_CHECK macro, but it hides the
105 dnl prefix and stuff from the coders. We will get aros_$2 on the
106 dnl variable, and aros_cv_$2 on the cache variable.
107 AC_DEFUN([AROS_CACHE_CHECK],
108 [AC_MSG_CHECKING([$1])
109 AC_CACHE_VAL(aros_cv_[$2],
111 aros_cv_[$2]="[$]aros_[$2]"
113 aros_[$2]="[$]aros_cv_[$2]"
114 AC_MSG_RESULT([$]aros_$2)])