]>
Commit | Line | Data |
---|---|---|
1 | sinclude(./aclocal.m4)dnl Autoconf lossage | |
2 | GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. | |
3 | # Local configure fragment for sysdeps/unix/sysv/linux/mips. | |
4 | ||
5 | case $machine in | |
6 | mips*64*) | |
7 | rm -f asm-unistd.h | |
8 | asm_unistd_h=$sysheaders/asm/unistd.h | |
9 | if test ! -f $asm_unistd_h; then | |
10 | # Try to find asm/unistd.h in compiler header search path. | |
11 | try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - | | |
12 | sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'` | |
13 | if test -n "$try_asm_unistd_h" && | |
14 | test -f "$try_asm_unistd_h"; then | |
15 | asm_unistd_h=$try_asm_unistd_h | |
16 | fi | |
17 | fi | |
18 | if test ! -f "$asm_unistd_h"; then | |
19 | AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed]) | |
20 | echo '#include <asm/unistd.h>' > asm-unistd.h | |
21 | elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then | |
22 | # The point of this preprocessing is to turn __NR_<syscall> into | |
23 | # __NR_N64_<syscall>, as well as to define __NR_<syscall> to | |
24 | # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined | |
25 | # and <abi> is the compiler-enabled ABI. | |
26 | cat "$asm_unistd_h" | | |
27 | sed -e 's,__NR_,__NR_N64_,g' \ | |
28 | -e 's,__NR_N64_##,__NR_##,g' \ | |
29 | -e 's,__NR_N64_O32_,__NR_O32_,g' \ | |
30 | -e 's,__NR_N64_N32_,__NR_N32_,g' \ | |
31 | -e 's,__NR_N64_N64_,__NR_N64_,g' \ | |
32 | | awk > asm-unistd.h ' | |
33 | BEGIN { print "#include <sgidefs.h>"; } | |
34 | /^#define __NR.*unused/ { print; next; } | |
35 | /^#define __NR_N64__exit __NR_N64_exit/ { | |
36 | print "#define __NR__exit __NR_exit"; | |
37 | print "#define __NR_O32__exit __NR_O32_exit"; | |
38 | print "#define __NR_N32__exit __NR_N32_exit"; | |
39 | print; next; | |
40 | } | |
41 | /^#define __NR_O32_/ { | |
42 | name = $2; | |
43 | sub (/_O32_/, "_", name); | |
44 | print; | |
45 | print "#if _MIPS_SIM == _ABIO32"; | |
46 | print "# define " name " " $2; | |
47 | print "#endif"; | |
48 | next; | |
49 | } | |
50 | /^#define __NR_N32_/ { | |
51 | name = $2; | |
52 | sub (/_N32_/, "_", name); | |
53 | print; | |
54 | print "#if _MIPS_SIM == _ABIN32"; | |
55 | print "# define " name " " $2; | |
56 | print "#endif"; | |
57 | next; | |
58 | } | |
59 | /^#define __NR_N64_/ { | |
60 | name = $2; | |
61 | sub (/_N64_/, "_", name); | |
62 | print; | |
63 | print "#if _MIPS_SIM == _ABI64"; | |
64 | print "# define " name " " $2; | |
65 | print "#endif"; | |
66 | next; | |
67 | } | |
68 | { | |
69 | print; | |
70 | }' | |
71 | else | |
72 | echo '#include <asm/unistd.h>' > asm-unistd.h | |
73 | fi ;; | |
74 | mips*) | |
75 | rm -f asm-unistd.h | |
76 | echo '#include <asm/unistd.h>' > asm-unistd.h | |
77 | ;; | |
78 | esac |