-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathacinclude.m4
More file actions
160 lines (145 loc) · 4.31 KB
/
Copy pathacinclude.m4
File metadata and controls
160 lines (145 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
dnl Some autoconf macros for AROS
dnl
dnl Search for a file, and place the result into the cache.
dnl AROS_REQUIRED(name,var)
dnl Checks if var is defined, and aborts otherwise. name is just for
dnl presentation to the user.
dnl
AC_DEFUN([AROS_REQUIRED],
[req_avail=yes
if test "$2" = ""; then
req_avail=no
fi
if test "$2" = "no"; then
req_avail=no
fi
if test "$req_avail" = "no"; then
AC_MSG_ERROR([$1 is required to build AROS. Please install and run configure again.])
fi])
dnl AROS_CONFIG_WARNING(message)
dnl Records a non-fatal configuration warning describing an optional feature
dnl that will be missing from the build because a host component was not found.
dnl All recorded warnings are presented together at the end of the configure
dnl run. Each message is shown on its own line. Only call this for features
dnl that are actually used by the target currently being configured.
dnl
AC_DEFUN([AROS_CONFIG_WARNING],
[CONFIG_WARNINGS="${CONFIG_WARNINGS} * $1
"])
dnl AROS_PROG(var,prog,args)
dnl Checks if prog is on the path. If it is, sets var to "prog args".
dnl args is optional.
dnl
AC_DEFUN([AROS_PROG],
[AC_CHECK_PROG([$1],[$2],[$2 $3])])
dnl AROS_PATH_PROG(var,prog,args)
dnl Like AROS_PROG but gets the full path
dnl
AC_DEFUN([AROS_PATH_PROG],
[AC_PATH_PROG([$1],[$2],[$2 $3])])
dnl AROS_BUILDCMD(var,prog,ext)
dnl appends the cmd part of prog with ext
dnl
AC_DEFUN([AROS_BUILDCMD],
[if test "$3" != ""; then
if test "$2" != ""; then
ac_prog_args=`expr "X$2" : '[[^ ]]* \(.*\)'`
ac_prog_cmd=`expr "X$2" : '^\S*'`
$1="$ac_prog_cmd[$]$3 $ac_prog_args"
fi
fi])
dnl AROS_TOOL_CCPATH(var,prog,override)
dnl This will first look for the tool in the CC path and then in the
dnl normal path (CC path only supported for gcc at the moment)
AC_DEFUN([AROS_TOOL_CCPATH],
[
if test "$3" = ""; then
ac_tool_[$2]=[$2]
else
ac_tool_[$2]=[$3]
fi
if test "$GCC" = "yes"; then
aros_gcc_[$2]=`$CC -print-prog-name=$ac_tool_[$2]`
AC_PATH_PROG([$1], [`basename $aros_gcc_[$2]`], , [`dirname $aros_gcc_[$2]`])
fi
if test "$[$1]" = ""; then
AC_PATH_PROGS([$1],[$ac_tool_[$2]])
fi
])
dnl AROS_TOOL_TARGET(var,prog,override)
dnl This is effectively the same as AROS_PROG, but adds the appropriate
dnl arch prefix when cross compiling.
dnl
AC_DEFUN([AROS_TOOL_TARGET],
[
if test "$3" = ""; then
if test "$cross_compiling" = "yes" ; then
AC_PATH_PROG([$1],${target_tool_prefix}[$2])
else
AROS_TOOL_CCPATH($1, $2)
fi
else
ac_tool_optarg=`expr "X$3" : '[[^ ]]* \(.*\)'`
AC_PATH_PROG($1, $3)
$1="[$]$1 $ac_tool_optarg"
fi
])
dnl AROS_TOOL_KERNEL(var,prog,override)
dnl This is effectively the same as AROS_PROG, but adds the appropriate
dnl arch prefix when cross compiling.
dnl
AC_DEFUN([AROS_TOOL_KERNEL],
[
if test "$3" = ""; then
if test "$cross_compiling" = "yes" ; then
AC_PATH_PROG([$1],${kernel_tool_prefix}[$2])
else
AROS_TOOL_CCPATH($1, $2)
fi
else
ac_tool_optarg=`expr "X$3" : '[[^ ]]* \(.*\)'`
AC_PATH_PROG($1, $3)
$1="[$]$1 $ac_tool_optarg"
fi
])
dnl AROS_CACHE_CHECK(message, var, check)
dnl This is similar to the AC_CACHE_CHECK macro, but it hides the
dnl prefix and stuff from the coders. We will get aros_$2 on the
dnl variable, and aros_cv_$2 on the cache variable.
AC_DEFUN([AROS_CACHE_CHECK],
[AC_MSG_CHECKING([$1])
AC_CACHE_VAL(aros_cv_[$2],
[$3
aros_cv_[$2]="[$]aros_[$2]"
])
aros_[$2]="[$]aros_cv_[$2]"
AC_MSG_RESULT([$]aros_$2)])
dnl AX_GCC_ARM_MARCH_CONFIG([BASEARCH], [SOFTVAR], [HARDVAR])
dnl BASEARCH: Base architecture (e.g. armv7-a)
dnl SOFTVAR: Shell variable name to store the soft-float -march target
dnl HARDVAR: Shell variable name to store the hard-float -march target
AC_DEFUN([AX_GCC_ARM_MARCH_CONFIG], [
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_GCC_TRADITIONAL])
m4_pushdef([BASEARCH], [$1])
m4_pushdef([SOFTVAR], [$2])
m4_pushdef([HARDVAR], [$3])
if test "$GCC_VERSION_MAJOR" -lt "10"; then
if test "$GCC_VERSION_MAJOR" -lt "8"; then
SOFTVAR="BASEARCH"
HARDVAR="BASEARCH"
else
SOFTVAR="BASEARCH+nofp"
HARDVAR="BASEARCH+fp"
fi
aros_config_cflags="$aros_config_cflags ${CFLAGS_NO_COMMON}"
else
SOFTVAR="BASEARCH+nofp"
HARDVAR="BASEARCH+fp"
fi
AC_SUBST([SOFTVAR])
AC_SUBST([HARDVAR])
m4_popdef([BASEARCH])
m4_popdef([SOFTVAR])
m4_popdef([HARDVAR])
])