chiark / gitweb /
build-sys: use more generic regular expression to generate syscall-list.txt correctly
authorHuang Hang <seakage2h@gmail.com>
Thu, 9 Aug 2012 03:22:08 +0000 (11:22 +0800)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Aug 2012 10:21:04 +0000 (12:21 +0200)
Currently MIPS and ARM define syscall numbers for multiple ABI in one
<asm/unistd.h>. The #define statments for each syscall are formated as:

 #define __NR_scname (BASE_OFFSET + sc_number)

Thus we need a more generic regular expression to match these in awk.

Makefile.am

index da0b6f50b0f586520c41b8902618b927cb863617..ad8f71d821c3edb9f819df59305b9a8400f94d0c 100644 (file)
@@ -1030,7 +1030,7 @@ BUILT_SOURCES += \
 
 src/core/syscall-list.txt: Makefile
        $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
+       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+\(?.*[0-9]+.*\)?/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
 
 src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile
        $(AM_V_at)$(MKDIR_P) $(dir $@)