All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] configure: add configure checks to compile kernel modules
@ 2013-06-06 14:21 Alexey Kodanev
  2013-06-11  1:31 ` Mike Frysinger
  2013-06-11  1:32 ` Mike Frysinger
  0 siblings, 2 replies; 9+ messages in thread
From: Alexey Kodanev @ 2013-06-06 14:21 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko, Alexey Kodanev

There're new configure options added to tune modules building process.
New m4 function tries to determine if kernel-devel package is available
and sets makefile's variables (WITH_MODULES, ...) accordingly.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 configure.ac                 |    1 +
 include/mk/config.mk.default |    6 +++
 include/mk/config.mk.in      |    6 +++
 m4/ltp-kernel_devel.m4       |   72 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 m4/ltp-kernel_devel.m4

diff --git a/configure.ac b/configure.ac
index f217f50..f0fc6b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,5 +167,6 @@ LTP_CHECK_MADVISE
 LTP_CHECK_ACL_SUPPORT
 LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_MREMAP_FIXED
+LTP_CHECK_KERNEL_DEVEL
 
 AC_OUTPUT
diff --git a/include/mk/config.mk.default b/include/mk/config.mk.default
index bd364a6..558e856 100644
--- a/include/mk/config.mk.default
+++ b/include/mk/config.mk.default
@@ -73,4 +73,10 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KBUILD_RELEASE		:=
+KBUILD_DIR		:=
+KBUILD_VERSION		:=
+KBUILD_PATCHLEVEL	:=
+WITH_MODULES		:= no
+
 export datarootdir includedir libdir mandir prefix
diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
index b835c86..d38e5f1 100644
--- a/include/mk/config.mk.in
+++ b/include/mk/config.mk.in
@@ -75,6 +75,12 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KBUILD_RELEASE		:= @KBUILD_RELEASE@
+KBUILD_DIR		:= @KBUILD_DIR@
+KBUILD_VERSION		:= @KBUILD_VERSION@
+KBUILD_PATCHLEVEL	:= @KBUILD_PATCHLEVEL@
+WITH_MODULES		:= @WITH_MODULES@
+
 ifeq ($(strip $(prefix)),)
 $(error you are using $$(prefix) incorrectly -- set it to $(abs_top_srcdir) if you want to build in the source tree)
 endif
diff --git a/m4/ltp-kernel_devel.m4 b/m4/ltp-kernel_devel.m4
new file mode 100644
index 0000000..cf4a56e
--- /dev/null
+++ b/m4/ltp-kernel_devel.m4
@@ -0,0 +1,72 @@
+dnl Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation.
+dnl
+dnl This program is distributed in the hope that it would be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write the Free Software Foundation,
+dnl Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+dnl
+dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+dnl
+
+dnl
+dnl LTP_CHECK_KERNEL_DEVEL
+dnl ----------------------------
+dnl Building kernel modules
+dnl requires kernel-devel installed
+dnl
+
+AC_DEFUN([LTP_CHECK_KERNEL_DEVEL],
+[
+AC_ARG_WITH(
+	    [kbuild-release],
+	    [AC_HELP_STRING([--with-kbuild-release=RELEASE],
+			    [specify the kernel release to build modules for])],
+	    [KBUILD_RELEASE="${withval}"],
+	    [KBUILD_RELEASE=`uname -r`])
+
+AC_SUBST(KBUILD_RELEASE)
+
+AC_ARG_WITH([kbuild-dir],
+	    [AC_HELP_STRING([--with-kbuild-dir=DIR],
+			    [specify path to kernel-devel directory])],
+	    [KBUILD_DIR="${withval}"],
+	    [KBUILD_DIR="/lib/modules/$KBUILD_RELEASE/build"])
+
+AC_SUBST(KBUILD_DIR)
+
+WITH_MODULES="no"
+
+if test -f "$KBUILD_DIR/Makefile"; then
+
+	KBUILD_VERSION=`grep -o '^VERSION = [[0-9]]*' -m 1 \
+"${KBUILD_DIR}/Makefile" | grep -o '[[0-9]]*'`
+
+	KBUILD_PATCHLEVEL=`grep -o "^PATCHLEVEL = [[0-9]]*" -m 1 \
+"${KBUILD_DIR}/Makefile" | grep -o "[[0-9]]*"`
+
+	if [[ -n "$KBUILD_VERSION" ]] && [[ -n "$KBUILD_PATCHLEVEL" ]]; then
+		WITH_MODULES="yes"
+	fi
+fi
+
+AC_MSG_RESULT([checking for kernel-devel... $WITH_MODULES])
+
+AC_ARG_WITH(
+	    [modules],
+	    [AC_HELP_STRING([--without-modules],
+			    [disable auto-building kernel modules])],
+			    [WITH_MODULES="no"],
+			    [])
+
+AC_SUBST(KBUILD_VERSION)
+AC_SUBST(KBUILD_PATCHLEVEL)
+AC_SUBST(WITH_MODULES)
+])
-- 
1.7.1


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
  2013-06-06 14:21 [LTP] [PATCH] configure: add configure checks to compile kernel modules Alexey Kodanev
