From 9a32b37048777332c19587a8edcb6297a600dcf6 Mon Sep 17 00:00:00 2001 From: riccardom Date: Sat, 9 Apr 2011 17:12:32 +0000 Subject: [PATCH] Add detection and build support for libsoundtouch and so metaspu Based on patches from Tobias Jakobi (liquidacid) in #3250391 --- desmume/configure.ac | 11 +++++++++++ desmume/src/Makefile.am | 6 +++++- desmume/src/cli/Makefile.am | 4 ++-- desmume/src/gtk-glade/Makefile.am | 8 +++++--- desmume/src/gtk/Makefile.am | 4 ++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/desmume/configure.ac b/desmume/configure.ac index 6fcc7a5e2..6fd6c3fae 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -178,6 +178,10 @@ AC_PROVIDE_IFELSE([PKG_PROG_PKG_CONFIG], [ AC_SUBST(LIBAGG_CFLAGS) AC_SUBST(LIBAGG_LIBS) + PKG_CHECK_MODULES(LIBSOUNDTOUCH, soundtouch >= 1.5.0, HAVE_LIBSOUNDTOUCH=yes, HAVE_LIBSOUNDTOUCH=no) + AC_SUBST(LIBSOUNDTOUCH_CFLAGS) + AC_SUBST(LIBSOUNDTOUCH_LIBS) + AC_PATH_PROG(UPDATEDESKTOP, [update-desktop-database]) fi ],[ @@ -202,6 +206,13 @@ else AC_MSG_WARN([Antigrain library not found, HUD will be disabled]) fi +AM_CONDITIONAL([HAVE_LIBSOUNDTOUCH], [test "${HAVE_LIBSOUNDTOUCH}" = "yes"]) +if test "x$HAVE_LIBSOUNDTOUCH" = "xyes"; then + AC_DEFINE([HAVE_LIBSOUNDTOUCH]) +else + AC_MSG_WARN([SoundTouch library not found, pcsx2 resampler will be disabled]) +fi + if test "x$FOUND_GLIB" = "xno"; then if test ! "x$GTK_MACOSX_HACK" = "xyes"; then AC_MSG_ERROR([Glib is required to build desmume]) diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 0c80f81c4..4a403c76b 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/src/desmume.mk -AM_CPPFLAGS += $(SDL_CFLAGS) $(GTHREAD_CFLAGS) $(X_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) +AM_CPPFLAGS += $(SDL_CFLAGS) $(GTHREAD_CFLAGS) $(X_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(LIBSOUNDTOUCH_CFLAGS) EXTRA_DIST = build.bat instruction_tabdef.inc thumb_tabdef.inc fs-linux.cpp fs-windows.cpp if HAVE_GDB_STUB @@ -101,6 +101,10 @@ libdesmume_a_SOURCES += mic.cpp endif endif +if HAVE_LIBSOUNDTOUCH +libdesmume_a_SOURCES += metaspu/SndOut.cpp metaspu/SndOut.h metaspu/Timestretcher.cpp +endif + if HAVE_LIBAGG libdesmume_a_SOURCES += aggdraw.cpp aggdraw.h GPU_osd.cpp else diff --git a/desmume/src/cli/Makefile.am b/desmume/src/cli/Makefile.am index 32ac74bc5..1985209f6 100644 --- a/desmume/src/cli/Makefile.am +++ b/desmume/src/cli/Makefile.am @@ -1,11 +1,11 @@ SUBDIRS = doc include $(top_srcdir)/src/desmume.mk -AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) +AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) $(LIBSOUNDTOUCH_CFLAGS) bin_PROGRAMS = desmume-cli desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../driver.h ../driver.cpp -desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) +desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) $(LIBSOUNDTOUCH_LIBS) if HAVE_GDB_STUB desmume_cli_LDADD += ../gdbstub/libgdbstub.a endif diff --git a/desmume/src/gtk-glade/Makefile.am b/desmume/src/gtk-glade/Makefile.am index 052ab2ab2..b667fca93 100644 --- a/desmume/src/gtk-glade/Makefile.am +++ b/desmume/src/gtk-glade/Makefile.am @@ -2,8 +2,9 @@ SUBDIRS = doc include $(top_srcdir)/src/desmume.mk AM_CPPFLAGS += $(SDL_CFLAGS) $(GTKGLEXT_CFLAGS) $(LIBGLADE_CFLAGS) \ - $(GTHREAD_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) -DDATADIR=\"$(gladedir)/\" \ - -DLOCALEDIR=\"$(localedir)\" + $(GTHREAD_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) \ + $(LIBSOUNDTOUCH_CFLAGS) \ + -DDATADIR=\"$(gladedir)/\" -DLOCALEDIR=\"$(localedir)\" AM_LDFLAGS += -rdynamic $(INTLLIBS) EXTRA_DIST = $(glade_DATA) desmume-glade.desktop @@ -31,7 +32,8 @@ desmume_glade_SOURCES = \ desmume_glade_LDADD = ../libdesmume.a \ $(SDL_LIBS) $(GTKGLEXT_LIBS) $(LIBGLADE_LIBS) \ - $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) + $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) \ + $(LIBSOUNDTOUCH_LIBS) if HAVE_GDB_STUB desmume_glade_LDADD += ../gdbstub/libgdbstub.a endif diff --git a/desmume/src/gtk/Makefile.am b/desmume/src/gtk/Makefile.am index 36fda312a..754204d1d 100644 --- a/desmume/src/gtk/Makefile.am +++ b/desmume/src/gtk/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = doc include $(top_srcdir)/src/desmume.mk -AM_CPPFLAGS += $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) +AM_CPPFLAGS += $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(LIBSOUNDTOUCH_CFLAGS) Applicationsdir = $(datadir)/applications Applications_DATA = desmume.desktop @@ -20,7 +20,7 @@ desmume_SOURCES = \ cheatsGTK.h cheatsGTK.cpp \ main.cpp main.h desmume_LDADD = ../libdesmume.a \ - $(SDL_LIBS) $(GTK_LIBS) $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) + $(SDL_LIBS) $(GTK_LIBS) $(GTHREAD_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(LIBSOUNDTOUCH_LIBS) if HAVE_GDB_STUB desmume_LDADD += ../gdbstub/libgdbstub.a endif