RetroArch/cores/libretro-ffmpeg/Makefile.common

182 lines
4.8 KiB
Makefile
Raw Normal View History

2016-09-03 21:59:52 +02:00
LIBAVCODEC_SOURCE :=
LIBAVFORMAT_SOURCE :=
LIBAVUTIL_SOURCE :=
DEPS_SOURCE :=
2016-09-05 20:48:27 +02:00
DEFINES := -DHAVE_SWRESAMPLE
2019-02-03 15:49:35 -08:00
LIBRETRO_SOURCE :=
2016-09-05 00:36:04 +02:00
GL_SOURCE :=
2016-09-03 21:59:52 +02:00
2016-09-05 02:45:10 +02:00
CPUOPTS :=
2016-09-03 21:59:52 +02:00
DEPS_DIR := $(CORE_DIR)/deps
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
BASE_DIR := $(CORE_DIR)/..
AVFORMAT_DIR := $(BASE_DIR)/libavformat
AVCODEC_DIR := $(BASE_DIR)/libavcodec
AVUTIL_DIR := $(BASE_DIR)/libavutil
SWSCALE_DIR := $(BASE_DIR)/libswscale
SWRESAMPLE_DIR := $(BASE_DIR)/libswresample
2016-09-07 13:19:28 +02:00
INCFLAGS += -I$(BASE_DIR) -I$(CORE_DIR) -I$(LIBRETRO_COMM_DIR)/include -I$(LIBRETRO_COMM_DIR)/include/compat
2016-09-03 21:59:52 +02:00
LIBRETRO_SOURCE += $(CORE_DIR)/ffmpeg_core.c \
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.c \
2016-09-05 00:36:04 +02:00
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c
2016-09-03 21:59:52 +02:00
2016-09-05 02:45:10 +02:00
ifeq ($(LIBRETRO_SWITCH),1)
DEFINES += -DLIBRETRO_SWITCH=1
INTERNAL_LIBAVCODEC = 1
INTERNAL_LIBAVFORMAT = 1
INTERNAL_LIBAVUTIL = 1
INTERNAL_LIBSWRESAMPLE = 1
INTERNAL_LIBSWSCALE = 1
INTERNAL_LIBASS = 0
INTERNAL_LIBFLAC = 1
INTERNAL_LIBOGG = 1
INTERNAL_LIBLAME = 1
INTERNAL_LIBFAAC = 1
INTERNAL_LIBVORBIS = 1
INTERNAL_ZLIB = 1
endif
ifeq ($(INTERNAL_LIBAVCODEC),1)
BAKE_IN_FFMPEG=1
else
ifneq (,$(findstring unix,$(platform)))
LIBS += $(shell pkg-config libavcodec --libs)
CFLAGS += $(shell pkg-config libavcodec --cflags)
else ifneq (,$(findstring osx,$(platform)))
LIBS += $(shell pkg-config libavcodec --libs)
CFLAGS += $(shell pkg-config libavcodec --cflags)
else ifneq (,$(findstring win,$(platform)))
LIBS += -lavcodec
endif
endif
ifeq ($(INTERNAL_LIBASS),1)
else
ifeq ($(WANT_LIBASS),1)
ifneq (,$(findstring unix,$(platform)))
ifneq (,$(findstring osx,$(platform)))
LIBS += $(shell pkg-config libass --libs)
CFLAGS += $(shell pkg-config libass --cflags)
endif
endif
endif
endif
ifeq ($(INTERNAL_LIBAVFORMAT),1)
BAKE_IN_FFMPEG=1
else
ifneq (,$(findstring unix,$(platform)))
LIBS += $(shell pkg-config libavformat --libs)
CFLAGS += $(shell pkg-config libavformat --cflags)
else ifneq (,$(findstring osx,$(platform)))
LIBS += $(shell pkg-config libavformat --libs)
CFLAGS += $(shell pkg-config libavformat --cflags)
else ifneq (,$(findstring win,$(platform)))
LIBS += -lavformat
endif
endif
ifeq ($(INTERNAL_LIBSWRESAMPLE),1)
BAKE_IN_FFMPEG=1
else
ifneq (,$(findstring unix,$(platform)))
LIBS += $(shell pkg-config libswresample --libs)
CFLAGS += $(shell pkg-config libswresample --cflags)
else ifneq (,$(findstring osx,$(platform)))
LIBS += $(shell pkg-config libswresample --libs)
CFLAGS += $(shell pkg-config libswresample --cflags)
else ifneq (,$(findstring win,$(platform)))
LIBS += -lswresample
endif
endif
ifeq ($(INTERNAL_LIBSWSCALE),1)
BAKE_IN_FFMPEG=1
else
ifneq (,$(findstring unix,$(platform)))
LIBS += $(shell pkg-config libswscale --libs)
CFLAGS += $(shell pkg-config libswscale --cflags)
else ifneq (,$(findstring osx,$(platform)))
LIBS += $(shell pkg-config libswscale --libs)
CFLAGS += $(shell pkg-config libswscale --cflags)
else ifneq (,$(findstring win,$(platform)))
LIBS += -lswscale
endif
endif
ifeq ($(INTERNAL_LIBAVUTIL),1)
BAKE_IN_FFMPEG=1
else
ifneq (,$(findstring unix,$(platform)))
LIBS += $(shell pkg-config libavutil --libs)
CFLAGS += $(shell pkg-config libavutil --cflags)
else ifneq (,$(findstring osx,$(platform)))
gIBS += $(shell pkg-config libavutil --libs)
CFLAGS += $(shell pkg-config libavutil --cflags)
else ifneq (,$(findstring win,$(platform)))
LIBS += -lavutil
endif
endif
2016-09-03 21:59:52 +02:00
ifeq ($(HAVE_BIGENDIAN),1)
CPUOPTS += -DHAVE_BIGENDIAN=1 -DMSB_FIRST
else
CPUOPTS += -DHAVE_BIGENDIAN=0
endif
ifeq ($(HAVE_SSA), 1)
LIBS += $(shell pkg-config libass --libs)
DEFINES += -DHAVE_SSA
endif
2016-09-05 00:36:04 +02:00
ifeq ($(BAKE_IN_FFMPEG),1)
2016-09-05 20:48:27 +02:00
DEFINES += -DHAVE_GMTIME_R -DHAVE_LOCALTIME_R
ifneq (,$(findstring unix,$(platform)))
DEFINES += -DHAVE_STRUCT_SOCKADDR_STORAGE -DHAVE_STRUCT_ADDRINFO -DHAVE_FMINF
else ifneq (,$(findstring osx,$(platform)))
DEFINES += -DHAVE_STRUCT_SOCKADDR_STORAGE -DHAVE_STRUCT_ADDRINFO
endif
2016-09-05 02:45:10 +02:00
include $(CORE_DIR)/Makefile.ffmpeg
2016-09-03 21:59:52 +02:00
endif
2016-09-05 00:36:04 +02:00
ifeq ($(HAVE_OPENGL),1)
ifeq ($(GLES),1)
LIBS += $(GL_LIB)
GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES3
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/glsym_es3.c
2016-09-03 21:59:52 +02:00
else
2016-09-05 00:36:04 +02:00
LIBS += $(GL_LIB)
GLFLAGS += -DHAVE_OPENGL
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.c
2016-09-03 21:59:52 +02:00
endif
2016-09-05 00:36:04 +02:00
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/rglgen.c
2016-09-03 21:59:52 +02:00
ifeq ($(HAVE_GL_FFT), 1)
2016-09-05 00:36:04 +02:00
DEFINES += -DHAVE_GL_FFT
2017-04-22 20:56:59 +02:00
FFT_SOURCE += $(CORE_DIR)/ffmpeg_fft.c
2016-09-03 21:59:52 +02:00
endif
2016-09-05 00:36:04 +02:00
endif
2016-09-03 21:59:52 +02:00
2016-09-05 00:36:04 +02:00
ifeq ($(HAVE_PTHREADS),1)
LIBS += -lpthread
2016-09-03 21:59:52 +02:00
endif
2016-09-05 00:36:04 +02:00
SOURCES_C := $(GL_SOURCE) \
$(DEPS_SOURCE) \
$(LIBRETRO_SOURCE) \
$(LIBAVUTIL_SOURCE) \
$(LIBAVFORMAT_SOURCE) \
$(LIBSWSCALE_SOURCE) \
$(LIBAVCODEC_SOURCE) \
2017-04-22 20:56:59 +02:00
$(FFT_SOURCE) \
2016-09-05 00:36:04 +02:00
$(LIBSWRESAMPLE_SOURCE)
2016-09-03 21:59:52 +02:00
2017-04-22 20:56:59 +02:00
SOURCES_CXX :=