configure: Restore saved CFLAGS
[openafs.git] / src / cf / linux-test5.m4
1 dnl These options seem to only be used for the 2.4.x
2 dnl Linux kernel build
3 AC_DEFUN([OPENAFS_GCC_SUPPORTS_MARCH], [
4   AC_CACHE_CHECK([if $CC accepts -march=pentium],
5     [openafs_cv_gcc_supports_march],
6     [save_CFLAGS="$CFLAGS"
7      CFLAGS="-MARCH=pentium"
8      AC_TRY_COMPILE([],
9                     [int x;],
10                     [openafs_cv_gcc_supports_march=yes],
11                     [openafs_cv_gcc_supports_march=no])
12      CFLAGS="$save_CFLAGS"
13     ])
14   AS_IF([test x$openafs_cv_gcc_supports_march = xyes],
15         [P5PLUS_KOPTS="-march=pentium"],
16         [P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"])
17 ])
18
19 AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING], [
20   AC_CACHE_CHECK([if $CC needs -fno-strict-aliasing],
21     [openafs_cv_gcc_needs_no_strict_aliasing],
22     [save_CFLAGS="$CFLAGS"
23      CFLAGS="-fno-strict-aliasing"
24      AC_TRY_COMPILE([],
25                     [int x;],
26                     [openafs_cv_gcc_needs_no_strict_aliasing=yes],
27                     [openafs_cv_gcc_needs_no_strict_aliasing=no])
28      CFLAGS="$save_CFLAGS"
29   ])
30   AS_IF([test x$openafs_cv_gcc_needs_no_strict_aliasing = xyes],
31         [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"])
32 ])
33
34 AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE], [
35   AC_CACHE_CHECK([if $CC needs -fno-strength-reduce],
36     [openafs_cv_gcc_needs_no_strength_reduce],
37     [save_CFLAGS="$CFLAGS"
38      CFLAGS="-fno-strength-reduce"
39      AC_TRY_COMPILE([],
40                     [int x;],
41                     [openafs_cv_gcc_needs_no_strength_reduce=yes],
42                     [openafs_cv_gcc_needs_no_strength_reduce=no])
43      CFLAGS="$save_CFLAGS"
44   ])
45   AS_IF([test x$openafs_cv_gcc_needs_no_strength_reduce = xyes],
46         [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"])
47 ])
48
49 AC_DEFUN([OPENAFS_GCC_SUPPORTS_NO_COMMON], [
50   AC_CACHE_CHECK([if $CC supports -fno-common],
51     [openafs_cv_gcc_supports_no_common],
52     [save_CFLAGS="$CFLAGS"
53      CFLAGS="-fno-common"
54      AC_TRY_COMPILE([],
55                     [int x;],
56                     [openafs_cv_gcc_supports_no_common=yes],
57                     [openafs_cv_gcc_supports_no_common=no])
58
59      CFLAGS="$save_CFLAGS"
60   ])
61   AS_IF([test x$openafs_cv_gcc_supports_no_common = xyes],
62         [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"])
63 ])
64
65 AC_DEFUN([OPENAFS_GCC_SUPPORTS_PIPE], [
66   AC_CACHE_CHECK([if $CC supports -pipe],
67     [openafs_cv_gcc_supports_pipe],
68     [save_CFLAGS="$CFLAGS"
69      CFLAGS="-pipe"
70      AC_TRY_COMPILE([],
71                     [int x;],
72                     [openafs_cv_gcc_supports_pipe=yes],
73                     [openafs_cv_gcc_supports_pipe=no])
74   CFLAGS="$save_CFLAGS"
75   ])
76   AS_IF([test x$openafs_cv_gcc_supports_pipe = xyes],
77           [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"])
78 ])