diff options
author | Pete Batard <pbatard@gmail.com> | 2010-03-08 23:40:38 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-03-08 23:40:38 +0000 |
commit | cb781bf531ee56c5cbb06e3595edf73eedfe7bca (patch) | |
tree | 10ad5c7e35be67f163ae7bdabf5af4b6a19d4e75 | |
parent | d4a736d822a6a7e8494f4055e77c188c53c1fa2f (diff) | |
download | libusb-cb781bf531ee56c5cbb06e3595edf73eedfe7bca.tar.gz |
merged master's r201a162
-rwxr-xr-x | autogen.sh | 9 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | ddk_build.cmd | 3 | ||||
-rw-r--r-- | examples/lsusb_2008.vcproj | 4 | ||||
-rw-r--r-- | examples/xusb.c | 128 | ||||
-rw-r--r-- | examples/xusb_2008.vcproj | 4 | ||||
-rw-r--r-- | libusb-dll_2005.vcproj | 6 | ||||
-rw-r--r-- | libusb-dll_2008.vcproj | 2 | ||||
-rw-r--r-- | libusb-static_2008.vcproj | 4 | ||||
-rw-r--r-- | libusb/Makefile.am | 2 | ||||
-rw-r--r-- | libusb/libusb-1.0.rc (renamed from msvc/libusb-1.0.rc) | 10 | ||||
-rw-r--r-- | libusb_dll.dsp | 6 | ||||
-rw-r--r-- | msvc/resource.h | 15 |
13 files changed, 98 insertions, 103 deletions
@@ -4,9 +4,14 @@ (glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize || LIBTOOLIZE=libtoolize $LIBTOOLIZE --copy --force || exit 1 +# Force ltmain's NLS test to set locale to C always. Prevents an +# issue when compiling shared libs with MinGW on Chinese locale. +type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; } +sed -e s/\\\\\${\$lt_var+set}/set/g ltmain.sh > lttmp.sh +mv lttmp.sh ltmain.sh +# aclocal || exit 1 autoheader || exit 1 autoconf || exit 1 automake -a -c || exit 1 -./configure --enable-maintainer-mode --enable-debug-log \ - --enable-examples-build $* +./configure --enable-debug-log --enable-examples-build $* diff --git a/configure.ac b/configure.ac index ac08e0b..a0abae3 100644 --- a/configure.ac +++ b/configure.ac @@ -66,14 +66,6 @@ AM_CONDITIONAL([OS_DARWIN], [test "x$backend" == "xdarwin"]) AM_CONDITIONAL([OS_WINDOWS], [test "x$backend" == "xwindows"]) AM_CONDITIONAL([POSIX_THREADS], [test "x$threads" == "xposix"]) -# Library versioning -lt_major="0" -lt_revision="0" -lt_age="0" -AC_SUBST(lt_major) -AC_SUBST(lt_revision) -AC_SUBST(lt_age) - # timerfd AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0]) AC_ARG_ENABLE([timerfd], diff --git a/ddk_build.cmd b/ddk_build.cmd index e51d939..236c589 100644 --- a/ddk_build.cmd +++ b/ddk_build.cmd @@ -4,12 +4,10 @@ if Test%BUILD_ALT_DIR%==Test goto usage set version=1.0 cd libusb\os -copy /y ..\..\msvc\libusb-%version%.rc . @echo on build -cZ @echo off if errorlevel 1 goto builderror -del libusb-%version%.rc cd ..\.. set cpudir=i386 @@ -94,7 +92,6 @@ goto done :builderror -del libusb-%version%.rc cd ..\.. echo Build failed goto done diff --git a/examples/lsusb_2008.vcproj b/examples/lsusb_2008.vcproj index f56019c..168cf3f 100644 --- a/examples/lsusb_2008.vcproj +++ b/examples/lsusb_2008.vcproj @@ -53,7 +53,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -131,7 +130,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -209,7 +207,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -290,7 +287,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" diff --git a/examples/xusb.c b/examples/xusb.c index 6bc3b4f..5664ce6 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -154,7 +154,7 @@ void display_buffer_hex(unsigned char *buffer, unsigned size) } -// The XBOX Controller is really a HID device that got its HID Report Descriptors +// The XBOX Controller is really a HID device that got its HID Report Descriptors // removed by Microsoft. // Input/Output reports described at http://euc.jp/periphs/xbox-controller.ja.html int display_xbox_status(libusb_device_handle *handle) @@ -691,7 +691,10 @@ __cdecl #endif main(int argc, char** argv) { + int show_help = 0; + int got_vidpid = 0; int r; + size_t i, arglen1, arglen2; unsigned tmp_vid, tmp_pid; uint16_t endian_test = 0xBE00; @@ -707,63 +710,94 @@ main(int argc, char** argv) } if (argc >= 2) { - if ((argv[1][0] != '-') || (argv[1][1] == 'h')) { - printf("usage: %s [-h] [-i] [-j] [-k] [-l] [-s] [-x] [vid:pid]\n", argv[0]); - printf(" -h: display usage\n"); - printf(" -i: test HID device\n"); - printf(" -j: test OLIMEX ARM-USB-TINY JTAG, 2 channel composite device\n"); - printf(" -k: test Mass Storage USB device\n"); - printf(" -l: test Plantronics Headset (HID)\n"); - printf(" -s: test Microsoft Sidewinder Precision Pro (HID)\n"); - printf(" -x: test Microsoft XBox Controller Type S (default)\n"); - - return 0; + arglen1 = strlen(argv[1]); + if ( ((argv[1][0] == '-') || (argv[1][0] == '/')) + && (arglen1 >= 2) ) { + switch(argv[1][1]) { + case 'i': + // IBM HID Optical mouse - 1 interface + VID = 0x04B3; + PID = 0x3108; + test_mode = USE_HID; + break; + case 'j': + // OLIMEX ARM-USB-TINY JTAG, 2 channel composite device - 2 interfaces + VID = 0x15BA; + PID = 0x0004; + test_mode = USE_JTAG; + break; + case 'k': + // Generic 2 GB USB Key (SCSI Transparent/Bulk Only) - 1 interface + VID = 0x0204; + PID = 0x6025; + test_mode = USE_KEY; + break; + case 'l': + // Plantronics DSP 400, 2 channel HID composite device - 1 HID interface + VID = 0x047F; + PID = 0x0CA1; + test_mode = USE_HID; + break; + case 's': + // Microsoft Sidewinder Precision Pro Joystick - 1 HID interface + VID = 0x045E; + PID = 0x0008; + test_mode = USE_HID; + break; + default: + show_help = -1; + break; + } + } else { + for (i=0; i<arglen1; i++) { + if (argv[1][i] == ':') + break; + } + if (i != arglen1) { + if (sscanf_s(argv[1], "%x:%x" , &tmp_vid, &tmp_pid) != 2) { + printf(" Please specify VID & PID as \"vid:pid\" in hexadecimal format\n"); + return 1; + } + VID = (uint16_t)tmp_vid; + PID = (uint16_t)tmp_pid; + test_mode = USE_KEY; + got_vidpid = -1; + } else { + show_help = -1; + } } - switch(argv[1][1]) { - case 'i': - // IBM HID Optical mouse - 1 interface - VID = 0x04B3; - PID = 0x3108; - test_mode = USE_HID; - break; - case 'j': - // OLIMEX ARM-USB-TINY JTAG, 2 channel composite device - 2 interfaces - VID = 0x15BA; - PID = 0x0004; - test_mode = USE_JTAG; - break; - case 'k': - // Generic 2 GB USB Key (SCSI Transparent/Bulk Only) - 1 interface - VID = 0x0204; - PID = 0x6025; - test_mode = USE_KEY; - break; - case 'l': - // Plantronics DSP 400, 2 channel HID composite device - 1 HID interface - VID = 0x047F; - PID = 0x0CA1; - test_mode = USE_HID; - break; - case 's': - // Microsoft Sidewinder Precision Pro Joystick - 1 HID interface - VID = 0x045E; - PID = 0x0008; - test_mode = USE_HID; - break; - default: - break; + } + + if ((argc == 3) && (!got_vidpid)) { + arglen2 = strlen(argv[2]); + for (i=0; i<arglen2; i++) { + if (argv[2][i] == ':') + break; } - if (argc == 3) { + if (i != arglen2) { if (sscanf_s(argv[2], "%x:%x" , &tmp_vid, &tmp_pid) != 2) { printf(" Please specify VID & PID as \"vid:pid\" in hexadecimal format\n"); return 1; } VID = (uint16_t)tmp_vid; PID = (uint16_t)tmp_pid; - printf("%04X:%04X\n", VID, PID); + } else { + show_help = -1; } } + if ((show_help) || (argc == 1) || (argc >= 4)) { + printf("usage: %s [-h] [-i] [-j] [-k] [-l] [-s] [-x] [vid:pid]\n", argv[0]); + printf(" -h: display usage\n"); + printf(" -i: test HID device\n"); + printf(" -j: test OLIMEX ARM-USB-TINY JTAG, 2 channel composite device\n"); + printf(" -k: test Mass Storage USB device\n"); + printf(" -l: test Plantronics Headset (HID)\n"); + printf(" -s: test Microsoft Sidewinder Precision Pro (HID)\n"); + printf(" -x: test Microsoft XBox Controller Type S (default)\n"); + return 0; + } + r = libusb_init(NULL); if (r < 0) return r; diff --git a/examples/xusb_2008.vcproj b/examples/xusb_2008.vcproj index f604ecc..224249a 100644 --- a/examples/xusb_2008.vcproj +++ b/examples/xusb_2008.vcproj @@ -53,7 +53,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -131,7 +130,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -209,7 +207,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -290,7 +287,6 @@ UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" diff --git a/libusb-dll_2005.vcproj b/libusb-dll_2005.vcproj index 09271b3..18d301b 100644 --- a/libusb-dll_2005.vcproj +++ b/libusb-dll_2005.vcproj @@ -52,6 +52,7 @@ WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" + CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -129,6 +130,7 @@ WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" + CallingConvention="2 /> <Tool Name="VCManagedResourceCompilerTool" @@ -211,6 +213,7 @@ WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" + CallingConvention="2 /> <Tool Name="VCManagedResourceCompilerTool" @@ -289,6 +292,7 @@ WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" + CallingConvention="2 /> <Tool Name="VCManagedResourceCompilerTool" @@ -447,7 +451,7 @@ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > <File - RelativePath=".\msvc\libusb-1.0.rc" + RelativePath=".\libusb\libusb-1.0.rc" > </File> </Filter> diff --git a/libusb-dll_2008.vcproj b/libusb-dll_2008.vcproj index a31fdee..85fa353 100644 --- a/libusb-dll_2008.vcproj +++ b/libusb-dll_2008.vcproj @@ -388,7 +388,7 @@ > </File> <File - RelativePath=".\msvc\libusb-1.0.rc" + RelativePath=".\libusb\libusb-1.0.rc" > </File> </Filter> diff --git a/libusb-static_2008.vcproj b/libusb-static_2008.vcproj index 98f37c7..16c7c0e 100644 --- a/libusb-static_2008.vcproj +++ b/libusb-static_2008.vcproj @@ -50,7 +50,6 @@ RuntimeLibrary="1" WarningLevel="3" DebugInformationFormat="4" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -114,7 +113,6 @@ RuntimeLibrary="1" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -178,7 +176,6 @@ EnableFunctionLevelLinking="true" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" @@ -243,7 +240,6 @@ EnableFunctionLevelLinking="true" WarningLevel="3" DebugInformationFormat="3" - CallingConvention="2" /> <Tool Name="VCManagedResourceCompilerTool" diff --git a/libusb/Makefile.am b/libusb/Makefile.am index 6152daa..48b28fb 100644 --- a/libusb/Makefile.am +++ b/libusb/Makefile.am @@ -8,7 +8,7 @@ endif LINUX_USBFS_SRC = $(THREADS_SRC) os/poll_posix.h os/linux_usbfs.h os/linux_usbfs.c DARWIN_USB_SRC = $(THREADS_SRC) os/poll_posix.h os/darwin_usb.h os/darwin_usb.c -WINDOWS_USB_SRC = $(THREADS_SRC) os/poll_windows.h os/poll_windows.c os/windows_usb.h os/windows_usb.c ../msvc/libusb-1.0.rc +WINDOWS_USB_SRC = $(THREADS_SRC) os/poll_windows.h os/poll_windows.c os/windows_usb.h os/windows_usb.c libusb-1.0.rc EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(WINDOWS_USB_SRC) diff --git a/msvc/libusb-1.0.rc b/libusb/libusb-1.0.rc index 769ddb6..5dea80c 100644 --- a/msvc/libusb-1.0.rc +++ b/libusb/libusb-1.0.rc @@ -1,6 +1,5 @@ //Microsoft Developer Studio generated resource script. // -#include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -46,16 +45,11 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 1 TEXTINCLUDE DISCARDABLE BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN "#include ""winresrc.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" @@ -117,7 +111,7 @@ END #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // -// Generated from the TEXTINCLUDE 3 resource. +// Generated from the TEXTINCLUDE 2 resource. // diff --git a/libusb_dll.dsp b/libusb_dll.dsp index 0b9a423..e937eff 100644 --- a/libusb_dll.dsp +++ b/libusb_dll.dsp @@ -114,7 +114,7 @@ SOURCE=".\libusb\libusb-1.0.def" # End Source File # Begin Source File -SOURCE=".\msvc\libusb-1.0.rc" +SOURCE=".\libusb\libusb-1.0.rc" # End Source File # Begin Source File @@ -167,10 +167,6 @@ SOURCE=.\libusb\os\poll_posix.h # End Source File # Begin Source File -SOURCE=.\msvc\resource.h -# End Source File -# Begin Source File - SOURCE=.\libusb\os\threads_posix.h # End Source File # Begin Source File diff --git a/msvc/resource.h b/msvc/resource.h deleted file mode 100644 index d973f20..0000000 --- a/msvc/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by libusb-1.0.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif |