usermode-linux-configure-cleanup-20030808
authorKris Van Hees <aedil-afs@alchar.org>
Mon, 11 Aug 2003 20:29:21 +0000 (20:29 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 11 Aug 2003 20:29:21 +0000 (20:29 +0000)
clean up configure test for usermode linux

acinclude.m4
src/config/afs_sysnames.h
src/libafs/MakefileProto.LINUX.in

index 170c6f6..acccc89 100644 (file)
@@ -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 <linux/autoconf.h>],
+                        [#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)
index 53cd0e9..d42e882 100644 (file)
@@ -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
  *
 #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)
index 434eea5..ea8ff63 100644 (file)
@@ -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
 <i386_linux22 i386_linux24>
 CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@
@@ -42,7 +44,7 @@ CCFLAGS = $(COMMON_KERN_CFLAGS) -mcmodel=kernel
 DEFINES = $(COMMON_DEFINES) 
 
 <i386_umlinux22 i386_umlinux24>
-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
 
 <alpha_linux_22 alpha_linux_24>
@@ -95,7 +97,6 @@ DESTDIRS=linux_destdirs
 
 include Makefile.common
 
-LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@
 LINUX_MODULE_NAME=
 LOCAL_SMP_DEF=