1
0
Fork 0
forked from len0rd/rockbox

jztool: add correct compiler flags for building on Mac

Change-Id: Ic89b5a2e65754891fedd63fec1e7235ed424e5f9
This commit is contained in:
Aidan MacDonald 2021-06-05 22:36:24 +01:00
parent 474293a12b
commit 695d1701cd

View file

@ -25,15 +25,23 @@ ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32)
# TODO: support Windows # TODO: support Windows
else else
ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
# OSX -- /opt location is cheesy attempt to support ARM macs # Mac, tested on x86 only -- may need to adjust paths if building on ARM.
# COMPLETELY UNTESTED, testing from someone with an actual Mac is appreciated! # paths should work with homebrew libusb.
CFLAGS += -I/usr/local/include -I/opt/homebrew/include LIBUSB_CFLAGS ?= -I/usr/local/include/libusb-1.0
LDOPTS += -L/usr/local/lib -L/opt/homebrew/lib -lusb-1.0 ifdef STATIC
LIBUSB_LDOPTS ?= /usr/local/lib/libusb-1.0.a -framework IOKit -framework CoreFoundation
else else
# Linux LIBUSB_LDOPTS ?= -L/usr/local/lib -lusb-1.0
CFLAGS += `pkg-config --cflags libusb-1.0` endif
LDOPTS += `pkg-config --libs libusb-1.0` else
# Linux; note for static builds you need to build a copy of libusb without
# udev support and specify the includes / libs manually
LIBUSB_CFLAGS ?= `pkg-config --cflags libusb-1.0`
LIBUSB_LDOPTS ?= `pkg-config --libs libusb-1.0`
endif endif
endif endif
CFLAGS += $(LIBUSB_CFLAGS)
LDOPTS += $(LIBUSB_LDOPTS)
include ../libtools.make include ../libtools.make