Whamcloud - gitweb
- 2.5 fixes for MDS
[fs/lustre-release.git] / lustre / archdep.m4
1 AC_MSG_CHECKING(if you are running linux 2.5...)
2 if test -e $LINUX/include/linux/namei.h ; then
3         linux25=yes
4         AC_MSG_RESULT(yes)
5 else
6         linux25=no
7         AC_MSG_RESULT(no)
8 fi
9 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
10
11 AC_MSG_CHECKING(if you are running user mode linux for $host_alias..)
12 if test -e $LINUX/include/asm-um ; then
13 if test  X`ls -id $LINUX/include/asm | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
14         host_cpu="um";
15         AC_MSG_RESULT(yes)
16 else
17         AC_MSG_RESULT(no)
18 fi
19
20 else 
21         AC_MSG_RESULT(no)
22 fi
23
24 AC_MSG_CHECKING(setting make flags system architecture: )
25 case ${host_cpu} in
26         um )
27         AC_MSG_RESULT($host_cpu)
28         KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
29         KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE  -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include '
30         MOD_LINK=elf_i386
31 ;;
32         i*86 )
33         AC_MSG_RESULT($host_cpu)
34         KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -pipe'
35         KCPPFLAGS='-D__KERNEL__ -DMODULE '
36         MOD_LINK=elf_i386
37 ;;
38
39         alphaev6 )
40         AC_MSG_RESULT($host_cpu)
41         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
42         KCPPFLAGS='-D__KERNEL__ -DMODULE '
43         MOD_LINK=elf64alpha
44 ;;
45
46         alphaev67 )
47         AC_MSG_RESULT($host_cpu)
48         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
49         KCPPFLAGS='-D__KERNEL__ -DMODULE '
50         MOD_LINK=elf64alpha
51 ;;
52
53         alpha* )
54         AC_MSG_RESULT($host_cpu)
55         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev5'
56         KCPPFLAGS='-D__KERNEL__ -DMODULE '
57         MOD_LINK=elf64alpha
58 ;;
59
60         ia64 )
61         AC_MSG_RESULT($host_cpu)
62         KCFLAGS='-Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step'
63         KCPPFLAGS='-D__KERNEL__ -DMODULE'
64         MOD_LINK=elf64_ia64
65 ;;
66
67         sparc64 )
68         AC_MSG_RESULT($host_cpu)
69         KCFLAGS='-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
70         KCPPFLAGS='-D__KERNEL__'
71         MOD_LINK=elf64_sparc
72
73 ;;
74
75         powerpc )
76         AC_MSG_RESULT($host_cpu)
77         KCFLAGS='-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
78         KCPPFLAGS='-D__KERNEL__'
79         MOD_LINK=elf32ppclinux
80 ;;
81
82         *)
83         AC_ERROR("Unknown Linux Platform: $host_cpu")
84 ;;
85 esac
86
87 AC_MSG_CHECKING(for MODVERSIONS)
88 if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
89 then
90         MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
91         AC_MSG_RESULT(yes)
92 else
93         MFLAGS=
94         AC_MSG_RESULT(no)
95 fi
96
97 AC_MSG_CHECKING(for SMP)
98 if egrep -e SMP=y $LINUX/.config >/dev/null 2>&1; then
99         SMPFLAG=
100         AC_MSG_RESULT(yes)
101 else
102         SMPFLAG=
103         AC_MSG_RESULT(no)
104 fi
105
106 CFLAGS="$KCFLAGS $MFLAGS"
107 ARCHCPPFLAGS="$KCPPFLAGS"