@ 2013-06-11  1:31 ` Mike Frysinger
  2013-06-11  9:34   ` alexey.kodanev
  2013-06-11  1:32 ` Mike Frysinger
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2013-06-11  1:31 UTC (permalink / raw)
  To: ltp-list; +Cc: Alexey Kodanev, vasily.isaenko


[-- Attachment #1.1: Type: Text/Plain, Size: 2676 bytes --]

On Thursday 06 June 2013 10:21:47 Alexey Kodanev wrote:
> --- /dev/null
> +++ b/m4/ltp-kernel_devel.m4
> @@ -0,0 +1,72 @@
> +dnl Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
> +dnl
> +dnl This program is free software; you can redistribute it and/or
> +dnl modify it under the terms of the GNU General Public License as
> +dnl published by the Free Software Foundation.
> +dnl
> +dnl This program is distributed in the hope that it would be useful,
> +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
> +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +dnl GNU General Public License for more details.
> +dnl
> +dnl You should have received a copy of the GNU General Public License
> +dnl along with this program; if not, write the Free Software Foundation,
> +dnl Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

you've apparently deleted the phrase "either version 2 of the License, or (at 
your option) any later version.".  i have no idea why you would do such a 
thing, but it's obviously not desirable.  apparently this isn't the first time 
as i see you've done it in at least 0e335dbed65afb79eab5b30e8d49d8066f165316.

please send a patch to fix your previous commits, and fix this one as well.  or 
i'm afraid we'll have to revert.

> +AC_DEFUN([LTP_CHECK_KERNEL_DEVEL],
> +[

cuddle the [ up and use dnl.  see _LTP_CHECK_LINUX_PTRACE for what i mean.

> +AC_ARG_WITH(
> +	    [kbuild-release],

"kbuild "is meaningless outside of the linux kernel tree.  it's also not a 
specific release.  call it "linux-version" instead.  or maybe "kmod-version".

> +	    [AC_HELP_STRING([--with-kbuild-release=RELEASE],
> +			    [specify the kernel release to build modules for])],

you're mixing tabs & spaces in a way that only works with 8 spaces.  either 
use pure tabs to indent (one level at a time), or use tabs to line up to the 
common part, then use spaces after that.

> +	    [KBUILD_RELEASE="${withval}"],
> +	    [KBUILD_RELEASE=`uname -r`])

defaulting like this won't work.  you need to check $cross_compiling is set to 
yes in order to default to `uname -r`.

seems like it'd be simpler to just do:
	AC_ARG_WITH([linux-version], [AC_HELP_STRING(...)],,
		AS_IF([test "$cross_compiling" != no],
			[with_linux_version=`uname -r`]))
	LINUX_VERSION=$with_linux_version
	AC_SUBST(LINUX_VERSION)

> +AC_MSG_RESULT([checking for kernel-devel... $WITH_MODULES])

err, that's not how it works.  you first call AC_MSG_CHECKING([for kernel-
devel]) and then you do AC_MSG_RESULT([$WITH_MODULES]) after the actual 
checks.
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 184 bytes --]

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
  2013-06-06 14:21 [LTP] [PATCH] configure: add configure checks to compile kernel modules Alexey Kodanev
  2013-06-11  1:31 ` Mike Frysinger
