about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/configure.in
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-03-17 15:50:05 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-03-17 15:50:05 +0000
commitc27d68482ce992ff3675da796766b3c04b9b0f84 (patch)
tree8542f43332f098067571c04655ac0c45c71ed9f2 /sysdeps/unix/sysv/linux/mips/configure.in
parent935af0f27f2313e3a78160e90f1a8f118c3f46ec (diff)
downloadglibc-c27d68482ce992ff3675da796766b3c04b9b0f84.tar.gz
glibc-c27d68482ce992ff3675da796766b3c04b9b0f84.tar.xz
glibc-c27d68482ce992ff3675da796766b3c04b9b0f84.zip
* sysdeps/unix/sysv/linux/mips/configure.in: New. Pre-process asm/unistd.h into asm-unistd.h. * sysdeps/unix/sysv/linux/mips/configure: Generated. * sysdeps/unix/sysv/linux/mips/Makefile: Do custom processing of syscall list. * sysdeps/unix/sysv/linux/mips/sys/syscall.h: New file. * sysdeps/unix/sysv/linux/mips/clone.S: Don't include asm/unistd.h.
	* sysdeps/unix/sysv/linux/mips/configure.in: New.  Pre-process
	asm/unistd.h into asm-unistd.h.
	* sysdeps/unix/sysv/linux/mips/configure: Generated.
	* sysdeps/unix/sysv/linux/mips/Makefile: Do custom processing
	of syscall list.
	* sysdeps/unix/sysv/linux/mips/sys/syscall.h: New file.
	* sysdeps/unix/sysv/linux/mips/clone.S: Don't include
	asm/unistd.h.

2003-03-17  Alexandre Oliva  <aoliva@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/configure.in')
-rw-r--r--sysdeps/unix/sysv/linux/mips/configure.in75
1 files changed, 75 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/configure.in b/sysdeps/unix/sysv/linux/mips/configure.in
new file mode 100644
index 0000000000..3df0c91b30
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/configure.in
@@ -0,0 +1,75 @@
+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 '
+/^#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 == _MIPS_SIM_ABI32";
+	print "# define " name " " $2;
+	print "#endif";
+	next;
+}
+/^#define __NR_N32_/ {
+	name = $2;
+	sub (/_N32_/, "_", name);
+	print;
+	print "#if defined _ABIN32 && _MIPS_SIM == _ABIN32";
+	print "# define " name " " $2;
+	print "#endif";
+	next;
+}
+/^#define __NR_N64_/ {
+	name = $2;
+	sub (/_N64_/, "_", name);
+	print;
+	print "#if defined _ABI64 && _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