diff --git a/Makefile b/Makefile index 948f454d..41caa048 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,10 @@ ifeq ($(ARCH), win) LDFLAGS += -static-libgcc -static-libstdc++ -lpthread \ -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \ -lgdi32 -lopengl32 -lcomdlg32 -lole32 \ - -Ldep/lib -lglew32 -lglfw3dll -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi + -Ldep/lib -lglew32 -lglfw3dll -lcurl -lzip -lportaudio_x64 -lportmidi \ + -Wl,-Bstatic -ljansson -lsamplerate TARGET = Rack.exe - # OBJECTS = Rack.res + OBJECTS = Rack.res endif @@ -80,8 +81,6 @@ ifeq ($(ARCH), lin) cp dep/lib/libzip.so.5 dist/Rack/ cp dep/lib/libportaudio.so.2 dist/Rack/ cp dep/lib/libportmidi.so dist/Rack/ - cp dep/lib/libsamplerate.so.0 dist/Rack/ - cp dep/lib/libsamplerate.so.0 dist/Rack/ endif ifeq ($(ARCH), mac) mkdir -p $(BUNDLE) @@ -118,9 +117,19 @@ ifeq ($(ARCH), mac) cp -R Rack.app dist/Rack/ endif ifeq ($(ARCH), win) - # TODO Copy dlls - cp Rack/*.dll dist/Rack/ - cp Rack/Rack.exe dist/Rack/ + cp Rack.exe dist/Rack/ + cp /mingw64/bin/libwinpthread-1.dll dist/Rack/ + cp /mingw64/bin/zlib1.dll dist/Rack/ + cp /mingw64/bin/libstdc++-6.dll dist/Rack/ + cp /mingw64/bin/libgcc_s_seh-1.dll dist/Rack/ + cp dep/bin/glew32.dll dist/Rack/ + cp dep/bin/glfw3.dll dist/Rack/ + cp dep/bin/libcurl-4.dll dist/Rack/ + cp dep/bin/libjansson-4.dll dist/Rack/ + cp dep/bin/libportmidi.dll dist/Rack/ + cp dep/bin/libsamplerate-0.dll dist/Rack/ + cp dep/bin/libzip-5.dll dist/Rack/ + cp dep/bin/portaudio_x64.dll dist/Rack/ endif # Fundamental diff --git a/Rack.rc b/Rack.rc index 5befe687..ba196a06 100644 --- a/Rack.rc +++ b/Rack.rc @@ -1 +1 @@ -GLFW_ICON ICON res/icon.ico \ No newline at end of file +GLFW_ICON ICON icon.ico \ No newline at end of file diff --git a/dep/Makefile b/dep/Makefile index d4c472f5..c430cc07 100755 --- a/dep/Makefile +++ b/dep/Makefile @@ -93,21 +93,21 @@ $(portmidi): $(MAKE) -C $@ $(MAKE) -C $@ install -$(asio): - echo "For ASIO support, download and move the ASIO SDK to $@" - exit 1 - +$(portaudio): ifeq ($(ARCH),win) -PORTAUDIO_DEPS = $(asio) -PORTAUDIO_ASIO = --with-host_os=mingw --with-winapi=wmme,asio --with-asiodir="../$(asio)" -endif - -$(portaudio): $(PORTAUDIO_DEPS) + $(WGET) https://github.com/adfernandes/precompiled-portaudio-windows/raw/master/portaudio-r1891-build.zip + $(UNZIP) portaudio-r1891-build.zip + mv portaudio-r1891-build $@ + cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.lib "$(LOCAL)/lib" + cp portaudio/lib/x64/ReleaseMinDependency/portaudio_x64.dll "$(LOCAL)/bin" + cp portaudio/include/*.h "$(LOCAL)/include" +else $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz $(UNTAR) pa_stable_v190600_20161030.tgz cd $@ && ./configure --prefix="$(LOCAL)" $(PORTAUDIO_ASIO) $(MAKE) -C $@ $(MAKE) -C $@ install +endif clean: git clean -fdxi diff --git a/include/util/request.hpp b/include/util/request.hpp index cd593bbb..3df0f167 100644 --- a/include/util/request.hpp +++ b/include/util/request.hpp @@ -11,12 +11,7 @@ enum RequestMethod { DELETE_METHOD, }; -/** Must be called before using this API */ -void requestInit(); -void requestDestroy(); - /** Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) */ json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ); /** Returns the filename, blank if unsuccessful */ bool requestDownload(std::string url, std::string filename, float *progress); - diff --git a/src/plugin.cpp b/src/plugin.cpp index 5849a3d9..ac560bc7 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -13,7 +13,6 @@ #if ARCH_WIN #include - #include #include #define mkdir(_dir, _perms) _mkdir(_dir) #else @@ -56,7 +55,8 @@ static int loadPlugin(std::string slug) { #if ARCH_WIN HINSTANCE handle = LoadLibrary(path.c_str()); if (!handle) { - fprintf(stderr, "Failed to load library %s\n", path.c_str()); + int error = GetLastError(); + fprintf(stderr, "Failed to load library %s: %d\n", path.c_str(), error); return -1; } #elif ARCH_LIN || ARCH_MAC @@ -92,8 +92,6 @@ static int loadPlugin(std::string slug) { } void pluginInit() { - requestInit(); - // Load core // This function is defined in core.cpp Plugin *corePlugin = init(); @@ -118,7 +116,6 @@ void pluginDestroy() { delete plugin; } gPlugins.clear(); - requestDestroy(); } //////////////////// diff --git a/src/util.cpp b/src/util.cpp index 1032bd1f..8fba2144 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,10 @@ #include #include +#if ARCH_WIN +#include +#include +#endif namespace rack { diff --git a/src/util/request.cpp b/src/util/request.cpp index 400c3274..5e859f36 100644 --- a/src/util/request.cpp +++ b/src/util/request.cpp @@ -13,15 +13,6 @@ static size_t writeStringCallback(char *ptr, size_t size, size_t nmemb, void *us } -void requestInit() { - curl_global_init(CURL_GLOBAL_NOTHING); -} - -void requestDestroy() { - curl_global_cleanup(); -} - - json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ) { CURL *curl = curl_easy_init(); if (!curl) @@ -91,7 +82,9 @@ json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ) { // Perform request printf("Requesting %s\n", url.c_str()); + // curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); CURLcode res = curl_easy_perform(curl); + printf("%d\n", res); // Cleanup if (method != GET_METHOD)