@ 2013-06-11  1:32 ` Mike Frysinger
  1 sibling, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2013-06-11  1:32 UTC (permalink / raw)
  To: ltp-list; +Cc: Alexey Kodanev, vasily.isaenko


[-- Attachment #1.1: Type: Text/Plain, Size: 587 bytes --]

On Thursday 06 June 2013 10:21:47 Alexey Kodanev wrote:
> There're new configure options added to tune modules building process.
> New m4 function tries to determine if kernel-devel package is available
> and sets makefile's variables (WITH_MODULES, ...) accordingly.

also, please version your patches in standard git style.  the first one is:
	[PATCH] configure: ....
then the second one (perhaps with the reply-to set to the fist patch) is:
	[PATCH v2] configure: ...
and so on

having multiple threads starting off with the same subject is really hard to 
follow
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 184 bytes --]

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
  2013-06-11  1:31 ` Mike Frysinger
@ 2013-06-11  9:34   ` alexey.kodanev
  2013-06-11 17:04     ` Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: alexey.kodanev @ 2013-06-11  9:34 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: vasily.isaenko, ltp-list


On 06/11/2013 05:31 AM, Mike Frysinger wrote:
> On Thursday 06 June 2013 10:21:47 Alexey Kodanev wrote:
>
> you've apparently deleted the phrase "either version 2 of the License, or (at
> your option) any later version.".  i have no idea why you would do such a
> thing, but it's obviously not desirable.  apparently this isn't the first time
> as i see you've done it in at least 0e335dbed65afb79eab5b30e8d49d8066f165316.
>
> please send a patch to fix your previous commits, and fix this one as well.  or
> i'm afraid we'll have to revert.
>
Sure, I will fix it.
> defaulting like this won't work.  you need to check $cross_compiling is set to
> yes in order to default to `uname -r`.
>
> seems like it'd be simpler to just do:
> 	AC_ARG_WITH([linux-version], [AC_HELP_STRING(...)],,
> 		AS_IF([test "$cross_compiling" != no],
> 			[with_linux_version=`uname -r`]))
> 	LINUX_VERSION=$with_linux_version
> 	AC_SUBST(LINUX_VERSION)
>
May be defaulting it to `uname -r` when $cross_compiling is set to no?

Thanks,
Alexey

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
  2013-06-11  9:34   ` alexey.kodanev
@ 2013-06-11 17:04     ` Mike Frysinger
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2013-06-11 17:04 UTC (permalink / raw)
  To: alexey.kodanev; +Cc: vasily.isaenko, ltp-list


[-- Attachment #1.1: Type: Text/Plain, Size: 723 bytes --]

On Tuesday 11 June 2013 05:34:57 alexey.kodanev@oracle.com wrote:
> On 06/11/2013 05:31 AM, Mike Frysinger wrote:
> > defaulting like this won't work.  you need to check $cross_compiling is
> > set to yes in order to default to `uname -r`.
> > 
> > seems like it'd be simpler to just do:
> > 	AC_ARG_WITH([linux-version], [AC_HELP_STRING(...)],,
> > 		AS_IF([test "$cross_compiling" != no],
> > 			[with_linux_version=`uname -r`]))
> > 	LINUX_VERSION=$with_linux_version
> > 	AC_SUBST(LINUX_VERSION)
> 
> May be defaulting it to `uname -r` when $cross_compiling is set to no?

yeah, i inverted the check here (i didn't test any of the code ... just typed 
it into the e-mail).  but you get the idea.
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 184 bytes --]

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] configure: add configure checks to compile kernel modules
@ 2013-06-06 14:13 Alexey Kodanev
  0 siblings, 0 replies; 9+ messages in thread
