have_ffmpeg=no
have_libresample=no
+have_libcryptopp=no
# search for system libs if not building for arcade
if test "$itg_arcade" = "no"; then
LIBS="$LIBS -lresample"
fi
+ # there has to be a better way... -hifi
+ AC_LANG([C++])
+ AC_CHECK_HEADER([crypto++/cryptlib.h], have_libcryptopp=yes, have_libcryptopp=no)
+ AC_LANG([C])
+ if test "$have_libcryptopp" = "yes"; then
+ LIBS="$LIBS -lcrypto++"
+ AC_DEFINE(HAVE_LIBCRYPTOPP, 1, [system CryptoPP available])
+ fi
+
if test "$have_libavcodec" = "yes"; then
AC_MSG_CHECKING([for libavcodec >= 0.6.1])
AC_TRY_RUN([
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" = "yes")
AM_CONDITIONAL(HAVE_LIBRESAMPLE, test "$have_libresample" = "yes")
+AM_CONDITIONAL(HAVE_LIBCRYPTOPP, test "$have_libcryptopp" = "yes")
SM_CHECK_CRASH_HANDLER
// crypt headers
#include <typeinfo>
-#include "crypto561/files.h"
-#include "crypto561/filters.h"
-#include "crypto561/cryptlib.h"
-#include "crypto561/sha.h"
-#include "crypto561/rsa.h"
-#include "crypto561/osrng.h"
+#if defined(HAVE_LIBCRYPTOPP)
+ #include <crypto++/files.h>
+ #include <crypto++/filters.h>
+ #include <crypto++/cryptlib.h>
+ #include <crypto++/sha.h>
+ #include <crypto++/rsa.h>
+ #include <crypto++/osrng.h>
+#else
+ #include "crypto561/files.h"
+ #include "crypto561/filters.h"
+ #include "crypto561/cryptlib.h"
+ #include "crypto561/sha.h"
+ #include "crypto561/rsa.h"
+ #include "crypto561/osrng.h"
+#endif
#if defined(_MSC_VER) && !defined(_XBOX) && _MSC_VER <= 1310
#if defined(_DEBUG)
#pragma comment(lib, "crypto561/cryptlib_vs2003/Win32/output/debug/cryptlib_vs2003.lib")
bool m_waiting;
};
-class RageFileSource : public SourceTemplate<RageFileStore>
+template <class T>
+class RageSourceTemplate : public Source
+{
+public:
+ RageSourceTemplate<T>(BufferedTransformation *attachment, T _store)
+ : Source(attachment), m_store(_store) {}
+ size_t Pump2(lword &byteCount, bool blocking=true)
+ {return m_store.TransferTo2(*AttachedTransformation(), byteCount, DEFAULT_CHANNEL, blocking);}
+ size_t PumpMessages2(unsigned int &messageCount, bool blocking=true)
+ {return m_store.TransferMessagesTo2(*AttachedTransformation(), messageCount, DEFAULT_CHANNEL, blocking);}
+ bool SourceExhausted() const
+ {return !m_store.AnyRetrievable() && !m_store.AnyMessages();}
+
+protected:
+ T m_store;
+};
+
+class RageFileSource : public RageSourceTemplate<RageFileStore>
{
public:
typedef FileStore::Err Err;
typedef FileStore::ReadErr ReadErr;
RageFileSource( RageFileBasic *pFile, bool pumpAll, BufferedTransformation *attachment = NULL )
- : SourceTemplate<RageFileStore>(attachment,RageFileStore(pFile)) {SourceInitialize(pumpAll, MakeParameters("InputBinaryMode", true, false));}
+ : RageSourceTemplate<RageFileStore>(attachment,RageFileStore(pFile)) {SourceInitialize(pumpAll, MakeParameters("InputBinaryMode", true, false));}
};
RageFileStore::ReadErr::ReadErr( const RageFileBasic &f ):
LIBS += -nodefaultlibs -Wl,-Bstatic -lstdc++ $(LUA_LIBS) -lXrandr -lXrender -lmad -lgcc -lgcc_eh -Wl,-Bdynamic -lpthread -lusb -lc
endif
+STATIC_LIBS =
+
if !HAVE_LIBRESAMPLE
-all: $(srcdir)/libresample/libresample.a $(srcdir)/crypto561/libcryptopp.a
+ $(STATIC_LIBS) += $(srcdir)/libresample/libresample.a
+endif
+
+if !HAVE_LIBCRYPTOPP
+ $(STATIC_LIBS) += $(srcdir)/crypto561/libcryptopp.a
+endif
+
+all: $(STATIC_LIBS)
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
main_LDADD = \
$(AUDIO_LIBS) \
$(SDL_LIBS) \
- $(XLIBS) \
- $(srcdir)/crypto561/libcryptopp.a
+ $(XLIBS)
openitg_SOURCES = $(main_SOURCES)
main_LDADD += $(srcdir)/libresample/libresample.a
endif
+if !HAVE_LIBCRYPTOPP
+main_LDADD += $(srcdir)/crypto561/libcryptopp.a
+endif
+
if !HAVE_FFMPEG
openitg_LDADD = $(main_LDADD) \
$(srcdir)/ffmpeg/lib/libavformat.a $(srcdir)/ffmpeg/lib/libavcodec.a
tests/test_file_errors.cpp \
MsdFile.cpp MsdFile.h \
XmlFile.cpp XmlFile.h \
- $(srcdir)/crypto561/libcryptopp.a \
CryptManager.cpp CryptManager.h $(cryptopp) $(crypto)
+if !HAVE_LIBCRYPTOPP
+test_file_errors_SOURCES += $(srcdir)/crypto561/libcryptopp.a
+endif
+
TESTS += test_timing_data
test_timing_data_SOURCES = \
$(all_test_SOURCES) \