diff --git a/Makefile b/Makefile index 1cafde2d08..97522ce10c 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,19 @@ TARGET = ssnes OBJ = ssnes.o file.o driver.o conf/config_file.o settings.o dynamic.o -LIBS = -lsamplerate +LIBS = DEFINES = +ifeq ($(HAVE_SRC), 1) + LIBS += $(SRC_LIBS) + DEFINES += $(SRC_CFLAGS) +endif + ifeq ($(HAVE_RSOUND), 1) OBJ += audio/rsound.o LIBS += -lrsound endif + ifeq ($(HAVE_OSS), 1) OBJ += audio/oss.o endif diff --git a/config.def.h b/config.def.h index b2bb457c9c..1453430a5b 100644 --- a/config.def.h +++ b/config.def.h @@ -27,7 +27,10 @@ #include "libsnes.hpp" #include "driver.h" #include "config.h" + +#ifdef HAVE_SRC #include +#endif ///////////////// Drivers diff --git a/general.h b/general.h index 1ad972dee9..9488c56327 100644 --- a/general.h +++ b/general.h @@ -20,11 +20,13 @@ #define __SSNES_GENERAL_H #include -#include #include "driver.h" #include #include "record/ffemu.h" #include "config.h" +#ifdef HAVE_SRC +#include +#endif #define MAX_PLAYERS 2 diff --git a/qb/config.libs.sh b/qb/config.libs.sh index d2f9f6cef1..9e910d9cc2 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -32,12 +32,13 @@ if [ $HAVE_FFMPEG != no ]; then ( [ $HAVE_FFMPEG = auto ] && ( [ $HAVE_AVCODEC = no ] || [ $HAVE_AVFORMAT = no ] || [ $HAVE_AVCORE = no ] || [ $HAVE_AVUTIL = no ] || [ $HAVE_SWSCALE = no ] ) && HAVE_FFMPEG=no ) || HAVE_FFMPEG=yes fi -check_lib SRC -lsamplerate src_callback_new +check_pkgconf SRC samplerate +check_critical SRC "Cannot find libsamplerate." check_lib DYNAMIC -ldl dlopen # Creates config.mk and config.h. -VARS="ALSA OSS AL RSOUND ROAR JACK SDL FILTER CG XML DYNAMIC FFMPEG AVCODEC AVFORMAT AVCORE AVUTIL SWSCALE" +VARS="ALSA OSS AL RSOUND ROAR JACK SDL FILTER CG XML DYNAMIC FFMPEG AVCODEC AVFORMAT AVCORE AVUTIL SWSCALE SRC" create_config_make config.mk $VARS create_config_header config.h $VARS diff --git a/ssnes.c b/ssnes.c index 9b0bc1d9d9..2043640e5f 100644 --- a/ssnes.c +++ b/ssnes.c @@ -17,7 +17,6 @@ #include -#include #include #include #include @@ -30,6 +29,9 @@ #include "dynamic.h" #include "record/ffemu.h" #include +#ifdef HAVE_SRC +#include +#endif struct global g_extern = { .video_active = true,