RetroArch/cores/libretro-ffmpeg/Makefile.common

179 lines
4.9 KiB
Makefile

LIBAVCODEC_SOURCE :=
LIBAVFORMAT_SOURCE :=
LIBAVUTIL_SOURCE :=
DEPS_SOURCE :=
DEFINES := -DHAVE_SWRESAMPLE
LIBRETRO_SOURCE :=
GL_SOURCE :=
CPUOPTS :=
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
INCFLAGS += -I$(BASE_DIR) -I$(CORE_DIR) -I$(LIBRETRO_COMM_DIR)/include -I$(LIBRETRO_COMM_DIR)/include/compat
LIBRETRO_SOURCE += $(CORE_DIR)/ffmpeg_core.c \
$(CORE_DIR)/packet_buffer.c \
$(CORE_DIR)/video_buffer.c \
$(LIBRETRO_COMM_DIR)/rthreads/tpool.c \
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.c \
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c
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
ifeq ($(HAVE_SSA), 1)
LIBS += $(shell pkg-config libass --libs)
DEFINES += -DHAVE_SSA
endif
ifeq ($(BAKE_IN_FFMPEG),1)
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
include $(CORE_DIR)/Makefile.ffmpeg
endif
ifeq ($(HAVE_OPENGL),1)
ifeq ($(GLES),1)
LIBS += $(GL_LIB)
GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES3
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/glsym_es3.c
else
LIBS += $(GL_LIB)
GLFLAGS += -DHAVE_OPENGL
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.c
endif
GL_SOURCE += $(LIBRETRO_COMM_DIR)/glsym/rglgen.c
ifeq ($(HAVE_GL_FFT), 1)
DEFINES += -DHAVE_GL_FFT
FFT_SOURCE += $(CORE_DIR)/ffmpeg_fft.c
endif
endif
ifeq ($(HAVE_PTHREADS),1)
LIBS += -lpthread
endif
SOURCES_C := $(GL_SOURCE) \
$(DEPS_SOURCE) \
$(LIBRETRO_SOURCE) \
$(LIBAVUTIL_SOURCE) \
$(LIBAVFORMAT_SOURCE) \
$(LIBSWSCALE_SOURCE) \
$(LIBAVCODEC_SOURCE) \
$(FFT_SOURCE) \
$(LIBSWRESAMPLE_SOURCE)
SOURCES_CXX :=