Whamcloud - gitweb
* init script designed for MCR by Gord Eagle, and a useful example
[fs/lustre-release.git] / lustre / archdep.m4
1 AC_MSG_CHECKING(if you are running user mode linux for $host_cpu ...)
2 if test -e $LINUX/include/asm-um ; then
3 if test  X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
4         host_cpu="um";
5         AC_MSG_RESULT(yes)
6 else
7         AC_MSG_RESULT(no (asm doesn't point at asm-um))
8 fi
9
10 else 
11         AC_MSG_RESULT(no (asm-um missing))
12 fi
13
14 AC_MSG_CHECKING(setting make flags system architecture: )
15 case ${host_cpu} in
16         um )
17         AC_MSG_RESULT($host_cpu)
18         KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
19         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 '
20         MOD_LINK=elf_i386
21 ;;
22         i*86 )
23         AC_MSG_RESULT($host_cpu)
24         KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -pipe'
25         KCPPFLAGS='-D__KERNEL__ -DMODULE '
26         MOD_LINK=elf_i386
27 ;;
28
29         alphaev6 )
30         AC_MSG_RESULT($host_cpu)
31         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
32         KCPPFLAGS='-D__KERNEL__ -DMODULE '
33         MOD_LINK=elf64alpha
34 ;;
35
36         alphaev67 )
37         AC_MSG_RESULT($host_cpu)
38         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6'
39         KCPPFLAGS='-D__KERNEL__ -DMODULE '
40         MOD_LINK=elf64alpha
41 ;;
42
43         alpha* )
44         AC_MSG_RESULT($host_cpu)
45         KCFLAGS='-g -O2  -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev5'
46         KCPPFLAGS='-D__KERNEL__ -DMODULE '
47         MOD_LINK=elf64alpha
48 ;;
49
50         ia64 )
51         AC_MSG_RESULT($host_cpu)
52         KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step'
53         KCPPFLAGS='-D__KERNEL__ -DMODULE'
54         MOD_LINK=elf64_ia64
55 ;;
56
57         sparc64 )
58         AC_MSG_RESULT($host_cpu)
59         KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -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'
60         KCPPFLAGS='-D__KERNEL__'
61         MOD_LINK=elf64_sparc
62
63 ;;
64
65         powerpc )
66         AC_MSG_RESULT($host_cpu)
67         KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
68         KCPPFLAGS='-D__KERNEL__'
69         MOD_LINK=elf32ppclinux
70 ;;
71
72         *)
73         AC_ERROR("Unknown Linux Platform: $host_cpu")
74 ;;
75 esac
76
77 AC_MSG_CHECKING(for MODVERSIONS)
78 if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
79 then
80         MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
81         AC_MSG_RESULT(yes)
82 else
83         MFLAGS=
84         AC_MSG_RESULT(no)
85 fi
86
87 AC_MSG_CHECKING(for SMP)
88 if egrep -e SMP=y $LINUX/.config >/dev/null 2>&1; then
89         SMPFLAG=
90         AC_MSG_RESULT(yes)
91 else
92         SMPFLAG=
93         AC_MSG_RESULT(no)
94 fi
95
96 CFLAGS="$KCFLAGS $MFLAGS"
97 ARCHCPPFLAGS="$KCPPFLAGS"