From: Alexey Kodanev @ 2013-06-06 14:13 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko, Alexey Kodanev

There're new configure options added to tune modules building process.
New m4 function tries to determine if kernel-devel package is available
and sets makefile's variables (WITH_MODULES, ...) accordingly.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 configure.ac                 |    1 +
 include/mk/config.mk.default |    6 +++
 include/mk/config.mk.in      |    6 +++
 m4/ltp-kernel_devel.m4       |   72 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 m4/ltp-kernel_devel.m4

diff --git a/configure.ac b/configure.ac
index f217f50..f0fc6b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,5 +167,6 @@ LTP_CHECK_MADVISE
 LTP_CHECK_ACL_SUPPORT
 LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_MREMAP_FIXED
+LTP_CHECK_KERNEL_DEVEL
 
 AC_OUTPUT
diff --git a/include/mk/config.mk.default b/include/mk/config.mk.default
index bd364a6..558e856 100644
--- a/include/mk/config.mk.default
+++ b/include/mk/config.mk.default
@@ -73,4 +73,10 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KBUILD_RELEASE		:=
+KBUILD_DIR		:=
+KBUILD_VERSION		:=
+KBUILD_PATCHLEVEL	:=
+WITH_MODULES		:= no
+
 export datarootdir includedir libdir mandir prefix
diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
index b835c86..d38e5f1 100644
--- a/include/mk/config.mk.in
+++ b/include/mk/config.mk.in
@@ -75,6 +75,12 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KBUILD_RELEASE		:= @KBUILD_RELEASE@
+KBUILD_DIR		:= @KBUILD_DIR@
+KBUILD_VERSION		:= @KBUILD_VERSION@
+KBUILD_PATCHLEVEL	:= @KBUILD_PATCHLEVEL@
+WITH_MODULES		:= @WITH_MODULES@
+
 ifeq ($(strip $(prefix)),)
 $(error you are using $$(prefix) incorrectly -- set it to $(abs_top_srcdir) if you want to build in the source tree)
 endif
diff --git a/m4/ltp-kernel_devel.m4 b/m4/ltp-kernel_devel.m4
new file mode 100644
index 0000000..a1fa8ec
--- /dev/null
+++ b/m4/ltp-kernel_devel.m4
@@ -0,0 +1,72 @@
+dnl Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation.
+dnl
+dnl This program is distributed in the hope that it would be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write the Free Software Foundation,
+dnl Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+dnl
+dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+dnl
+
+dnl
+dnl LTP_CHECK_KERNEL_DEVEL
+dnl ----------------------------
+dnl Building kernel modules
+dnl requires kernel-devel installed
+dnl
+
+AC_DEFUN([LTP_CHECK_KERNEL_DEVEL],
+[
+AC_ARG_WITH(
+	    [kbuild-release],
+	    [AC_HELP_STRING([--with-kbuild-release=RELEASE],
+			    [specify the kernel release to build modules for])],
+	    [KBUILD_RELEASE="${withval}"],
+	    [KBUILD_RELEASE=`uname -r`])
+
+AC_SUBST(KBUILD_RELEASE)
+
+AC_ARG_WITH([kbuild-dir],
+	    [AC_HELP_STRING([--with-kbuild-dir=DIR],
+			    [specify path to kernel-devel directory])],
+	    [KBUILD_DIR="${withval}"],
+	    [KBUILD_DIR="/lib/modules/$KBUILD_RELEASE/build"])
+
+AC_SUBST(KBUILD_DIR)
+
+if test -f "$KBUILD_DIR/Makefile"; then
+
+	KBUILD_VERSION=`grep -o '^VERSION = [[0-9]]*' -m 1 \
+"${KBUILD_DIR}/Makefile" | grep -o '[[0-9]]*'`
+
+	KBUILD_PATCHLEVEL=`grep -o "^PATCHLEVEL = [[0-9]]*" -m 1 \
+"${KBUILD_DIR}/Makefile" | grep -o "[[0-9]]*"`
+
+	if [[ -n "$KBUILD_VERSION" ]] && [[ -n "$KBUILD_PATCHLEVEL" ]]; then
+		WITH_MODULES="yes"
+	fi
+else
+	WITH_MODULES="no"
+fi
+
+AC_MSG_RESULT([checking for kernel-devel... $WITH_MODULES])
+
+AC_ARG_WITH(
+	    [modules],
+	    [AC_HELP_STRING([--without-modules],
+			    [disable auto-building kernel modules])],
+			    [WITH_MODULES="no"],
+			    [])
+
+AC_SUBST(KBUILD_VERSION)
+AC_SUBST(KBUILD_PATCHLEVEL)
+AC_SUBST(WITH_MODULES)
+])
-- 
1.7.1


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
       [not found]   ` <51B0716B.2090107@oracle.com>
@ 2013-06-06 13:56     ` chrubis
  0 siblings, 0 replies; 9+ messages in thread
