Search Linux Wireless

CRDA and cross-compilation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Who currently owns CRDA?

I started to stare at cross-compiling issues, but realized that we need
two versions of reglib.o and print-regdom.o...

One to link with regdumpdb (compiled with HOSTCC) and one to link with
everything else (compiled with TARGET_CC)...

No easy way to do this without a lot of changes.

Here's what I have so far.

--- crda-1.1.0/Makefile.orig	2009-04-17 14:49:45.000000000 -0700
+++ crda-1.1.0/Makefile	2009-08-06 00:53:47.000000000 -0700
@@ -1,6 +1,6 @@
 # Modify as you see fit, note this is built into crda,
 # so if you change it here you will have to change crda.c
-REG_BIN?=/usr/lib/crda/regulatory.bin
+REG_BIN?=$(DESTDIR)/usr/lib/crda/regulatory.bin
 REG_GIT?=git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
 
 PREFIX ?= /usr/
@@ -22,46 +22,74 @@ UDEV_RULE_DIR?=/lib/udev/rules.d/
 # with make PUBKEY_DIR=/usr/lib/crda/pubkeys
 PUBKEY_DIR?=pubkeys
 
+MKDIR ?= mkdir -p
+INSTALL ?= install
+
 CFLAGS += -Wall -g
 
 all: $(REG_BIN) crda intersect verify
 
-ifeq ($(USE_OPENSSL),1)
+ifeq ($(CROSS_COMPILE),)
+
+ ifeq ($(USE_OPENSSL),1)
 CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
 LDLIBS += `pkg-config --libs openssl`
 
 reglib.o: keys-ssl.c
 
-else
+ else
 CFLAGS += -DUSE_GCRYPT
 LDLIBS += -lgcrypt
 
 reglib.o: keys-gcrypt.c
 
-endif
-MKDIR ?= mkdir -p
-INSTALL ?= install
+ endif
 
 NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
 NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
 
-ifeq ($(NL1FOUND),Y)
+ ifeq ($(NL1FOUND),Y)
 NLLIBNAME = libnl-1
-endif
+ endif
 
-ifeq ($(NL2FOUND),Y)
+ ifeq ($(NL2FOUND),Y)
 CFLAGS += -DCONFIG_LIBNL20
 NLLIBS += -lnl-genl
 NLLIBNAME = libnl-2.0
-endif
+ endif
 
-ifeq ($(NLLIBNAME),)
+ ifeq ($(NLLIBNAME),)
 $(error Cannot find development files for any supported version of libnl)
-endif
+ endif
 
 NLLIBS += `pkg-config --libs $(NLLIBNAME)`
 CFLAGS += `pkg-config --cflags $(NLLIBNAME)`
 
+else
+
+ ifeq ($(USE_OPENSSL),1)
+CFLAGS += -DUSE_OPENSSL
+LDLIBS += -lssl
+
+reglib.o: keys-ssl.c
+
+ else
+CFLAGS += -DUSE_GCRYPT
+LDLIBS += -lgcrypt
+
+reglib.o: keys-gcrypt.c
+
+ endif
+
+ ifeq ($(USE_LIBNL20),1)
+CFLAGS += DCONFIG_LIBNL20
+NLLIBS = -lnl-genl -lnl-2.0
+ else
+NLLIBS = -lnl
+ endif
+
+endif
+
 ifeq ($(V),1)
 Q=
 NQ=@true
@@ -111,6 +139,10 @@ verify: $(REG_BIN) regdbdump
 	@$(NQ) ' GZIP' $<
 	$(Q)gzip < $< > $@
 
+install-reg:
+	git clone $(REG_GIT) wireless-regdb
+	$(INSTALL) -m 0444 -D wireless-regdb/regulatory.bin $(REG_BIN)
+
 install: crda crda.8.gz regdbdump.8.gz
 	$(NQ) '  INSTALL  crda'
 	$(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR)

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux