SM_LIBUSB
have_ffmpeg=no
+have_libresample=no
-# search for system ffmpeg if not building for arcade
+# search for system libs if not building for arcade
if test "$itg_arcade" = "no"; then
AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)
AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)
AC_SEARCH_LIBS(swscale_version, [swscale], have_libswscale=yes, have_libswscale=no)
+ have_libresample=yes
+ AC_CHECK_LIB(resample, resample_open, [x=y], have_libresample=no, [-lm])
+ if test "$have_libresample" = "yes"; then
+ LIBS="$LIBS -lresample"
+ fi
+
if test "$have_libavcodec" = "yes"; then
AC_MSG_CHECKING([for libavcodec >= 0.6.1])
AC_TRY_RUN([
fi
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" = "yes")
+AM_CONDITIONAL(HAVE_LIBRESAMPLE, test "$have_libresample" = "yes")
SM_CHECK_CRASH_HANDLER
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(src/Makefile)
-# TODO: clean this up - kinda hacky...
-cd src/libresample && autoconf && ./configure && cd ../..
+if test "$have_libresample" = "no"; then
+ # use our own libresample in vain
+ cd src/libresample && autoconf && ./configure && cd ../..
+fi
AC_OUTPUT
LIBS += -nodefaultlibs -Wl,-Bstatic -lstdc++ $(LUA_LIBS) -lXrandr -lXrender -lmad -lgcc -lgcc_eh -Wl,-Bdynamic -lpthread -lusb -lc
endif
+if !HAVE_LIBRESAMPLE
all: $(srcdir)/libresample/libresample.a $(srcdir)/crypto561/libcryptopp.a
clean-local: clean_libresample
$(srcdir)/libresample/libresample.a:
cd $(srcdir)/libresample && autoconf && sh ./configure && make
+else
+all: $(srcdir)/crypto561/libcryptopp.a
+endif
$(srcdir)/crypto561/libcryptopp.a:
cd $(srcdir)/crypto561 && make -f GNUmakefile
$(AUDIO_LIBS) \
$(SDL_LIBS) \
$(XLIBS) \
- $(srcdir)/libresample/libresample.a \
$(srcdir)/crypto561/libcryptopp.a
openitg_SOURCES = $(main_SOURCES)
+if !HAVE_LIBRESAMPLE
+main_LDADD += $(srcdir)/libresample/libresample.a
+endif
+
if !HAVE_FFMPEG
openitg_LDADD = $(main_LDADD) \
$(srcdir)/ffmpeg/lib/libavformat.a $(srcdir)/ffmpeg/lib/libavcodec.a
RageSoundResampler.cpp RageSoundResampler.h
test_audio_readers_LDADD = \
- $(AUDIO_LIBS) \
- $(srcdir)/libresample/libresample.a
+ $(AUDIO_LIBS)
+
+if !HAVE_LIBRESAMPLE
+test_audio_readers_LDADD += $(srcdir)/libresample/libresample.a
+endif
TESTS += test_file_readers
test_file_readers_SOURCES = \