From: chrubis @ 2013-06-06 13:56 UTC (permalink / raw)
  To: alexey.kodanev; +Cc: vasily.isaenko, ltp-list

Hi!
> >> There're new configure options added to tune modules building process.
> >> New m4 function tries to determine if kernel-devel package is available
> >> and sets makefile's variables (WITH_MODULES, ...) accordingly.
> >>
> >> Signed-off-by: Alexey Kodanev<alexey.kodanev@oracle.com>
> > This part looks fine.
> >
> > Maybe it would be better to include detected kernel version in the
> > configure output as well, but apart from that it's ok.
> >
> Sure, I will add VERSION and PATCHLEVEL variables from 
> .../build/Makefile to configure. Then we can use these variables 
> (WITH_MODULES, KERNEL_VERSION and KERNEL_PATCHLEVEL) to determine 
> whether to compile specific modules or not. Also, would it be better to 
> use KBUILD_VERSION, KBUILD_PATCHLEVEL, KBUILD_RELEASE names?

Sounds better to me.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] [PATCH] configure: add configure checks to compile kernel modules
  2013-06-05 12:01 Alexey Kodanev
@ 2013-06-06 10:57 ` chrubis
       [not found]   ` <51B0716B.2090107@oracle.com>
  0 siblings, 1 reply; 9+ messages in thread
From: chrubis @ 2013-06-06 10:57 UTC (permalink / raw)
  To: Alexey Kodanev; +Cc: vasily.isaenko, ltp-list

Hi!
> There're new configure options added to tune modules building process.
> New m4 function tries to determine if kernel-devel package is available
> and sets makefile's variables (WITH_MODULES, ...) accordingly.
> 
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>

This part looks fine.

