Hostap 0.0.2 -> 0.0.3 make install problem

Pavel Roskin proski
Wed May 21 16:15:39 PDT 2003


On Wed, 21 May 2003, insecure wrote:

> CONFIG_MODULES=y
> CONFIG_MODVERSIONS=y

Yes, that's the reason.  Indeed, support for versioned symbols was broken.

The patch is attached.  You may need to run "make install" more than once
because depmod is called before all modules are installed.  That's a bug
that will be fixed separately.

INCLUDES_MODVER was lost during transition to the new build system just
like other flags.  It should be added to CC like the PCMCIA include path.
Restoring it required moving more kernel-related code from the top-level
Makefile to driver/modules/Makefile (where it actually belongs).

Module versioning on 2.5.x kernels has not been tested yet.

-- 
Regards,
Pavel Roskin
-------------- next part --------------
--- Makefile
+++ Makefile
@@ -30,8 +30,6 @@
 KERNELRELEASE := $(shell if [ -r $(VERFILE) ]; \
 	then (cat $(VERFILE); echo UTS_RELEASE) | $(CC) $(INCLUDES) $(CFLAGS) -E - | tail -1 | xargs echo; \
 	else uname -r; fi)
-KERNELVER := $(shell echo "$(KERNELRELEASE)" | \
-	sed "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/")
 MODPATH := $(DESTDIR)/lib/modules/$(KERNELRELEASE)
 MODULE_CS := hostap_cs.o
 MODULE_PLX := hostap_plx.o
@@ -78,35 +76,6 @@
 CFLAGS += -fomit-frame-pointer
 endif
 
-
-ifdef CONFIG_MODVERSIONS
-
-VERFILES=$(MSRC)/hostap.ver $(MSRC)/hostap_crypt.ver
-$(MSRC)/hostap_crypt_wep.o: $(VERFILES)
-$(MSRC)/hostap.o: $(VERFILES)
-$(MSRC)/hostap_cs.o: $(VERFILES)
-$(MSRC)/hostap_plx.o: $(VERFILES)
-$(MSRC)/hostap_pci.o: $(VERFILES)
-INCLUDES_MODVER=-include $(MSRC)/hostap_crypt.ver -include $(MSRC)/hostap.ver
-
-GENKSYMS=/sbin/genksyms
-ifdef CONFIG_SMP
-        GENKSYMS += -p smp_
-endif
-
-$(MSRC)/hostap_crypt.ver: $(MSRC)/hostap_crypt.c
-	$(CC) $(INCLUDES) $(CFLAGS) -E -D__GENKSYMS__ $^ | \
-		$(GENKSYMS) -k $(KERNELVER) > $@
-$(MSRC)/hostap.ver: $(MSRC)/hostap.c
-	$(CC) $(INCLUDES) $(CFLAGS) -E -D__GENKSYMS__ $^ | \
-		$(GENKSYMS) -k $(KERNELVER) > $@
-
-endif
-
-
-.c.o:
-	$(CC) $(INCLUDES) $(INCLUDES_MODVER) $(CFLAGS) -o $@ $<
-
 2.4:
 	@if ! echo "$(KERNELRELEASE)" | grep -q "^2\.4"; then \
 		echo "*** Can't build for 2.4 with a non-2.4 source!"; \
--- driver/modules/Makefile
+++ driver/modules/Makefile
@@ -9,11 +9,37 @@
 obj-m += hostap_pci.o
 
 ifeq ($(TOPDIR)/Rules.make,$(wildcard $(TOPDIR)/Rules.make))
+# old build system (before 2.5.x)
 include $(TOPDIR)/Rules.make
+
+ifdef CONFIG_MODVERSIONS
+
+VERFILES=hostap.ver hostap_crypt.ver
+hostap_crypt_wep.o: $(VERFILES)
+hostap.o: $(VERFILES)
+hostap_cs.o: $(VERFILES)
+hostap_plx.o: $(VERFILES)
+hostap_pci.o: $(VERFILES)
+INCLUDES_MODVER=-include hostap_crypt.ver -include hostap.ver
+
+GENKSYMS=/sbin/genksyms
+ifdef CONFIG_SMP
+        GENKSYMS += -p smp_
 endif
 
+hostap_crypt.ver: hostap_crypt.c
+	$(CC) $(INCLUDES) $(CFLAGS) -E -D__GENKSYMS__ $^ | \
+		$(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@
+hostap.ver: hostap.c
+	$(CC) $(INCLUDES) $(CFLAGS) -E -D__GENKSYMS__ $^ | \
+		$(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@
+
+endif # CONFIG_MODVERSIONS
+endif # old build system
+
+
 # Need to add pcmcia-cs include path in the beginning of include directories.
 # CFLAGS would add it to the end, so this need to use CC..
 ifneq ($(PCMCIA_PATH),)
-CC += -I$(PCMCIA_PATH)/include
+CC += -I$(PCMCIA_PATH)/include $(INCLUDES_MODVER)
 endif



More information about the Hostap mailing list