Move the compat_util.c handling to lkm/compat/Makefile.inc. The users

are expected to set COMPAT_UTIL_OVERRIDE to preferred emulation name
prefix.
Use this for compat_freebsd and compat_linux LKMs.
This commit is contained in:
jdolecek 2001-10-27 12:09:34 +00:00
parent 9f2548a603
commit a24e94e460
3 changed files with 20 additions and 23 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.5 2001/01/14 06:29:27 christos Exp $
# $NetBSD: Makefile.inc,v 1.6 2001/10/27 12:09:34 jdolecek Exp $
.if !target(assym.h)
S!= cd ${.CURDIR}/../../..;pwd
@ -18,5 +18,19 @@ assym.h: ${S}/kern/genassym.sh ${GENASSYM_DIR}/genassym.cf
< ${GENASSYM_DIR}/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
.if defined(COMPAT_UTIL_OVERRIDE) && !empty(COMPAT_UTIL_OVERRIDE)
# compat_util.c symbol redifinitions
CPPFLAGS+= -Demul_find=${COMPAT_UTIL_OVERRIDE}_emul_find \
-Dstackgap_init=${COMPAT_UTIL_OVERRIDE}_stackgap_init \
-Demul_flags_translate=${COMPAT_UTIL_OVERRIDE}_emul_flags_translate \
-Dstackgap_alloc=${COMPAT_UTIL_OVERRIDE}_stackgap_alloc \
-Dcompat_offseterr=${COMPAT_UTIL_OVERRIDE}_compat_offseterr
# get emul_find() and friends
.PATH: $S/compat/common
SRCS+= compat_util.c
.endif
.include "../Makefile.inc"
.endif

View File

@ -1,17 +1,12 @@
# $NetBSD: Makefile,v 1.10 2000/12/18 20:50:09 jdolecek Exp $
# $NetBSD: Makefile,v 1.11 2001/10/27 12:09:34 jdolecek Exp $
COMPAT_UTIL_OVERRIDE= freebsd
.include "../Makefile.inc"
.PATH: $S/compat/freebsd
CPPFLAGS+= -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_FREEBSD -DKTRACE
CPPFLAGS+= -nostdinc
# compat_util.c symbol redifinitions
CPPFLAGS+= -Demul_find=freebsd_emul_find \
-Dstackgap_init=freebsd_stackgap_init \
-Demul_flags_translate=freebsd_emul_flags_translate \
-Dstackgap_alloc=freebsd_stackgap_alloc \
-Dcompat_offseterr=freebsd_compat_offseterr
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE \
-I. -I${S}
@ -20,14 +15,10 @@ MKMAN= no
KMOD= compat_freebsd
# common source files
SRCS= lkminit_emul.c
SRCS+= lkminit_emul.c
SRCS+= freebsd_exec.c freebsd_file.c freebsd_ioctl.c freebsd_ipc.c \
freebsd_misc.c freebsd_ptrace.c freebsd_syscalls.c freebsd_sysent.c
# emul_find() and friends - symbols are redefined to freebsd_FOO()
.PATH: $S/compat/common
SRCS+= compat_util.c
# XXXX - temporary, not applicable for kernel with COMPAT_43, OSSAUDIO
#.PATH: $S/compat/common $S/compat/ossaudio
#SRCS+= uipc_syscalls_43.c vfs_syscalls_43.c kern_resource_43.c \

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.16 2001/07/04 10:29:16 jdolecek Exp $
# $NetBSD: Makefile,v 1.17 2001/10/27 12:09:34 jdolecek Exp $
COMPAT_UTIL_OVERRIDE= linux
.include "../Makefile.inc"
.PATH: $S/compat/linux/arch/${MACHINE_ARCH}
@ -8,11 +9,6 @@
CPPFLAGS+= -DNWSDISPLAY=1 -DSYSVSEM -DSYSVMSG -DSYSVSHM -DCOMPAT_LINUX
CPPFLAGS+= -nostdinc -DKTRACE -DNSEQUENCER=1 -DINET6
# compat_util.c symbol redifinitions
CPPFLAGS+= -Demul_find=linux_emul_find -Dstackgap_init=linux_stackgap_init\
-Demul_flags_translate=linux_emul_flags_translate \
-Dstackgap_alloc=linux_stackgap_alloc \
-Dcompat_offseterr=linux_compat_offseterr
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D_KERNEL \
-I. -I${S} -DCOMPAT_LINUX -D_LKM
@ -29,10 +25,6 @@ SRCS+= linux_cdrom.c linux_errno.c linux_exec.c linux_file.c \
SRCS+= linux_machdep.c linux_syscalls.c linux_sysent.c
SRCS+= linux_fdio.c linux_hdio.c linux_blkio.c
# emul_find() and friends - symbols are redefined to linux_FOO()
.PATH: $S/compat/common
SRCS+= compat_util.c
# XXXX - temporary, not applicable for kernel with COMPAT_43, OSSAUDIO
#.PATH: $S/compat/common $S/compat/ossaudio
#SRCS+= vfs_syscalls_43.c kern_resource_43.c kern_info_43.c ossaudio.c