configure-allow-kernel-debugging-support-20020310
authorDerek Atkins <warlord@mit.edu>
Sun, 10 Mar 2002 18:39:45 +0000 (18:39 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 10 Mar 2002 18:39:45 +0000 (18:39 +0000)
currently for linux only, but allow it for others in the future

acinclude.m4
src/libafs/MakefileProto.LINUX.in

index 95f6a53..b97d81e 100644 (file)
@@ -47,6 +47,9 @@ AC_ARG_ENABLE(transarc-paths,
 AC_ARG_ENABLE(tivoli-tsm,
 [  --enable-tivoli-tsm                 Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no"
 )
+AC_ARG_ENABLE(debug-kernel,
+[  --enable-debug-kernel               enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no"
+)
 
 dnl weird ass systems
 AC_AIX
@@ -67,6 +70,11 @@ AM_PROG_LEX
 
 OPENAFS_CHECK_BIGENDIAN
 
+KERN_DEBUG_OPT=
+if test "x$enable_debug_kernel" = "xyes"; then
+  KERN_DEBUG_OPT=-g
+fi
+
 AC_MSG_CHECKING(your OS)
 system=$host
 case $system in
@@ -117,6 +125,11 @@ case $system in
                fi
                AC_MSG_RESULT(linux)
                if test "x$enable_kernel_module" = "xyes"; then
+                OMIT_FRAME_POINTER=
+                if test "x$enable_debug_kernel" = "xno"; then
+                       OMIT_FRAME_POINTER=-fomit-frame-pointer
+                fi
+                AC_SUBST(OMIT_FRAME_POINTER)
                 ifdef([OPENAFS_CONFIGURE_LIBAFS],
                   [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
                   [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
@@ -202,6 +215,7 @@ case $system in
                 AC_MSG_RESULT($system)
                 ;;
 esac
+AC_SUBST(KERN_DEBUG_OPT)
 
 if test "x$with_afs_sysname" != "x"; then
         AFS_SYSNAME="$with_afs_sysname"
index 27455e2..6c034d0 100644 (file)
@@ -6,8 +6,10 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 srcdir=@srcdir@
-include @TOP_OBJDIR@/src/config/Makefile.config
+KDEBUG=@KERN_DEBUG_OPT@
+FOMIT=@FOMIT_FRAME_POINTER@
 
+include @TOP_OBJDIR@/src/config/Makefile.config
 
 # OS specific object files:
 AFS_OS_OBJS = \
@@ -37,40 +39,41 @@ CC = gcc
 LD = ld
 # -Wall
 <i386_linux22 i386_linux24>
-CCFLAGS =   -O2 -fomit-frame-pointer \
+CCFLAGS =  $(KDEBUG) -O2 $(FOMIT) \
        -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
        -malign-functions=2
 DEFINES = -D__KERNEL__  -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
 <alpha_linux_22 alpha_linux_24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <s390_linux22 s390_linux24>
-CCFLAGS =   -O -fomit-frame-pointer -fno-strength-reduce \
+CCFLAGS =   -O $(FOMIT) -fno-strength-reduce \
        -fno-strict-aliasing -fsigned-char 
 DEFINES = -D__KERNEL__  -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <sparc_linux22 sparc_linux24>
 LD = ld -m elf32_sparc
-CCFLAGS =   -O2 -fomit-frame-pointer \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
        -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
 DEFINES = -D__KERNEL__  -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <sparc64_linux22 sparc64_linux24>
 CC = sparc64-linux-gcc
 LD = ld -m elf64_sparc
-CCFLAGS =   -O2 -fomit-frame-pointer \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
        -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
 DEFINES = -D__KERNEL__  -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <ppc_linux22 ppc_linux24>
-CCFLAGS =   -O2 -fomit-frame-pointer -fno-strength-reduce \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce \
        -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
        -fno-builtin -ffixed-r2
 DEFINES = -D__KERNEL__  -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <parisc_linux24>
-CCFLAGS =   -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fno-strength-reduce \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
+       -fno-strict-aliasing -fno-common -fno-strength-reduce \
         -fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
         -mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
 DEFINES = -D__KERNEL__  -D__linux__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <ia64_linux24>
-CCFLAGS =   -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) -fno-strict-aliasing -pipe \
        -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
 <all>