Introduce separate HOST and TARGET compilation steps.
PATCH 1/1 Introduce separate HOST and TARGET compilation steps.
The regdbdump tool is really a host executable that is used during the build process. It could also be installed and used on the target, but two separate compilations are needed to achieve that goal.
Currently, regdbdump is only built for the target, and thus cross-compilation of the tool is really feasible without this patch (or one like it).
---
This patch for the CRDA repository was offered on 12-June-2009 as an RFC, but received no comments at that time.
Makefile | 281 +++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 223 insertions(+), 58 deletions(-)
Makefile +223 -58
@@ -1,3 +1,5 @@ +-include .config + # 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
@@ -22,101 +24,259 @@ UDEV_RULE_DIR?=/lib/udev/rules.d/ # with make PUBKEY_DIR=/usr/lib/crda/pubkeys PUBKEY_DIR?=pubkeys -CFLAGS += -Wall -g -all: $(REG_BIN) crda intersect verify +MKDIR ?= mkdir -p +INSTALL ?= install + + +ifeq ($(V),1) + Q= + NQ=@true +else + Q=@ + NQ=@echo +endif + +# +# Determine what target and host libraries and executables +# need to be built as that will determine what libraries will +# need to be found on the host or in the target environment. +# -ifeq ($(USE_OPENSSL),1) -CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl` -LDLIBS += `pkg-config --libs openssl` +BUILD := crda intersect regdbdump -reglib.o: keys-ssl.c +HOST_BUILD := $(patsubst %,host/%,$(BUILD)) +TARGET_BUILD := $(patsubst %,target/%,$(BUILD)) +ifeq ($(CROSS_COMPILE),) + # Host only + # Initially treat host and target the same using target. + TARGET_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH) + TARGET_USE_OPENSSL := $(USE_OPENSSL) + BUILD_ALL := $(TARGET_BUILD) + INSTALL_EXECS := target/crda target/regdbdump else -CFLAGS += -DUSE_GCRYPT -LDLIBS += -lgcrypt + # Cross compile + BUILD_ALL := $(TARGET_BUILD) + ifeq ($(BUILD_FOR_HOST_TOO),1) + BUILD_ALL += $(HOST_BUILD) + endif + INSTALL_EXECS := target/crda target/regdbdump +endif + +INSTALL_MAN := crda.8.gz regdbdump.8.gz + -reglib.o: keys-gcrypt.c +TARGET_CFLAGS += -Wall -g + +ifeq ($(TARGET_USE_OPENSSL),1) + TARGET_CFLAGS_KEYS += -DUSE_OPENSSL \ + `PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --cflags openssl` + TARGET_LDLIBS_KEYS += `PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --libs openssl` + TARGET_KEYS_FILE := keys-ssl.c +else + TARGET_CFLAGS_KEYS += -DUSE_GCRYPT + TARGET_LDLIBS_KEYS += -lgcrypt + TARGET_KEYS_FILE := keys-gcrypt.c endif -MKDIR ?= mkdir -p -INSTALL ?= install -NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y) -NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y) +TARGET_NL1FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=1 libnl-1 && echo Y) +TARGET_NL2FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=2 libnl-2.0 && echo Y) -ifeq ($(NL1FOUND),Y) -NLLIBNAME = libnl-1 +ifeq ($(TARGET_NL1FOUND),Y) + TARGET_NLLIBNAME := libnl-1 endif -ifeq ($(NL2FOUND),Y) -CFLAGS += -DCONFIG_LIBNL20 -NLLIBS += -lnl-genl -NLLIBNAME = libnl-2.0 +ifeq ($(TARGET_NL2FOUND),Y) + TARGET_CFLAGS_NL += -DCONFIG_LIBNL20 + TARGET_LDLIBS_NL += -lnl-genl + TARGET_NLLIBNAME := libnl-2.0 endif -ifeq ($(NLLIBNAME),) -$(error Cannot find development files for any supported version of libnl) +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) +ifeq ($(TARGET_NLLIBNAME),) +$(error Cannot find development files for any supported version of target libnl) +endif endif -NLLIBS += `pkg-config --libs $(NLLIBNAME)` -CFLAGS += `pkg-config --cflags $(NLLIBNAME)` +TARGET_LDLIBS_NL += `PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --libs $(TARGET_NLLIBNAME)` +TARGET_CFLAGS_NL += `PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --cflags $(TARGET_NLLIBNAME)` + +TARGET_CFLAGS += $(TARGET_CFLAGS_NL) $(TARGET_CFLAGS_KEYS) +TARGET_LDLIBS += $(TARGET_LDLIBS_NL) $(TARGET_LDLIBS_KEYS) + + +# +# When not cross-compiling, treat target and host the same +# by transferring target-values to the HOST_* names and then +# only building the host targets. +# +# However when cross-compiling, build-up the real host-values +# in HOST_*, leaving the generic names to be for the target. +# +ifeq ($(CROSS_COMPILE),) + +# Not cross compiling, the host is the target. +HOST_CC := $(CC) +HOST_CFLAGS := $(TARGET_CFLAGS) +HOST_CPPFLAGS := $(TARGET_CPPFLAGS) +HOST_LDFLAGS := $(TARGET_LDFLAGS) +HOST_LDLIBS := $(TARGET_LDLIBS) +HOST_USE_OPENSSL := $(TARGET_USE_OPENSSL) +HOST_LDLIBS := $(TARGET_LDLIBS) +HOST_KEYS_FILE := $(TARGET_KEYS_FILE) +BUILD_ALL := $(subst target/,host/,$(BUILD_ALL)) +INSTALL_EXECS := $(subst target/,host/,$(INSTALL_EXECS)) -ifeq ($(V),1) -Q= -NQ=@true else -Q=@ -NQ=@echo + +# Cross compiling, so trump up HOST definitions now. + +HOST_CFLAGS += -Wall -g + +ifeq ($(HOST_USE_OPENSSL),1) + HOST_CFLAGS_KEYS += -DUSE_OPENSSL -DFOO \ + `PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --cflags openssl` + HOST_LDLIBS_KEYS += `PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --libs openssl` + HOST_KEYS_FILE := keys-ssl.c +else + HOST_CFLAGS_KEYS += -DUSE_GCRYPT + HOST_LDLIBS_KEYS += -lgcrypt + HOST_KEYS_FILE := keys-gcrypt.c endif -$(REG_BIN): - $(NQ) ' EXIST ' $(REG_BIN) - $(NQ) - $(NQ) ERROR: The file: $(REG_BIN) is missing. You need this in place in order - $(NQ) to build CRDA. You can get it from: - $(NQ) - $(NQ) $(REG_GIT) - $(NQ) - $(NQ) "Once cloned (no need to build) cp regulatory.bin to $(REG_BIN)" - $(NQ) - $(Q) exit 1 -keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem) - $(NQ) ' GEN ' $@ - $(NQ) ' Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem) - $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@ +ifeq ($(findstring host/crda,$(BUILD_ALL)),host/crda) +HOST_NL1FOUND := $(shell PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=1 libnl-1 && echo Y) +HOST_NL2FOUND := $(shell PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=2 libnl-2.0 && echo Y) + +ifeq ($(HOST_NL1FOUND),Y) + HOST_NLLIBNAME := libnl-1 +endif + +ifeq ($(HOST_NL2FOUND),Y) + HOST_CFLAGS_NL += -DCONFIG_LIBNL20 + HOST_LDLIBS_NL += -lnl-genl + HOST_NLLIBNAME := libnl-2.0 +endif + +ifeq ($(HOST_NLLIBNAME),) +$(error Cannot find development files for any supported version of host libnl) +endif -%.o: %.c regdb.h +HOST_LDLIBS_NL += `PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --libs $(HOST_NLLIBNAME)` +HOST_CFLAGS_NL += `PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) \ + pkg-config --cflags $(HOST_NLLIBNAME)` +endif + +endif + +HOST_CFLAGS += $(HOST_CFLAGS_KEYS) $(HOST_CFLAGS_NL) +HOST_LDLIBS += $(HOST_LDLIBS_KEYS) $(HOST_LDLIBS_NL) + + +CRDA_OBJS := reglib.o crda.o +REGDBDUMP_OBJS := reglib.o regdbdump.o print-regdom.o +INTERSECT_OBJS := reglib.o intersect.o print-regdom.o + + + +all: host target $(REG_BIN) $(BUILD_ALL) verify + +host target: + $(MKDIR) $@ + @echo Building $(BUILD_ALL) + + +target/crda: $(patsubst %,target/%,$(CRDA_OBJS)) + $(NQ) ' LD ' $@ + $(Q)$(CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@ $^ $(TARGET_LDLIBS) $(NLLIBS) + +target/regdbdump: $(patsubst %,target/%,$(REGDBDUMP_OBJS)) + $(NQ) ' LD ' $@ + $(Q)$(CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@ $^ $(TARGET_LDLIBS) + +target/intersect: $(patsubst %,target/%,$(INTERSECT_OBJS)) + $(NQ) ' LD ' $@ + $(Q)$(CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@ $^ $(TARGET_LDLIBS) + +target/reglib.o: $(TARGET_KEYS_FILE) + +target/%.o: %.c regdb.h $(NQ) ' CC ' $@ - $(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(Q)$(CC) -c $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -o $@ $< + -crda: reglib.o crda.o +host/crda: $(patsubst %,host/%,$(CRDA_OBJS)) $(NQ) ' LD ' $@ - $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(NLLIBS) + $(Q)$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LDLIBS) $(HOST_LIBS_NL) -regdbdump: reglib.o regdbdump.o print-regdom.o +host/regdbdump: $(patsubst %,host/%,$(REGDBDUMP_OBJS)) $(NQ) ' LD ' $@ - $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(Q)$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LDLIBS) -intersect: reglib.o intersect.o print-regdom.o +host/intersect: $(patsubst %,host/%,$(INTERSECT_OBJS)) $(NQ) ' LD ' $@ - $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(Q)$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LDLIBS) + +host/reglib.o: $(HOST_KEYS_FILE) + +host/%.o: %.c regdb.h + $(NQ) ' HOST_CC ' $@ + $(Q)$(HOST_CC) -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) -o $@ $< + -verify: $(REG_BIN) regdbdump +keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem) + $(NQ) ' GEN ' $@ + $(NQ) ' Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem) + $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@ + +verify: $(REG_BIN) host/regdbdump $(NQ) ' CHK $(REG_BIN)' - $(Q)./regdbdump $(REG_BIN) >/dev/null + $(Q)./host/regdbdump $(REG_BIN) >/dev/null + + +$(REG_BIN): + $(NQ) ' EXIST ' $(REG_BIN) + $(NQ) + $(NQ) ERROR: The file: $(REG_BIN) is missing. You need this in place in order + $(NQ) to build CRDA. You can get it from: + $(NQ) + $(NQ) $(REG_GIT) + $(NQ) + $(NQ) "Once cloned (no need to build) cp regulatory.bin to $(REG_BIN)" + $(NQ) + $(Q) exit 1 %.gz: % @$(NQ) ' GZIP' $< $(Q)gzip < $< > $@ -install: crda crda.8.gz regdbdump.8.gz - $(NQ) ' INSTALL crda' + +install: install_execs install_udev install_man + +install_execs: $(INSTALL_EXECS) $(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR) - $(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) crda - $(NQ) ' INSTALL regdbdump' - $(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) regdbdump + $(Q)for exec in $(INSTALL_EXECS) ; do \ + echo " INSTALL $$exec" ; \ + $(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) $$exec ; \ + done + +.PHONY: install_udev +install_udev: +ifndef NO_INSTALL_UDEV $(NQ) ' INSTALL $(UDEV_LEVEL)regulatory.rules' $(Q)$(MKDIR) $(DESTDIR)/$(UDEV_RULE_DIR)/ @# This removes the old rule you may have, we were not
@@ -127,6 +287,9 @@ install: crda crda.8.gz regdbdump.8.gz $(Q)$(INSTALL) -m 644 -t \ $(DESTDIR)/$(UDEV_RULE_DIR)/ \ udev/$(UDEV_LEVEL)regulatory.rules +endif + +install_man: $(INSTALL_MAN) $(NQ) ' INSTALL crda.8.gz' $(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/ $(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ crda.8.gz
@@ -134,5 +297,7 @@ install: crda crda.8.gz regdbdump.8.gz $(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ regdbdump.8.gz clean: + $(NQ) ' CLEAN' $(Q)rm -f crda regdbdump intersect *.o *~ *.pyc keys-*.c *.gz \ udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed + $(Q)rm -rf host/ target/
Signature · 1 line
1.6.3.GIT
Quoted 9 lines · Jon Loeliger
The regdbdump tool is really a host executable that is used during the build process. It could also be installed and used on the target, but two separate compilations are needed to achieve that goal.
Currently, regdbdump is only built for the target, and thus cross-compilation of the tool is really feasible without this patch (or one like it).
Quoted 5 lines
Signed-off-by Jon Loeliger <[email protected]>---
This patch for the CRDA repository was offered on 12-June-2009 as an RFC, but received no comments at that time.
I think you'll get more attention if you make your changes simple and separate. Otherwise, it's hard to review.
Makefile line 1
Quoted 2 lines
Makefile +1
-0@@ -1,3 +1,5 @@ +-include .config
This shouldn't be needed. Variables can be set on the make command line.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 29
Quoted 2 lines
Makefile +2
-0+MKDIR ?= mkdir -p +INSTALL ?= install
That's unrelated to the purpose of your patch.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 38
Quoted 7 lines
Makefile +7
-0+ifeq ($(V),1) + Q= + NQ=@true +else + Q=@ + NQ=@echo +endif
And this is unrelated too.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 43
Quoted 3 lines
Makefile +3
-0+# Determine what target and host libraries and executables +# need to be built as that will determine what libraries will +# need to be found on the host or in the target environment.
That's unclear. Also, most user don't cross-compile. It's better not to attract too much attention to the aspect important to you unless there is some trick here that everybody touching this Makefile needs to know.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 49
Quoted 3 lines
Makefile +2
-1-reglib.o: keys-ssl.c +HOST_BUILD := $(patsubst %,host/%,$(BUILD)) +TARGET_BUILD := $(patsubst %,target/%,$(BUILD))
The word "target" is normally limited to the compilers and similar tools to denote what kind of executables or object files will be supported by the program. It doesn't really apply here. If you look at the Linux build system, it has HOSTCC that produces tools for compiling and CC that produces the actual kernel.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 89
Quoted 6 lines
Makefile +4
-2-NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y) -NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y) +TARGET_NL1FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=1 libnl-1 && echo Y) +TARGET_NL2FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=2 libnl-2.0 && echo Y)
Again, you are adding "TARGET" for no reason.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 103
Quoted 4 lines
-$(error Cannot find development files for any supported version of libnl)
Makefile +3
-0+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) +ifeq ($(TARGET_NLLIBNAME),) +$(error Cannot find development files for any supported version of target libnl)
The same thing here. Most users don't really care about this distinction. It's the "host" compilation that is unusual. If a library was missing to build an interim tool for compilation, that might be worth noting.
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 119
Quoted 3 lines
Makefile +3
-0+# When not cross-compiling, treat target and host the same +# by transferring target-values to the HOST_* names and then +# only building the host targets.
Again, you are attracting too much attention to your work. There are other aspects most users will care about. They will look to see which libraries are needed, where the executables will be installed by default, what the default compiler options are.
I've seen code where many developers commented about the changes they did. It was impossible to understand what the code does, but the comments were telling why the code was changed.
Skipping lots of stuff.
Makefile install: crda crda.8.gz regdbdump.8.gz · line 303
Quoted 4 lines
Makefile +2
-0+ $(NQ) ' CLEAN' $(Q)rm -f crda regdbdump intersect *.o *~ *.pyc keys-*.c *.gz \ udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed + $(Q)rm -rf host/ target/
Again, this is an unrelated change.
Signature · 2 lines
Regards, Pavel Roskin
Quoted 6 lines · Pavel Roskin
Makefile line 1
Quoted 3 lines
Makefile +1
-0@@ -1,3 +1,5 @@ +-include .configThis shouldn't be needed. Variables can be set on the make command line.
Allowing the use of .config here is in the same style as iw's Makefile and .config. And, yes, the make command line does allow variables to be set. But here's what I'd have to supply:
CC := $(CROSS_COMPILE)gcc
HOST_CC := gcc
DESTDIR := $(STAGING_DIR)
HOST_PKG_CONFIG_PATH ?= /usr/lib/pkgconfig
TARGET_PKG_CONFIG_PATH ?= $(PKG_CONFIG_PATH)
STAGING_INC_DIR := $(STAGING_DIR)/usr/local/include
STAGING_LIB_DIR := $(STAGING_DIR)/usr/local/lib
KERNEL_DIR ?= ../../kernel
KERNEL_INC_DIR := $(KERNEL_DIR)/include
TARGET_CFLAGS += -I$(KERNEL_INC_DIR) \
-I$(STAGING_INC_DIR)
TARGET_LDLIBS += -L$(STAGING_LIB_DIR)
REG_BIN := ../wireless-regdb/regulatory.bin
HOST_USE_OPENSSL := 1
TARGET_USE_OPENSSL := 1
NO_INSTALL_UDEV := 1Quoted 5 lines
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 29
Quoted 2 lines
Makefile +2
-0+MKDIR ?= mkdir -p +INSTALL ?= installThat's unrelated to the purpose of your patch.
Quoted 9 lines
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 38
Quoted 7 lines
Makefile +7
-0+ifeq ($(V),1) + Q= + NQ=@true +else + Q=@ + NQ=@echo +endifAnd this is unrelated too.
Unrelated, perhaps. I'll submit a separate patch to regroup similar items.
Quoted 5 lines
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 43
Quoted 3 lines
Makefile +3
-0+# Determine what target and host libraries and executables +# need to be built as that will determine what libraries will +# need to be found on the host or in the target environment.That's unclear.
I'm not sure what is unclear here. Choosing the set of executables determines what libraries are needed.
Quoted 1 line
Also, most user don't cross-compile.
Some do. I'm one of them.
Quoted 4 lines
It's better not
to attract too much attention to the aspect important to you unless there is some trick here that everybody touching thisMakefileneeds to know.
OK.
Quoted 7 lines
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 49
Quoted 3 lines
Makefile +2
-1-reglib.o: keys-ssl.c +HOST_BUILD := $(patsubst %,host/%,$(BUILD)) +TARGET_BUILD := $(patsubst %,target/%,$(BUILD))The word "target" is normally limited to the compilers and similar tools to denote what kind of executables or object files will be supported by the program. It doesn't really apply here.
Right. It does apply here. I'm building on an X86 host for a PowerPC target.
Quoted 3 lines
If you look at the Linux
build system, it has HOSTCC that produces tools for compiling and CC that produces the actual kernel.
Right. Like this:
CC := $(CROSS_COMPILE)gcc
HOST_CC := gccQuoted 8 lines
Makefile UDEV_RULE_DIR?=/lib/udev/rules.d/ · line 89
Quoted 6 lines
Makefile +4
-2-NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y) -NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y) +TARGET_NL1FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=1 libnl-1 && echo Y) +TARGET_NL2FOUND := $(shell PKG_CONFIG_PATH=$(TARGET_PKG_CONFIG_PATH) \ + pkg-config --atleast-version=2 libnl-2.0 && echo Y)Again, you are adding "TARGET" for no reason.
No reason except explicit clarity.
Quoted 6 lines
Makefile install: crda crda.8.gz regdbdump.8.gz · line 303
Quoted 4 lines
Makefile +2
-0+ $(NQ) ' CLEAN' $(Q)rm -f crda regdbdump intersect *.o *~ *.pyc keys-*.c *.gz \ udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed + $(Q)rm -rf host/ target/Again, this is an unrelated change.
I'll submit a separate patch for the first, added line.
Thanks,
jdl
Quoted 8 lines · Jon Loeliger
The regdbdump tool is really a host executable that is used during the build process. It could also be installed and used on the target, but two separate compilations are needed to achieve that goal.
Currently, regdbdump is only built for the target, and thus cross-compilation of the tool is really feasible without this patch (or one like it).
I don't think John is the correct addressee, Luis maintains this still, afaik. The only thing I'm not sure about is the separation into host/ and target/, but otherwise this seems ok to me.
johannes
Quoted 11 lines · Johannes Berg
Quoted 8 lines · Jon Loeliger
The regdbdump tool is really a host executable that is used during the build process. It could also be installed and used on the target, but two separate compilations are needed to achieve that goal.
Currently, regdbdump is only built for the target, and thus cross-compilation of the tool is really feasible without this patch (or one like it).
I don't think John is the correct addressee, Luis maintains this still,
Oh! Sorry!
Quoted 2 lines
afaik. The only thing I'm not sure about is the separation into host/ and target/,
Do you have another suggestion? Another approach would be to leave the "target" stuff in the top-level directory straight up, and bury the build of the host "tools" in a sub-directory?
Quoted 1 line
but otherwise this seems ok to me.
Thanks.
Quoted 1 line
johannes
jdl
Quoted 13 lines · Jon Loeliger
Quoted 11 lines · Johannes Berg
Quoted 8 lines · Jon Loeliger
The regdbdump tool is really a host executable that is used during the build process. It could also be installed and used on the target, but two separate compilations are needed to achieve that goal.
Currently, regdbdump is only built for the target, and thus cross-compilation of the tool is really feasible without this patch (or one like it).
I don't think John is the correct addressee, Luis maintains this still,
Quoted 8 lines
Oh! Sorry!
Quoted 2 lines
afaik. The only thing I'm not sure about is the separation into host/ and target/,
Do you have another suggestion? Another approach would be to leave the "target" stuff in the top-level directory straight up, and bury the build of the host "tools" in a sub-directory?
As Pavel suggested can you split your work into separate patches? You seem to do more than one thing and this patch is pretty large as is.
Luis