LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I am stuck... (https://www.linuxquestions.org/questions/linux-newbie-8/i-am-stuck-204323/)

SGFHK321 07-12-2004 10:22 PM

I am stuck...
 
Quote:

[root@localhost cmaudio]# make
cc -D__KERNEL__ -I/usr/src/linux-2.6.3-15mdk/include -Wall -Wstrict-prototypes -O -fno-strict-aliasing -mpreferred-stack-boundary=2 -march=i686 -falign-functions=4 -DMODULE -c -o main.o main.c
In file included from main.c:1:
cmaudio.h:19:27: linux/wrapper.h: No such file or directory
In file included from /usr/src/linux-2.6.3-15mdk/include/linux/irq.h:20,
from /usr/src/linux-2.6.3-15mdk/include/asm/hardirq.h:6,
from cmaudio.h:21,
from main.c:1:
/usr/src/linux-2.6.3-15mdk/include/asm/irq.h:16:25: irq_vectors.h: No such file or directory
In file included from /usr/src/linux-2.6.3-15mdk/include/asm/hardirq.h:6,
from cmaudio.h:21,
from main.c:1:
/usr/src/linux-2.6.3-15mdk/include/linux/irq.h:70: error: `NR_IRQS' undeclared here (not in a function)
In file included from /usr/src/linux-2.6.3-15mdk/include/linux/irq.h:72,
from /usr/src/linux-2.6.3-15mdk/include/asm/hardirq.h:6,
from cmaudio.h:21,
from main.c:1:
/usr/src/linux-2.6.3-15mdk/include/asm/hw_irq.h:28: error: `NR_IRQ_VECTORS' undeclared here (not in a function)
/usr/src/linux-2.6.3-15mdk/include/asm/hw_irq.h:31: error: `NR_IRQS' undeclared here (not in a function)
main.c: In function `alloc_dmabuf':
main.c:450: warning: implicit declaration of function `mem_map_reserve'
main.c: In function `dealloc_dmabuf':
main.c:503: warning: implicit declaration of function `mem_map_unreserve'
main.c: In function `cmedia_probe':
main.c:1989: error: structure has no member named `driver_data'
main.c: In function `cmedia_remove':
main.c:2005: error: structure has no member named `driver_data'
main.c: In function `cmedia_init_module':
main.c:2063: warning: implicit declaration of function `pci_present'
make: *** [main.o] Error 1
I am trying intsall the sound driver from CMI but when I exeuce the make command this is the result.
Can anyone tell me what went wrong?

5h4r4d 07-12-2004 10:24 PM

did u do ./configure before u did make?

SGFHK321 07-12-2004 10:28 PM

there is no such file or directory

5h4r4d 07-12-2004 10:36 PM

do you have the kernel sources on your machine?
for compiling a kernel module you will need the kernel-source code that matches your running kernel

SGFHK321 07-12-2004 10:37 PM

Here is what is in the make file:

Quote:

#
# Copyright (c) C-Media Electronics Inc.
#
#
#

MODULE = cmaudio.o

# SYSINCLUDE can be overridden by environment variable or command line argument
# TARGET_KERNEL can be overridden by build system
# TARGET_KERNEL ?= $(shell uname -r)
LINUXDIR = $(shell uname -r | awk '{sub(/-.*/,"",$$0); print $$0}')
#SYSINCLUDE = /usr/src/linux-2.4/include
SYSINCLUDE = /usr/src/linux-2.6.3-15mdk/include

# Find kernel sources, if they're installed
ifeq ($(filter build, $(notdir $(wildcard /lib/modules/linux-2.6.3-15mdk/*))), build)
KERNSRC = /lib/modules/linux-2.6.3-15mdk/build
else
KERNSRC = /usr/src/linux-2.6.3-15mdk
endif
#KERNSRC = /usr/src/linux-$(LINUXDIR)


SYSINCLUDE ?= $(KERNSRC)/include


# Flags for kernel modules
CFLAGS= -D__KERNEL__ $(ARCHDEFS) -I$(SYSINCLUDE) -Wall -Wstrict-prototypes -O -fno-strict-aliasing -mpreferred-stack-boundary=2 -march=i686 -falign-functions=4 -DMODULE

#
# Modversion settings
#
CFLAGS += $(if $(wildcard $(SYSINCLUDE)/linux/modversions.h), -DMODVERSIONS -include $(SYSINCLUDE)/linux/modversions.h)

TARGET = cmaudio
OBJS = main.o cmi9739.o cmi9738.o sis_7018.o via_82cxxx.o intel_ichx.o ali_5451.o

#
#
#
all: $(TARGET).o

$(TARGET).o: $(OBJS)
$(LD) -r $^ -o $@

# mv cmaudio.o $(MODULE)

# Installation

TARGETDIR = /lib/modules/linux-2.6.3-15mdk/kernel/drivers/sound


# Double install; try first without setting root, then try again with
# so we can build rpm files
install:
mkdir -p $(INSTROOT)/$(TARGETDIR)
install -b -m 644 $(MODULE) $(INSTROOT)/$(TARGETDIR)
-install -b -m 644 -o root $(MODULE) $(INSTROOT)/$(TARGETDIR)
-/sbin/depmod -a

uninstall:
rm -f $(TARGETDIR)/$(MODULE)
/sbin/depmod -a

clean:
rm -f *.o *~ core

SGFHK321 07-12-2004 10:38 PM

Quote:

Originally posted by 5h4r4d
do you have the kernel sources on your machine?
for compiling a kernel module you will need the kernel-source code that matches your running kernel

I am sure I have installed the kernel by exeucing the "urpmi" command.

5h4r4d 07-12-2004 10:39 PM

the make file is expecting the kernel sources, if you do not have the kernel source for your active kernel, download and install the kernel sources / headers.

SGFHK321 07-12-2004 10:42 PM

How do I know if I had it installed or not? If I dont how do I install them? what the names of the rpms to look for?

5h4r4d 07-12-2004 10:48 PM

Check the contents of the following folder, The folder should contain header files
/usr/src/linux-2.6.3-15mdk/include

SGFHK321 07-12-2004 11:01 PM

Quote:

[root@localhost include]# dir
acpi asm-generic asm-m68k asm-x86_64 math-emu pcmcia sound
asm asm-i386 asm-ppc config media rxrpc video
asm-alpha asm-ia64 asm-um linux net scsi
[root@localhost include]#
These are all directries. I dont know what does a header file look like.

5h4r4d 07-12-2004 11:07 PM

rerun make and see if your problem is resolved now that you have the kernel sources installed

SGFHK321 07-12-2004 11:09 PM

Actually I have installed it and attempted an installation before posting this thread...


All times are GMT -5. The time now is 04:41 PM.