diff --git a/Makefile b/Makefile index fdab0e2..5ed1fcf 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,15 @@ HEADERS = $(XAV_DIR)/reader.h $(XAV_DIR)/decoder.h $(XAV_DIR)/utils.h SOURCES = $(XAV_DIR)/xav_nif.c $(XAV_DIR)/reader.c $(XAV_DIR)/decoder.c $(XAV_DIR)/utils.c ifeq ($(USE_BUNDLED_FFMPEG), true) -CFLAGS = -fPIC -I$(ERTS_INCLUDE_DIR) -I${FFMPEG_INCLUDE_DIR} -I${XAV_DIR} -shared $(XAV_DEBUG_LOGS) -LDFLAGS = -L$(FFMPEG_LIB_DIR) -Wl,--whole-archive -lavcodec -lswscale -lavutil -lavformat -Wl,--no-whole-archive + CFLAGS = -fPIC -I$(ERTS_INCLUDE_DIR) -I${FFMPEG_INCLUDE_DIR} -I${XAV_DIR} -shared $(XAV_DEBUG_LOGS) + LDFLAGS = -L$(FFMPEG_LIB_DIR) -Wl,--whole-archive -lavcodec -lswscale -lavutil -lavformat -Wl,--no-whole-archive else -CFLAGS = -fPIC -I$(ERTS_INCLUDE_DIR) -I${XAV_DIR} -shared $(XAV_DEBUG_LOGS) -LDFLAGS = -lavcodec -lswscale -lavutil -lavformat -lavdevice -lswresample + CFLAGS = -fPIC -I$(ERTS_INCLUDE_DIR) -I${XAV_DIR} -shared $(XAV_DEBUG_LOGS) + LDFLAGS = -lavcodec -lswscale -lavutil -lavformat -lavdevice -lswresample +endif + +ifeq ($(shell uname -s),Darwin) + CFLAGS += -undefined dynamic_lookup endif $(XAV_SO): Makefile $(SOURCES) $(HEADERS)