bison = find_program('bison')
flex = find_program('flex')
+awk = find_program('gawk', 'mawk', 'nawk', 'awk')
build_hwclock = not get_option('build-hwclock').disabled()
bison_gen = generator(
errnos_h = custom_target('errnos.h',
input : 'tools/all_errnos',
output : 'errnos.h',
- command : ['tools/all_errnos', cc.cmd_array(), get_option('c_args')],
+ command : ['tools/all_errnos', awk.full_path(),
+ cc.cmd_array(), get_option('c_args')],
)
opt = not get_option('build-lsfd').require(lib_rt.found()).disabled()
syscalls_h = custom_target('syscalls.h',
input : 'tools/all_syscalls',
output : 'syscalls.h',
- command : ['tools/all_syscalls', cc.cmd_array(), get_option('c_args')],
+ command : ['tools/all_syscalls', awk.full_path(),
+ cc.cmd_array(), get_option('c_args')],
)
if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
errnos.h: $(top_srcdir)/tools/all_errnos
@echo ' GEN $@'
- @$(top_srcdir)/tools/all_errnos $(CC) $(CFLAGS)
+ @$(top_srcdir)/tools/all_errnos "$(AWK)" $(CC) $(CFLAGS)
-include errnos.h.deps
CLEANFILES += errnos.h errnos.h.deps
syscalls.h: $(top_srcdir)/tools/all_syscalls
@echo ' GEN $@'
- @$(top_srcdir)/tools/all_syscalls $(CC) $(CFLAGS)
+ @$(top_srcdir)/tools/all_syscalls "$(AWK)" $(CC) $(CFLAGS)
-include syscalls.h.deps
CLEANFILES += syscalls.h syscalls.h.deps
set -e
set -o pipefail
+AWK="$1"
+shift
OUTPUT=errnos.h
ERRNO_INCLUDES="
#include <sys/errno.h>
trap 'rm -f $OUTPUT $OUTPUT.deps' ERR
"$@" -MD -MF "$OUTPUT.deps" <<< "$ERRNO_INCLUDES" -dM -E - \
- | gawk 'match($0, /^#[ \t]*define[ \t]*E([^ ]+)/, res) { print "UL_ERRNO(\"E" res[1] "\", E" res[1] ")" }' \
+ | "$AWK" 'match($0, /^#[ \t]*define[ \t]*E([^ ]+)/, res) { print "UL_ERRNO(\"E" res[1] "\", E" res[1] ")" }' \
| sort \
> "$OUTPUT"
set -e
set -o pipefail
+AWK="$1"
+shift
OUTPUT=syscalls.h
SYSCALL_INCLUDES="
#include <sys/syscall.h>
trap 'rm -f $OUTPUT $OUTPUT.deps' ERR
"$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \
- | gawk 'match($0, /^#define __NR_([^ ]+)/, res) { print "UL_SYSCALL(\"" res[1] "\", __NR_" res[1] ")" }' \
+ | "$AWK" 'match($0, /^#define __NR_([^ ]+)/, res) { print "UL_SYSCALL(\"" res[1] "\", __NR_" res[1] ")" }' \
| sort \
> "$OUTPUT"