glibc/sysdeps/unix/sysv/linux/mips/configure.in
Andreas Jaeger c997e9d40e Update.
2004-11-05  Maciej W. Rozycki  <macro@mips.com>

	* sysdeps/mips/dl-machine.h: Include <sgidefs.h>.  Use _ABIO32,
	_ABIN32 and _ABI64 for ABI selection throughout.
	* sysdeps/mips/elf/start.S: Likewise.
	* sysdeps/mips/mips64/__longjmp.c: Likewise.
	* sysdeps/mips/mips64/bsd-_setjmp.S: Likewise.
	* sysdeps/mips/mips64/bsd-setjmp.S: Likewise.
	* sysdeps/mips/mips64/setjmp.S: Likewise.
	* sysdeps/mips/mips64/setjmp_aux.c: Likewise.
	* sysdeps/mips/sys/regdef.h: Likewise.
	* sysdeps/mips/sys/ucontext.h: Likewise.
	* sysdeps/unix/mips/sysdep.h: Likewise.
	* sysdeps/unix/sysv/linux/kernel-features.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/ptrace.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.

	* sysdeps/mips/atomicity.h: Use _ABIO32, _ABIN32 and _ABI64 for
	ABI selection throughout.
	* sysdeps/mips/bits/setjmp.h: Likewise.
	* sysdeps/mips/fpu/bits/mathdef.h: Likewise.
	* sysdeps/mips/machine-gmon.h: Likewise.
	* sysdeps/mips/sys/asm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/ptrace.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/user.h: Likewise.

	* sysdeps/mips/sgidefs.h: Prevent <asm/sgidefs.h> from being 
	included by kernel headers and undo its settings if already 
	included.  Define _ABIO32, _ABIN32 and _ABI64 if missing and use 
	them to define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32 and 
	_MIPS_SIM_ABI64 for compatibility.
	* sysdeps/unix/sysv/linux/mips/Makefile: Use _ABIO32, _ABIN32 and
	_ABI64 for ABI selection in generated syscall-list.h
	* sysdeps/unix/sysv/linux/mips/configure.in: Use _ABIO32, _ABIN32
	and _ABI64 for ABI selection in generated asm-unistd.h.
	* sysdeps/unix/sysv/linux/mips/configure: Regenerate.

	* sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Correct
	an inverted _MIPS_SIM conditional.
2004-11-24 04:39:24 +00:00

77 lines
2.1 KiB
Plaintext

sinclude(./aclocal.m4)dnl Autoconf lossage
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/mips.
case $machine in
mips*64*)
rm -f asm-unistd.h
asm_unistd_h=$sysheaders/asm/unistd.h
if test ! -f $asm_unistd_h; then
# Try to find asm/unistd.h in compiler header search path.
try_asm_unistd_h=`echo '#include <asm/unistd.h>' | $CPP - |
sed -n '/^# 1 "\(\/[^"]*\)".*/{s,,\1,p;q;}'`
if test -n "$try_asm_unistd_h" &&
test -f "$try_asm_unistd_h"; then
asm_unistd_h=$try_asm_unistd_h
fi
fi
if test ! -f "$asm_unistd_h"; then
AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed])
echo '#include <asm/unistd.h>' > asm-unistd.h
else
# The point of this preprocessing is to turn __NR_<syscall> into
# __NR_N64_<syscall>, as well as to define __NR_<syscall> to
# __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined
# and <abi> is the compiler-enabled ABI.
cat "$asm_unistd_h" |
sed -e 's,__NR_,__NR_N64_,g' \
-e 's,__NR_N64_##,__NR_##,g' \
-e 's,__NR_N64_O32_,__NR_O32_,g' \
-e 's,__NR_N64_N32_,__NR_N32_,g' \
-e 's,__NR_N64_N64_,__NR_N64_,g' \
| awk > asm-unistd.h '
BEGIN { print "#include <sgidefs.h>"; }
/^#define __NR.*unused/ { print; next; }
/^#define __NR_N64__exit __NR_N64_exit/ {
print "#define __NR__exit __NR_exit";
print "#define __NR_O32__exit __NR_O32_exit";
print "#define __NR_N32__exit __NR_N32_exit";
print; next;
}
/^#define __NR_O32_/ {
name = $2;
sub (/_O32_/, "_", name);
print;
print "#if _MIPS_SIM == _ABIO32";
print "# define " name " " $2;
print "#endif";
next;
}
/^#define __NR_N32_/ {
name = $2;
sub (/_N32_/, "_", name);
print;
print "#if _MIPS_SIM == _ABIN32";
print "# define " name " " $2;
print "#endif";
next;
}
/^#define __NR_N64_/ {
name = $2;
sub (/_N64_/, "_", name);
print;
print "#if _MIPS_SIM == _ABI64";
print "# define " name " " $2;
print "#endif";
next;
}
{
print;
}'
fi ;;
mips*)
rm -f asm-unistd.h
echo '#include <asm/unistd.h>' > asm-unistd.h
;;
esac