comparison acinclude.m4 @ 2717:1b4fcab95915

Synchronized acinclude.m4.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 16 Jun 2008 19:23:05 +0300
parents b52eee8523d5
children 37f75d10f46a
comparison
equal deleted inserted replaced
2716:ad10080d5005 2717:1b4fcab95915
46 46
47 47
48 dnl ** Simple wrapper for AC_ARG_ENABLE 48 dnl ** Simple wrapper for AC_ARG_ENABLE
49 dnl ** AUD_ARG_ENABLE([name], [default value], [help string], [if enabled], [if disabled]) 49 dnl ** AUD_ARG_ENABLE([name], [default value], [help string], [if enabled], [if disabled])
50 AC_DEFUN([AUD_ARG_ENABLE], [dnl 50 AC_DEFUN([AUD_ARG_ENABLE], [dnl
51 # _A_ARG_ENABLE($1, $2, $3, $4, $5)
52 define([Name], [translit([$1], [./-], [___])])dnl 51 define([Name], [translit([$1], [./-], [___])])dnl
53 define([cBasce], [$3 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl 52 define([cBasce], [ifelse([$2],[yes],[Disable],[Enable]) $3 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl
54 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_[]Name=$2]) 53 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_[]Name=$2])
55 if test "x${enable_[]Name}" = "xyes"; then 54 if test "x${enable_[]Name}" = "xyes"; then
56 m4_ifvaln([$4], [$4], [:])dnl 55 m4_ifvaln([$4], [$4], [:])dnl
57 m4_ifvaln([$5], [else $5])dnl 56 m4_ifvaln([$5], [else $5])dnl
58 fi 57 fi
59 ]) 58 ])
60 59
61 60
62 AC_DEFUN([AUD_ARG_SIMPLE], [dnl 61 AC_DEFUN([AUD_ARG_SIMPLE], [dnl
63 # _A_ARG_SIMPLE($1, $2, $3, $4, $5, $6)
64 define([Name], [translit([$1], [./-], [___])])dnl 62 define([Name], [translit([$1], [./-], [___])])dnl
65 define([cBasce], [$3 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl 63 define([cBasce], [ifelse([$2],[yes],[Disable],[Enable]) $3 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl
66 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_[]Name=$2]) 64 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_[]Name=$2])
67 if test "x${enable_[]Name}" = "xyes"; then 65 if test "x${enable_[]Name}" = "xyes"; then
68 AC_DEFINE([$4], [$5], [$6]) 66 AC_DEFINE([$4], [$5], [$6])
69 fi 67 fi
70 AUD_CONDITIONAL([$4], [enable_$1]) 68 AUD_CONDITIONAL([$4], [enable_$1])
189 [http://www.atheme.org/projects/mcs.shtml]) 187 [http://www.atheme.org/projects/mcs.shtml])
190 188
191 189
192 dnl SSE2 support 190 dnl SSE2 support
193 dnl ============ 191 dnl ============
194 AUD_ARG_ENABLE([sse2], [yes], 192 AUD_ARG_ENABLE([sse2], [yes], [SSE2 support],
195 [Disable SSE2 support],
196 [ 193 [
197 AC_MSG_CHECKING([SSE2 support]) 194 AC_MSG_CHECKING([SSE2 support])
198 aud_my_save_CFLAGS="$CFLAGS" 195 aud_my_save_CFLAGS="$CFLAGS"
199 CFLAGS="-msse2" 196 CFLAGS="-msse2"
200 AC_TRY_RUN([ 197 AC_TRY_RUN([
216 CFLAGS="$aud_my_save_CFLAGS" 213 CFLAGS="$aud_my_save_CFLAGS"
217 ]) 214 ])
218 215
219 dnl AltiVec support 216 dnl AltiVec support
220 dnl =============== 217 dnl ===============
221 AUD_ARG_ENABLE([altivec], [yes], 218 AUD_ARG_ENABLE([altivec], [yes], [AltiVec support],
222 [Disable AltiVec support],
223 [ 219 [
224 AC_CHECK_HEADERS([altivec.h], 220 AC_CHECK_HEADERS([altivec.h],
225 [ 221 [
226 AC_DEFINE([HAVE_ALTIVEC], 1, [Define to 1 if your system has AltiVec.]) 222 AC_DEFINE([HAVE_ALTIVEC], 1, [Define to 1 if your system has AltiVec.])
227 AC_DEFINE([HAVE_ALTIVEC_H], 1, [Define to 1 if your system has an altivec.h file.]) 223 AC_DEFINE([HAVE_ALTIVEC_H], 1, [Define to 1 if your system has an altivec.h file.])
232 enable_altivec="no" 228 enable_altivec="no"
233 ]) 229 ])
234 ]) 230 ])
235 231
236 ]) 232 ])
233
234
235 dnl Plugin helper macros
236 dnl ====================
237 AC_DEFUN([AUD_PLUGIN_ADD], [dnl
238 define([Name], [translit([$1], [A-Z./-], [a-z___])])dnl
239 have_[]Name="yes"; res_short_[]Name="$1"
240 res_desc_[]Name="$3"; ifdef([aud_def_plugin_$2], [$2[]_PLUGINS="${$2[]_PLUGINS} $1"], [$2[]_PLUGINS="$1"])dnl
241 define([aud_def_plugin_$2],[1])dnl
242 ])
243
244 AC_DEFUN([AUD_PLUGIN_CHK], [dnl
245 define([cBasce], [$5 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl
246 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_$2="$3"])dnl
247 have_$2="no"
248 if test "x${enable_$2}" = "xyes"; then
249 m4_ifvaln([$6], [$6], [:])
250 if test "x${have_$2}" = "xyes"; then
251 m4_ifvaln([$7], [$7], [:])dnl
252 else
253 res_msg_$2="(not found)"
254 m4_ifvaln([$8], [$8], [:])dnl
255 fi
256 else
257 res_msg_$2="(disabled)"
258 m4_ifvaln([$9], [$9], [:])dnl
259 fi
260 ])
261
262 AC_DEFUN([AUD_PLUGIN_CHECK_SIMPLE], [dnl
263 define([cBasce], [$6 (def: ifelse([$2],[yes],[enabled],[disabled]))])dnl
264 AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], cBasce)],, [enable_$2="$3"])dnl
265 have_$2="no"
266 if test "x${enable_$2}" = "xyes"; then
267 m4_ifvaln([$6], [$6], [:])
268 else
269 res_msg_$2="(disabled)"
270 m4_ifvaln([$7], [$7], [:])dnl
271 fi
272 ])
273
274
275 dnl Check and enable a plugin with a pkg-config check
276 AC_DEFUN([AUD_PLUGIN_CHECK_PKG], [dnl
277 define([Name], [translit([$1], [A-Z./-], [a-z___])])dnl
278 define([BigN], [translit([$1], [a-z./-], [A-Z___])])dnl
279 AUD_PLUGIN_CHK([$1], Name, [$2], [$4], [$6], [dnl
280 PKG_CHECK_MODULES([]BigN, [$7], [have_[]Name[]="yes"], [have_[]Name[]="no"])
281 ], [
282 AUD_PLUGIN_ADD([$5], [$3])
283 m4_ifvaln([$8], [$8])
284 ], [$9], [$10])
285 ])
286
287 dnl Check and enable a plugin with a header files check
288 AC_DEFUN([AUD_PLUGIN_CHECK_HEADERS], [
289 define([Name], [translit([$1], [A-Z./-], [a-z___])])dnl
290 AUD_PLUGIN_CHK([$1], Name, [$2], [$4], [$6], [
291 AC_CHECK_HEADERS([$7], [have_[]Name[]="yes"], [have_[]Name[]="no"])
292 ], [
293 AUD_PLUGIN_ADD([$5], [$3])
294 m4_ifvaln([$8], [$8])
295 ], [$9], [$10])
296 ])
297
298 dnl Check and enable a plugin with complex checks
299 AC_DEFUN([AUD_PLUGIN_CHECK_COMPLEX], [
300 # CHECK_COMPLEX #1 : $1
301 define([Name], [translit([$1], [A-Z./-], [a-z___])])dnl
302 AUD_PLUGIN_CHK([$1], Name, [$2], [$4], [$6], [
303 # CHECK_COMPLEX #2 BEGIN
304 $7
305 # CHECK_COMPLEX #2 END
306 ], [
307 # CHECK_COMPLEX #3 BEGIN
308 AUD_PLUGIN_ADD([$5], [$3])
309 m4_ifvaln([$8], [$8])
310 # CHECK_COMPLEX #3 END
311 ], [$9], [$10])
312 ])
313