From: Derek Atkins Date: Thu, 12 Jul 2001 18:18:53 +0000 (+0000) Subject: add-redhat-buildsys-enabler-in-configure-20010712 X-Git-Tag: openafs-stable-1_1_0~16 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=61aa7f4aafc2f4f980b95b5adf868e3f7d20421b add-redhat-buildsys-enabler-in-configure-20010712 to make things easier when building in a spec file environment --- diff --git a/Makefile.in b/Makefile.in index 9b33477..ee132c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,6 +44,14 @@ all: set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED) $(MAKE) install "COMPILE_PART1=cd src; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_CLEAN=; $(MAKE) clean SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} +all_nolibafs: + set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED) + $(MAKE) install TARGET=finale_nolibafs "COMPILE_PART1=cd src; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_CLEAN=; $(MAKE) clean SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} + +only_libafs: + set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED) + $(MAKE) install TARGET=libafs "COMPILE_PART1=cd src; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_CLEAN=; $(MAKE) clean SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} + project: cmd comerr config: @@ -383,6 +391,12 @@ finale: project cmd comerr afsd allrcmds butc tbutc @ENABLE_KERNEL_MODULE@ libua libafsauthent libadmin ${COMPILE_PART1} finale ${COMPILE_PART2} +finale_nolibafs: project cmd comerr afsd allrcmds butc tbutc libuafs audit kauth log package \ + ptserver scout bu_utils ubik uss bozo vfsck volser \ + venus update xstat afsmonitor dauth tests libafsrpc \ + libafsauthent libadmin + ${COMPILE_PART1} finale ${COMPILE_PART2} + # Use washtool to ensure MakefileProto is current and obj/libafs exists. libafs_setup: config export diff --git a/configure.in b/configure.in index ecf2072..a7bc132 100644 --- a/configure.in +++ b/configure.in @@ -30,6 +30,9 @@ AC_ARG_WITH(linux-kernel-headers, AC_ARG_ENABLE(kernel-module, [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes" ) +AC_ARG_ENABLE(redhat-buildsys, +[ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no" +) AC_PROG_CC @@ -68,8 +71,19 @@ case $system in if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1` if test "x$linux_kvers" = "x"; then - AC_MSG_ERROR(Linux headers lack version definition) - exit 1 + if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1` + if test "x$linux_kvers" = "x"; then + + AC_MSG_ERROR(Linux headers lack version definition [2]) + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + AC_MSG_ERROR(Linux headers lack version definition) + exit 1 + fi else LINUX_VERSION="$linux_kvers" fi diff --git a/src/cf/linux-test3.m4 b/src/cf/linux-test3.m4 index fe3ce59..202c9eb 100644 --- a/src/cf/linux-test3.m4 +++ b/src/cf/linux-test3.m4 @@ -1,60 +1,70 @@ AC_DEFUN(LINUX_NEED_RHCONFIG,[ -AC_MSG_CHECKING(for redhat kernel configuration) -if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then +if test "x$enable_redhat_buildsys" = "xyes"; then + RHCONFIG_SP="" + RHCONFIG_MP="" +else + AC_MSG_CHECKING(for redhat kernel configuration) + if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then ac_linux_rhconfig=yes - RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" - RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" + RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0 -U__SMP__" + RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1 -D__SMP__" AC_MSG_RESULT($ac_linux_rhconfig) if test ! -f "/boot/kernel.h"; then AC_MSG_WARN([/boot/kernel.h does not exist. build may fail]) fi -else + else ac_linux_rhconfig=no - RHCONFIG_SP="" - RHCONFIG_MP="" + RHCONFIG_SP="-U__SMP__" + RHCONFIG_MP="-D__SMP__" AC_MSG_RESULT($ac_linux_rhconfig) + fi fi AC_SUBST(RHCONFIG_SP) AC_SUBST(RHCONFIG_MP) ]) AC_DEFUN(LINUX_WHICH_MODULES,[ -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" -AC_MSG_CHECKING(if kernel uses MODVERSIONS) -AC_CACHE_VAL(ac_cv_linux_config_modversions,[ -AC_TRY_COMPILE( +if test "x$enable_redhat_buildsys" = "xyes"; then + MPS=Default +else + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" + AC_MSG_CHECKING(if kernel uses MODVERSIONS) + AC_CACHE_VAL(ac_cv_linux_config_modversions,[ + AC_TRY_COMPILE( [#include ], [#ifndef CONFIG_MODVERSIONS lose; #endif ], -ac_cv_linux_config_modversions=yes, -ac_cv_linux_config_modversions=no)]) -AC_MSG_RESULT($ac_cv_linux_config_modversions) -AC_MSG_CHECKING(which kernel modules to build) -if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then - MPS="MP SP" -else -AC_CACHE_VAL(ac_cv_linux_config_smp, [ -AC_TRY_COMPILE( + ac_cv_linux_config_modversions=yes, + ac_cv_linux_config_modversions=no)]) + AC_MSG_RESULT($ac_cv_linux_config_modversions) + AC_MSG_CHECKING(which kernel modules to build) + if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then + MPS="MP SP" + else + AC_CACHE_VAL(ac_cv_linux_config_smp, [ + AC_TRY_COMPILE( [#include ], [#ifndef CONFIG_SMP lose; #endif ], -ac_cv_linux_config_smp=yes, -ac_cv_linux_config_smp=no)]) -dnl AC_MSG_RESULT($ac_cv_linux_config_smp) - if test "x$ac_cv_linux_config_smp" = "xyes"; then - MPS=MP - else - MPS=SP - fi + ac_cv_linux_config_smp=yes, + ac_cv_linux_config_smp=no)]) + dnl AC_MSG_RESULT($ac_cv_linux_config_smp) + if test "x$ac_cv_linux_config_smp" = "xyes"; then + MPS=MP + else + MPS=SP + fi + fi + CPPFLAGS=$save_CPPFLAGS + AC_MSG_RESULT($MPS) fi -AC_MSG_RESULT($MPS) AC_SUBST(MPS) -CPPFLAGS=$save_CPPFLAGS]) +]) diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index c7cf7e7..94850a6 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -80,12 +80,14 @@ include Makefile.common LINUX_VERS=@LINUX_VERSION@ LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ +LINUX_MODULE_NAME= +LOCAL_SMP_DEF= setup: -rm -f h net netinet sys rpc -ln -s rx rpc for m in ${MPS} ; do \ - KDIR=$(KOBJ)-${LINUX_VERS}-$$m; \ + KDIR=$(KOBJ)-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m; \ mkdir -p $${KDIR}; \ ln -fs ../Makefile $${KDIR}/Makefile ; \ ln -fs ../Makefile.common $${KDIR}/Makefile.common; \ @@ -121,17 +123,17 @@ ${COMPDIRS}: ln -s ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm for m in ${MPS} ; do \ - KDIR=${KOBJ}-${LINUX_VERS}-$$m ; \ + KDIR=${KOBJ}-${LINUX_VERS}${LINUX_MODULE_NAME}-$$m ; \ echo Building in directory: $${KDIR} ; \ if [ "$$m" = "MP" ] ; then \ - SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ -D__SMP__" ; \ + SMP_DEF="-DAFS_SMP @RHCONFIG_MP@ ${LOCAL_SMP_DEF}" ; \ TARG="libafs.mp" ; \ else \ - SMP_DEF="@RHCONFIG_SP@ -U__SMP__" ; \ + SMP_DEF="@RHCONFIG_SP@ ${LOCAL_SMP_DEF}" ; \ TARG=libafs ; \ fi ; \ cd $${KDIR} ; \ - $(MAKE) DESTDIR=${DESTDIR} SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=${LINUX_VERS} || exit $$?; \ + $(MAKE) DESTDIR=${DESTDIR} SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT=${LINUX_VERS}${LINUX_MODULE_NAME} || exit $$?; \ cd ../ ; \ done