about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/Makefile')
-rw-r--r--sysdeps/unix/sysv/linux/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index d25e0525ca..8c9fcfe934 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -16,8 +16,29 @@ endif
 
 ifeq ($(subdir), misc)
 sysdep_routines += mount umount xmknod s_ptrace s_sysctl sysctl llseek \
-setfsgid setfsuid sysinfo uselib
+setfsgid setfsuid sysinfo uselib s_reboot
 headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h
+
+install-others += $(includedir)/sys/syscall.h
+
+$(includedir)/sys/syscall.h::
+	@rm -f $(objpfx)syscall.h $(objpfx)syscall.sed
+	@(os=`uname -sr`; \
+	  echo -e '1i\\\n#ifndef _SYS_SYSCALL_H\\'; \
+	  echo -e '#define _SYS_SYSCALL_H\t1\\\n\\'; \
+	  echo -e -n '/* This file is automatically generated as part of '; \
+	  echo -e 'GNU libc-$(version)\\'; \
+	  echo -e "   on a system running $$os.  */\\"; echo; \
+	  echo -e -n 's/#define __NR_\\([A-Za-z0-9_]*\\)[ \t]*__NR_\\(.*\\)/';\
+	  echo -e '#define SYS_\\1 SYS_\\2/p'; \
+	  echo -e -n 's/#define __NR_\\([A-Za-z0-9_]*\\)[ \t]*\\(.*\\)/';\
+	  echo -e '#define SYS_\\1 \\2/p'; \
+	  echo -e '$$i\\\n\\\n#endif\t/* sys/syscall.h */\nd') \
+	    >  $(objpfx)syscall.sed
+	set -- `echo '#include <asm/unistd.h>'|$(CC) -M -E -`; \
+	sed -f $(objpfx)syscall.sed $$2 > $(objpfx)syscall.h
+	$(INSTALL_DATA) $(objpfx)syscall.h $@
+	rm -f $(objpfx)syscall.h $(objpfx)syscall.sed
 endif
 
 ifeq ($(subdir), time)