From f910d769edd08ae563680f885acfebe43ac251f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann?= Date: Mon, 10 Oct 2005 18:35:00 +0000 Subject: [PATCH] Add --disable-kernel-module option. Patch from Pascal Terjan. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Mon Oct 10 14:33:50 2005 Søren Sandmann * configure.ac: Add --disable-kernel-module option. Patch from Pascal Terjan. --- ChangeLog | 5 +++++ Makefile.am | 2 +- configure.ac | 55 ++++++++++++++++++++++++++++++++++--------------------- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0107815..68487ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 10 14:33:50 2005 Søren Sandmann + + * configure.ac: Add --disable-kernel-module option. Patch from + Pascal Terjan. + Mon Oct 10 13:00:20 2005 Robert Love * module/sysprof-module.c: Don't use INTERVAL or SAMPLES_PER_SECOND diff --git a/Makefile.am b/Makefile.am index d477a8e..975d2bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = module +SUBDIRS = $(MODULE_SUBDIR) DIST_SUBDIRS = module bin_PROGRAMS = sysprof sysprof-text diff --git a/configure.ac b/configure.ac index f58f48e..4b52ef9 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,39 @@ AC_ARG_WITH(separate-debug-dir, AC_DEFINE_DIR(DEBUGDIR, debugdir, [Look for global separate debug info in this path]) +AC_ARG_ENABLE(kernel-module, + AC_HELP_STRING(--disable-kernel-module, disable building kernel module)) + +kernel_module="yes" +if test "x$enableval" = "xno"; then + kernel_module="no" +fi + +if test $kernel_module = "yes"; then + # Activate build in module/ subdir + MODULE_SUBDIR=module + + # Kernel version + KMAJOR=`uname -r | cut -d"." -f 1` + KMINOR=`uname -r | cut -d"." -f 2` + KMICRO=`uname -r | cut -d"." -f 3 | cut -d"-" -f 1` + + if [[ $KMICRO -lt 11 ]] ; then + echo * + echo * Linux \>= 2.6.11 is required + echo * + exit 1 + fi + + if [ ! test -f /lib/modules/`uname -r`/build/Makefile ] ; then + echo \* + echo \* Sysprof requires the kernel source code to be installed. + echo \* On a Fedora Core system the relevant package is kernel-devel + echo \* + exit 1 + fi +fi + # Pkgconfig dependencies dep_modules="gtk+-2.0 > 2.6.0 gthread-2.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0" @@ -65,30 +98,10 @@ AC_CHECK_LIB(bfd, bfd_get_error, [DEP_LIBS="$DEP_LIBS -lbfd -liberty"], # emit files AC_SUBST(DEP_LIBS) +AC_SUBST(MODULE_SUBDIR) AC_CONFIG_FILES([ Makefile ]) -# Kernel version - -KMAJOR=`uname -r | cut -d"." -f 1` -KMINOR=`uname -r | cut -d"." -f 2` -KMICRO=`uname -r | cut -d"." -f 3 | cut -d"-" -f 1` - -if [[ $KMICRO -lt 11 ]] ; then - echo * - echo * Linux \>= 2.6.11 is required - echo * - exit 1 -fi - -if [ ! test -f /lib/modules/`uname -r`/build/Makefile ] ; then - echo \* - echo \* Sysprof requires the kernel source code to be installed. - echo \* On a Fedora Core system the relevant package is kernel-devel - echo \* - exit 1 -fi - AC_OUTPUT -- 2.7.4