Index: lib/libsysdecode/Makefile =================================================================== --- lib/libsysdecode/Makefile +++ lib/libsysdecode/Makefile @@ -123,7 +123,7 @@ DEPENDOBJS+= tables.h tables.h: mktables - sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET} + sh ${.CURDIR}/mktables ${MACHINE} ${SRCTOP}/sys ${.TARGET} # mkioctls runs find(1) for headers so needs to rebuild every time. This used # to be a hack only done in buildworld. Index: lib/libsysdecode/mktables =================================================================== --- lib/libsysdecode/mktables +++ lib/libsysdecode/mktables @@ -37,12 +37,13 @@ if [ -z "$1" ] then - echo "usage: sh $0 include-dir [output-file]" + echo "usage: sh $0 machine include-dir [output-file]" exit 1 fi -include_dir=$1 -if [ -n "$2" ]; then - output_file="$2" +machine=$1 +include_dir=$2 +if [ -n "$3" ]; then + output_file="$3" output_tmp=$(mktemp -u) exec > "$output_tmp" fi @@ -101,7 +102,7 @@ gen_table "flockops" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" gen_table "kldsymcmd" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" -gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" +gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "sys/aio.h" gen_table "madvisebehav" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" gen_table "minheritflags" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" gen_table "mlockallflags" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" @@ -162,10 +163,11 @@ gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+((CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\))|(\(CAP_[A-Z_]+[[:space:]]*\|.*\)))" "sys/capsicum.h" gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" gen_table "cmsgtypesocket" "SCM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/socket.h" -if [ -e "${include_dir}/x86/sysarch.h" ]; then - gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" +#if [ -e "${include_dir}/x86/include/sysarch.h" ]; then +if [ "$machine" == "amd64" ] || [ "$machine" == "i386" ]; then + gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/include/sysarch.h" else - gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h" + gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "${machine}/include/sysarch.h" fi gen_table "shmflags" "SHM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/mman.h" "SHM_ANON"