]>
Commit | Line | Data |
---|---|---|
5c5d24f0 | 1 | # $Id: aclocal.m4 3321 2007-03-30 23:32:43Z jilles $ - aclocal.m4 - Autoconf fun... |
212380e3 AC |
2 | AC_DEFUN([AC_DEFINE_DIR], [ |
3 | test "x$prefix" = xNONE && prefix="$ac_default_prefix" | |
4 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
5 | ac_define_dir=`eval echo [$]$2` | |
6 | ac_define_dir=`eval echo [$]ac_define_dir` | |
7 | $1="$ac_define_dir" | |
8 | AC_SUBST($1) | |
9 | ifelse($3, , | |
10 | AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), | |
11 | AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) | |
12 | ]) | |
13 | ||
14 | AC_DEFUN([AC_SUBST_DIR], [ | |
15 | ifelse($2,,,$1="[$]$2") | |
16 | $1=`( | |
17 | test "x$prefix" = xNONE && prefix="$ac_default_prefix" | |
18 | test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" | |
19 | eval echo \""[$]$1"\" | |
20 | )` | |
21 | AC_SUBST($1) | |
22 | ]) | |
23 | ||
24 | dnl CHARYBDIS_C_GCC_TRY_FLAGS(<warnings>,<cachevar>) | |
25 | AC_DEFUN([CHARYBDIS_C_GCC_TRY_FLAGS],[ | |
26 | AC_MSG_CHECKING([GCC flag(s) $1]) | |
27 | if test "${GCC-no}" = yes | |
28 | then | |
29 | AC_CACHE_VAL($2,[ | |
30 | oldcflags="${CFLAGS-}" | |
31 | CFLAGS="${CFLAGS-} ${CWARNS} $1 -Werror" | |
32 | AC_TRY_COMPILE([ | |
33 | #include <string.h> | |
34 | #include <stdio.h> | |
35 | int main(void); | |
36 | ],[ | |
5c5d24f0 | 37 | (void)strcmp("a","b"); fprintf(stdout,"test ok\n"); |
212380e3 AC |
38 | ], [$2=yes], [$2=no]) |
39 | CFLAGS="${oldcflags}"]) | |
40 | if test "x$$2" = xyes; then | |
41 | CWARNS="${CWARNS}$1 " | |
42 | AC_MSG_RESULT(ok) | |
43 | else | |
44 | $2='' | |
45 | AC_MSG_RESULT(no) | |
46 | fi | |
47 | else | |
48 | AC_MSG_RESULT(no, not using GCC) | |
49 | fi | |
50 | ]) |