diff --git a/src/config/config.c b/src/config/config.c index 0967126f85..5512d67e80 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "AFS_component_version_number.c" @@ -24,8 +25,9 @@ main(int argc, char **argv) { register FILE *infile; register FILE *outfile; - char *alist[3]; + char *alist[5]; register int code; + char *sysname; if (argc != 4) { printf @@ -42,9 +44,20 @@ main(int argc, char **argv) printf("config: output file %s not found.\n", argv[2]); exit(1); } + memset (alist, 0, sizeof (alist)); alist[0] = argv[3]; alist[1] = "all"; - alist[2] = NULL; + + /* This allows JUST arch or JUST OS/version, + * Linux 2.6 uses the in-kernel build system, so + * just 'linux26' is enough. */ + sysname = strdup (alist[0]); + alist[2] = strchr (sysname, '_'); + if (alist[2]) { + alist[3] = sysname; + *alist[2] = 0; + alist[2]++; + } code = mc_copy(infile, outfile, alist); if (code) { printf("config: failed to correctly write makefile '%s', code %d\n", diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 620de5095c..e828750441 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -35,7 +35,7 @@ COMMON_DEFINES=-D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ # System specific build commands and flags - + # All the platform-specific and kernel-related things are provided by # the kernel build system. So we should _not_ use COMMON_KERN_CFLAGS! CCFLAGS = -Wno-strict-prototypes @@ -104,9 +104,9 @@ DESTDIRS=linux_destdirs include Makefile.common - + LINUX_MODULE_EXT=ko - + LINUX_MODULE_EXT=o @@ -229,7 +229,7 @@ libafs.ep: $(LIBAFS_EP) libafs.bm: $(LIBAFS_BM) echo BM Build Complete - + ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko cp libafs.ko $@ @@ -239,7 +239,7 @@ libafs.ko: .FORCE @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules - + ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(RM) -f $@ $(LD) -r -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)