DEVEL15-autoconf-262-support-20081020
[openafs.git] / src / cf / linux-test5.m4
1
2 AC_DEFUN([OPENAFS_GCC_SUPPORTS_MARCH], [
3 AC_MSG_CHECKING(if $CC accepts -march=pentium)
4 save_CFLAGS="$CFLAGS"
5 CFLAGS="-MARCH=pentium"
6 AC_CACHE_VAL(openafs_cv_gcc_supports_march,[
7 AC_TRY_COMPILE(
8 [],
9 [int x;],
10 openafs_cv_gcc_supports_march=yes,
11 openafs_cv_gcc_supports_march=no)])
12 AC_MSG_RESULT($openafs_cv_gcc_supports_march)
13 if test x$openafs_cv_gcc_supports_march = xyes; then
14   P5PLUS_KOPTS="-march=pentium"
15 else
16   P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
17 fi
18 CFLAGS="$save_CFLAGS"
19 ])
20
21 AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING], [
22 AC_MSG_CHECKING(if $CC needs -fno-strict-aliasing)
23 save_CFLAGS="$CFLAGS"
24 CFLAGS="-fno-strict-aliasing"
25 AC_CACHE_VAL(openafs_cv_gcc_needs_no_strict_aliasing,[
26 AC_TRY_COMPILE(
27 [],
28 [int x;],
29 openafs_cv_gcc_needs_no_strict_aliasing=yes,
30 openafs_cv_gcc_needs_no_strict_aliasing=no)])
31 AC_MSG_RESULT($openafs_cv_gcc_needs_no_strict_aliasing)
32 if test x$openafs_cv_gcc_needs_no_strict_aliasing = xyes; then
33   LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"
34 fi
35 CFLAGS="$save_CFLAGS"
36 ])
37
38 AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE], [
39 AC_MSG_CHECKING(if $CC needs -fno-strength-reduce)
40 save_CFLAGS="$CFLAGS"
41 CFLAGS="-fno-strength-reduce"
42 AC_CACHE_VAL(openafs_cv_gcc_needs_no_strength_reduce,[
43 AC_TRY_COMPILE(
44 [],
45 [int x;],
46 openafs_cv_gcc_needs_no_strength_reduce=yes,
47 openafs_cv_gcc_needs_no_strength_reduce=no)])
48 AC_MSG_RESULT($openafs_cv_gcc_needs_no_strength_reduce)
49 if test x$openafs_cv_gcc_needs_no_strength_reduce = xyes; then
50   LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"
51 fi
52 CFLAGS="$save_CFLAGS"
53 ])
54
55 AC_DEFUN([OPENAFS_GCC_SUPPORTS_NO_COMMON], [
56 AC_MSG_CHECKING(if $CC supports -fno-common)
57 save_CFLAGS="$CFLAGS"
58 CFLAGS="-fno-common"
59 AC_CACHE_VAL(openafs_cv_gcc_supports_no_common,[
60 AC_TRY_COMPILE(
61 [],
62 [int x;],
63 openafs_cv_gcc_supports_no_common=yes,
64 openafs_cv_gcc_supports_no_common=no)])
65 AC_MSG_RESULT($openafs_cv_gcc_supports_no_common)
66 if test x$openafs_cv_gcc_supports_no_common = xyes; then
67   LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"
68 fi
69 CFLAGS="$save_CFLAGS"
70 ])
71
72 AC_DEFUN([OPENAFS_GCC_SUPPORTS_PIPE], [
73 AC_MSG_CHECKING(if $CC supports -pipe)
74 save_CFLAGS="$CFLAGS"
75 CFLAGS="-pipe"
76 AC_CACHE_VAL(openafs_cv_gcc_supports_pipe,[
77 AC_TRY_COMPILE(
78 [],
79 [int x;],
80 openafs_cv_gcc_supports_pipe=yes,
81 openafs_cv_gcc_supports_pipe=no)])
82 AC_MSG_RESULT($openafs_cv_gcc_supports_pipe)
83 if test x$openafs_cv_gcc_supports_pipe = xyes; then
84   LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"
85 fi
86 CFLAGS="$save_CFLAGS"
87 ])