From be95c11413b06f4a3e6007e46c04a1e0bf34c70e Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Mon, 11 Aug 2003 20:29:21 +0000 Subject: [PATCH] usermode-linux-configure-cleanup-20030808 clean up configure test for usermode linux --- acinclude.m4 | 18 ++++++++++++------ src/config/afs_sysnames.h | 9 +++++---- src/libafs/MakefileProto.LINUX.in | 5 +++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 170c6f6..acccc89 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -558,13 +558,19 @@ else fi _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` AFS_SYSNAME="$_AFS_SYSNAME" - if test -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then - AFS_ISUML=`awk '$[]2 == "CONFIG_USERMODE"{print $[]3}' $LINUX_KERNEL_PATH/include/linux/autoconf.h` - if test "x${AFS_ISUML}" = "x1"; then - _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` - fi - AFS_SYSNAME="$_AFS_SYSNAME" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" + AC_TRY_COMPILE( + [#include ], + [#ifndef CONFIG_USERMODE + #error not UML + #endif], + ac_cv_linux_is_uml=yes,) + if test "${ac_cv_linux_is_uml}" = yes; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` fi + CPPFLAGS="$save_CPPFLAGS" + AFS_SYSNAME="$_AFS_SYSNAME" ;; esac AC_MSG_RESULT($AFS_SYSNAME) diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 53cd0e9..d42e882 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -7,10 +7,6 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define SYS_NAME_ID_i386_umlinux2 2700 -#define SYS_NAME_ID_i386_umlinux22 2701 -#define SYS_NAME_ID_i386_umlinux24 2702 - /* * File: afs_sysnames.h * @@ -194,6 +190,11 @@ #define SYS_NAME_ID_amd64_linux2 2700 #define SYS_NAME_ID_amd64_linux22 2701 #define SYS_NAME_ID_amd64_linux24 2702 + +#define SYS_NAME_ID_i386_umlinux2 2800 +#define SYS_NAME_ID_i386_umlinux22 2801 +#define SYS_NAME_ID_i386_umlinux24 2802 + /* * Placeholder to keep system-wide standard flags since this file is included by all * files (i.e in afs/param.h) diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 434eea5..ea8ff63 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -32,6 +32,8 @@ COMMON_KERN_CFLAGS=$(KERN_DBG) $(KERN_OPTMZ) @LINUX_GCC_KOPTS@ COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} +LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ + # System specific build commands and flags CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ @@ -42,7 +44,7 @@ CCFLAGS = $(COMMON_KERN_CFLAGS) -mcmodel=kernel DEFINES = $(COMMON_DEFINES) -CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -I/usr/src/linux/arch/um/include -I/usr/src/linux/arch/um/kernel/tt/include -I/usr/src/linux/arch/um/kernel/skas/include +CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include DEFINES = $(COMMON_DEFINES) -DCPU=586 @@ -95,7 +97,6 @@ DESTDIRS=linux_destdirs include Makefile.common -LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ LINUX_MODULE_NAME= LOCAL_SMP_DEF= -- 1.9.4