Skip to contentSkip to conversation

RLIM_INFINITY inconsistency between archs

DISCUSSION Adam Sampson 2 participants 2 messages Jul 29, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Jamie Lokier

But instead, how about a script: /lib/modules/VERSION/compile-module. The script would know where to find the kernel headers. That could be /lib/modules/include for distributions, and /my/kernel/tree/include for folks who used `make modules_install' recently.

I'll second that suggestion. This kind of thing works very well indeed for projects like Apache.

Signature · 7 lines
Adam Sampson
[email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#1 lore raw

In article <[email protected]>,

Quoted 8 lines · Adam Sampson
Quoted 4 lines · Jamie Lokier

But instead, how about a script: /lib/modules/VERSION/compile-module. The script would know where to find the kernel headers. That could be /lib/modules/include for distributions, and /my/kernel/tree/include for folks who used `make modules_install' recently.

I'll second that suggestion. This kind of thing works very well indeed for projects like Apache.

It is indeed a very good idea. The script could just spit out the CFLAGS used for kernel compilation like this:

#! /bin/sh
cat <<EOF
-D__KERNEL__ -I/usr/src/linux-2.2.15/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DUTS_MACHINE='"i386"' EOF

Then a module Makefile would be as simple as

# Set KVER manually if you want to compile against another kernel version KVER=$(shell uname -r)
CFLAGS=$(shell /lib/modules/$(KVER)/kernel-config)

module.o: module.c module.h

I've tried this, it works.

Mike.

Signature · 6 lines
Cistron Certified Internetwork Expert #1. Think free speech; drink free beer.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/