Hi Felix,
+GCC_ARCH:=
+ifneq ($(findstring -march=armv4,$(TARGET_OPTIMIZATION)),)
+ GCC_ARCH:=armv4
+endif
+ifneq ($(findstring -march=armv4t,$(TARGET_OPTIMIZATION)),)
+ GCC_ARCH:=armv4t
+endif
+ifneq ($(findstring -march=armv5t,$(TARGET_OPTIMIZATION)),)
+ GCC_ARCH:=armv5t
+endif
+ifneq ($(findstring -march=armv5te,$(TARGET_OPTIMIZATION)),)
+ GCC_ARCH:=armv5te
+endif
+
+ifneq ($(GCC_ARCH),)
+ GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
+endif
+
How about this instead?
GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=arm%,$(TARGET_OPTIMIZATION)))
That way we won't have to list every single possible ARM arch type.
Maybe we could even remove the 'arm' part from the filter to use this
on other architectures as well.
In this case we should convert the ifneq contructs in rules.mk, as
well, to make sure each arch is compiled with the correctly
configured compiler:
ifneq ($(findstring -march=armv4,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=_v4
endif
ifneq ($(findstring -march=armv4t,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=_v4t
endif
ifneq ($(findstring -march=armv5t,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=_v5t
endif
ifneq ($(findstring -march=armv5te,$(TARGET_OPTIMIZATION)),)
ARCH_SUFFIX:=_v5te
endif
Thanks,
Jochen
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel