[tulip] pci-scan and tulip staticly in kernel

Claus Rosenberger Claus.Rosenberger@rocnet.de
Sat Aug 31 15:34:01 2002


How i can build the pci-scan and tulip.c staticly into the kernel. I have
following configuration :

drivers/net/tulip directory
***************************

-rw-r--r--    1 compile  users        8740 13. Apr 21:27 kern_compat.h
-rw-r--r--    1 compile  users         225  9. Jan 2002  Makefile
-rw-r--r--    1 compile  users       18157  1. Apr 00:25 pci-scan.c
-rw-r--r--    1 compile  users        2990  9. Jan 2002  pci-scan.h
-rw-r--r--    1 compile  users      117969 16. Apr 00:39 tulip.c
-rw-r--r--    1 compile  users       41032 30. Aug 18:37 tulip.o


Makefile in tulip directory
***************************

#
# Makefile for the kernel LANfinity tulip device driver.
#

# The target object and module list name.

obj-y   :=
obj-n   :=
obj-m   :=
obj-    :=

obj-$(CONFIG_TULIP) += tulip.o pci-scan.o

include $(TOPDIR)/Rules.make

Output while kernel compiling part tulip
**************************************

make -C tulip
make[3]: Entering directory
'/usr/local/src/buildroot/build/disk-linux-kernel/drivers/net/tulip'
make all_targets
make[4]: Entering directory
`/usr/local/src/buildroot/build/disk-linux-kernel/drivers/net/tulip'
make[4]: Für das Target »all_targets« gibt es nichts zu tun.
make[4]: Leaving directory
`/usr/local/src/buildroot/build/disk-linux-kernel/drivers/net/tulip'
make[3]: Leaving directory
`/usr/local/src/buildroot/build/disk-linux-kernel/drivers/net/tulip'
make all_targets
make[3]: Entering directory
`/usr/local/src/buildroot/build/disk-linux-kernel/drivers/net'
gcc -D__KERNEL__
-I/usr/local/src/buildroot/build/disk-linux-kernel/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i386   -DKBUILD_BASENAME=tulip  -c -o tulip/tulip.o tulip/tulip.c
In file included from tulip/tulip.c:148:
/usr/local/src/buildroot/build/disk-linux-kernel/include/linux/malloc.h:4:
warning: #warning linux/malloc.h is deprecated, use linux/slab.h instead.


Error while kernel compilation
******************************

ld -m elf_i386 -T
/usr/local/src/buildroot/build/disk-linux-kernel/arch/i386/vml
inux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o
init/main.o init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
mm/mm.o fs/fs.o ipc/ipc.o \
         drivers/parport/driver.o drivers/char/char.o
drivers/block/block.o drivers/misc/misc.o drivers/net/net.o
drivers/media/media.o drivers/ide/idedriver.o
drivers/scsi/scsidrv.o drivers/cdrom/driver.o drivers/pci/driver.o
drivers/video/video.o \
        net/network.o \
        /usr/local/src/buildroot/build/disk-linux-kernel/arch/i386/lib/lib.a
/usr/local/src/buildroot/build/disk-linux-kernel/lib/lib.a
/usr/local/src/buildroot/build/disk-linux-kernel/arch/i386/lib/lib.a
\
        --end-group \
        -o vmlinux
drivers/net/net.o: In function `tulip_probe':
drivers/net/net.o(.text+0x5136): undefined reference to `pci_drv_register'
make: *** [vmlinux] Fehler 1


There is no compile information about pci-scan !!
Should i change the Makefile in drivers/net ?

Original lines
**************

ifeq ($(CONFIG_TULIP),y)
  obj-y += tulip/tulip.o
endif

Changes Lines
*************

ifeq ($(CONFIG_TULIP),y)
  obj-y += tulip/tulip.o tulip/pci-scan.o
endif

If i do i get following error :

gcc -D__KERNEL__
-I/usr/local/src/buildroot/build/disk-linux-kernel/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i386   -DKBUILD_BASENAME=pci_scan  -c -o tulip/pci-scan.o
tulip/pci-scan.c
tulip/pci-scan.c:53: linux/modversions.h: No such file or directory
tulip/pci-scan.c:59: linux/modversions.h: No such file or directory
make[3]: *** [tulip/pci-scan.o] Fehler 1



How i should change the Makefiles ?

Thanks a lot, Claus