Maybe it would be better to include detected kernel version in the
configure output as well, but apart from that it's ok.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH] configure: add configure checks to compile kernel modules
@ 2013-06-05 12:01 Alexey Kodanev
  2013-06-06 10:57 ` chrubis
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Kodanev @ 2013-06-05 12:01 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko, Alexey Kodanev

There're new configure options added to tune modules building process.
New m4 function tries to determine if kernel-devel package is available
and sets makefile's variables (WITH_MODULES, ...) accordingly.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 configure.ac                 |    1 +
 include/mk/config.mk.default |    4 +++
 include/mk/config.mk.in      |    4 +++
 m4/ltp-kernel_devel.m4       |   61 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 0 deletions(-)
 create mode 100644 m4/ltp-kernel_devel.m4

diff --git a/configure.ac b/configure.ac
index f217f50..f0fc6b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,5 +167,6 @@ LTP_CHECK_MADVISE
 LTP_CHECK_ACL_SUPPORT
 LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_MREMAP_FIXED
+LTP_CHECK_KERNEL_DEVEL
 
 AC_OUTPUT
diff --git a/include/mk/config.mk.default b/include/mk/config.mk.default
index bd364a6..8eec868 100644
--- a/include/mk/config.mk.default
+++ b/include/mk/config.mk.default
@@ -73,4 +73,8 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KERNEL_RELEASE		:=
+KERNEL_DEVEL_DIR	:=
+WITH_MODULES		:= no
+
 export datarootdir includedir libdir mandir prefix
diff --git a/include/mk/config.mk.in b/include/mk/config.mk.in
index b835c86..4edd22a 100644
--- a/include/mk/config.mk.in
+++ b/include/mk/config.mk.in
@@ -75,6 +75,10 @@ LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
 CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
+KERNEL_RELEASE		:= @KERNEL_RELEASE@
+KERNEL_DEVEL_DIR	:= @KERNEL_DEVEL_DIR@
+WITH_MODULES		:= @WITH_MODULES@
+
 ifeq ($(strip $(prefix)),)
 $(error you are using $$(prefix) incorrectly -- set it to $(abs_top_srcdir) if you want to build in the source tree)
 endif
diff --git a/m4/ltp-kernel_devel.m4 b/m4/ltp-kernel_devel.m4
new file mode 100644
index 0000000..f58ee2e
--- /dev/null
+++ b/m4/ltp-kernel_devel.m4
@@ -0,0 +1,61 @@
+dnl Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation.
+dnl
+dnl This program is distributed in the hope that it would be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write the Free Software Foundation,
+dnl Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+dnl
+dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+dnl
+
+dnl
+dnl LTP_CHECK_KERNEL_DEVEL
+dnl ----------------------------
+dnl Building kernel modules
+dnl requires kernel-devel installed
+dnl
+
+AC_DEFUN([LTP_CHECK_KERNEL_DEVEL],
+[
+AC_ARG_WITH(
+	    [kernel-release],
+	    [AC_HELP_STRING([--with-kernel-release=RELEASE],
+			    [specify the kernel release to build modules for])],
+	    [KERNEL_RELEASE="${withval}"],
+	    [KERNEL_RELEASE=`uname -r`])
+
+AC_SUBST(KERNEL_RELEASE)
+
+AC_ARG_WITH([kernel-devel],
+	    [AC_HELP_STRING([--with-kernel-devel=DIR],
+			    [specify path to kernel-devel directory])],
+	    [KERNEL_DEVEL_DIR="${withval}"],
+	    [KERNEL_DEVEL_DIR="/lib/modules/$KERNEL_RELEASE/build"])
+
+AC_SUBST(KERNEL_DEVEL_DIR)
+
+if test -f "$KERNEL_DEVEL_DIR/Makefile"; then
+	WITH_MODULES="yes"
+else
+	WITH_MODULES="no"
+fi
+
+AC_MSG_RESULT([checking for kernel-devel... $WITH_MODULES])
+
+AC_ARG_WITH(
+	    [modules],
+	    [AC_HELP_STRING([--without-modules],
+			    [disable auto-building kernel modules])],
+			    [WITH_MODULES="no"],
+			    [])
+
+AC_SUBST(WITH_MODULES)
+])
-- 
1.7.1


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-11 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06 14:21 [LTP] [PATCH] configure: add configure checks to compile kernel modules Alexey Kodanev
2013-06-11  1:31 ` Mike Frysinger
2013-06-11  9:34   ` alexey.kodanev
2013-06-11 17:04     ` Mike Frysinger
2013-06-11  1:32 ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2013-06-06 14:13 Alexey Kodanev
2013-06-05 12:01 Alexey Kodanev
2013-06-06 10:57 ` chrubis
     [not found]   ` <51B0716B.2090107@oracle.com>
2013-06-06 13:56     ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.