linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CRDA and cross-compilation
@ 2009-08-06  8:08 Philip A. Prindeville
  2009-08-06 14:46 ` Jon Loeliger
  2009-08-06 15:09 ` John W. Linville
  0 siblings, 2 replies; 22+ messages in thread
From: Philip A. Prindeville @ 2009-08-06  8:08 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

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.


[-- Attachment #2: crda-cross-compile.patch --]
[-- Type: text/plain, Size: 2266 bytes --]

--- 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)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-08-11 12:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06  8:08 CRDA and cross-compilation Philip A. Prindeville
2009-08-06 14:46 ` Jon Loeliger
2009-08-06 16:41   ` Pavel Roskin
2009-08-06 16:56     ` Luis R. Rodriguez
2009-08-06 17:38       ` Philip A. Prindeville
2009-08-06 17:45       ` Pavel Roskin
2009-08-06 18:30         ` Philip A. Prindeville
2009-08-06 18:41           ` Pavel Roskin
2009-08-06 18:42         ` Luis R. Rodriguez
2009-08-06 19:08           ` Pavel Roskin
2009-08-06 19:23             ` Luis R. Rodriguez
     [not found]           ` <4A7BD15E.1030604@redfish-solutions.com>
     [not found]             ` <43e72e890908070905s447a2fc0j2dc086048194db34@mail.gmail.com>
     [not found]               ` <4A7CC24D.1000104@redfish-solutions.com>
     [not found]                 ` <1249698462.25983.7.camel@mj>
2009-08-10 22:13                   ` [PATCH] " Philip A. Prindeville
2009-08-10 22:30                     ` Luis R. Rodriguez
2009-08-10 23:55                       ` Philip A. Prindeville
2009-08-11  0:25                         ` Pavel Roskin
2009-08-11  0:41                           ` Philip A. Prindeville
2009-08-11  5:52                           ` Philip A. Prindeville
2009-08-11  0:41                     ` Philip Craig
2009-08-11  0:45                       ` Philip A. Prindeville
2009-08-06 19:14         ` Philip A. Prindeville
2009-08-06 19:21           ` Jon Loeliger
2009-08-06 15:09 ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).