linux-sunxi / sunxi-tools

A collection of command line tools for ARM devices with Allwinner SoCs.
http://linux-sunxi.org/
GNU General Public License v2.0
579 stars 421 forks source link

The project plans to support MacOS? #136

Closed mangobuge closed 4 years ago

mangobuge commented 4 years ago

I want to use it under mac

retpolanne commented 10 months ago

In case anyone needs it

git clone https://github.com/dgibson/dtc.git
cd dtc
git checkout v1.6.1
make

then made these changes to the makefile

--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,7 @@ DEFAULT_CFLAGS += -D_NETBSD_SOURCE
 endif

 DEFAULT_CFLAGS += -Iinclude/
+DEFAULT_CFLAGS += -I${HOME}/Dev/dtc/libfdt

 PKG_CONFIG ?= pkg-config

@@ -126,6 +127,7 @@ LIBUSB_LIBS ?= `$(PKG_CONFIG) --libs $(LIBUSB)`
 ZLIB = zlib
 ZLIB_CFLAGS ?= `$(PKG_CONFIG) --cflags $(ZLIB)`
 ZLIB_LIBS ?= `$(PKG_CONFIG) --libs $(ZLIB)`
+FDT_LIBS ?= -L ${HOME}/Dev/dtc/libfdt/

 ifeq ($(OS),Windows_NT)
        # Windows lacks mman.h / mmap()
@@ -143,7 +145,7 @@ SPI_FLASH:= fel-spiflash.c fel-spiflash.h fel-remotefunc-spi-data-transfer.h

 sunxi-fel: fel.c fit_image.c thunks/fel-to-spl-thunk.h $(PROGRESS) $(SOC_INFO) $(FEL_LIB) $(SPI_FLASH)
        $(CC) $(HOST_CFLAGS) $(LIBUSB_CFLAGS) $(ZLIB_CFLAGS) $(LDFLAGS) -o $@ \
-               $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS) $(ZLIB_LIBS) -lfdt
+               $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS) $(ZLIB_LIBS) $(FDT_LIBS) -lfdt

 sunxi-nand-part: nand-part-main.c nand-part.c nand-part-a10.h nand-part-a20.h
        $(CC) $(HOST_CFLAGS) -c -o nand-part-main.o nand-part-main.c