changeset 1656:7fb51f6d31af

package portaudio: add test program, disable built-in tests, and remove superflous shared flag
author Tony Theodore <tonyt@logyst.com>
date Wed, 16 Mar 2011 21:56:00 +1100
parents 85199de32430
children 19fefe2bffcd
files src/portaudio-test.c src/portaudio.mk
diffstat 2 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/portaudio-test.c	Wed Mar 16 21:56:00 2011 +1100
@@ -0,0 +1,21 @@
+/* This file is part of mingw-cross-env.       */
+/* See doc/index.html for further information. */
+
+#include <portaudio.h>
+#include <stdio.h>
+
+int main()
+{
+    int i;
+    const PaDeviceInfo *device_info;
+
+    Pa_Initialize();
+    printf("Version: %s\n", Pa_GetVersionText());
+    for( i = 0; i < Pa_GetDeviceCount(); i++ )
+    {
+        device_info = Pa_GetDeviceInfo(i);
+        printf("Device %d: %s %s\n", i, device_info->name, Pa_GetHostApiInfo(device_info->hostApi)->name);
+    }
+    Pa_Terminate();
+    return 0;
+}
--- a/src/portaudio.mk	Mon Mar 14 09:38:38 2011 +0100
+++ b/src/portaudio.mk	Wed Mar 16 21:56:00 2011 +1100
@@ -27,6 +27,11 @@
         --with-host_os=mingw \
         --with-winapi=directx \
         --with-dxdir=$(PREFIX)/$(TARGET)
-    $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
-    $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+    $(MAKE) -C '$(1)' -j '$(JOBS)' SHARED_FLAGS= TESTS=
+    $(MAKE) -C '$(1)' -j 1 install
+
+    '$(TARGET)-gcc' \
+        -W -Wall -Werror -ansi -pedantic \
+        '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-portaudio.exe' \
+        `'$(TARGET)-pkg-config' portaudio-2.0 --cflags --libs`
 endef