Whamcloud - gitweb
0ae4905646fa6c241f31a66ec26054529ad84d86
[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         DIRS24="mds"
5         FSMOD="mds_ext3"
6         AC_MSG_RESULT(yes)
7 else
8         linux25=no
9         DIRS24="mds extN"
10         FSMOD="mds_extN"
11         AC_MSG_RESULT(no)
12 fi
13 AC_SUBST(DIRS24)
14 AC_SUBST(FSMOD)
15 ## AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
16
17 AC_MSG_CHECKING(if you are running user mode linux for $host_alias..)
18 if test -e $LINUX/include/asm-um ; then
19 if test  X`ls -id $LINUX/include/asm | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
20         host_cpu="um";
21         AC_MSG_RESULT(yes)
22 else
23         AC_MSG_RESULT(no)
24 fi
25
26 else 
27         AC_MSG_RESULT(no)
28 fi
29
30 AC_MSG_CHECKING(setting make flags system architecture: )
31 case ${host_cpu} in
32         um )
33         AC_MSG_RESULT($host_cpu)
34         KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
35         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 '
36         MOD_LINK=elf_i386
37 ;;
38         i*86 )
39         AC_MSG_RESULT($host_cpu)
40         KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -pipe'
41         KCPPFLAGS='-D__KERNEL__ -DMODULE '
42         MOD_LINK=elf_i386
43 ;;
44
45         alphaev6 )
46         AC_MSG_RESULT($host_cpu)
47         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'
48         KCPPFLAGS='-D__KERNEL__ -DMODULE '
49         MOD_LINK=elf64alpha
50 ;;
51
52         alphaev67 )
53         AC_MSG_RESULT($host_cpu)
54         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'
55         KCPPFLAGS='-D__KERNEL__ -DMODULE '
56         MOD_LINK=elf64alpha
57 ;;
58
59         alpha* )
60         AC_MSG_RESULT($host_cpu)
61         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'
62         KCPPFLAGS='-D__KERNEL__ -DMODULE '
63         MOD_LINK=elf64alpha
64 ;;
65
66         ia64 )
67         AC_MSG_RESULT($host_cpu)
68         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'
69         KCPPFLAGS='-D__KERNEL__ -DMODULE'
70         MOD_LINK=elf64_ia64
71 ;;
72
73         sparc64 )
74         AC_MSG_RESULT($host_cpu)
75         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'
76         KCPPFLAGS='-D__KERNEL__'
77         MOD_LINK=elf64_sparc
78
79 ;;
80
81         powerpc )
82         AC_MSG_RESULT($host_cpu)
83         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'
84         KCPPFLAGS='-D__KERNEL__'
85         MOD_LINK=elf32ppclinux
86 ;;
87
88         *)
89         AC_ERROR("Unknown Linux Platform: $host_cpu")
90 ;;
91 esac
92
93 AC_MSG_CHECKING(for MODVERSIONS)
94 if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
95 then
96         MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
97         AC_MSG_RESULT(yes)
98 else
99         MFLAGS=
100         AC_MSG_RESULT(no)
101 fi
102
103 AC_MSG_CHECKING(for SMP)
104 if egrep -e SMP=y $LINUX/.config >/dev/null 2>&1; then
105         SMPFLAG=
106         AC_MSG_RESULT(yes)
107 else
108         SMPFLAG=
109         AC_MSG_RESULT(no)
110 fi
111
112 CFLAGS="$KCFLAGS $MFLAGS"
113 ARCHCPPFLAGS="$KCPPFLAGS"