Changeset 1882
- Timestamp:
- Dec 12, 2016, 6:38:13 PM (8 years ago)
- Location:
- libusb1/trunk
- Files:
-
- 20 deleted
- 63 edited
- 108 copied
Legend:
- Unmodified
- Added
- Removed
-
libusb1/trunk ¶
-
Property svn:mergeinfo
set to
/libusb1/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
TabularUnified libusb1/trunk/AUTHORS ¶
r1876 r1882 1 Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org> 2 Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> 3 Copyright (C) 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net> 4 Copyright (C) 2009-2012 Pete Batard <pete@akeo.ie> 5 Copyright (C) 2010 Michael Plante <michael.plante@gmail.com> 6 Copyright (C) 2010-2012 Peter Stuge <peter@stuge.se> 7 Copyright (C) 2011-2012 Hans de Goede <hdegoede@redhat.com> 8 Copyright (C) 2012 Martin Pieuchot <mpi@openbsd.org> 1 Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 2 Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org> 3 Copyright © 2010-2012 Peter Stuge <peter@stuge.se> 4 Copyright © 2008-2016 Nathan Hjelm <hjelmn@users.sourceforge.net> 5 Copyright © 2009-2013 Pete Batard <pete@akeo.ie> 6 Copyright © 2009-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com> 7 Copyright © 2010-2012 Michael Plante <michael.plante@gmail.com> 8 Copyright © 2011-2013 Hans de Goede <hdegoede@redhat.com> 9 Copyright © 2012-2013 Martin Pieuchot <mpi@openbsd.org> 10 Copyright © 2012-2013 Toby Gray <toby.gray@realvnc.com> 11 Copyright © 2013-2015 Chris Dickens <christopher.a.dickens@gmail.com> 9 12 10 13 Other contributors: 14 Akshay Jaggi 11 15 Alan Ott 12 16 Alan Stern 13 17 Alex Vatchenko 18 Andrew Fernandes 19 Anthony Clay 20 Antonio Ospite 14 21 Artem Egorkine 15 22 Aurelien Jarno 16 23 Bastien Nocera 17 Brian Shirley 24 Bei Zhang 25 Benjamin Dobell 26 Carl Karsten 27 Colin Walters 28 Dave Camarillo 18 29 David Engraf 19 30 David Moore 31 Davidlohr Bueso 32 Federico Manzan 20 33 Felipe Balbi 34 Florian Albrechtskirchinger 35 Francesco Montorsi 36 Francisco Facioni 37 Gaurav Gupta 21 38 Graeme Gill 22 Hans de Goede 39 Gustavo Zacarias 23 40 Hans Ulrich Niedermann 24 41 Hector Martin 25 42 Hoi-Ho Chan 43 Ilya Konstantinov 26 44 James Hanko 45 John Sheu 46 Joshua Blake 47 Justin Bischoff 48 Karsten Koenig 27 49 Konrad Rzepecki 28 Ludovic Rousseau 50 Kuangye Guo 51 Lars Kanis 52 Lars Wirzenius 53 Luca Longinotti 54 Marcus Meissner 55 Markus Heidelberg 56 Martin Ettl 29 57 Martin Koegler 30 Martin Pieuchot 31 Maya Erez 58 Matthias Bolte 32 59 Mike Frysinger 33 60 Mikhail Gusarov 61 Moritz Fischer 62 ÐаÑОПМПв ÐаМООл 63 Nicholas Corgan 64 Omri Iluz 34 65 Orin Eman 66 Paul Fertser 35 67 Pekka Nikander 36 Peter Stuge37 68 Rob Walker 38 69 Sean McBride 39 70 Sebastian Pipping 40 Stephan Meyer 71 Simon Haggett 72 Simon Newton 41 73 Thomas Röfer 74 Tim Hutt 75 Tim Roberts 76 Tobias Klauser 42 77 Toby Peterson 78 Tormod Volden 43 79 Trygve LaugstÞl 80 Uri Lublin 44 81 Vasily Khoruzhick 82 Vegard Storheil Eriksen 83 Venkatesh Shukla 45 84 Vitali Lovich 46 85 Xiaofan Chen 86 Zoltán Kovács 87 РПЌаМ ÐПМÑеМкП 88 parafin 89 xantares -
TabularUnified libusb1/trunk/ChangeLog ¶
r1876 r1882 1 commit 1753a3a8d3f4c22ba9a63d9517b8cc128d368e48 2 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 3 Date: Tue Apr 9 19:13:41 2013 -0600 4 5 Add new example showing USB 3.0 descriptor parsing 6 7 commit 5b0196e926210441d84136e1ea28282d3a75adb0 8 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 9 Date: Tue Apr 9 19:01:02 2013 -0600 10 11 Update release notes for 1.0.16 release. 12 13 commit c61f55ff9d47e9049aa639c8a2367b426742ab13 14 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 15 Date: Sun Apr 7 23:23:37 2013 -0600 16 17 Fix various typos from the previous release candidate. 18 19 - Use tab compression in libusb.h 20 - Fix typos in USB 3.0 descriptor parsing. 21 22 commit 652c7085592467946b75f89ec9d00e3d55c6db3a 23 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 24 Date: Sun Apr 7 22:29:12 2013 -0600 25 26 on to 1.0.16-rc5 27 28 commit ce7bcf54eee1337cf8d3ed55ad6793d340ab15a3 29 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 30 Date: Sun Apr 7 22:26:46 2013 -0600 31 32 Use stdint types instead of u_int_*. 33 34 Fixes an issue created by the USB 3.0 descriptor patch. The patch 35 used u_int_* instead of the C99 stdint types. 36 37 commit bbc21298c1ff45b8e27097ebe3cd03bf2303af22 38 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 39 Date: Sun Apr 7 17:15:24 2013 -0600 40 41 Further doxygen updates 42 43 commit b52e1ec382cfff0f2d553d8fd483773d3637dd93 44 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 45 Date: Sun Apr 7 14:21:48 2013 -0600 46 47 Update doxygen documentation for hotplug and USB 3.0 descriptors. 48 49 commit 008dabcf2d9aaa87dbf26c95403c930267547842 50 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 51 Date: Sun Apr 7 10:19:18 2013 -0600 52 53 fix rc syntax 54 55 commit 2c88efaf10cdb7b857e9cb942b9ec4d793602170 56 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 57 Date: Sun Apr 7 09:35:29 2013 -0600 58 59 darwin: don't need darwin_error_str if ENABLE_LOGGING is not defined 60 61 commit 87432753af97abea8f264e2a3f0de0bf79b99f14 62 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 63 Date: Sun Apr 7 09:22:48 2013 -0600 64 65 update AUTHORS 66 67 commit ff6f2b75cd5b23066bb900019358a0d599311f5d 68 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 69 Date: Sat Apr 6 22:28:43 2013 -0600 70 71 keep new USB 3.0 descriptor code in line with current libusb style 72 73 commit 022c4bfb939bc376af4c96d52074a39560744750 74 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 75 Date: Sat Apr 6 13:16:47 2013 -0600 76 77 now on to rc4 78 79 commit 7c901bb72e8c946fd84baa2b8ee24f67394c9c00 80 Author: Maya Erez <merez@codeaurora.org> 81 Date: Sat Apr 6 12:30:22 2013 -0600 82 83 Add definitions for Endpoint Companion and BOS descriptors. 84 Add APIs for parsing the Endpoint Companion and BOS descriptors. 85 86 Nathan: Modified the original patch to fit the interface now already 87 provided by the freebsd implementation of libusb 1.0. 88 89 commit 55c23742dece5bed4f010d0cf44a2dddb8439d45 90 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 91 Date: Thu Apr 4 08:51:03 2013 -0600 92 93 darwin: do not try to work around buggy devices with bInterval = 0 on isochronous endpoints 94 95 commit 04c009ab8b4c98b4b03fec8aa72c8e88a9b0946b 96 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 97 Date: Wed Apr 3 15:21:39 2013 -0600 98 99 on to 1.0.16rc3 100 101 commit f60fcc4c9910b97b6575648d38255d396cfac883 102 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 103 Date: Wed Apr 3 08:37:21 2013 -0600 104 105 Use AM_CPPFLAGS instead of INCLUDES in examples/Makefile.am 106 107 commit fb62de0ab3fadab7bf79363e2be282a0fe0e60f1 108 Author: Hans de Goede <hdegoede@redhat.com> 109 Date: Wed Aug 22 11:47:00 2012 +0100 110 111 Linux: Avoid unnecessary splitting of bulk transfers 112 113 * With the latest kernels it is no longer needed to always split large bulk 114 transfers into multiple urbs. This patch takes advantage of this by not 115 splitting when not necessary. Note that the non-split code path is in essence 116 using the old split code path with an urb count which is always 1. 117 * This leads to more sane handling of large transfers with recent kernels, 118 although our splitting code is well tested, not splitting at all still is 119 a lot better :) 120 * When used with a recent kernel, this also fixes the problems, on XHCI attached 121 devices, when a large bulk-in transfer ends with a short read in an urb other 122 then the last urb. 123 * For more on this see: http://marc.info/?l=linux-usb&m=133797554910355 124 125 Conflicts: 126 libusb/os/linux_usbfs.c 127 libusb/version_nano.h 128 129 commit 7204a06b77b73242403a94eee5227e9e3f874b39 130 Author: Hans de Goede <hdegoede@redhat.com> 131 Date: Wed Aug 22 11:47:00 2012 +0100 132 133 Linux: Add support for the new get_capabilities ioctl 134 135 * There were a few (new) usbdevfs capabilities which libusbx could not 136 discover in any other way then checking the kernel version. 137 * However, this presents the following problems: 138 1) It is just not very pretty 139 2) Given the tendency of enterprise distros to backport stuff it is not 140 reliable 141 3) Some of these features turn out to not work with certain host controllers, 142 making depending on them based on the kernel version not a good idea 143 * Therefore a new USBDEVFS_GET_CAPABILITIES ioctl has been added to the kernel 144 to offer a better way to find out a device's capabilities (technically 145 the capabilities of the host controller to which the device is attached, 146 but that does not matter). 147 148 Conflicts: 149 libusb/os/linux_usbfs.c 150 libusb/version_nano.h 151 152 commit 50c682386e9d12e7e55805a8da550d8449a9b5c6 153 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 154 Date: Tue Apr 2 22:12:47 2013 -0600 155 156 darwin: don't assume an interval of 1 157 158 commit 14e19c7a675ce3b519a3ed84aca4bdb37e99aa4e 159 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 160 Date: Thu Feb 14 10:18:27 2013 -0700 161 162 darwin: only send a zero-length packet if the transfer completed successfully 163 164 commit 569cb63680bd28c9e8d1fd7ee8c3de2dcafa80e2 165 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 166 Date: Wed Feb 13 15:05:12 2013 -0700 167 168 When compiled with netlink support only use kernel messages. If compiled with udev support and udev is not running return an error on libusb_init. 169 170 commit d5449b017e757e1e47483604201c431e5dfc6868 171 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 172 Date: Wed Feb 13 09:36:27 2013 -0700 173 174 linux/netlink: clean up parsing code/cosmetics 175 176 commit 909d4d5a1e38a31509f852777902d3ec1a0c58ab 177 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 178 Date: Wed Feb 13 08:11:45 2013 -0700 179 180 linux: update netlink backend to detect udev 181 182 commit 4d62f0d62f9b242bd4bee841b5eac626bb2da7bd 183 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 184 Date: Tue Feb 12 19:59:20 2013 -0700 185 186 Use kCFNumberSInt32Type when reading device location from the IO registry 187 188 commit 906d2e63345ca4e8d7500438a76be83c053c70e8 189 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 190 Date: Tue Feb 12 07:38:51 2013 -0700 191 192 add support to for netlink 193 194 commit daf3d9b9f31f329f6cbd6d03383ad2cb6a712cc9 195 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 196 Date: Mon Feb 11 08:55:55 2013 -0700 197 198 fix bug in hotplug example 199 200 commit 5a49fd335a3e4a9883ebae48195ba4deb123d2d3 201 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 202 Date: Sun Feb 10 19:08:53 2013 -0700 203 204 Update hotplug example (and as per suggestion from Xiaofan rename to hotplugtest) and fix typos in hotplug code. 205 206 commit 4f77bb9751acc31d91ba91a51546ab0269add892 207 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 208 Date: Sun Feb 10 14:46:38 2013 -0700 209 210 windows: call usbi_sanitize_device to ensure the device descriptor gets cached 211 212 commit 693ae74f4eb05411c9ccc078df971ed26af17a03 213 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 214 Date: Sat Feb 9 09:24:05 2013 -0700 215 216 Replace LIBUSB_HOTPLUG_*_ANY with LIBUSB_HOTPLUG_MATCH_ANY. 217 218 commit ab28ea6ce4909a9fdd8f61547122b4a651c3265c 219 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 220 Date: Fri Feb 8 20:41:43 2013 -0700 221 222 darwin: add fcntl.h 223 224 commit a4d10c0157b9316927f3cb2b9f23243e1885303f 225 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 226 Date: Fri Feb 8 20:39:46 2013 -0700 227 228 Fix usbi_log_v in the case where ctx is NULL (no default context). 229 230 Fixes #147. 231 232 commit db49e905d84fd606e629b39dfe25d47da06e09a4 233 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 234 Date: Fri Feb 8 17:19:01 2013 -0700 235 236 On windows do not set the hotplug pipe as non-blocking. I will leave it up the backend maintainers to figure out. 237 238 commit aa54ff14e091e0cca2286def724368e8f6af2e1c 239 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 240 Date: Fri Feb 8 00:12:13 2013 -0700 241 242 darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET transfer flag. 243 244 References #6. 245 246 commit d7370d4cdbff83f2b218732a74d7ddd9a73a83bd 247 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 248 Date: Thu Feb 7 23:35:32 2013 -0700 249 250 Don't set the USBFS_URB_SHORT_NOT_OK flag on the last URB. 251 252 Fixes: #142 253 254 commit 3c3fa2fd657c43e98b6ab3350b007831770d46a6 255 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 256 Date: Thu Feb 7 22:32:40 2013 -0700 257 258 update copyrights 259 260 commit b3f88acd3e4aeabc6c09837904994c49d72138bf 261 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 262 Date: Thu Feb 7 22:12:47 2013 -0700 263 264 check read/write error codes 265 266 commit cb822d1dcdadf04d126df7474820d685310046e1 267 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 268 Date: Thu Feb 7 21:56:30 2013 -0700 269 270 darwin/libusb_reset: reenumerate device if the device descriptor or any configuration descriptor has changed 271 272 commit 532e83ad2a4f1089db2931fb9c36844b7fe27972 273 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 274 Date: Fri Feb 8 17:10:24 2013 -0700 275 276 replace removed automake macro AM_CONFIG_HEADER with AC_CONFIG_HEADERS. 277 278 Fixes #159. Thanks to cazfi. 279 280 commit 0f4023998b1927a73c6a5c9ed0cf06234cf6f145 281 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 282 Date: Thu Feb 7 20:05:01 2013 -0700 283 284 bump version to 1.0.16rc2 285 286 commit a93814998d1b2981dbbb7ec2e8cbacdc06a3a167 287 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 288 Date: Thu Feb 7 20:03:21 2013 -0700 289 290 update hotplug example 291 292 commit a5250f5c6cbf1bd568f2225985bb68b4a8177dbf 293 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 294 Date: Thu Feb 7 20:02:52 2013 -0700 295 296 handle hotplug events from libusb_handle_events 297 298 commit 65568b275009184bfd20becc2652eaa22a17d163 299 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 300 Date: Mon Feb 4 19:46:45 2013 -0700 301 302 add hotplug support 303 304 commit 78184dd8627959d172ab5672c631f880b911ab63 305 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 306 Date: Sun Dec 9 14:24:01 2012 -0700 307 308 update hotplug documentation 309 310 commit 3c3fa057d239e33cffb0e0ad57384faf15b01312 311 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 312 Date: Fri Dec 7 19:59:39 2012 -0700 313 314 core: bump to rc1 315 316 commit def5cb569a69ddf082606601490a6ad104bb711f 317 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 318 Date: Fri Dec 7 19:57:53 2012 -0700 319 320 darwin: separate the processing of async io and hotplug events. 321 322 This commit adds another thread to the Darwin backend, This thread handles only async IO events enabling the use of blocking IO in a hotplug callback. 323 324 commit 094d73e4a160330e1d3860874054c11841b12f76 325 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 326 Date: Fri Dec 7 19:55:21 2012 -0700 327 328 darwin: clean up extraneous includes 329 330 commit 18dd6c3d890292685e3db610a3b1ecd7f21299a3 331 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 332 Date: Fri Dec 7 19:54:15 2012 -0700 333 334 hotplug: update api 335 336 commit 33543615dd070edf70da615ca1589046ca159101 337 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 338 Date: Fri Dec 7 19:50:33 2012 -0700 339 340 doc: ignore internal hotplug header 341 342 commit a4f43258a6de642754c21891839b763fec91e5b9 343 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 344 Date: Fri Dec 7 19:49:47 2012 -0700 345 346 core: add hotplug capability check 347 348 commit 33f7a0bc6555cafab4ea9af890ad72901ebd4e97 349 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 350 Date: Fri Nov 30 19:18:33 2012 -0700 351 352 darwin: ensure there is at least one device reference per context 353 354 commit 4aac9a3375ddfd1a001c1bb1e0002fffe53ac443 355 Author: Nathan Hjelm <hjelmn@cs.unm.edu> 356 Date: Fri Nov 30 19:17:43 2012 -0700 357 358 darwin: dpriv->device will never be NULL for a valid device. remove unnecessary code that handled this case 359 360 commit e92dc87455a4533f462643ed5ba29c4f2b0075cc 361 Author: Nathan Hjelm <hjelmn@me.com> 362 Date: Thu Nov 29 16:19:11 2012 -0700 363 364 darwin: allow control messages on devices we can not exclusively open 365 366 commit 4f2c5aadb2742b7a4c8059d08e516b51d713e68f 367 Author: Nathan Hjelm <hjelmn@me.com> 368 Date: Thu Nov 29 16:14:03 2012 -0700 369 370 Add hotplug support to the Linux backend. 371 372 commit a42bae34cb66022891a8aadd54018d03c9c8c71e 373 Author: Nathan Hjelm <hjelmn@me.com> 374 Date: Thu Nov 29 16:13:00 2012 -0700 375 376 Add hotplug support to the Darwin backend. 377 378 commit 01218366248ded97b6e802ea4b183303cc6a10f4 379 Author: Nathan Hjelm <hjelmn@me.com> 380 Date: Thu Nov 29 14:23:26 2012 -0700 381 382 Add hotplug support. Bumping the version to 1.0.15 and change the so version. 383 384 The internal API is changing as follows: 385 - Adding two new functions. usbi_connect_device, and usbi_disconnect_device. Backends must call these functions to add them to the context's device list at one of two places: initial enumeration (done at init), and on device attach and removal. These functions need to be called once per context. 386 - Backends that support hotplug should not provide a get_device_list funtion. This function is now deprecated and will likely be removed when all backends support hotplug. 387 388 The external API is changing as follows: 389 - Several new functions have been added to register for notification of device attach/detach. Callbacks are per context and can be called once or persist for the lifetime of the context. 390 - Details of the new functionality can be found in libusb.h 391 392 commit 2574334e8c46b2d86f2c1b920195f917368554ef 393 Author: Nathan Hjelm <hjelmn@me.com> 394 Date: Thu Nov 29 13:53:41 2012 -0700 395 396 cache device descriptors in the core 397 398 commit 30e02dee5840de7c0835fc5a31f2e544b6e45bd5 399 Author: Nathan Hjelm <hjelmn@me.com> 400 Date: Thu Nov 29 13:46:07 2012 -0700 401 402 Fix #150: do not unsuspend Apple devices by checking for idProduct == kIOUSBVendorIDAppleComputer 403 404 commit 319e3a4297986aee16f7a4b6f3d23ef0bdaf7e03 405 Author: Nathan Hjelm <hjelmn@me.com> 406 Date: Sun Sep 30 11:49:01 2012 -0600 407 408 core: Keep a list of contexts (active_contexts_list) created by libusb_init. The list can be used by backends to determine which contexts need notification of device removal (and in the future device arrival). The active_contexts_list is protected from multiple access by the active_contexts_lock. 409 410 commit 251392979d418025e5dcadf515ca1a0b0f4d52e3 411 Author: Nathan Hjelm <hjelmn@me.com> 412 Date: Tue Oct 2 08:07:03 2012 -0600 413 414 darwin: add support for detecting superspeed devices (IOUSBFamily 5.0.0 or newer) 415 416 commit 81827fe1c358ef2b69da14bb52beec36dedce261 417 Author: Nathan Hjelm <hjelmn@me.com> 418 Date: Sun Sep 30 10:22:30 2012 -0600 419 420 clean up tabs 421 422 commit 6960cae5d0860f2060e5b0190d8b58d335317066 423 Author: Nathan Hjelm <hjelmn@me.com> 424 Date: Fri Sep 28 22:13:09 2012 -0600 425 426 darwin: use Release instead of IODestroyPlugInInterface to avoid stopping IOServices associated with a device 427 428 commit 775d8f71cecf5c3fa6f9da717cfbc728a0f8b7c2 429 Author: Nathan Hjelm <hjelmn@me.com> 430 Date: Fri Sep 28 21:18:36 2012 -0600 431 432 darwin: don't bother retrying or unsuspending Apple devices during enumeration 433 434 commit 0394057cb13b1d32d6aa1182b5d82f0f59f7031b 435 Author: Nathan Hjelm <hjelmn@me.com> 436 Date: Fri Sep 28 21:18:08 2012 -0600 437 438 darwin: reduce number of times libusb attempts to retrieve a device descriptor during enumeration 439 440 commit 2b044abace76ba0095ee5dbc71a7dac75e8c8f05 441 Author: Pete Batard <pete@akeo.ie> 442 Date: Wed Aug 22 01:32:10 2012 -0700 443 444 io.c: Handle >= 1 second transfer timeout in libusb_wait_for_event() 445 446 commit 3b821d0a709c6b5b3094a763bb04e48ed0447050 447 Author: Peter Stuge <peter@stuge.se> 448 Date: Wed Aug 22 01:32:10 2012 -0700 449 450 io.c: Handle >= 1 second transfer timeout in libusb_submit_transfer() 451 452 commit b7ed26c7add5528b71a205b4f04c242d3cbeab54 453 Author: Peter Stuge <peter@stuge.se> 454 Date: Sat Aug 4 14:27:55 2012 +0200 455 456 INSTALL_WIN.txt: Correct Windows backend webpage URL 457 458 commit cf60da545c915905869fa4007fcdc5faa75fdcbb 459 Author: Peter Stuge <peter@stuge.se> 460 Date: Sat Aug 4 14:26:43 2012 +0200 461 462 Windows: #include <windows.h> in header files 463 464 commit 36962a408b07920f2fdd61dda6bef0e9e319e7d2 465 Author: Peter Stuge <peter@stuge.se> 466 Date: Sun Jul 29 06:22:45 2012 +0200 467 468 Windows: Remove msvc/inttypes.h 469 470 This file might have been needed for platform abstraction, except that 471 all code shared among platforms doesn't need the file. Windows code in 472 particular does not need to use the file. 473 474 The file was used in one single place, where the PRIu64 define has now 475 been replaced with it's value "I64u". 476 477 commit 455b2d98869826db7276ddb69ce7b73f1acc9f94 478 Author: Peter Stuge <peter@stuge.se> 479 Date: Sat Jul 28 19:17:15 2012 +0200 480 481 libusb.h: Fix #145 libusb_ref_device() and libusb_unref_device() typos 482 483 commit 53e526e21b519300aff9c9579f886cfc107b0a30 484 Author: Simon Haggett <simon.haggett@realvnc.com> 485 Date: Tue Jul 10 16:07:45 2012 +0100 486 487 Windows: Stop leaking event handle when destroying condition variables 488 489 usbi_cond_destroy() must close the handle created by usbi_cond_intwait(). 490 491 commit c5194b408286229ce0d94765f963890057d46ee0 492 Author: Peter Stuge <peter@stuge.se> 493 Date: Tue Jul 10 16:54:16 2012 +0200 494 495 io.c: Avoid timerfd race condition between completion and new submit 496 497 An event handler thread working on transfer completion for the last 498 flying transfer with a timeout can end up racing with a call to 499 libusb_submit_transfer() from a second thread, so that the timerfd 500 gets disarmed even though libusb actually again has a transfer with 501 a timeout. 502 503 By arming or disarming the timerfd during completion strictly 504 according to remaining flying transfers while also holding the 505 flying_transfers_lock this change ensures that a new transfer can 506 not be added to the flying list until the completion code path has 507 armed/disarmed the timerfd according to the current flying list. 508 509 Hans de Goede describes the race condition situation in 510 http://sourceforge.net/mailarchive/message.php?msg_id=29520709 511 512 Signed-off-by: Peter Stuge <peter@stuge.se> 513 514 commit 0845ff2aeed9ad009d246ecc2a945f007817ca9a 515 Author: Peter Stuge <peter@stuge.se> 516 Date: Tue Jul 10 06:29:48 2012 +0200 517 518 .gitattributes: Set INSTALL_WIN.txt eol=crlf attribute 519 520 commit cd8e76f0b1f47271c4059cd6c1e67e23f0e247a8 521 Author: Pete Batard <pete@akeo.ie> 522 Date: Thu May 10 16:44:30 2012 +0100 523 524 Windows: Add INSTALL_WIN.txt 525 526 libusbx.git commit 75b1cf81db74357f55cc4d0f596ef19a6a25c5cd 527 528 [stuge: Remove trailing whitespace] 529 530 commit 3bd6db0b8f60143836f5a933f35b15d764fbc7dc 531 Author: Ludovic Rousseau <ludovic.rousseau@gmail.com> 532 Date: Wed May 9 09:13:41 2012 +0200 533 534 examples/Makefile.am: Use the implicit _SOURCES rule 535 536 By default automake looks for a source file foo.c for a foo binary. 537 538 libusbx.git commit 7e52e1e7534ead3f66b13bdcb28ac8587ff47ab0 539 540 commit 1bd831c4e88857bff2f1670c89eda1d04da1cc54 541 Author: Peter Stuge <peter@stuge.se> 542 Date: Tue Jul 10 01:46:38 2012 +0200 543 544 io.c: Only disarm timerfd when no flying transfer has a timeout 545 546 Commit 4630fc22cff8ad3e1afa9b223378c0aabe282b5c made libusb work 547 correctly when built to use timerfd but run on a kernel without 548 timerfd support. The commit unfortunately also broke the logic 549 during transfer completion which decides if the timerfd will be 550 disarmed or not, and disarm_timerfd() was called even if the 551 timerfd had already been armed with the next flying transfer 552 timeout. 553 554 Before the offending commit the timerfd would be disarmed only 555 when arm_timerfd_for_next_timeout() reported that there was no 556 flying transfer with a timeout. Let's restore that behavior. 557 558 The bug was spotted through code review both by the author and 559 by Hans de Goede, but was not squashed until Vincent Pellier 560 experienced transfers never timing out, and helped confirm 561 the source of the problem. Many thanks! 562 563 References #73. 564 565 commit ae996af002793005db318689229300ff73549964 566 Author: Ludovic Rousseau <ludovic.rousseau@gmail.com> 567 Date: Tue May 8 20:34:12 2012 +0200 568 569 Darwin: Fix warning: comparison between signed and unsigned 570 571 libusbx.git commit c5c6b0e69a13786e48b2b6254c8e5458dc6716cc 572 573 commit 0f29541c6728c9c2159080267b43e9b4144e9e56 574 Author: Ludovic Rousseau <ludovic.rousseau@gmail.com> 575 Date: Tue May 8 15:53:56 2012 +0200 576 577 Core: Return LIBUSB_ERROR_IO on sync API TRANSFER_ERROR and _CANCELLED 578 579 This is much more appropriate and also fixes gcc -Wswitch-enum warnings. 580 581 libusbx.git commit 30ccbd773bc02d5dfd21e02bfba6d58234f59393 582 583 commit 133092314d539d4c1a37997bb0c4ccfbcacb4677 584 Author: Ludovic Rousseau <ludovic.rousseau@gmail.com> 585 Date: Fri May 4 16:56:00 2012 +0100 586 587 autogen.sh: Correctly pass arguments containing spaces to configure 588 589 libusbx.git commit d20cd4f3573fe74d0ec5a4e1d60c9d291547ace4 590 591 commit 8dc8b977d796b227f59eb5a7b247b38e27748d52 592 Author: Ludovic Rousseau <ludovic.rousseau@gmail.com> 593 Date: Fri May 4 16:56:00 2012 +0100 594 595 autogen.sh: Exit script on first error 596 597 libusbx.git commit c74fe3ab703a28c6d8c3755213e3736c5d1eb35e 598 599 commit d8e35a560dfada578c6f6dea520d7d908b002001 600 Author: Toby Gray <toby.gray@realvnc.com> 601 Date: Thu May 3 11:25:11 2012 +0100 602 603 Windows: Fix deadlock when submitting transfers 604 605 The Windows backend needed to call usbi_fd_notification() from 606 submit_transfer() because a new event source is added for every WinUSB 607 transfer. This could cause a deadlock when attempting to lock the event 608 lock if another thread was processing events on the just-submitted 609 transfer. 610 611 The deadlock comes about as the thread calling libusb_submit_transfer() 612 acquires the transfer mutex before trying to acquire the event lock; this 613 is the other order of lock acquisition from an event thread handling 614 activity on the just submitted transfer. This could lead to one of two 615 deadlocks: 616 617 1) If the transfer completes while usbi_fd_notification() is waiting for 618 the event lock and the callback attempts to resubmit the transfer. 619 620 2) If the transfer timeout is hit while usbi_fd_notification() is waiting 621 for the event lock then the attempt to cancel the transfer will deadlock. 622 623 This patch fixes both of these deadlocks by having libusb_submit_transfer() 624 only call usbi_fd_notification() after having released the transfer mutex. 625 626 This deadlock was always present in the Windows code, but temporarily 627 deleted by mistake in commit 6506013c6d4face34cfec79dd0584e9f528cbc6a 628 and later restored in commit 325a8416697cf69b9b926ed68720f12b1aedf940. 629 630 libusbx.git commit 1ed09c7b2a5fc27c3cfea21740584879781bff67 631 632 [stuge: Touch up commit message] 633 634 commit b988c3d66e349b4f3c430410a42b6203f4fef80f 635 Author: Peter Stuge <peter@stuge.se> 636 Date: Sun Jun 3 21:28:13 2012 +0200 637 638 Clean up broken whitespace in list_for_each_entry() macros 639 640 Introduced by commit aa77b02da65afb0332b9e6853dae9e4dcda00bfa. 641 642 commit f651b2669c6ab0804d572650d79551bc2b70f525 643 Author: Peter Stuge <peter@stuge.se> 644 Date: Tue May 8 19:50:17 2012 +0200 645 646 examples: Add sam3u_benchmark isochronous example by Harald Welte 647 648 Copied with the author's permission under LGPL-2.1 from 649 usb-benchmark-project/host/benchmark.c in 650 git://git.gnumonks.org/sam3u-tests.git commit 651 74959f7ee88f1597286cd435f312a8ff52c56b7e 652 653 http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=sam3u-tests.git;a=blob;f=usb-benchmark-project/host/benchmark.c;h=74959f7ee88f1597286cd435f312a8ff52c56b7e 654 655 An Atmel SAM3U test firmware is also available in the above repository. 656 657 commit 3a69eff1aaf8e3242937bd7ecc94a60e7aa502cd 658 Author: Peter Stuge <peter@stuge.se> 659 Date: Tue May 8 19:22:31 2012 +0200 660 661 examples: Only check for HAVE_SIGACTION once in Makefile.am 662 663 commit d9dbb433f3f3b9787417e34316604d99cb72b188 664 Author: Peter Stuge <peter@stuge.se> 665 Date: Tue May 8 19:19:28 2012 +0200 666 667 .gitignore: Add examples/ path to the examples 668 669 commit a129732fb45fc424743f26f01c906e4514f11521 670 Author: Peter Stuge <peter@stuge.se> 671 Date: Tue May 8 19:14:40 2012 +0200 672 673 examples: Use a common LDADD for all examples 674 675 commit 325a8416697cf69b9b926ed68720f12b1aedf940 676 Author: Uri Lublin <uril@redhat.com> 677 Date: Tue May 1 16:47:34 2012 +0300 678 679 Windows: Make new transfers correctly notify the event handling thread 680 681 usbi_fd_notification() calls are added back into submit_*_transfer() 682 so that the event handling thread will be aware of new transfers. 683 684 libusb.git commit 6506013c6d4face34cfec79dd0584e9f528cbc6a from 685 libusbx.git commit 4cccbed825fe1dc138121640a6497d7d05aac159 removed 686 these calls during the removal of the DYNAMIC_FDS Windows-specific 687 688 [stuge: Rewrite commit message] 689 690 commit 4674b4d137df2e2e49a1057c947888de8f37d6e8 691 Author: Ludovic Rousseau <ludovic.rousseau+github@gmail.com> 692 Date: Fri Apr 20 22:25:38 2012 +0100 693 694 Linux: Fix warning: comparison between signed and unsigned 695 696 libusbx.git commit 36a7119bf296cecd4e910bef86908fd782224960 697 698 commit ab9cd5a7be637f7b793987971a706b1d11c27ded 699 Author: Peter Stuge <peter@stuge.se> 700 Date: Fri Apr 20 08:10:11 2012 +0200 701 702 libusb-1.0.9 703 704 commit 696400ad83531bcf944c71164a46f9ccb6a33df3 705 Author: Peter Stuge <peter@stuge.se> 706 Date: Fri Apr 20 08:08:34 2012 +0200 707 708 AUTHORS: Update list of contributors 709 710 commit 19f94537ea55586dd85f8d627fcfaa6173069ea1 711 Author: Peter Stuge <peter@stuge.se> 712 Date: Fri Apr 20 06:41:34 2012 +0200 713 714 AUTHORS: Add Martin Pieuchot as copyright holder 715 716 commit 1a1c633d7912a2565f6af0c9294e10a759d40e05 717 Author: Peter Stuge <peter@stuge.se> 718 Date: Fri Apr 20 06:41:12 2012 +0200 719 720 AUTHORS: Add Hans de Goede as copyright holder 721 722 commit 9477f793341d59cc861acb283e6cb03b5730ac91 723 Author: Peter Stuge <peter@stuge.se> 724 Date: Fri Apr 20 06:40:45 2012 +0200 725 726 AUTHORS: Add Peter Stuge as copyright holder 727 728 commit 4b0dfe9770356af3c51103a9b3d63c5f8cc63d8b 729 Author: Pete Batard <pete@akeo.ie> 730 Date: Mon Apr 2 15:47:53 2012 +0100 731 732 AUTHORS: Update Pete Batard's copyright years and email address 733 734 libusbx.git commit f98eaca0985364be00fcfde3fd3884075092a4e9 735 736 [stuge: Remove unrelated changes] 737 738 commit 9f0ea78357b7b1654cb3e7de6ff57f5f378b68f1 739 Author: Peter Stuge <peter@stuge.se> 740 Date: Fri Apr 20 08:35:04 2012 +0200 741 742 AUTHORS: Update Nathan Hjelm's copyright years 743 744 commit 8d38506ebc9fb57a40113e5a7739572a42b826d8 745 Author: Peter Stuge <peter@stuge.se> 746 Date: Fri Apr 20 06:36:08 2012 +0200 747 748 README: Add the BSDs, punctuation, mailinglist link, and remove Daniel 749 750 commit 05cbe2de45806db309343cdf298d8569c55863e5 751 Author: James Hanko <james.hanko@tridentmicro.com> 752 Date: Wed Oct 19 17:32:34 2011 -0700 753 754 Linux: Search for /dev/usbdev<bus>.<device> USB device special files 755 756 If neither the (now deprecated) usbfs filesystem nor udev is available 757 then libusb searches for device nodes also in /dev where they may be 758 created if the kernel was built with the option CONFIG_USB_DEVICE_CLASS. 759 This helps on embedded systems such as Android, and all mdev users. 760 761 Fixes #119. 762 763 commit a806d169e6b5f675289cb9307fcd6b908edd9219 764 Author: Peter Stuge <peter@stuge.se> 765 Date: Fri Apr 20 04:32:47 2012 +0200 766 767 Add a timestamp in log messages 768 769 Fixes #34. 770 771 commit 03f4d40c748506c85f88427dd53afd5c663a2929 772 Author: Peter Stuge <peter@stuge.se> 773 Date: Fri Apr 20 02:24:44 2012 +0200 774 775 Include library version in the very first libusb_init() debug message 776 777 commit 84d5eafd1f24a1c6f77f0c2a2ad40e1fbfdea381 778 Author: Martin Pieuchot <mpi@openbsd.org> 779 Date: Thu Apr 19 13:33:36 2012 +0200 780 781 OpenBSD: Provide libusb_get_device_speed() data 782 783 Because the different speed values used by the libusb and OpenBSD's 784 usb_device_info structure are compatible, keep the code simple and 785 just copy the value returned by the USB_GET_DEVICEINFO ioctl() call. 786 787 Fixes #45. 788 789 commit c145ec09732fac2eef53accc07314040d22b64a5 790 Author: Peter Stuge <peter@stuge.se> 791 Date: Fri Apr 20 00:11:01 2012 +0200 792 793 doc/Makefile.am: Remove username from SF web rsync upload command 794 795 Commit c407a2d97b6f8715d3452257a0adac40a20178e6 did it for tarballs. 796 797 libusbx.git commit ca159f15737e9097a4d031c9950f281c42af040a 798 799 commit 6506013c6d4face34cfec79dd0584e9f528cbc6a 800 Author: Pete Batard <pete@akeo.ie> 801 Date: Tue Apr 10 13:30:24 2012 +0100 802 803 Windows: Remove #define compile time options in the backend source code 804 805 * The DYNAMIC_FDS, AUTO_CLAIM and FORCE_INSTANT_TIMEOUTS options 806 were introduced for development/testing and don't appear to be 807 used by the Windows backend users => remove them. 808 809 libusbx.git commit 4cccbed825fe1dc138121640a6497d7d05aac159 810 811 commit e291e369b975692dfa1a0f029244af597fa61220 812 Author: Pete Batard <pete@akeo.ie> 813 Date: Tue Apr 10 13:05:37 2012 +0100 814 815 Windows: Warn on one libusb_get_device_list() memory allocation failure 816 817 libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b 818 819 commit 2f40a03ea0552cd8b5ce3d7667b20dc04da061da 820 Author: Pete Batard <pete@akeo.ie> 821 Date: Tue Apr 10 13:05:37 2012 +0100 822 823 Windows: Add textual error name to debug message on auto-release errors 824 825 libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b 826 827 commit 3c7f85a49b42ac36c6d41294858518c554ac4694 828 Author: Pete Batard <pete@akeo.ie> 829 Date: Tue Apr 10 13:05:37 2012 +0100 830 831 Windows: Silence warning about unused function guid_to_string() 832 833 Commit 6b1982b1bd321b55698ce537e64648e8aec85f6f removed the #ifdef 834 around guid_to_string() but this ended up causing a warning when 835 the function wasn't being called. Add it back with correct _MSC_VER. 836 837 libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b 838 839 [stuge: Rewrite commit message for libusb.git] 840 841 commit eb55963a6b33799ea76c34f538f21e86f235ea62 842 Author: Pete Batard <pete@akeo.ie> 843 Date: Tue Apr 10 13:05:37 2012 +0100 844 845 Windows: Base DUMMY_HANDLE on LONG_PTR instead of LONG 846 847 libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b 848 849 commit d930865987de523061eca259a7fed11aea626831 850 Author: Pete Batard <pete@akeo.ie> 851 Date: Tue Apr 10 13:05:37 2012 +0100 852 853 Windows: Prefer calloc() over malloc() and cast all allocations 854 855 This silences VS2010 intellisense warnings on memory allocation. 856 857 libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b 858 859 commit df35117ce58b74fa530baaaccc30adaf432398ea 860 Author: Peter Stuge <peter@stuge.se> 861 Date: Thu Apr 19 22:55:44 2012 +0200 862 863 Add libusb_get_version() API function 864 865 Let's see how this will be used. Fixes #53. 866 867 libusbx.git commit 37dfd16c8c2f36c81c86de303072def0dc405e32 868 869 [stuge: Remove unrelated changes] 870 [stuge: Add struct libusb_version member rc for release candidate suffix] 871 [stuge: Add struct libusb_version member describe for git describe output] 872 873 commit 29d5f63c5765f36ea65b55c4cd5f36e1f10a4dae 874 Author: Peter Stuge <peter@stuge.se> 875 Date: Thu Apr 19 22:25:07 2012 +0200 876 877 Windows: Rename VS2005 solution and add VS2010 project files 878 879 libusbx.git commit fcad0941e52eb2fd6d57d3327f420db14dfabf0b 880 881 [stuge: Remove xusb references] 882 [stuge: Add newlines at end of new files] 883 [stuge: Rename libusb_20??.sln to libusb_vs20??.sln] 884 885 commit b217ec1f904c4382010a3a834a7c58d595b594cf 886 Author: Pete Batard <pete@akeo.ie> 887 Date: Sat Mar 31 22:32:56 2012 +0100 888 889 libusb/Makefile.am: Fix missing DLL .def file from make dist 890 891 libusbx.git commit 10dc1ea9a799b13b7423968130da812aa97289bf 892 893 [stuge: Use EXTRA_DIST in libusb/Makefile.am instead] 894 895 commit 54cb51d8417e0128eb9088bf628db138c9daa2a0 896 Author: Pete Batard <pete@akeo.ie> 897 Date: Sat Mar 31 22:14:47 2012 +0100 898 899 Makefile.am: Fix msvc dir not being included in make dist 900 901 libusbx.git commit a8a80b60a14e3a8269e42dedf34fda66da8e0e50 902 903 commit 38d5ba472c6cb728ec818a0c8d964b632c8a7992 904 Author: Hans de Goede <hdegoede@redhat.com> 905 Date: Fri Mar 30 13:40:32 2012 +0100 906 907 Linux: Don't spam the console with 'device unconfigured' errors 908 909 libusbx.git commit 3c968be61befc47d33562843e5479ff67303b0c4 910 911 commit 93f14087b2e79d71ba1e53c0b9c7da655dd1258e 912 Author: Nathan Hjelm <hjelmn@me.com> 913 Date: Thu Apr 19 05:52:58 2012 -0600 914 915 Darwin: Silence warning: cast from pointer to integer of different size 916 917 As per http://marc.info/?m=133483651109899 918 919 Reported-by: Xiaofan Chen <xiaofanc@gmail.com> 920 921 commit 0efc2086646200d8dee86cbbb1e98136383a05c3 922 Author: Pete Batard <pete@akeo.ie> 923 Date: Thu Mar 29 23:21:25 2012 +0100 924 925 .gitattributes: Add export-ignore for .gitattributs and .gitignore 926 927 This keeps the git files out of archives created by gitweb. 928 929 libusbx.git commit 2250152b251243f75c951533ae7b1139a785cfe6 930 931 [stuge: Removed unrelated whitespace changes] 932 933 commit a7ef55c02f0116b94cb75831e5d90ad258c662f8 934 Author: Pete Batard <pete@akeo.ie> 935 Date: Wed Mar 28 01:02:02 2012 +0100 936 937 Windows: fix Clang warnings about unused assignations 938 939 libusbx.git commit c0e7b289fdb35687b90263b14426319d2b96b132 940 941 commit ac8eed67e1595ee5a069623e48362d8a85dcb252 942 Author: Pete Batard <pete@akeo.ie> 943 Date: Mon Mar 26 23:34:25 2012 +0100 944 945 configure.ac: LT_LANG([Windows Resource]) makes windres check redundant 946 947 libusbx.git commit 4f9fd6a29a712b0e3312983e9ff153e6d7ed0822 948 949 commit 89ce6f7d05dc8ff4a441a01b192d2e20857f6c48 950 Author: Pete Batard <pete@akeo.ie> 951 Date: Tue Mar 27 00:03:07 2012 +0100 952 953 Windows: Bring .vcproj x86_64 output directories in line with x86_32 954 955 libusbx.git commit abdb4437ea1897226076fa706651e350dba1cfd5 956 957 commit 77743c6f5b3cfa2d06dcb32204bc65d8bd4fec80 958 Author: Hans de Goede <hdegoede@redhat.com> 959 Date: Fri Mar 9 11:31:11 2012 +0100 960 961 Linux: Fix a comment in handle_iso_completion() 962 963 Fix the comment at the end of handle_iso_completion, we don't stop on 964 urbs / isoc packets with less data then requested, which is a good 965 thing since it is a normal condition for isoc transfers. 966 967 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 968 969 commit 5b87c2c7475a8d68270e19336afec0c5a08579ca 970 Author: Hans de Goede <hdegoede@redhat.com> 971 Date: Fri Mar 9 11:31:10 2012 +0100 972 973 Linux: Remove bogus status handling from handle_iso_completion() 974 975 Remove a useless check+set of status because: 976 1. The check is always true; and 977 2. The new value is never used 978 979 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 980 981 commit e23d8f67eab947e5d41216e0139f0a50d1342ef8 982 Author: Hans de Goede <hdegoede@redhat.com> 983 Date: Fri Mar 9 11:31:09 2012 +0100 984 985 Linux: Translate isoc packet status codes to LIBUSB_TRANSFER_ codes 986 987 During testing of my usbredir code I hit a scenario where my libusb 988 app was seeing EXDEV as status in the transfer's iso_packet_desc. 989 990 This happened because we didn't translate linux negative errno errors 991 in each isoc packet's status to LIBUSB_TRANSFER_ status codes! This 992 patch adds these translations. 993 994 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 995 996 commit 7199bc2c9c351b553b6175a588237ee793719281 997 Author: Hans de Goede <hdegoede@redhat.com> 998 Date: Fri Mar 9 11:31:08 2012 +0100 999 1000 Linux: Fix URB return code handling 1001 1002 During testing of my usbredir code I hit a case where EOVERFLOW was not 1003 handled in handle_control_completion(). Instead of just fixing this one 1004 case I've audited (and fixed where necessary) all handle_foo_completion() 1005 functions to know about all errors documented in 1006 linux/Documentation/usb/error-codes.txt. 1007 1008 Note that for handle_iso_completion() this patch actually removes the 1009 handling of some codes, since these can never occur on an iso urb (they 1010 can only occur on the iso packets included in the urb, see the next patch 1011 in this series). Also, in case an unknown status is encountered on an iso 1012 urb this patch sets the urb's status to ERROR rather then leaving it at 1013 completed. 1014 1015 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1016 1017 commit 98bc7b8d125c2756deadfc889dcefd4e6f2fcd02 1018 Author: Hans de Goede <hdegoede@redhat.com> 1019 Date: Fri Mar 9 11:31:07 2012 +0100 1020 1021 Don't print an error when libusb_cancel_transfer() fails with NOT_FOUND 1022 1023 As stated in the documentation for libusb_cancel_transfer(), 1024 LIBUSB_ERROR_NOT_FOUND is an expected return value for 1025 libusb_cancel_transfer() under certain circumstances, so 1026 printing an error every time this happens is undesirable. 1027 1028 Even more so because under Linux IOCTL_USBFS_DISCARDURB sets errno 1029 to EINVAL when the kernel can't not find the urb in the kernel's 1030 urbs-in-flight list, which means that the urb has already completed 1031 at the host controller level but it has not necessarily been reaped 1032 yet. IOW under Linux libusb_cancel_transfer() may yield a result of 1033 LIBUSB_ERROR_NOT_FOUND *before* the transfer's callback has been 1034 called! In conclusion there is no way for applications to avoid 1035 calling libusb_cancel_transfer() on already completed transfers, 1036 and these errors can and do happen frequently for some USB traffic. 1037 1038 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1039 1040 commit 4db8275da59996eb1c22d2e9e9c527fa58b288ad 1041 Author: Hans de Goede <hdegoede@redhat.com> 1042 Date: Fri Mar 9 11:31:06 2012 +0100 1043 1044 Linux: Fix cancel_transfer return value when cancelling a multi-urb transfer 1045 1046 If we fail to cancel the last urb of a multi-urb transfer because it 1047 has already completed (errno == EINVAL on DISCARD_URB), then the entire 1048 transfer has already completed, so returning NOT_FOUND is consistent 1049 with what the documentation for libusb_cancel_transfer() says. 1050 1051 But if we've successfully cancelled the last urb, and then another urb 1052 fails with errno == EINVAL, this means that we've still cancelled the 1053 transfer, as it has only *partially* completed. 1054 1055 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1056 1057 commit b22253ba9cbd399299b534a8c5e3bbac3f240963 1058 Author: Peter Stuge <peter@stuge.se> 1059 Date: Thu Apr 19 04:05:29 2012 +0200 1060 1061 libusb-1.0.pc: Mention OpenBSD and NetBSD in description 1062 1063 commit 6aa0fc60d94e3123de230d3fbc9196814c0e466e 1064 Author: Peter Stuge <peter@stuge.se> 1065 Date: Mon Apr 16 05:59:44 2012 +0200 1066 1067 io.c: Add debug message with the callback address on completed transfer 1068 1069 commit de41604560a57b2279ac1d0a10b8192a9224d284 1070 Author: Xiaofan Chen <xiaofanc@gmail.com> 1071 Date: Sun Apr 15 11:50:27 2012 +0800 1072 1073 Experimental support for NetBSD using the OpenBSD backend 1074 1075 Signed-off-by: Xiaofan Chen <xiaofanc@gmail.com> 1076 1077 commit 404054cb508881c9bd6bc575b66c4f509046b4af 1078 Author: Peter Stuge <peter@stuge.se> 1079 Date: Thu Apr 19 00:41:45 2012 +0200 1080 1081 configure.ac: Separate per-OS backend selection from per-backend settings 1082 1083 commit 2eba7e4197cf9afa77451186e1a116ee3ae91adc 1084 Author: Xiaofan Chen <xiaofanc@gmail.com> 1085 Date: Sun Apr 15 07:17:18 2012 +0800 1086 1087 Linux: Silence unused variable warnings when without CLOCK_MONOTONIC 1088 1089 Signed-off-by: Xiaofan Chen <xiaofanc@gmail.com> 1090 1091 commit bc790a9c414871cc1d33f1c7686048434a700e45 1092 Author: Peter Stuge <peter@stuge.se> 1093 Date: Sat Apr 7 05:20:36 2012 +0200 1094 1095 examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded 1096 1097 The OpenBSD C compiler generates a warning for every use of sprintf() 1098 and for a good reason. Reported in http://marc.info/?m=133376187514495 1099 1100 Reported-by: Xiaofan Chen <xiaofanc@gmail.com> 1101 1102 commit bffa232dca51bcc41df71c5735fa56370b7509ad 1103 Author: Peter Stuge <peter@stuge.se> 1104 Date: Sat Apr 7 03:55:36 2012 +0200 1105 1106 OpenBSD: Fix warning: 'hpriv' may be used uninitialized 1107 1108 As reported in http://marc.info/?m=133376187514495 1109 1110 The variable would be used uninitialized when the internal list of 1111 open devices is empty as obsd_handle_events() checks which device 1112 the event fd belongs to, which can not actually happen, but if it 1113 ever does happen then we will now return LIBUSB_ERROR_NO_DEVICE. 1114 1115 Reported-by: Xiaofan Chen <xiaofanc@gmail.com> 1116 1117 commit 6b1982b1bd321b55698ce537e64648e8aec85f6f 1118 Author: Moses McKnight <moses@texband.net> 1119 Date: Fri Mar 30 21:53:20 2012 -0500 1120 1121 Windows: Fix build on VC++2003 which doesn't support variadic macros 1122 1123 Change _MSC_VER tests to check for >= 1400 instead of > 1200 because 1124 Visual C++ did not support variadic macros until VC++2005, as per 1125 http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx 1126 1127 Since usbi_dbg() is a function and not a macro with the old MS C 1128 compilers the functions guid_to_string() and windows_error_str() 1129 need to be compiled unconditionally, and the compiler should remove 1130 the dead code when debug logging is disabled on newer compilers. 1131 1132 commit 58ac0355e547080c82d02685a32480b891383d3d 1133 Author: Peter Stuge <peter@stuge.se> 1134 Date: Sat Mar 31 03:44:40 2012 +0200 1135 1136 Windows: Don't use a log function body macro for old MS compilers 1137 1138 The duplication is a lot more straightforward than the previous LOG_BODY 1139 macro, which also didn't handle the special debug case correctly. The 1140 duplicated code is fortunately not very long. 1141 1142 commit 76af4c99bd6122c1dd7b58858b669c919d8c8806 1143 Author: Peter Stuge <peter@stuge.se> 1144 Date: Thu Mar 22 01:52:59 2012 +0100 1145 1146 libusbi.h: Add IS_EPIN() IS_EPOUT() IS_XFERIN() and IS_XFEROUT() macros 1147 1148 The macros make backend code a little simpler to read, since the 1149 transfer and endpoint direction is checked in several places across 1150 the supported platforms. 1151 1152 commit e3d0a4cb9e2f9872c9fdbb22d7ded169e111fc8f 1153 Author: Peter Stuge <peter@stuge.se> 1154 Date: Wed Feb 22 14:21:54 2012 +0100 1155 1156 Add LIBUSB_TRANSFER_ADD_ZERO_PACKET flag to indicate need for ZLP 1157 1158 Some protocols which use USB require an extra zero length data packet 1159 to signal end-of-transfer on bulk endpoints, if the last data packet 1160 is exactly wMaxPacketSize bytes long. 1161 1162 This flag allows applications to inform libusb about this requirement, 1163 so that libusb can handle the issue transparently. 1164 1165 At the moment the new flag is only supported on Linux, and submitting 1166 a transfer with the flag set returns an error at submit time on other 1167 systems. Hopefully implementations will soon follow for other systems. 1168 1169 References #6. 1170 1171 commit 7e0c747cc5ed0a31f38dff5eb5f03d4043b05ada 1172 Author: Peter Stuge <peter@stuge.se> 1173 Date: Sun Feb 19 06:58:16 2012 +0100 1174 1175 libusb.h: Add comma after last value in enums to ease future expansion 1176 1177 commit c20ec7a927c05e0b960269751c26ab2b6e0b39ab 1178 Author: Peter Stuge <peter@stuge.se> 1179 Date: Sun Feb 19 05:39:33 2012 +0100 1180 1181 Linux: Rework bulk continuation check to generic kernel version check 1182 1183 The old check_flag_bulk_continuation() tested for one specific running 1184 kernel version. The new kernel_version_ge() instead allows to test the 1185 running kernel version against major, minor and sublevel parameters. 1186 1187 commit cf8f5a7be821099b143fcea8e4ba553daa22818b 1188 Author: Peter Stuge <peter@stuge.se> 1189 Date: Sun Feb 19 05:32:10 2012 +0100 1190 1191 OpenBSD: Correctly catch attempts to do isochronous OUT transfers 1192 1193 LIBUSB_ENDPOINT_OUT is the value of the direction bit, which is 0 for 1194 OUT transfers, so the previous condition could never evaluate to true. 1195 1196 commit ae8e86cffb81858af5eeddbf2ea1aec6d55f573d 1197 Author: Peter Stuge <peter@stuge.se> 1198 Date: Sun Feb 19 00:42:20 2012 +0100 1199 1200 Darwin: Do not reject devices with product id 0x0000 1201 1202 Fixes #128. 1203 1204 commit 4630fc22cff8ad3e1afa9b223378c0aabe282b5c 1205 Author: Peter Stuge <peter@stuge.se> 1206 Date: Mon Feb 13 16:59:51 2012 +0100 1207 1208 Do not call timerfd functions when timerfd is not being used 1209 1210 When libusb was built with timerfd support but used on a system 1211 without timerfd support the library would hang indefinitely on 1212 completion of the first transfer, since timerfd functions were 1213 being called unconditionally and the error returned when timerfd 1214 was not being used caused a confused internal state. 1215 1216 Many thanks to Ivo Smits for looking into the issue, proposing 1217 an initial solution, and helping with testing! Fixes #73. 1218 1219 commit c40f3df1efbb9232b525e5f675746762ca2304b8 1220 Author: Michael Plante <michael.plante@gmail.com> 1221 Date: Sun Feb 12 13:49:35 2012 -0500 1222 1223 Windows: Fix MSVC6 IDE warning on line continuation in libusb-1.0.rc 1224 1225 * libusb\libusb-1.0.rc(21): Could not find the file LIBUSB_RC. 1226 * only shows up first time after opening workspace. 1227 * shows up on either build or clean. 1228 * not actually due to rc.exe, but prior to it. 1229 * probably an IDE bug. 1230 * does not show up when running an exported makefile. 1231 1232 Signed-off-by: Michael Plante <michael.plante@gmail.com> 1233 1234 commit 5526841023101bafa280755c3bd19fc44b9c32a0 1235 Author: Pete Batard <pete@akeo.ie> 1236 Date: Sat Jan 7 23:30:23 2012 +0000 1237 1238 Windows: Add Renesas SuperSpeed support for libusb_get_device_speed() 1239 1240 * tests conducted using a Renesas PCIE USB 3.0 controller and driver and 1241 a mass storage USB 3.0 confirm that USB_NODE_CONNECTION_INFORMATION_EX 1242 uses (undocumented) value 3 for SuperSpeed 1243 1244 commit 3df437680f8f5406795ec5f32d96612d327b2ca4 1245 Author: Peter Stuge <peter@stuge.se> 1246 Date: Fri Feb 10 18:06:43 2012 +0100 1247 1248 autogen.sh: Try to use libtoolize before trying glibtoolize 1249 1250 This helps on Mac OS X where an old glibtoolize is included in the 1251 system and newer, manually installed, versions provide libtoolize. 1252 1253 See also http://marc.info/?m=132490560131894 1254 1255 commit 4afbc78fe09bfc3dd7a609e5f82e9272c9e6226d 1256 Author: Peter Stuge <peter@stuge.se> 1257 Date: Wed Feb 8 15:54:21 2012 +0100 1258 1259 Rename the lsusb example program to listdevs 1260 1261 This is intended to reduce confusion with the much more significant 1262 lsusb utility which is part of the usbutils package. 1263 1264 commit 57ab55159298b7057e0dd9b3854f7fd1550588ed 1265 Author: Sean McBride <sean@rogue-research.com> 1266 Date: Fri Dec 9 13:44:21 2011 -0500 1267 1268 core.c: Fix clang warning about useless store to a variable 1269 1270 commit 32bbbd133e24c24d02646c0f7d1963404d4955f2 1271 Author: Sean McBride <sean@rogue-research.com> 1272 Date: Fri Dec 9 13:43:46 2011 -0500 1273 1274 Darwin: Clarify comments on event thread creation and termination 1275 1276 commit 6cf3285a4e0dfaec0fe53b8eb6a9281e3c5bcb6c 1277 Author: Sean McBride <sean@rogue-research.com> 1278 Date: Fri Dec 9 13:43:46 2011 -0500 1279 1280 Darwin: Fix incorrect mutex protection of libusb_darwin_acfl global 1281 1282 commit 662ced422cf1ffce68753296a81dccf87f3a1c57 1283 Author: Sean McBride <sean@rogue-research.com> 1284 Date: Fri Dec 9 13:43:46 2011 -0500 1285 1286 Darwin: Use retained runloop variable instead of CFRunLoopGetCurrent() 1287 1288 commit 952a9bb6116afc69c4bae4714c2eb0713bf62a6d 1289 Author: Sean McBride <sean@rogue-research.com> 1290 Date: Fri Dec 9 13:37:22 2011 -0500 1291 1292 Darwin: Fix libusb_init() and libusb_exit() refcount race condition 1293 1294 Use OSAtomicIncrement32Barrier() and OSAtomicDecrement32Barrier() 1295 in darwin_init() and darwin_exit() to be thread safe. 1296 1297 commit 721cc1c19fc8e88c4482ab3d1e8a34fa100c403c 1298 Author: Sean McBride <sean@rogue-research.com> 1299 Date: Fri Dec 9 13:33:28 2011 -0500 1300 1301 threads_posix.c: Fix prototype warning by including threads_posix.h 1302 1303 commit f6ef0fca4b36657c1a0885c18cc4c4afcb4f7339 1304 Author: Dave Camarillo <dave.camarillo@gmail.com> 1305 Date: Fri Sep 23 11:56:58 2011 +0100 1306 1307 Windows: Fix crash during enumeration with >= 64 connected devices 1308 1309 * indexes were outgrowing the unref_list array before realloc, 1310 resulting in out of bound access and crash. 1311 1312 commit e280760331e8b39ad3530235653644654166b322 1313 Author: Pete Batard <pbatard@gmail.com> 1314 Date: Tue Oct 26 16:31:13 2010 +0100 1315 1316 Windows MSVC6: Remove SetupAPI, AdvAPI32 and OLE32 dependencies 1317 1318 * this ensures that libusb dependent applications only need 1319 to link with libusb on Windows 1320 * (copied from Pete's msvc08 mods to msvc6 by Michael) 1321 1322 commit fa66c93253855c9146011a6854d65df6d390039f 1323 Author: Pete Batard <pbatard@gmail.com> 1324 Date: Tue Dec 13 21:18:10 2011 -0500 1325 1326 Windows: Output an error message on calls to libusb_get_pollfds() 1327 1328 Signed-off-by: Michael Plante <michael.plante@gmail.com> 1329 1330 commit 637145ed29ee7c7b13ac45d10cf1f798fc06cbd9 1331 Author: Pete Batard <pbatard@gmail.com> 1332 Date: Thu Jun 3 22:14:20 2010 -0500 1333 1334 io.c: Fix comment since pthreads isn't the only threading libusb uses 1335 1336 commit bb37939ab44a54a054f73e2f381808b12fb9cb33 1337 Author: Michael Plante <michael.plante@gmail.com> 1338 Date: Mon Aug 2 19:59:12 2010 -0500 1339 1340 libusb.h: Cast in libusb_get_string_descriptor() to avoid MSVC6 warning 1341 1342 On MSVC6 bitwise OR promotes to int, causing the warning. 1343 1344 commit ca09754471acba9a22fe8fc09170e5660d1d5c5d 1345 Author: Michael Plante <michael.plante@gmail.com> 1346 Date: Fri Dec 23 16:50:21 2011 -0600 1347 1348 Windows: guid_to_string() is only discarded when macro-usbi_dbg used 1349 1350 * usbi_dbg encloses all references to guid_to_string 1351 * MinGW/cygwin warn about an unused function, so the #if 1352 squelches this warning 1353 * MSVC6 uses a variadic function form of usbi_dbg instead 1354 of a macro, so the compiler still "sees" guid_to_string 1355 and it therefore needs to always be defined for MSVC6, 1356 even if it's only a stub. 1357 * So we define it if usbi_dbg is used OR if MSVC6 is used. 1358 1359 Signed-off-by: Michael Plante <michael.plante@gmail.com> 1360 1361 commit 8e15adcb0089882d10269ab77d35e193770ab90e 1362 Author: Pete Batard <pete@akeo.ie> 1363 Date: Tue Nov 15 01:11:12 2011 +0000 1364 1365 Windows: Fix undefined datatype 'LONG_PTR' in MSVC6 1366 1367 * issue reported by Elmi 1368 1369 Signed-off-by: Michael Plante <michael.plante@gmail.com> 1370 1371 commit 17ad642cae618cc09c5516612fa3880d4b6b8635 1372 Author: Pete Batard <pete@akeo.ie> 1373 Date: Sun Nov 13 23:10:15 2011 +0000 1374 1375 Windows: Fix for MSVC6 preprocessor not accepting blank parameters 1376 1377 * unlike later iterations of Visual Studio, MSVC6 does not accept 1378 blank parameters on macro calls [eg. CALL(a, ,b)] 1379 * blank params were used with the DLL_DECLARE and DLL_LOAD macros 1380 * issue reported by Elmi 1381 1382 commit c591a7cbf7dbc6fbb4368e65cf58a8cd02582aeb 1383 Author: Michael Plante <michael.plante@gmail.com> 1384 Date: Tue Oct 26 11:39:38 2010 +0100 1385 1386 Windows: Switch MSVC6 .dsp project files from MBCS to Unicode 1387 1388 * MBCS (which is different from UTF-8) only makes sense if 1389 supporting Windows 95/98, which we don't 1390 * (try to match Pete's vcproj changes in MSVC6) 1391 1392 commit 536e424fd7d057fc3f20f9939f9de4572e51c815 1393 Author: Michael Plante <michael.plante@gmail.com> 1394 Date: Tue Dec 13 21:39:40 2011 -0500 1395 1396 Windows: Add missing MSVC6 lsusb.dsp project file 1397 1398 Signed-off-by: Michael Plante <michael.plante@gmail.com> 1399 1400 commit c56828857eb7ba6fb4f7701693dbb3fe4e75d5f6 1401 Author: Martin Pieuchot <mpi@openbsd.org> 1402 Date: Mon Jan 30 09:59:30 2012 +0100 1403 1404 OpenBSD backend 1405 1406 commit d2285744c7fa4007bb411be354268209d350b0f2 1407 Author: Xiaofan Chen <xiaofanc@gmail.com> 1408 Date: Fri Jan 13 18:07:34 2012 +0100 1409 1410 configure.ac: Darwin: Move -lobjc from LIBS to PC_LIBS_PRIVATE 1411 1412 Since commit 40327cd134718475f6cec8935b856d4fdff2099c it is neccessary 1413 to explicitly include -lobjc not only when linking libusb itself, but 1414 also for programs linking statically against libusb. References #63. 1415 1416 See also http://marc.info/?m=132505900202378 1417 1418 commit 93b0e09d53ed1d177631af9182378492481a790a 1419 Author: Xiaofan Chen <xiaofanc@gmail.com> 1420 Date: Fri Jan 13 13:04:00 2012 +0100 1421 1422 examples: Link only with ../libusb/libusb-1.0.la and not with -lusb-1.0 1423 1424 Previous _LDFLAGS included both the freshly built libusb in ../libusb 1425 and -lusb-1.0, where libtool would usually resolve the latter to an 1426 already-installed libusb library in the system. The extra reference 1427 to a second libusb library resulted in failure to build examples on 1428 Mac OS X in some cases, and is plain wrong. 1429 1430 See also the thread at http://marc.info/?m=132637593623667 1431 1432 commit cdc5df8f1b206a7c19bc221e8a9a97d5d98deb85 1433 Author: Peter Stuge <peter@stuge.se> 1434 Date: Thu Jan 12 10:34:55 2012 +0100 1435 1436 libusb/Makefile.am: Avoid recursive variables in .rc silent-rule 1437 1438 Not every make supports recursive variable expansion so some automake 1439 versions complain about non-POSIX variable names ever since commit 1440 70bec4a9f8ec28d36c731011fa24d37c74ad3523 which added support for 1441 silent-rules in our rule to compile the Windows .rc file. 1442 1443 This commit removes the recursive variables and instead uses the 1444 simple and generic GEN message and associated variable. 1445 1446 commit a8e2e7cab278fbfcba91909eaf762cf66da9eda5 1447 Author: Ludovic Rousseau <ludovic.rousseau+github@gmail.com> 1448 Date: Sat Sep 24 18:27:54 2011 +0200 1449 1450 Core: Fix #122 warning: no previous prototype for âusbi_log_vâ 1451 1452 Declare the usbi_log_v() function before using it. 1453 1454 commit e88ecb1e65604c222f82da586bb9e9066d66fbba 1455 Author: Sean McBride <sean@rogue-research.com> 1456 Date: Fri Oct 14 14:40:29 2011 -0400 1457 1458 Darwin: Set a name for the background thread on Mac OS X 10.6 and later 1459 1460 The call to pthread_setname_np() makes it easy to identify the 1461 background thread in the Xcode debugger and in crash reports. 1462 1463 commit 60bad550dcb31a315a667a6614c52f712c82f45f 1464 Author: Peter Stuge <peter@stuge.se> 1465 Date: Thu Sep 22 21:42:35 2011 +0200 1466 1467 libusb/Makefile.am: Add libusb-1.0.rc dependency on version.h 1468 1469 commit 70bec4a9f8ec28d36c731011fa24d37c74ad3523 1470 Author: Peter Stuge <peter@stuge.se> 1471 Date: Thu Sep 22 21:38:29 2011 +0200 1472 1473 libusb/Makefile.am: Make the libusb-1.0.rc rule support silent-rules 1474 1475 commit fa9b682a638e54a4556ef6bd343ef56d6300a520 1476 Author: Peter Stuge <peter@stuge.se> 1477 Date: Thu Sep 22 21:17:37 2011 +0200 1478 1479 configure.ac: Enable libtool support for Windows Resource language 1480 1481 commit 58c73ddca310f757fc7ca75197bf3d7ca58ce29a 1482 Author: Sean McBride <sean@rogue-research.com> 1483 Date: Mon Sep 19 12:52:44 2011 -0400 1484 1485 descriptor.c: Use size_t for minor 64 bit compliance improvement 1486 1487 Fixes #121. 1488 1489 commit 27ec326a9f1bff4481702b35f39897c65a5db586 1490 Author: Sean McBride <sean@rogue-research.com> 1491 Date: Mon Sep 19 12:42:33 2011 -0400 1492 1493 Darwin: Fix warnings about mismatched signed/unsigned compare 1494 1495 References #121. 1496 1497 commit 59cc79f2c8e5da41fe2c761bf1e1d9cd18ddac81 1498 Author: Sean McBride <sean@rogue-research.com> 1499 Date: Mon Sep 19 12:38:20 2011 -0400 1500 1501 Fix unused variable warnings when without timerfd and/or when on Darwin 1502 1503 References #121. 1504 1505 commit 1cc5b4a9fb984e83681ae5c797fa6b22bc20f809 1506 Author: Ludovic Rousseau <ludovic.rousseau+github@gmail.com> 1507 Date: Fri Sep 16 18:07:56 2011 +0200 1508 1509 Correctly handle LIBUSB_TRANSFER_OVERFLOW in libusb_control_transfer() 1510 1511 sync.c: In function `libusb_control_transfer': 1512 sync.c:122: warning: enumeration value `LIBUSB_TRANSFER_OVERFLOW' not 1513 handled in switch 1514 1515 Fixes #120. 1516 1517 commit c55f581f43885f8576d8e2ebf4d46cd7ff3c1030 1518 Author: Pete Batard <pete@akeo.ie> 1519 Date: Mon Sep 19 16:01:37 2011 +0100 1520 1521 Windows: do not set altsetting 0 as part of libusb_release_interface() 1522 1523 * pointed out by Travis Robinson and Xiaofan Chen 1524 * similar to a change advised by Alan Stern for the Linux kernel: 1525 http://marc.info/?m=122790204410765 1526 1527 commit efd3fae8f95ef7797ecd4b5731b198f100007d6a 1528 Author: Pete Batard <pete@akeo.ie> 1529 Date: Mon Sep 19 15:45:35 2011 +0100 1530 1531 Windows: fix communication with hubs 1532 1533 * issue reported by René Haunstrup in http://marc.info/?m=130503019227814 1534 1535 commit a8d1eb7963e5811e16e8fb7e157cf3a00d888347 1536 Author: Pete Batard <pete@akeo.ie> 1537 Date: Mon Sep 19 15:41:39 2011 +0100 1538 1539 Windows: add USB 3.0 controller support 1540 1541 * Windows 8, NEC/Renesas, TI, Fresco Logic, Etron, VIA, ASMedia 1542 (some of which untested!) 1543 * includes workaround for NEC/Renesas USB 3.0 root hubs 1544 1545 commit 48a19497bdd14325738ac9197d8cf4ebe1daa2d4 1546 Author: Pete Batard <pete@akeo.ie> 1547 Date: Mon Sep 19 15:28:03 2011 +0100 1548 1549 Windows: add static keywords and drop duplicated or unneeded code 1550 1551 commit af407286ba2fd346755297e56e365d84b98090d5 1552 Author: Pete Batard <pete@akeo.ie> 1553 Date: Mon Sep 19 13:59:46 2011 +0100 1554 1555 Windows: fix 'windows_error_str' defined but not used when not logging 1556 1557 commit abc3143ba1989a48f62246c2afb0eb4c3c5f7917 1558 Author: Peter Stuge <peter@stuge.se> 1559 Date: Thu Sep 22 10:19:17 2011 +0200 1560 1561 libusbi.h: Silence unused context variable warnings when not logging 1562 1563 commit 69b71c896a153a307360cf21be67b3b6e1e09a2d 1564 Author: Pete Batard <pete@akeo.ie> 1565 Date: Mon Sep 19 13:06:22 2011 +0100 1566 1567 Windows: copy DLL file regardless of ddk_build.cmd dll argument case 1568 1569 commit fdbac8971212bda3a42feeeaeb92fd8e49c7e904 1570 Author: Pete Batard <pete@akeo.ie> 1571 Date: Sun Sep 18 20:06:45 2011 +0100 1572 1573 Windows: Add uint32_t typedef for old MSC so that DDK can build lsusb 1574 1575 commit c471d55e909d84012f065715703dad454d1fa421 1576 Author: Vitali Lovich <vlovich@gmail.com> 1577 Date: Fri Sep 16 08:53:25 2011 -0600 1578 1579 Darwin: fix port leak in darwin_clock_gettime() 1580 1581 commit 477f3917f8c123e36993f9c0ba8156ca0f16ccfa 1582 Author: Vitali Lovich <vlovich@gmail.com> 1583 Date: Fri Sep 16 08:50:40 2011 -0600 1584 1585 Darwin: remove unnecessary run loop invalidation during libusb_exit() 1586 1587 commit f52094f37ccaff8137f5ce39867d2dba9b0f6bf9 1588 Author: Vitali Lovich <vlovich@gmail.com> 1589 Date: Fri Sep 16 08:49:54 2011 -0600 1590 1591 Darwin: fix port leak during libusb_exit() 1592 1593 commit 8a2f7b5c0520e6099f2c624cd0994c60867c1628 1594 Author: Vitali Lovich <vlovich@gmail.com> 1595 Date: Fri Sep 16 08:48:28 2011 -0600 1596 1597 Darwin: fix potential leak on libusb_claim_interface() error 1598 1599 commit b1ee2ef8d0b67dcc51c15742cb2decb386cffd9b 1600 Author: Nathan Hjelm <hjelmn@me.com> 1601 Date: Fri Sep 16 08:41:01 2011 -0600 1602 1603 Darwin: Fix #117 transfer size 64/32 bit issue for transfer callbacks 1604 1605 The transfer size is now always truncated to 32 bits. 1606 1607 commit c407a2d97b6f8715d3452257a0adac40a20178e6 1608 Author: Peter Stuge <peter@stuge.se> 1609 Date: Thu Sep 15 17:04:43 2011 +0200 1610 1611 Remove username from SF FRS rsync upload command 1612 1613 commit cbc2d7b2de58cf5fb02d9e5a39be0870527f8632 1614 Author: Peter Stuge <peter@stuge.se> 1615 Date: Thu Sep 15 16:48:35 2011 +0200 1616 1617 Support release candidate versions in configure.ac and libusb-1.0.rc 1618 1619 commit 384a528ed7adde935681313dacc5cd79e4be9ea1 1620 Author: Peter Stuge <peter@stuge.se> 1621 Date: Thu Sep 15 16:32:47 2011 +0200 1622 1623 Tidy .gitignore a little 1624 1625 There's no xusb, we need a glob pattern for matching .exe files, and 1626 fpusb tarballs aren't very common in the libusb source dir. 1627 1628 commit 9ad3643391a7fc6ce97aa77ffaf97d244fd9e613 1629 Author: Hans de Goede <hdegoede@redhat.com> 1630 Date: Wed Sep 14 10:53:48 2011 +0200 1631 1632 Docs: Clarify that libusb_handle_events_timeout() tv param can't be NULL 1633 1634 The example code and API doc for libusb_handle_events_timeout() could be 1635 interpreted as it being OK to pass a NULL pointer for the tv argument (I 1636 interpreted it like that when I first started coding for libusb). 1637 1638 This patch changes the docs to make it clear that one must always supply 1639 a tv struct to libusb_handle_events_timeout. 1640 1641 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1642 1643 commit e1c06fb070c1328a3b78c7da8b9e779d466edd97 1644 Author: Peter Stuge <peter@stuge.se> 1645 Date: Wed Sep 14 08:23:43 2011 +0200 1646 1647 Makefile.am: Do not remove ChangeLog on make distclean, fixes #116 1648 1649 [pbatard: Remove it on make maintainer-clean instead] 1650 1651 commit 0c5bf03eb829e51dcf19562fc4f745937235ea51 1652 Author: Vitali Lovich <vlovich@aliph.com> 1653 Date: Wed Sep 14 07:02:06 2011 +0200 1654 1655 Darwin: Reduce race likelihood between cancellation and device disconnect 1656 1657 References #88. The race condition still remains, but this change 1658 makes it less likely to trigger. 1659 1660 commit 3e6e257f55156c4600f3116a0befba8cee62872a 1661 Author: Peter Stuge <peter@stuge.se> 1662 Date: Wed Sep 14 04:00:33 2011 +0200 1663 1664 Document that libusb_get_device_list() can return any libusb_error code 1665 1666 Fixes #87. 1667 1668 commit 737ba04ea40f19564b445fbb489907529e75edc9 1669 Author: Pete Batard <pbatard@gmail.com> 1670 Date: Thu Jun 16 10:49:13 2011 +0100 1671 1672 Linux: Fix #81 URB double free race condition on device disconnect 1673 1674 A submitted transfer that has just been failed by the kernel could be 1675 picked up by an event handler to be cleaned up, where freeing of URB 1676 memory would race with the submit function doing it's own cleanup and 1677 freeing as a result of the submit failing. 1678 1679 libusb_submit_transfer() always holds itransfer->lock, so the race can 1680 be avoided by taking that lock also in the cleanup path and checking 1681 that the URB memory has not already been freed before freeing it there. 1682 1683 As http://libusb.org/ticket/81#comment:14 notes there is still another 1684 possible, but unlikely, race condition between libusb_submit_transfer() 1685 and an event handling thread. That will require more work to solve. 1686 1687 [stuge: Add check in cleanup path that URBs have not already been freed] 1688 1689 commit 1b0f758a334d78d3832d17d694ac0c931da36050 1690 Author: Peter Stuge <peter@stuge.se> 1691 Date: Wed Sep 14 03:00:14 2011 +0200 1692 1693 Add libusb_error_name() API function 1694 1695 Until we have i18ned error messages we can at least offer easy 1696 translation from numeric error code to the error code's name. 1697 1698 [hansg: switch() on enum to get a compiler warning if a case is missing] 1699 [hansg: Better return value when called with an unknown error code] 1700 [hansg: Fix DEFAULT_VISIBILITY in definition to compile on all platforms] 1701 1702 commit e16805130a04b2642891e86b8f479e6343ca17da 1703 Author: Peter Stuge <peter@stuge.se> 1704 Date: Wed Sep 14 02:30:18 2011 +0200 1705 1706 Add libusb_has_capability() API function 1707 1708 Since it is currently not planned to change the filename of the libusb 1709 library between libusb-1.0 versions at least on Windows systems it's 1710 important to have a capability API. 1711 1712 Currently there exists only one capability; LIBUSB_CAP_HAS_CAPABILITY, 1713 which tests support for the libusb_has_capability() API. 1714 1715 commit 2dc2fa2a56408e515d25359323b4ea2f1bbec14a 1716 Author: Sebastian Pipping <sebastian@pipping.org> 1717 Date: Tue Sep 13 20:38:26 2011 +0200 1718 1719 Fix typos in introductory documentation 1720 1721 commit 0a828082aeedc6d19b6de4e3b10cc9762352fa7f 1722 Author: Pekka Nikander <pekka.nikander@senseg.com> 1723 Date: Tue Sep 13 18:57:43 2011 +0200 1724 1725 Linux: Add libusb_open() debug and error messages with the device path 1726 1727 Fixes #109. 1728 1729 commit 6583372125d73543fe0db9fdc59850b9c6aa50d9 1730 Author: Pekka Nikander <pekka.nikander@senseg.com> 1731 Date: Tue Sep 13 18:52:36 2011 +0200 1732 1733 Add debug message with libusb_open() error code 1734 1735 References #109. 1736 1737 commit f797ecb3b4e653594f8ebc0c9d9e2ca579062779 1738 Author: Hans de Goede <hdegoede@redhat.com> 1739 Date: Mon Sep 12 18:11:20 2011 +0200 1740 1741 Document libusb_handle_events_completed() and _timeout_completed() 1742 1743 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1744 [stuge: Note that the old racy functions should be avoided by new code] 1745 1746 commit 6696512aade99bb15d6792af90ae329af270eba6 1747 Author: Graeme Gill <graeme2@argyllcms.com> 1748 Date: Sat Sep 10 15:47:05 2011 +0200 1749 1750 Fix #56 race condition causing delayed completion of sync transfers 1751 1752 The sync API had a race where it would check a condition to know if it 1753 needed to call a libusb_handle_events() function. However, the check 1754 was done outside of the lock that is held while the condition is set, 1755 so another thread could completely serve whatever was needed to make 1756 the condition true between it being checked and the event handler being 1757 called. This situation would be detected after a libusb-internal timeout 1758 of 60 seconds, after which the transfer would be completed without 1759 error, but with significant delay. 1760 1761 Original patch at http://marc.info/?l=libusb-devel&m=127252114815709 1762 1763 Changes by Hans de Goede: 1764 - Renamed the "race-proof" functions from libusb_handle_events*_check() 1765 to libusb_handle_events*_completed() 1766 - Drop r = 0 setting in libusb_handle_events_timeout_completed() 1767 (to make both completed checking cases identical flow wise) 1768 1769 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1770 [stuge: Simplify libusb_handle_events_timeout() change with a goto] 1771 [pbatard: Fix _handle_events_timeout() and _completed() definitions] 1772 1773 commit cfee5446cdb2974c1e90c7c379a365c495975aef 1774 Author: Nathan Hjelm <hjelmn@me.com> 1775 Date: Fri Aug 26 23:06:40 2011 -0600 1776 1777 Darwin: Use a condition to signal async thread ready in libusb_init() 1778 1779 commit d1bd234f7e1b1ff4168b8f605e2038e87a0e361f 1780 Author: Nathan Hjelm <hjelmn@me.com> 1781 Date: Thu Jul 21 22:34:12 2011 -0600 1782 1783 Fix #64 use of reserved identifiers throughout libusb 1784 1785 commit a97762a8a121de1ad3deb9e861088b69bb6a155b 1786 Author: Nathan Hjelm <hjelmn@me.com> 1787 Date: Thu Jul 21 22:31:09 2011 -0600 1788 1789 Darwin: fix libusb_get_device_list() and libusb_claim_interface() leaks 1790 1791 commit 8723df191fcedc6161732fd06d12df392c6dea3f 1792 Author: Nathan Hjelm <hjelmn@me.com> 1793 Date: Thu Jul 21 22:28:47 2011 -0600 1794 1795 Darwin: use kIOMasterPortDefault instead of creating a master port 1796 1797 commit 0eb7e43759003610d1afe6148aa6ff4f5859ccb0 1798 Author: Peter Stuge <peter@stuge.se> 1799 Date: Wed Jul 27 03:15:03 2011 +0200 1800 1801 Allow devices with zero configurations to be discovered 1802 1803 At least in Linux, wireless USB devices have zero configurations until 1804 they have been authorized. This device state can be set for any USB 1805 device using: 1806 1807 echo 0 > /sys/bus/usb/devices/?-?/authorized 1808 1809 An unauthorized device would previously make usbi_sanitize_device() 1810 return LIBUSB_ERROR_IO, although there really was no I/O error. 1811 1812 Reported-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> 1813 1814 commit 5010c3e80423d13acee6eeb4af974e8a9bcdd006 1815 Author: Peter Stuge <peter@stuge.se> 1816 Date: Wed Jul 27 06:17:48 2011 +0200 1817 1818 Linux: Continue enumeration even if one device returns an error 1819 1820 commit 2bf8848fb5c85ace0f445c0820a0c173cf76bf43 1821 Author: Hans de Goede <hdegoede@redhat.com> 1822 Date: Fri Jun 17 10:19:00 2011 +0200 1823 1824 Linux: Handle single- and two-digit kernel versions like 3.0 and 4 1825 1826 The code has been tested with various version strings. 1827 1828 [stuge: Remove bogus string length check and optimize for newer kernels] 1829 1830 commit 0288bf24f91eca9f433ebad91a7eb6c0e3e29133 1831 Author: Pete Batard <pbatard@gmail.com> 1832 Date: Thu Mar 3 18:35:35 2011 +0000 1833 1834 Windows: Provide libusb_get_device_speed() data 1835 1836 * use (currently superspeed unaware) USB_NODE_CONNECTION_INFORMATION_EX 1837 1838 Fixes #45. 1839 1840 [stuge: Explicitly convert OS device speeds to libusb device speeds] 1841 [pbatard: Add breaks overlooked when adding explicit conversion] 1842 1843 commit 382b7deaadd7e2f1d08c9e921e460bb3abf130b2 1844 Author: Trygve LaugstÞl <trygvis@inamo.no> 1845 Date: Tue Jul 19 23:20:40 2011 +0200 1846 1847 Darwin: Provide libusb_get_device_speed() data 1848 1849 References #45. 1850 1851 commit 44d6319f57e7e2c77347da228ed032e62716b438 1852 Author: Hans de Goede <hdegoede@redhat.com> 1853 Date: Thu Feb 17 15:06:40 2011 +0100 1854 1855 Linux: Provide libusb_get_device_speed() data from sysfs 1856 1857 References #45. 1858 1859 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1860 1861 commit c8c40bcbd22abca922ff31c4ed6a75fd7af78b59 1862 Author: Hans de Goede <hdegoede@redhat.com> 1863 Date: Thu Feb 17 13:17:55 2011 +0100 1864 1865 Add new API function libusb_get_device_speed() 1866 1867 Reworked version of my earlier patch, largely modelled after (if not 1868 copy and pasted from) Trygve LaugstÞl's <trygvis@inamo.no> similar 1869 commit 5a6541e0d80fb1f21e2b960bc2337a612f9d74fb in 1870 git://git.libusb.org/libusb-trygvis.git 1871 http://git.libusb.org/libusb-trygvis.git 1872 http://git.libusb.org/?p=libusb-trygvis.git;a=commitdiff;h=5a6541e0d 1873 1874 This patch does not add any OS specific code. The supporting code in 1875 each backend follows in separate patches. References #45. 1876 1877 Signed-off-By: Hans de Goede <hdegoede@redhat.com> 1878 1879 commit 0db8cba7f2c372f0127c7df9724e5a35e93f2069 1880 Author: Nathan Hjelm <hjelmn@me.com> 1881 Date: Sun Mar 20 00:25:44 2011 -0600 1882 1883 Darwin: Improve device enumeration performance 1884 1885 The device location is saved, and later used whenever iterating over 1886 devices. Fixes #111 and #112. 1887 1888 [stuge: Formatting fixes and split out libusb_get_device_speed() change] 1889 [stuge: Combine with patch that uses the saved device location] 1890 1891 commit 511ec4301deb516691e39e3df5b90fe28cb2bb0f 1892 Author: Hans de Goede <hdegoede@redhat.com> 1893 Date: Thu Feb 17 12:49:36 2011 +0100 1894 1895 Linux: Use __read_sysfs_attr() to get busnum and devaddr 1896 1897 Remove code duplication. 1898 1899 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1900 1901 commit e05bbc59ca7b896e2b825bde59bf883ac8c09f5c 1902 Author: Hans de Goede <hdegoede@redhat.com> 1903 Date: Thu Feb 17 12:45:10 2011 +0100 1904 1905 Linux: Add __read_sysfs_attr() helper function 1906 1907 On Linux we often need to read (postive) integers from sysfs. This patch 1908 adds a helper function for this. This is a preparation patch for adding 1909 a libusb_get_device_speed() function to libusb. 1910 1911 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1912 1913 commit 20e26dda0f86dafa3436b152e090b5f3410c8ce4 1914 Author: Hans de Goede <hdegoede@redhat.com> 1915 Date: Tue Feb 8 16:37:18 2011 +0100 1916 1917 Linux: Stop kernel from re-attaching in-kernel driver after reset 1918 1919 When an interface is bound to the usbfs driver (iow claimed), the 1920 kernel will unbind it, and then after the reset do a device_attach 1921 on the interface, which will bind the default in kernel driver to 1922 the interface. 1923 1924 So if an app has detached the in kernel driver, and claimed the 1925 interface and then does a libusb_reset_device. Things end up with 1926 the interface no longer being bound to the usbfs driver (so no longer 1927 claimed) and instead it is bound to the in kernel driver (iow the in 1928 kernel driver is re-attached). 1929 1930 We can stop this from happening by releasing all claimed interfaces 1931 before the reset, as the kernel will not do the device attach after 1932 reset, if no driver was bound to the interface before the reset. 1933 1934 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1935 1936 commit 4e294dc9848aab86b31d2fff228cf97e7eadf913 1937 Author: Hans de Goede <hdegoede@redhat.com> 1938 Date: Thu Feb 17 12:35:46 2011 +0100 1939 1940 Core: Use USB_MAXINTERFACES rather then sizeof(claimed_interfaces) 1941 1942 claimed_interfaces is a long and thus its size differs on 32 1943 versus 64 bits, this patch uses USB_MAXINTERFACES instead of 1944 sizeof(claimed_interfaces) on interface number range checks 1945 for consistent behavior independent of the arch. 1946 1947 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1948 1949 commit a68f956dd4c29d6ed799f04f07a3346317843999 1950 Author: Hans de Goede <hdegoede@redhat.com> 1951 Date: Wed Feb 9 12:40:35 2011 +0100 1952 1953 Linux: Fix warnings seen when compiling with gcc-4.6 1954 1955 Compiling with gcc-4.6 results in the following warnings: 1956 os/linux_usbfs.c: In function 'op_get_configuration': 1957 os/linux_usbfs.c:1144:6: warning: variable 'r' set but not used ... 1958 os/linux_usbfs.c: In function 'op_handle_events': 1959 os/linux_usbfs.c:2091:40: warning: 'status' may be used uninitialized ... 1960 os/linux_usbfs.c:2044:6: note: 'status' was declared here 1961 dpfp.c: In function 'save_to_file': 1962 dpfp.c:228:9: warning: variable 'ignore' set but not used ... 1963 dpfp_threaded.c: In function 'save_to_file': 1964 dpfp_threaded.c:257:9: warning: variable 'ignore' set but not used ... 1965 1966 This patch fixes these. (The second comes from handle_control_completion() 1967 which gcc seems to inline into op_handle_events().) 1968 1969 Signed-off-by: Hans de Goede <hdegoede@redhat.com> 1970 [stuge: Add fixes for dpfp examples and update source references] 1971 1972 commit 209b5ccd827039b933b730e3f29abd0d72d3c6c6 1973 Author: Vitali Lovich <vlovich@aliph.com> 1974 Date: Tue Jun 14 08:51:57 2011 +0200 1975 1976 Darwin: Fix #108 crash when a device is unplugged 1977 1978 commit d3543e9140536a9751811b44f8496489be1e6bb7 1979 Author: Peter Stuge <peter@stuge.se> 1980 Date: Mon Jun 13 22:58:23 2011 +0200 1981 1982 libusb.h: Add missing LIBUSB_CLASS_ codes currently defined by usb.org 1983 1984 LIBUSB_CLASS_PHYSICAL 1985 LIBUSB_CLASS_SMART_CARD 1986 LIBUSB_CLASS_CONTENT_SECURITY 1987 LIBUSB_CLASS_VIDEO 1988 LIBUSB_CLASS_PERSONAL_HEALTHCARE 1989 LIBUSB_CLASS_DIAGNOSTIC_DEVICE 1990 1991 Per http://www.usb.org/developers/defined_class 1992 1993 commit 08bc7ffb6a3b65afc6795cd048a890ee8da7d954 1994 Author: Peter Stuge <peter@stuge.se> 1995 Date: Mon Jun 13 22:53:40 2011 +0200 1996 1997 libusb.h: Add LIBUSB_CLASS_IMAGE in addition to LIBUSB_CLASS_PTP 1998 1999 The old LIBUSB_CLASS_PTP name is kept for compatibility. Fixes #106. 2000 2001 commit 3d7938d85a33cd98553c0c898a8dd0490826b077 2002 Author: Peter Stuge <peter@stuge.se> 2003 Date: Mon Jun 13 22:52:48 2011 +0200 2004 2005 libusb.h: Fix LIBUSB_CLASS_PRINTER description typo 2006 2007 References #106. 2008 2009 commit 5d0526af1a922afab02cdbdf4bb7078702759571 2010 Author: Sean McBride <sean@rogue-research.com> 2011 Date: Fri Feb 11 11:28:04 2011 -0500 2012 2013 Darwin: Fix #100 warning cast to pointer from integer of different size 2014 2015 commit bb8854ff5680136e29b57505300f131c2646f258 2016 Author: Sean McBride <sean@rogue-research.com> 2017 Date: Mon Jun 13 22:26:43 2011 +0200 2018 2019 configure.ac: Fix #97 clang warning about -fgnu89-inline 2020 2021 Remove the test that sets the flag since GNU89 inline semantics are not 2022 required by libusb. 2023 2024 [stuge: Also remove reference to the test result] 2025 2026 commit cb3c2e488f298b78027c9d5fc0bec0e5ba27d761 2027 Author: Pete Batard <pbatard@gmail.com> 2028 Date: Wed Jun 15 01:38:58 2011 +0200 2029 2030 Windows: Make cancel_io() in poll_windows.c static 2031 2032 References #97. 2033 2034 commit 6635dbb4acb5ee556a020e431b15c954edfcbd29 2035 Author: Peter Stuge <peter@stuge.se> 2036 Date: Mon Jun 13 22:21:02 2011 +0200 2037 2038 Windows: Make upperize() in windows_usb.h static 2039 2040 References #97. 2041 2042 commit 9479ce9dae3d0dbe2ce693bd02ccceb018a75fe9 2043 Author: Vitali Lovich <vlovich@aliph.com> 2044 Date: Wed Mar 16 17:33:57 2011 -0700 2045 2046 descriptor.c: Fix buffer read overflow caught by valgrind 2047 2048 In parse_interface() an unexpected descriptor would be parsed without 2049 validating the descriptor's length. It is possible for size to be 0 at 2050 this point, which means that the parsing would read past the end of the 2051 source buffer. Fix #83 by checking the length of the remaining buffer 2052 before parsing. 2053 2054 commit c775c2f43037cd235b65410583179195e25f9c4a 2055 Author: Vitali Lovich <vlovich@aliph.com> 2056 Date: Wed Mar 16 19:51:40 2011 -0700 2057 2058 Clean up in-flight transfers and device handle when closing a device 2059 2060 Any in-flight transfers should properly invalidate their references 2061 to device handles that are being closed. Additionally, they should be 2062 removed from the transfer-in-flight list. This is done with the events 2063 lock held to protect against another thread processing the same transfer. 2064 The events lock is initialized as a recursive mutex, because the device 2065 close code might itself be called while an event is being handled. 2066 Fixes #82. 2067 2068 [stuge: Trivial rework to reduce indenting] 2069 2070 commit 74282582cc879f091ad1d847411337bc3fa78a2b 2071 Author: Vitali Lovich <vlovich@aliph.com> 2072 Date: Wed Mar 16 19:43:30 2011 -0700 2073 2074 Add recursive mutexes to threading abstraction 2075 2076 This is necessary for the device close path which needs to attain the 2077 events lock, but which might itself be called while handling an event. 2078 The events lock is necessary to properly clean up transfers which might 2079 still be pointing to the device. References #82. 2080 2081 [stuge: Move usbi_mutex_init_recursive() into threads_posix.c] 2082 [stuge: Must also #define _XOPEN_SOURCE 500 to be able to build] 2083 [pbatard: Un-inline usbi_mutex_init_recursive() to make Cygwin happy] 2084 2085 commit 8f1bc0659136faf312dabe8fe67380a798299d33 2086 Author: Vitali Lovich <vlovich@aliph.com> 2087 Date: Wed Mar 16 19:48:35 2011 -0700 2088 2089 Add USBI_TRANSFER_CANCELLING and _DEVICE_DISAPPEARED status flags 2090 2091 The flags are used to indicate if a cancellation has started, and if 2092 a cancellation has failed because the device is no longer available. 2093 References #82. 2094 2095 commit 87ba8a9ead4fd9e81ae3c5a894f698779de1f2c2 2096 Author: Vitali Lovich <vlovich@aliph.com> 2097 Date: Wed Mar 16 19:50:04 2011 -0700 2098 2099 Linux: Detect and report that device has gone away while discarding URBs 2100 2101 Return LIBUSB_ERROR_NO_DEVICE if the device is no longer available 2102 (ENODEV) to discard the urbs. References #82. 2103 2104 commit 2c85c363cddd72b9ab425f05e2ee03e0b1df24f1 2105 Author: Peter Stuge <peter@stuge.se> 2106 Date: Mon Jun 6 02:46:46 2011 +0200 2107 2108 libusbi.h: Add comma after last value in enum usbi_transfer_flags 2109 2110 commit 5d7be3e1337f2444097504931ac0f2f0997b2b05 2111 Author: Peter Stuge <peter@stuge.se> 2112 Date: Sun Jun 5 23:28:07 2011 +0200 2113 2114 threads_posix.h: Whitespace fix 2115 2116 commit 18db4813e844fc6929680afcc9b793abcb06876a 2117 Author: Peter Stuge <peter@stuge.se> 2118 Date: Sun Jun 5 23:21:08 2011 +0200 2119 2120 libusb/Makefile.am: Correct threading files in libusb_1_0_la_SOURCES 2121 2122 commit 5f30c81f66e8dd61f8eae16de548697708f9bd18 2123 Author: Alan Ott <alan@signal11.us> 2124 Date: Thu Jul 21 16:37:48 2011 +0200 2125 2126 Linux: Fix #70 race condition in sysfs_get_device_list() 2127 2128 Change the way libusb chooses between using sysfs and usbfs for information 2129 about the attached devies. Using the old method, a race condition could 2130 occur if a device was unplugged just before (or during) the call to 2131 libusb_get_device_list(), corrupting the internal sysfs_can_relate_devices 2132 and sysfs_has_descriptors variables and preventing libusb_get_device_list() 2133 from working in future calls. 2134 2135 The old method was based on the assumption that if certain sysfs files 2136 (eg: busnum) could not be opened, that indicated an inadequacy of sysfs 2137 (ie: the running kernel's sysfs version did not contain those files), 2138 when in reality those files couldn't be opened because the device had 2139 been unplugged. 2140 2141 The new method checks the adequacy of sysfs during libusb_init() 2142 (op_init()) and if a sysfs file cannot be opened, it is now assumed that 2143 it is because the device has been unplugged, not because sysfs is 2144 inadequate. 2145 2146 Signed-off-by: Alan Ott <alan@signal11.us> 2147 [stuge: Include closedir() bugfix posted in ticket by Arne Laansoo] 2148 [stuge: Remove dead code in sysfs_scan_device() found by Hans de Goede] 2149 2150 commit 40327cd134718475f6cec8935b856d4fdff2099c 2151 Author: Sean McBride <sean@rogue-research.com> 2152 Date: Thu Feb 10 17:11:29 2011 -0500 2153 2154 Darwin: Fix #63 error when apps use Objective-C garbage collection 2155 2156 commit 3ba2fae24886fec89410e5f2295f65363edcc2df 2157 Author: Sean McBride <sean@rogue-research.com> 2158 Date: Fri Feb 5 11:50:34 2010 -0500 2159 2160 Darwin: Fix #28 clang analyzer warning about unbalanced retain/release 2161 2162 commit b67120f047f7eafa15c88c66fa61cef40805ec1f 2163 Author: Sean McBride <sean@rogue-research.com> 2164 Date: Fri Feb 5 11:50:34 2010 -0500 2165 2166 io.c: Fix clang analyzer warning about unused variable 2167 2168 References #28. 2169 2170 commit 51af85d03a098d7d99ea544e8e9535b5476bab33 2171 Author: Peter Stuge <peter@stuge.se> 2172 Date: Tue May 10 10:44:18 2011 +0200 2173 2174 .gitignore: Add m4 subdirectory created by libtool 2175 2176 commit c569e5b3b314538f45d0b3b6f14ce3dbdfee1be9 2177 Author: Ludovic Rousseau <rousseau@debian.org> 2178 Date: Mon Nov 15 14:45:50 2010 +0100 2179 2180 Linux: Do not include useless pthread.h 2181 2182 The code does not use threads so no need to #include <pthread.h> 2183 Fixes #74. 2184 2185 commit 82af9f9d440ef49015652c699157cf62020f097a 2186 Author: Pete Batard <pbatard@gmail.com> 2187 Date: Tue Mar 8 17:41:05 2011 +0000 2188 2189 Windows: minor code improvements 2190 2191 * mostly warnings from VS2010's Intellisense 2192 2193 commit 7e636dbe06001b9ac68e452a2fdc05e33fbb4e3a 2194 Author: Pete Batard <pbatard@gmail.com> 2195 Date: Tue Mar 8 17:40:39 2011 +0000 2196 2197 Windows: prevent set_configuration request from being sent using WinUSB 2198 2199 * multiple WinUSB set configuration requests can stall a device and 2200 WinUSB does not support setting of alt configuration in the first place 2201 * issue reported and investigated by Xiaofan Chen 2202 2203 commit 578c50c99646e5ebbcfbea653524a519b843ebcd 2204 Author: Graeme Gill <graeme@argyllcms.com> 2205 Date: Tue Mar 8 17:39:16 2011 +0000 2206 2207 Windows: fixed default WinUSB timeout and ineffective policy settings 2208 2209 * default WinUSB timeout was 5 seconds, which may be to small. 2210 PIPE_TRANSFER_TIMEOUT policy is now set to infinite for all EPs. 2211 * other WinUSB policy settings were called before the endpoints 2212 had been set. This is now fixed. 2213 2214 commit 25fa63ea1cfe02e784cb62d3b869fd15e62b5b6e 2215 Author: Pete Batard <pbatard@gmail.com> 2216 Date: Tue Mar 8 17:37:40 2011 +0000 2217 2218 Windows: Don't leak pipe fds 2219 2220 use _open() and _close() rather than _open_osfhandle() and CloseHandle() 2221 2222 * use of CloseHandle() prevented the pipe fds from being 2223 relinquished on libusb_exit() 2224 * leaked fds could lead to the OS running out of new fds 2225 and LIBUSB_ERROR_NO_MEM being returned as a result 2226 * using _open() avoids _open_osfhandle() redef for cygwin 2227 * issue reported by Stephano Antonelli 2228 2229 commit 3ccd9bddec316ee4b867959fd7f616eb4d410997 2230 Author: Peter Stuge <peter@stuge.se> 2231 Date: Tue May 10 10:05:29 2011 +0200 2232 2233 Windows: enumeration overhaul 2234 2235 * uses multiple passes in a single call 2236 * uses a hash table, in anticipation for hotplug 2237 * adds a (dummy) HUB interface for harmonization 2238 * adds calloc on device struct creation in core 2239 (to detect and avoid unnecessary double initialization) 2240 2241 commit bb108cbe39802785d10fe025b74ca5ee19734151 2242 Author: Pete Batard <pbatard@gmail.com> 2243 Date: Tue May 10 00:56:18 2011 +0100 2244 2245 Windows: MS project files part 4 - MSVC6 project files 2246 2247 Fixes #57 and #1. 2248 2249 commit 78896ae99b9c2d5672fc93c5bad0f5e8e75c53ea 2250 Author: Pete Batard <pbatard@gmail.com> 2251 Date: Tue May 10 00:53:09 2011 +0100 2252 2253 Windows: MS project files part 3 - VS2005 project files 2254 2255 References #57. 2256 2257 commit 9e5f4277e379a82f5d32e81db1bd0ffaa6637596 2258 Author: Pete Batard <pbatard@gmail.com> 2259 Date: Tue May 10 00:38:49 2011 +0100 2260 2261 Windows: MS project files part 2 - WDK project files 2262 2263 References #57. 2264 2265 commit c1e75431418cdfc10ec963d823fce479cdae6840 2266 Author: Pete Batard <pbatard@gmail.com> 2267 Date: Tue May 10 00:38:12 2011 +0100 2268 2269 Windows: MS project files part 1 - support files & preliminaries 2270 2271 * adds the MSVC support files used by MSVC6, VS2005 and WDK 2272 * also adds missing defines required by MS compilers in libusb.h 2273 * also anticipatory sets .gitattributes for CRLF handling 2274 * also adds manually maintained .def file for import lib generation 2275 2276 References #57. 2277 2278 commit 85a14f43e0ce27cd47f84fdaeacbaa81cebdb886 2279 Author: Peter Stuge <peter@stuge.se> 2280 Date: Mon May 9 08:12:24 2011 +0200 2281 2282 Move library version number from configure.ac to libusb/version.h 2283 2284 This is neccessary to support native MS builds. The Windows resource 2285 file libusb/libusb-1.0.rc must include the release version, which was 2286 previously only available after configure had run and had substituted 2287 the numbers into a generated libusb/libusb-1.0.rc file. 2288 2289 The version atoms are now stored as CPP style #defines in libusb/version.h 2290 so that the .rc no longer needs to be generated but can simply include the 2291 header file and access the version information directly. 2292 2293 The m4 macro LU_DEFINE_VERSION_ATOM() was added to configure.ac to get 2294 version atoms from libusb/version.h for use in AC_INIT(). The macro 2295 handles C and C++ style comments in version.h, but can easily be made 2296 to fail by obscuring the file. Please don't do that. 2297 2298 Tested with MinGW using autoconf, and manual compile of libusb-1.0.rc 2299 using RC.EXE Version 5.2.3690.0 from Visual C++ 2005 Express Edition. 2300 2301 commit 3481f52b014110f6c291e5a15e79ba774dcdfacf 2302 Author: Peter Stuge <peter@stuge.se> 2303 Date: Tue May 10 08:36:32 2011 +0200 2304 2305 Windows: Debug builds create the same .dll file name as non-debug 2306 2307 Thanks to Pete for pointing this out! 2308 2309 commit 9da8cf5c9ed9bd381a77d8170fc0556edbcce4dc 2310 Author: Pete Batard <pbatard@gmail.com> 2311 Date: Tue Mar 8 17:18:48 2011 +0000 2312 2313 Windows: explicit use of ANSI or WideChar calls 2314 2315 * This is in anticipation of adding MSVC project files 2316 that use Unicode rather than MBCS 2317 2318 commit ae675c1f49dc00b695fce7296903f60998cc28ed 2319 Author: Pete Batard <pbatard@gmail.com> 2320 Date: Tue Mar 8 17:16:23 2011 +0000 2321 2322 Windows: Remove SetupAPI, AdvAPI32 and OLE32 link-time dependencies 2323 2324 * this ensures that libusb dependent applications only need 2325 to explicitly link against libusb on Windows 2326 2327 The run-time dependency on Cfgmgr32.dll, OLE32.dll and SetupAPI.dll remains. 2328 2329 commit 356e312511e4892977636da52ec497ad2c716032 2330 Author: Pete Batard <pbatard@gmail.com> 2331 Date: Tue Mar 8 17:12:33 2011 +0000 2332 2333 Add .gitattributes to avoid Windows line ending issues with autocrlf 2334 2335 commit 61c120f025f3dee04eeb88159d7c0403a8bf91fe 2336 Author: Peter Stuge <peter@stuge.se> 2337 Date: Sun Feb 27 09:37:54 2011 +0100 2338 2339 Windows: Touch up FileDescription and ProductName resource strings 2340 2341 commit 99b4ddcd893834a4be8b5884037b650e57ba0ba2 2342 Author: Peter Stuge <peter@stuge.se> 2343 Date: Sun Feb 27 07:20:40 2011 +0100 2344 2345 Windows: Remove emulated direct device access via HID API 2346 2347 Either use a library such as HIDAPI to communicate with HID class 2348 devices, or replace the kernel driver for the device with one that 2349 offers support for the complete libusb API. 2350 2351 commit 4be84ab49c838d534d3a1b8a64ffa89774984ee7 2352 Author: Peter Stuge <peter@stuge.se> 2353 Date: Sun Feb 27 06:59:15 2011 +0100 2354 2355 Revert libusb_strerror() until we have i18n and l10n 2356 2357 commit 0e177f22fcc69d9aab6fb410e85f3413f478c94c 2358 Author: Pete Batard <pbatard@gmail.com> 2359 Date: Wed Jan 19 14:00:12 2011 +0000 2360 2361 dpfp_threaded: return instead of pthread_exit() to avoid Cygwin warning 2362 2363 commit e65878f21b0a0bb96debcb292dc03ce3c4ebb701 2364 Author: Pete Batard <pbatard@gmail.com> 2365 Date: Wed Jan 19 13:52:08 2011 +0000 2366 2367 Windows: Rename various variables named "index" to avoid shadow warnings 2368 2369 commit 019bf73bb2677dc7720bc8280527316adcbaa506 2370 Author: Pete Batard <pbatard@gmail.com> 2371 Date: Tue Oct 5 12:50:53 2010 +0100 2372 2373 Windows: Fix logic in enumeration of driver name and port number 2374 2375 commit 24494ed5db27737fc607fc35dda722521c9fe4d4 2376 Author: Pete Batard <pbatard@gmail.com> 2377 Date: Tue Oct 5 12:50:13 2010 +0100 2378 2379 Windows: Allow claiming any interface in composite device using WinUSB 2380 2381 Issue reported by Benjamin Dobell, see #48. The call to 2382 WinUsb_QueryInterfaceSettings() is removed since it doesn't work 2383 on any other interface but the first (a WinUSB limitation). 2384 2385 This allows the use of WinUSB.sys in lieu of the usbccgp.sys 2386 "USB Generic Parent" default driver for composite devices. 2387 2388 commit 9c8e6545f2fbb171f81a9451eaf2d09e1fbc13b3 2389 Author: Pete Batard <pbatard@gmail.com> 2390 Date: Tue Oct 5 12:47:15 2010 +0100 2391 2392 Windows: Allow arbitrary bConfigurationValue in config descriptors 2393 2394 Unlike bInterfaceNumber, bConfigurationValue does not have to be 2395 either sequential or contiguous. The bConfigurationValue is now 2396 included in debug output. Fixes #48 reported by Benjamin Dobell. 2397 2398 commit dcd002974e511879320233fd5b0600e06bdc5620 2399 Author: Thomas Röfer <Thomas.Roefer@dfki.de> 2400 Date: Fri Nov 19 22:03:11 2010 +0100 2401 2402 Darwin: Schedule isochronous transfers further in the future 2403 2404 This is required to make OpenKinect transfer data at 30 fps. This 2405 change was originally made by Theo Watson, and Thomas improved on it. 2406 The commit came via OpenKinect into libusb thanks to Kyle Machulis and 2407 Hector Martin. Fixes #66. 2408 2409 commit e83fad33dbaf9f37811da6d4cd9d3be554817944 2410 Author: Thomas Röfer <Thomas.Roefer@dfki.de> 2411 Date: Fri Nov 19 22:03:11 2010 +0100 2412 2413 Darwin: Fix #65 memory leak in submit_iso_transfer() 2414 2415 This was also independently fixed by Hoi-Ho Chan, but Thomas caught 2416 an additional problem with his fix. 2417 2418 This commit came via OpenKinect into libusb thanks to Kyle Machulis 2419 and Hector Martin. 2420 2421 commit 1a2d21fe42ad5a157651c787e2f500fc162c325b 2422 Author: Peter Stuge <peter@stuge.se> 2423 Date: Sat Feb 26 04:21:05 2011 +0100 2424 2425 configure.ac: Refactor Windows backend settings into one occurence 2426 2427 The Windows backend is used both with MinGW and Cygwin, and since most 2428 settings are identical they can be set in one place. 2429 2430 commit 717f47621d18de16b87e237f3740299f43e4ca1c 2431 Author: Peter Stuge <peter@stuge.se> 2432 Date: Mon Nov 15 19:58:51 2010 +0100 2433 2434 configure.ac: Rename AM_LDFLAGS to LTLDFLAGS and actually use them 2435 2436 The new variable name tries to clarify that libtool is being used. 2437 Linker flags must thus always be specified with -Wl. 2438 2439 Factor out the libtool flag -no-undefined from host specific cases. 2440 The flag is required to build a Windows DLL, but is correct also for 2441 the other supported systems. 2442 2443 Also, start actually using LTLDFLAGS in libusb/Makefile.am, so that 2444 libtool will see the options set by configure. 2445 2446 commit 3cbe5736469c1c52049752c137ae11387e9b079d 2447 Author: Peter Stuge <peter@stuge.se> 2448 Date: Sun Nov 21 23:38:46 2010 +0100 2449 2450 configure.ac: Clean up PC_LIBS_PRIVATE and AM_LDFLAGS 2451 2452 Move linker options for when linking the library itself from 2453 PC_LIBS_PRIVATE into AM_LDFLAGS. PC_LIBS_PRIVATE should only 2454 contain flags needed to link applications statically against libusb. 2455 Fixes #72. 2456 2457 commit ef39d1510580b9fcbacf13443fa7a4e553a9a88e 2458 Author: Peter Stuge <peter@stuge.se> 2459 Date: Fri Feb 25 02:33:29 2011 +0100 2460 2461 configure.ac: Call AC_CONFIG_FILES() for each output file 2462 2463 This avoids a problem with Windows line endings. 2464 2465 commit 6e52ea067711e6e7e1b2882757fb61b11b6f8feb 2466 Author: Peter Stuge <peter@stuge.se> 2467 Date: Sun Nov 21 23:37:27 2010 +0100 2468 2469 configure.ac: Whitespace changes and trivial reordering 2470 2471 commit 44b85dabc3f4efe0918a598f981675aa3765cc26 2472 Author: Peter Stuge <peter@stuge.se> 2473 Date: Sun Nov 21 23:10:35 2010 +0100 2474 2475 configure.ac: Quote AC_COMPILE_IFELSE() input 2476 2477 commit 19d5882c398e49a453ff78494db23b7f4d13c37c 2478 Author: Peter Stuge <peter@stuge.se> 2479 Date: Sun Nov 21 23:09:02 2010 +0100 2480 2481 configure.ac: Define booleans to 1 when set, instead of an empty string 2482 2483 This makes the generated config.h look a lot nicer. 2484 2485 commit c24649d796c8b5c97af79a41856422def2e593bc 2486 Author: Peter Stuge <peter@stuge.se> 2487 Date: Sat Oct 30 22:28:59 2010 +0200 2488 2489 configure.ac: Clean up redundancy and fix LIBS on Linux 2490 2491 LIBS, AM_LDFLAGS, OS_ conditionals and THREADS_POSIX had a bit of 2492 redundancy throughout the file, and on Linux LIBS ended up missing 2493 the -pthread flag. 2494 2495 commit 0bd4a4dd89ff64b99ab55bfc0c5782502c10c676 2496 Author: Peter Stuge <peter@stuge.se> 2497 Date: Sat Feb 26 04:08:38 2011 +0100 2498 2499 configure.ac: Touch up Darwin and Cygwin OS messages 2500 2501 commit 16cf11a1213272afd616598fa3aba0941e66ec3c 2502 Author: Peter Stuge <peter@stuge.se> 2503 Date: Sat Oct 30 22:13:05 2010 +0200 2504 2505 configure.ac: Do not use -pthread on Darwin 2506 2507 It's not needed because Darwin has POSIX Threads in libc. Fixes #96. 2508 2509 commit a120747d561929682cd0276ea4c13fb22fad8554 2510 Author: Peter Stuge <peter@stuge.se> 2511 Date: Sat Oct 30 22:07:37 2010 +0200 2512 2513 configure.ac: Check for poll.h, and for nfds_t on Darwin 2514 2515 On Linux, assume nfds_t is always available. 2516 2517 On Darwin, fall back to unsigned int when poll() exists but there 2518 is no nfds_t, such as on Mac OS X before 10.4. 2519 2520 On Windows (both MinGW and Cygwin), always use unsigned int instead 2521 of nfds_t, and don't check for poll.h because we use our own poll() 2522 implementation. 2523 2524 commit 21d03d12f92c0d9bd7990861ca0ebf5009f82799 2525 Author: Nathan Hjelm <hjelmn@me.com> 2526 Date: Tue Oct 5 20:08:08 2010 -0600 2527 2528 Darwin: Add support for control requests on endpoints other than 0 2529 2530 Signed-off-by: Nathan Hjelm <hjelmn@me.com> 2531 2532 commit 9bfacd760b40f1137a7835198c6028cbdaddeb18 2533 Author: Nathan Hjelm <hjelmn@me.com> 2534 Date: Tue Oct 5 23:11:50 2010 -0600 2535 2536 Darwin: Add more error checking for libusb_open() 2537 2538 Now also check the CreateDeviceAsyncEventSource() return code for errors. 2539 2540 Signed-off-by: Nathan Hjelm <hjelmn@me.com> 2541 2542 commit 478cd4a30728595fd742aa192d8149ee4216d4bc 2543 Author: Peter Stuge <peter@stuge.se> 2544 Date: Wed Nov 3 21:46:53 2010 +0100 2545 2546 Core: libusb_get_next_timeout() must consider all flying transfers 2547 2548 If transfer->flags indicated that a transfer had a timeout, but no 2549 timeout was actually set, then libusb_get_next_timeout() would look 2550 no further for a timeout, ignoring any transfers later in the list 2551 which had a timeout set. 2552 2553 Since libusb has an internal 60 second timeout this bug could not 2554 cause complete lockup, but it could cause a 60 second timeout even 2555 when a transfer was submitted with a shorter timeout. 2556 2557 commit 7802e4a3e38bcefccf96ae510ec2c6b7a959b8b5 2558 Author: Ludovic Rousseau <rousseau@debian.org> 2559 Date: Mon Nov 15 14:55:51 2010 +0100 2560 2561 Linux: Correctly catch read() errors for sysfs config descriptors 2562 2563 read(2) returns ssize_t (signed) and not size_t (unsigned) or int. 2564 2565 Silence "warning: comparison of unsigned expression < 0 is always false" 2566 and fix #75. 2567 2568 commit 4c7f3c8c3012bddba058afd2abdda792944fcda1 2569 Author: Peter Stuge <peter@stuge.se> 2570 Date: Sun Jan 23 04:01:25 2011 +0100 2571 2572 Linux: Refactor cancellation into one function for all transfer types 2573 2574 commit 011f1f297bc134188fab9960da1b1b9f0bd541aa 2575 Author: Peter Stuge <peter@stuge.se> 2576 Date: Sun Oct 17 08:19:56 2010 +0200 2577 2578 Linux: Refactor discarding of URBs into a function and return all errors 2579 2580 The Linux backend did not always return errors according to the 2581 libusb_cancel_transfer() documentation. 2582 2583 commit 26246df19cb4d88954a5aa9ed5f6b859e451df85 2584 Author: Peter Stuge <peter@stuge.se> 2585 Date: Sun Jan 23 04:01:01 2011 +0100 2586 2587 Linux: Set private number of URBs also for control transfers 2588 2589 commit 295c9d12e25bc2dbdd8b42bd67a1f7120f0631a1 2590 Author: Alan Stern <stern@rowland.harvard.edu> 2591 Date: Sun Oct 17 06:57:06 2010 +0200 2592 2593 Linux: cancel URBs in reverse order 2594 2595 In a multi-URB transfer, URBs should be cancelled in reverse order of 2596 submission. This prevents races that might otherwise occur (after URB N 2597 is cancelled, data may be transferred for URB N+1 before it too can be 2598 cancelled). Fixes #8. 2599 2600 commit 07df377a5df25e9c1811b554dc00eb8c40e5b995 2601 Author: Alan Stern <stern@rowland.harvard.edu> 2602 Date: Sun Oct 17 04:17:32 2010 +0200 2603 2604 Linux: report correct value for urb->actual_length 2605 2606 Transferred bytes are returned correctly by the kernel for every URB, 2607 even when an error occurs. Hence they should always be included in 2608 the transfer statistics. The same is true for isochronous packet 2609 length and status. 2610 2611 [stuge: set itransfer->transferred so data is stored at correct offset] 2612 2613 commit b26db49208c7a6ef0a99645142af21ce80c57c22 2614 Author: Alan Stern <stern@rowland.harvard.edu> 2615 Date: Fri Oct 22 11:13:34 2010 +0200 2616 2617 Linux: improve reporting of URB error status codes 2618 2619 Fix the way overflow errors are handled (they can occur in any 2620 transaction, not just the last one in a transfer) and add tests 2621 for other commonly-occuring error statuses. 2622 2623 commit efc29733ad31f81883a7ac51a6cc6cda9ad4feb9 2624 Author: Alan Stern <stern@rowland.harvard.edu> 2625 Date: Tue Oct 5 11:08:40 2010 -0400 2626 2627 Linux: improve detection of BULK_CONTINUATION kernel support 2628 2629 Clarify the comments describing the BULK_CONTINATION flag, and improve 2630 the subroutine that checks whether the flag is supported by making it 2631 "future-proof", i.e., by working properly with kernel version numbers 2632 higher than 2.6. 2633 2634 commit bd267cf92269e0c4cd8eef795b91eefb2c63452e 2635 Author: Peter Stuge <peter@stuge.se> 2636 Date: Mon Nov 22 05:14:00 2010 +0100 2637 2638 README: Update webpage URL and add Peter's email address 2639 2640 commit 845b715675703c5f1bc907f6302ece416c9f112c 2641 Author: Peter Stuge <peter@stuge.se> 2642 Date: Wed Aug 4 07:30:22 2010 +0200 2643 2644 libusb is not just for Linux! 2645 2646 commit 67d9ef7b6877e17f2deec81cd41dc0948f6bed4b 2647 Author: Nathan Hjelm <hjelmn@me.com> 2648 Date: Tue Oct 5 19:48:39 2010 -0600 2649 2650 Remove USBI_OS_HANDLES_TIMEOUT and fix int/isoc timeouts on Darwin 2651 2652 Backends set USBI_TRANSFER_OS_HANDLES_TIMEOUT for transfers instead. 2653 Darwin only handles timeouts for bulk and control transfers, so the 2654 backend now sets that flag accordingly, making libusb core handle 2655 timeouts for interrupt and isochronous transfers. Fixes #31. 2656 2657 Signed-off-by: Nathan Hjelm <hjelmn@me.com> 2658 2659 [stuge: rework libusb_get_next_timeout() and enum usbi_transfer_flags] 2660 [stuge: fix typo; set USBI_TRANSFER_TIMED_OUT flag correctly] 2661 2662 commit 370922dfbe0964c0b8a0c1974bb1d7b85ac10607 2663 Author: Peter Stuge <peter@stuge.se> 2664 Date: Sun Nov 14 03:14:00 2010 +0100 2665 2666 Silence "warning: suggest braces around empty body in an 'if' statement" 2667 2668 commit 0f85015bdf87f3bca0d86ed87c9b976176640922 2669 Author: Konrad Rzepecki <hannibal@astral.lodz.pl> 2670 Date: Sat Nov 13 14:09:22 2010 +0100 2671 2672 Disallow libusb_get_string_descriptor_ascii() with index 0 2673 2674 String descriptor 0 is the list of supported language IDs in the device, 2675 which can't have an ASCII representation. Calling the function with 2676 index 0 is thus not really useful. Fixes #43. 2677 2678 commit 3b41c31d3fa2c1f93649cc5fc0f59acbf3efd5a1 2679 Author: Ludovic Rousseau <rousseau@debian.org> 2680 Date: Fri Mar 19 15:35:14 2010 +0100 2681 2682 Use const for the usbi_parse_descriptor() format string 2683 2684 Constant strings should be "const char *" instead of "char *". Silence 2685 "discards qualifiers from pointer target type" warnings. Fixes #61. 2686 2687 commit 7f2e9f0776386997d2b4c4c47598ab88e3caeb7a 2688 Author: Hector Martin <hector@marcansoft.com> 2689 Date: Wed Aug 25 03:21:57 2010 +0200 2690 2691 Linux: Fix usbfs/sysfs config descriptor handling on big-endian 2692 2693 usbfs endian-swaps, sysfs doesn't, not the other way around. Fixes #51; 2694 descriptor endian parsing is backwards using sysfs on big-endian hosts. 2695 usbfs is untested. 2696 2697 Signed-off-by: Hector Martin <hector@marcansoft.com> 2698 2699 [stuge: checked against Documentation/usb/proc_usb_info.txt] 2700 2701 commit 2aa8984e59cf0f492e7fbebb8924f54f6160cc5e 2702 Author: Ludovic Rousseau <rousseau@debian.org> 2703 Date: Tue Aug 17 20:53:04 2010 +0200 2704 2705 examples: #include <libusb.h> without directory name 2706 2707 The libusb-1.0 directory name belongs in the compile command, e.g. 2708 via pkg-config --cflags. Fixes #58. 2709 2710 commit 7da756e09fd97efad2b35b5cee0e2b2550aac2cb 2711 Author: Ludovic Rousseau <rousseau@debian.org> 2712 Date: Thu Jun 24 10:14:24 2010 +0200 2713 2714 Add missing argument to libusb_wait_for_event() documentation, fix #55 2715 2716 In the libusb_wait_for_event() sample code in the section "Letting other 2717 threads do the work for you" the call to libusb_wait_for_event() was not 2718 updated by commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90, which added 2719 the libusb_context *ctx parameter to the function, so the sample code 2720 was broken until now. 2721 2722 commit 678c242705b29f9cb6cc421b5625a6485ae58047 2723 Author: Peter Stuge <peter@stuge.se> 2724 Date: Sat Oct 16 14:22:30 2010 +0200 2725 2726 examples: Silence warnings about return value of fwrite() 2727 2728 commit 9cd9059bf9baac69a9d6c909f4c1e000592fa260 2729 Author: Peter Stuge <peter@stuge.se> 2730 Date: Sat Oct 16 11:47:14 2010 +0200 2731 2732 Linux: Don't free() URBs prematurely on hardware error; fix #54 2733 2734 When an URB in a multi-URB transfer had an error, handle_bulk_completion() 2735 would free all URBs and segfault once the next one completed, instead of 2736 cancelling the remaining URBs and cleaning up as usual. 2737 2738 This is basically the patch from the ticket, plus some restructuring 2739 for increased readability of the function. 2740 2741 Many thanks to Brian Shirley and National Instruments for finding and 2742 fixing this! 2743 2744 commit 116d34f608b02f4e14668450b158acf5db726f95 2745 Author: Pete Batard <pbatard@gmail.com> 2746 Date: Tue Oct 5 12:43:41 2010 +0100 2747 2748 Windows: add support for filter drivers 2749 2750 * precedence is driver > upper filter > lower filter, and defined 2751 in struct driver_lookup lookup from set_device_paths() 2752 2753 commit eb833fcd837e3aac2e497438b14c8612254c28ce 2754 Author: Pete Batard <pbatard@gmail.com> 2755 Date: Tue Oct 5 12:36:49 2010 +0100 2756 2757 Windows: fix errcode shadow warning, and string and DLL_DECLARE fixes 2758 2759 * use FormatMessageA, and overall improvement of windows_error_str() 2760 * use safe_strlen() always 2761 * better typing/init default 2762 * more explicit debug message for devices with no driver 2763 2764 commit 1feadb5f78e1d2cdfd2aaf0011e041c2848bae37 2765 Author: Pete Batard <pbatard@gmail.com> 2766 Date: Tue Oct 5 12:29:32 2010 +0100 2767 2768 Windows: use IOCTLs for HID input, output and feature reports 2769 2770 * fixes feature reports not providing actual read size 2771 (reported by Axel Rohde http://marc.info/?m=127033070021994) 2772 * removes the USE_HIDD_FOR_REPORTS macro 2773 * IOCTL usage inspired from HIDAPI by Alan Ott 2774 2775 commit d7c25451f4075d2a12eb5cbc91ff3de8c0292da0 2776 Author: Daniel Drake <dan@reactivated.net> 2777 Date: Mon Oct 4 20:03:58 2010 +0100 2778 2779 Fix libtool version setting 2780 2781 This was being set too early to take effect. 2782 2783 commit a6fb54e2eef4e393bd06829bc3bdc746ea9d41a6 2784 Author: Mike Frysinger <vapier@gentoo.org> 2785 Date: Mon Oct 4 20:01:07 2010 +0100 2786 2787 Populate the pkg-config Libs.private field 2788 2789 commit a9b4065f048e750b7317f6434406fd528b69bf33 2790 Author: Mike Frysinger <vapier@gentoo.org> 2791 Date: Fri Aug 20 00:09:46 2010 -0400 2792 2793 Linux: fix build failure when CLOCK_MONOTONIC does not exist 2794 2795 This is not available on all platforms. 2796 2797 commit d192c5bd32736fde0080d756de6221287af34891 2798 Author: Daniel Drake <dan@reactivated.net> 2799 Date: Mon Oct 4 18:45:18 2010 +0100 2800 2801 Update libtool version info 2802 2803 With input from various people on the mailing list, update the libtool 2804 versioning info and start to update this on every release. 2805 2806 The next libusb release will not need a change here. All following ones 2807 will. 2808 2809 commit e65f69a7ef3de357c867ddaac9598efe407078b6 2810 Author: Pete Batard <pbatard@gmail.com> 2811 Date: Thu Aug 5 16:40:09 2010 +0100 2812 2813 Updated documentation for unsupported Darwin/Windows calls 2814 2815 commit c8bab4e19413d70c515a2eaf747a75b7f66fdc0b 2816 Author: Pete Batard <pbatard@gmail.com> 2817 Date: Sun Sep 19 14:24:25 2010 +0100 2818 2819 Windows: Make libusb_pollfd() return error 2820 2821 Windows does not have numerical file descriptors but does have the 2822 concept of event sources. Exposing these event sources will require 2823 some careful thought and design, to be completed later. 2824 2825 commit bd623f70d99fad8b975f8d4ee62ea4b1abf1272f 2826 Author: Daniel Drake <dan@reactivated.net> 2827 Date: Sun Sep 19 14:21:01 2010 +0100 2828 2829 MinGW: Use --add-stdcall-alias linker option 2830 2831 Naming of symbols inside the library is inconsistent on Windows: 2832 http://wyw.dcweb.cn/stdcall.htm 2833 2834 Use this linker option to add aliases which add compatibility with 2835 the "MSVC DLL" platform when a DEF file is used. It also better matches 2836 the appearance of the Windows API itself. 2837 2838 commit 29f9f9e3af3340df6a955881a93caf9d2a6d08d6 2839 Author: Pete Batard <pbatard@gmail.com> 2840 Date: Fri Aug 13 11:59:49 2010 +0100 2841 2842 Introduced calling convention (for Windows) 2843 2844 Under Windows, a variety of compilers and configurations are available, 2845 meaning that the manner of parameter passing (e.g. registers vs stack) 2846 can vary. 2847 2848 Match the Windows API calling convention and document this appropriately. 2849 This calling convention will be used regardless of the configuration of 2850 the user's development platform. 2851 2852 The only user-level complication is that all functions used as libusb 2853 callbacks must use the same calling convention as libusb. The 2854 LIBUSB_CALL macro is provided to make this easy. 2855 2856 Signed-off-by: Michael Plante <michael.plante@gmail.com> 2857 Signed-off-by: Pete Batard <pbatard@gmail.com> 2858 [dsd: slight change of strategy, add documentation] 2859 2860 commit be523f1fe7c136c3fca06ae9c96aff44a22482ba 2861 Author: Pete Batard <pbatard@gmail.com> 2862 Date: Fri Aug 6 21:56:04 2010 -0600 2863 2864 Windows: fix string copy in sanitize_path 2865 2866 The NULL byte was not being copied. 2867 2868 commit 7fd36af9f749ce8bf96f89cefd519a9f46825573 2869 Author: Pete Batard <pbatard@gmail.com> 2870 Date: Fri Jul 30 00:30:31 2010 +0100 2871 2872 Windows: DuplicateHandle failure is not a warning 2873 2874 This is because WinUSB handles are not duplicable, and generate a 2875 lot of these warnings. 2876 2877 commit 33cd2f68b4d500e852e354e5acae3d9a96a8ec26 2878 Author: Pete Batard <pbatard@gmail.com> 2879 Date: Fri Jul 30 00:23:05 2010 +0100 2880 2881 removed trailing whitespaces 2882 2883 commit e47849afe9381c864683220eac9ce7bcf43f7883 2884 Author: Pete Batard <pbatard@gmail.com> 2885 Date: Wed Aug 4 18:18:32 2010 -0600 2886 2887 Windows: Mark interfaces as unused when releasing 2888 2889 Without this important cleanup, the autoclaim code could attempt to 2890 reuse an unclaimed interface as if it were already claimed. 2891 2892 commit b30ca141a0bdce26e7cfdd91d346e49051532ee7 2893 Author: Pete Batard <pbatard@gmail.com> 2894 Date: Wed Aug 4 18:15:59 2010 -0600 2895 2896 Windows: fix device path string duplication 2897 2898 commit e8d7a89503d5655c4b04da718c6971e25ff48162 2899 Author: Nathan Hjelm <hjelmn@me.com> 2900 Date: Mon Aug 2 21:27:38 2010 -0600 2901 2902 Darwin: Cache device configuration value 2903 2904 Cache device configuration value to bring the Darwin backend more in 2905 line with the libusb spec. To handle buggy devices GetConfiguration is 2906 not called unless the device has more than one configuration. 2907 2908 commit fe5d1d2050f715ffa8cbd35a378ac969a1a01584 2909 Author: Xiaofan Chen <xiaofanc@gmail.com> 2910 Date: Fri Jul 30 15:56:43 2010 +0100 2911 2912 Fix inconsistencies between prototypes and definitions 2913 2914 This removes some warnings on cygwin regarding a name clash against 2915 the standard library "index" function. 2916 2917 commit 3b538c43e11b805a37d93b6283d270d5d5f0d1f5 2918 Author: Hoi-Ho Chan <hoiho.chan@gmail.com> 2919 Date: Tue Jul 27 21:04:17 2010 -0600 2920 2921 Darwin: handle kIOReturnUnderrun 2922 2923 This return code indicates that the device returned a data packet 2924 less than the max packet size. In libusb backend terms, this is 2925 a successful transfer. 2926 2927 commit 9a4249f8a104b98a15a7e3ba7ecae9a385ed9027 2928 Author: Pete Batard <pbatard@gmail.com> 2929 Date: Sat Jul 10 17:51:13 2010 -0600 2930 2931 Add Windows support 2932 2933 Via Cygwin/MinGW, libusb now has windows support. 2934 Thanks to contributors: Michael Plante, Orin Eman, Peter Stuge, 2935 Stephan Meyer, Xiaofan Chen. 2936 2937 commit d38dd5e3d2a872f7064eea084ddea8c33811dd7d 2938 Author: Hoi-Ho Chan <hoiho.chan@gmail.com> 2939 Date: Sat Jul 24 13:48:00 2010 -0600 2940 2941 Darwin: write iso transfer details into correct packets 2942 2943 commit fbff5b4b665ff2ebc948162617cf7f4f5d2fabeb 2944 Author: Nathan Hjelm <hjelmn@me.com> 2945 Date: Sat Jul 24 13:42:57 2010 -0600 2946 2947 Darwin: fix interface object leak 2948 2949 commit dffc09835d6860ae9b6a62c39af5be346188cb05 2950 Author: Nathan Hjelm <hjelmn@me.com> 2951 Date: Sat Jul 24 13:41:03 2010 -0600 2952 2953 Darwin: clean up some debug messages 2954 2955 commit 946d1abbca397b8e88a1b0b4df176dcc5e3b7348 2956 Author: Nathan Hjelm <hjelmn@me.com> 2957 Date: Sat Jul 24 13:39:16 2010 -0600 2958 2959 Darwin: Don't open devices during scan unless we have to unsuspend 2960 2961 commit 3b6d9ac82e2599cad7817d21e909a42275ddc4c4 2962 Author: Peter Stuge <peter@stuge.se> 2963 Date: Fri Jun 25 08:08:13 2010 +0200 2964 2965 Linux: Handle early complete of multi-URB transfer 2966 2967 commit a516fcb99376686d2d0028e5ac69950c57a55b9e 2968 Author: Daniel Drake <dan@reactivated.net> 2969 Date: Wed Jul 21 17:49:21 2010 -0600 2970 2971 Only compile dpfp examples when sigaction is available 2972 2973 It's not available on MinGW. 2974 2975 commit a1d831ef82e1700f4ebb9df6ca5cef74be757c08 2976 Author: Aurelien Jarno <aurelien@aurel32.net> 2977 Date: Tue May 25 09:32:19 2010 +0200 2978 2979 configure.ac: fix bashisms 2980 2981 commit 7211aba6e290f9805e911959b2a43a4b3ec56d4f 2982 Author: Daniel Drake <dan@reactivated.net> 2983 Date: Fri Jun 25 12:01:58 2010 -0500 2984 2985 Only include sys/time.h on appropriate platforms 2986 2987 This header doesn't exist on windows. 2988 For libusb, determine at configure-time if the header is available. 2989 For libusb.h, use gcc predefined macros to only include the header 2990 on platforms that need it. 2991 2992 commit b33c3cb9651459de1f3d549677cbac67a017a295 2993 Author: Daniel Drake <dan@reactivated.net> 2994 Date: Tue Jun 22 18:45:38 2010 -0500 2995 2996 Linux: Fix log message commit 2997 2998 Forgot to test this. 2999 3000 commit 139648d5723190734a51c1c66ddf41c3e87adf10 3001 Author: Ludovic Rousseau <rousseau@debian.org> 3002 Date: Mon Jun 21 10:19:29 2010 +0200 3003 3004 Only initialize the default context when it is requested 3005 3006 commit 22d61cd0891d8304dfc1a70579cf154fd8e6644a 3007 Author: Daniel Drake <dan@reactivated.net> 3008 Date: Tue Jun 22 18:20:23 2010 -0500 3009 3010 Linux: fix log message that was being unconditionally sent to stderr (#44) 3011 3012 This message was put in place to aid libusb-compat-0.1 users, who 3013 may run into the change that libusb-0.1 allowed you to usb_open() a 3014 device that you don't have write access to, but libusb-1.0 does not. 3015 3016 As explained on the ticket this change is dangerous so it should go through 3017 the usual logging mechanism. I also added a similar regular log message 3018 to libusb-compat-0.1. 3019 3020 commit 82065a2c5e9d5ad0b2bb28792d12462f2fa150f0 3021 Author: Ludovic Rousseau <rousseau@debian.org> 3022 Date: Thu Jun 10 18:41:27 2010 +0200 3023 3024 Fix 2 documentation typos 3025 3026 commit 351c062aacdde0b0fa7972ee9b7c6b355dcee110 3027 Author: Ludovic Rousseau <rousseau@debian.org> 3028 Date: Wed Apr 21 16:49:33 2010 +0200 3029 3030 add AM_MAINTAINER_MODE 3031 3032 commit a7c056c14867e1cc3ef83682f2706cdbdca7c4ce 3033 Author: Pete Batard <pbatard@gmail.com> 3034 Date: Thu Jun 10 17:00:25 2010 -0500 3035 3036 Factorize event handler interruption code 3037 3038 This will be additionally used by the windows backend which modifies 3039 the fd set frequently. 3040 3041 commit fc0af8e3f76925ad09e0fbc6d233d500753ee375 3042 Author: Pete Batard <pbatard@gmail.com> 3043 Date: Sat Jun 5 12:14:19 2010 -0500 3044 3045 Abstract low-level event handler operations 3046 3047 The Windows backend uses something other than UNIX file descriptors 3048 for event handling. Abstract out the operations to allow for this. 3049 3050 commit 64383fb5b55a74b706967836e81cef61e57df86a 3051 Author: Pete Batard <pbatard@gmail.com> 3052 Date: Tue Jun 1 11:38:14 2010 +0100 3053 3054 fixes the possibility of using a broken timercmp on Windows 3055 3056 Microsoft's implementation of timercmp does not work for >= or <=. 3057 3058 commit f6d60a9a8fcf06629812da886e3a5de592624b61 3059 Author: Pete Batard <pbatard@gmail.com> 3060 Date: Mon Feb 1 19:26:13 2010 +0000 3061 3062 Switched to standard int pointer type for windows 64-bit compat 3063 3064 On 64-bit Windows a pointer is 64 bit, but long is still 32 bit for 3065 backwards compatibility. 3066 uintptr_t nicely hides this difference and also works on Linux. 3067 3068 [dsd: add appropriate include] 3069 3070 commit a2fa855ce3795e31905b255267874af0603168bc 3071 Author: Michael Plante <michael.plante@gmail.com> 3072 Date: Tue Mar 9 16:39:46 2010 -0600 3073 3074 added doxygen, dpfp, msvc, and xusb stuff to gitignore 3075 3076 commit 845d96a9c30b6f053208ed6b5b5d4ad1655e2026 3077 Author: Daniel Drake <dan@reactivated.net> 3078 Date: Mon May 31 19:56:34 2010 -0500 3079 3080 Add reference counting to default context 3081 3082 Michael Plante pointed out that if 2 users call libusb_init(NULL) within 3083 a process, we end up creating 2 default contexts, one of which is lost. 3084 3085 Add reference counting so that the default context is reused and 3086 destroyed only after the last user. 3087 3088 commit 0e77f017fd3d1bdec4aced0429a380d3e434081b 3089 Author: Daniel Drake <dan@reactivated.net> 3090 Date: Thu May 27 19:24:49 2010 -0400 3091 3092 Fix libusb_init() error handling 3093 3094 9996ccaed7 introduced a problem in that mutexes could be destroyed 3095 in the error handling codepath before they had been created. 3096 Pointed out by Michael Plante. 3097 3098 commit b03de9d07bf9a6b0c4e6cba9ec06b5271a22e621 3099 Author: Michael Plante <michael.plante@gmail.com> 3100 Date: Mon May 24 11:57:10 2010 -0300 3101 3102 Modify log functions to compile with MSVC6 3103 3104 MSVC6 does not support variadics. 3105 3106 commit aa77b02da65afb0332b9e6853dae9e4dcda00bfa 3107 Author: Pete Batard <pbatard@gmail.com> 3108 Date: Sun Feb 14 19:46:05 2010 -0600 3109 3110 Add type parameter to the list_for_each_entry() and _safe() macros 3111 3112 typeof() is a GCC extension, not supported by target compilers such 3113 as MSVC. 3114 3115 commit b92b16f437079208c8dfb1dc2380893846a07ee9 3116 Author: Daniel Drake <dan@reactivated.net> 3117 Date: Wed May 19 17:37:29 2010 -0300 3118 3119 Fix a usbi_pollfd leak in error path 3120 3121 I accidently missed this when applying Pete Batard's earlier patch. 3122 Pointed out by Michael Plante. 3123 3124 commit 8aceb5c99056aaed6e6f2db1b303817e37e9fe8c 3125 Author: Pete Batard <pbatard@gmail.com> 3126 Date: Sun Feb 14 19:47:30 2010 -0600 3127 3128 Rename all interface parameters to usb_interface or interface_number 3129 3130 Remove the use of the ambiguous "interface" where possible without 3131 breaking the API. 3132 'interface' is a preprocessor #define already associated with COM on Windows, 3133 that can cause a conflict as soon as windows.h is included. 3134 3135 There are a few more places where interface is still used, which should 3136 be changed for libusb-2.0 3137 3138 commit d7031ee8e1c449af23b2674fe18d9fc652c9bd80 3139 Author: Pete Batard <pbatard@gmail.com> 3140 Date: Mon May 17 19:30:27 2010 -0300 3141 3142 Stricter types and casts 3143 3144 commit 9996ccaed740f8fcec4287a478ccaaa573f9865a 3145 Author: Pete Batard <pbatard@gmail.com> 3146 Date: Mon May 17 19:16:54 2010 -0300 3147 3148 Fixes to error handling and exit codepaths 3149 3150 Various locks and things were being leaked/left open when handling 3151 errors and during deinitialization. 3152 3153 [dsd: small tweaks] 3154 3155 commit 371ca4e440894bd1c845971418aa24c9d3919e63 3156 Author: Nathan Hjelm <hjelmn@me.com> 3157 Date: Thu May 13 19:38:05 2010 -0300 3158 3159 Darwin: Define IO_OBJECT_NULL if not already defined 3160 3161 Needed on Mac OSX 10.3 3162 3163 commit 7ba92cff94bbba19284749c614c26141d3023f37 3164 Author: Hans Ulrich Niedermann <hun@n-dimensional.de> 3165 Date: Fri Jan 29 12:08:52 2010 +0100 3166 3167 libusb_cpu_to_le16: macro->static inline function 3168 3169 The libusb_cpu_to_le16 macro was a ({ ... }) expression, which 3170 generates the following compiler warning every time it is used, 3171 (and that is several times for every #include <libusb.h>): 3172 3173 libusb.h:880: warning: ISO C forbids braced-groups within expressions 3174 3175 With this patch, #include <libusb.h> stops generating compiler 3176 warnings on gcc 4.4. 3177 3178 As libusb.h heavily relies on the use of static inline functions 3179 those can be relied on to work properly, and there should not be 3180 any significant difference in the code the compiler generates. 3181 3182 commit 3473ac6c6fab32202d02d87679ebdb24e7d2df98 3183 Author: Francesco <francesco.montorsi@gmail.com> 3184 Date: Tue Mar 9 16:35:35 2010 -0600 3185 3186 Add libusb_strerror() to get short error message in English from enum 3187 3188 [dsd: small tweaks] 3189 3190 commit 5b69f3b7b0610d5f518954792ddc93332a41d292 3191 Author: Michael Plante <michael.plante@gmail.com> 3192 Date: Thu Feb 25 19:39:22 2010 -0600 3193 3194 Fix libusb_device::lock memory leak 3195 3196 commit a636df4ca1b87ed3094a87828c022092a80ba613 3197 Author: Pete Batard <pbatard@gmail.com> 3198 Date: Wed May 12 21:46:31 2010 -0300 3199 3200 Whitespace cleanup 3201 3202 commit 23b5db8b3e353176dfa0635bfb6f0e2658f6e3de 3203 Author: Peter Stuge <peter@stuge.se> 3204 Date: Tue May 11 00:51:43 2010 +0100 3205 3206 Add internal abstraction for POSIX Threads 3207 3208 This prepares for a Windows backend without dependency on pthreads-w32. 3209 3210 pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*. 3211 3212 A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are 3213 introduced for statically initialized mutexes, since they may be 3214 implemented using other types when pthreads mutexes aren't used. 3215 3216 Move -pthread from libusb/Makefile.am to host-specific THREAD_CFLAGS in 3217 configure.ac. This will enable optional use of -lpthread for cygwin. 3218 3219 [dsd: minor tweaks, and roll in a change based on patches from Pete 3220 Batard to only build dpfp_threaded example when we're using pthreads] 3221 3222 commit a04cbb0095a78aeed3f65aaf06c46069d0ac184a 3223 Author: Daniel Drake <dan@reactivated.net> 3224 Date: Tue May 4 19:01:59 2010 -0300 3225 3226 v1.0.8 release 3227 3228 commit 53b47299531974fa8901b74a163f3c8ebae4eec9 3229 Author: Daniel Drake <dan@reactivated.net> 3230 Date: Thu Apr 22 18:12:51 2010 -0300 3231 3232 Linux: don't set SHORT_NOT_OK on bulk out URBs (#20 3233 3234 Setting this flag is illegal, and the behaviour we're looking for 3235 is already in place for host-to-device transfers without this flag. 3236 3237 commit 1519828b7ee1fce46d4c51fc097d52e01b8e0bb4 3238 Author: Daniel Drake <dan@reactivated.net> 3239 Date: Tue Apr 20 20:14:09 2010 -0300 3240 3241 Linux: Handle failure to read active configuration during enumeration 3242 3243 commit 45168627cc15aee3875192f34286110dbbd27095 3244 Author: Nathan Hjelm <hjelmn@me.com> 3245 Date: Tue Apr 20 19:43:06 2010 -0300 3246 3247 Darwin: don't reuse cached descriptors during enumeration 3248 3249 Descriptor reuse was causing scans to return invalid information when 3250 the device at a location has changed. 3251 3252 commit 3af329db6dcbfb96d24867c757f9e125e5b7b0e5 3253 Author: Daniel Drake <dan@reactivated.net> 3254 Date: Mon Apr 19 19:36:55 2010 -0300 3255 3256 v1.0.7 release 3257 3258 commit ceb8cacd6d2a4189de0db2ee46d45217511c69be 3259 Author: Daniel Drake <dan@reactivated.net> 3260 Date: Mon Apr 19 19:31:12 2010 -0300 3261 3262 Document that fd set contents are an internal implementation detail (#36) 3263 3264 commit 9bea500b5747bdeba7c8251d45608558e71a1db5 3265 Author: Martin Koegler <mkoegler@auto.tuwien.ac.at> 3266 Date: Mon Apr 19 19:22:46 2010 -0300 3267 3268 Linux: correct config descriptor endianness fix 3269 3270 The seek_to_next_config codepath deals with both sysfs and usbfs; 3271 make sure we only convert values in the usbfs path. 3272 3273 commit 02df59a309e813c50b8230de99e69fb4e1814279 3274 Author: Martin Koegler <mkoegler@auto.tuwien.ac.at> 3275 Date: Mon Apr 5 17:11:32 2010 +0200 3276 3277 Linux: Fix endianness handling of usbfs config descriptors (#27) 3278 3279 driver/usb/core/devio.c function usbdev_read translate the follwing files 3280 to CPU endianess: 3281 3282 le16_to_cpus(&temp_desc.bcdUSB); 3283 le16_to_cpus(&temp_desc.idVendor); 3284 le16_to_cpus(&temp_desc.idProduct); 3285 le16_to_cpus(&temp_desc.bcdDevice); 3286 3287 All other data is passed without any change. 3288 3289 libusb/os/linux_usbfs.c calls usbi_parse_descriptor with host_endian=1 3290 for config descriptors. According to the kernel code, they must be 3291 processed with host_endian=0, as they are not translated by the kernel. 3292 3293 Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> 3294 3295 commit ec303b01a5d4e51c000a283853af65059fa62285 3296 Author: Nathan Hjelm <hjelmn@mac.com> 3297 Date: Tue Mar 23 16:22:08 2010 -0600 3298 3299 Darwin: fix enumeration of devices with non-consecutive addresses (#23) 3300 3301 commit cd809e2f7cee3874b7ae16b2c482a8b63a90e4a5 3302 Author: Bastien Nocera <hadess@hadess.net> 3303 Date: Mon Mar 8 10:50:51 2010 +0000 3304 3305 Add more interface classes 3306 3307 As used in bluez. 3308 3309 commit 1ce4aa67d849f5cad8a21072dc1c7b42158ce817 3310 Author: Nathan Hjelm <hjelmn@mac.com> 3311 Date: Thu Mar 18 11:32:32 2010 -0600 3312 3313 Darwin: Cleanup async callback code, catch request timeouts 3314 3315 commit 68af9f8d731f700267335941a8214d34ab518cc8 3316 Author: Nathan Hjelm <hjelmn@mac.com> 3317 Date: Thu Mar 18 11:31:46 2010 -0600 3318 3319 Darwin: fix endianness of control setup packet 3320 3321 IOUSBLib expects the control request to be in host byte order. 3322 Swap the request into host byte order. 3323 3324 commit cfce4d127184f4e4f334976151a0f80594bb5e22 3325 Author: Nathan Hjelm <hjelmn@mac.com> 3326 Date: Mon Feb 15 14:10:08 2010 -0600 3327 3328 Darwin: fix memory leak in process_device 3329 3330 Credit to Mike Colagrosso for finding this bug. 3331 3332 commit 161893cfbefefe315f657677705abe090fc526f2 3333 Author: Nathan Hjelm <hjelmn@mac.com> 3334 Date: Mon Feb 15 14:09:19 2010 -0600 3335 3336 Darwin: use logging functions 3337 3338 Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log. 3339 3340 commit 2a72f38548208044dc3aa62681419d006c35732d 3341 Author: Nathan Hjelm <hjelmn@mac.com> 3342 Date: Mon Feb 15 14:07:44 2010 -0600 3343 3344 Darwin: support multiple calls to libusb_init 3345 3346 Credit to Orin Eman for finding this bug. 3347 3348 commit a4186794d87124503db2f5f51f51ce90bb95daa7 3349 Author: Daniel Drake <dan@reactivated.net> 3350 Date: Sun Nov 22 17:20:53 2009 +0000 3351 3352 v1.0.6 release 3353 3354 commit 8392ff22136fccaf1e15d186157609b8dd127bc5 3355 Author: Ludovic Rousseau <rousseau@debian.org> 3356 Date: Sun Oct 25 10:06:41 2009 +0100 3357 3358 lsusb example: make print_devs() static 3359 3360 lsusb.c:26: warning: no previous prototype for âprint_devsâ 3361 3362 commit 9cc6bfaa15239bb6db1c1570b9beb6df2f848951 3363 Author: Ludovic Rousseau <rousseau@debian.org> 3364 Date: Sun Oct 25 10:05:10 2009 +0100 3365 3366 Darwin: fix warning in darwin_error_str() 3367 3368 os/darwin_usb.c:63: warning: return discards qualifiers from pointer 3369 target type 3370 3371 commit 4c706d2fb6b2c43b10d72ac5dff51cac4d939f1a 3372 Author: Nathan Hjelm <hjelmn@mac.com> 3373 Date: Sat Nov 21 17:06:43 2009 +0000 3374 3375 Darwin: allow devices to be opened multiple times 3376 3377 Allows libusb applications to access multiple interfaces of the same 3378 device in the same application. 3379 3380 Also fixes a set alt interface bug. 3381 3382 commit 0232fc559cdacb9561f982dd6d28feb4435b3e4e 3383 Author: Daniel Drake <dan@reactivated.net> 3384 Date: Sat Nov 21 17:01:32 2009 +0000 3385 3386 Increase libusb_handle_events() timeout to 60 seconds 3387 3388 The internal timing seems to be working, this will be a better test of 3389 it before we make this timeout unlimited. 3390 3391 commit 0bd7ef5d8697973a026c36c15d6276177b4ec4ea 3392 Author: Daniel Drake <dan@reactivated.net> 3393 Date: Sat Nov 21 16:57:25 2009 +0000 3394 3395 Refine timerfd header check (#18) 3396 3397 Require glibc-2.9 for the working timerfd support. 3398 3399 commit 90d8fcab9018b8e6887a7e0592d1e5f692117234 3400 Author: Daniel Drake <dsd@gentoo.org> 3401 Date: Sun Nov 15 12:17:13 2009 +0000 3402 3403 v1.0.5 release 3404 3405 commit 11d591058e3f105b0e90c23bbf58b18de691e690 3406 Author: Daniel Drake <dsd@gentoo.org> 3407 Date: Sat Nov 7 10:43:59 2009 +0000 3408 3409 Update documentation about early completion caveats 3410 3411 commit f796c9528a71aa55326b6f0c9c7c5ec073d2bf92 3412 Author: Ludovic Rousseau <rousseau@debian.org> 3413 Date: Sun Oct 25 09:59:51 2009 +0100 3414 3415 Add libusb_get_max_iso_packet_size() to libusb.h 3416 3417 core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size' 3418 3419 commit 4783008b7e711de9cb31631e60dda995f44068de 3420 Author: Daniel Drake <dsd@gentoo.org> 3421 Date: Wed Oct 28 20:33:49 2009 +0545 3422 3423 Use timerfd for timeout handling 3424 3425 Use a new file descriptor from the timerfd system calls to handle 3426 timeouts. On supported systems, this means that there is less hassle 3427 figuring out when the poll() timeout should be, since 3428 libusb_get_next_timeout() will always return 0 and the timeout events will 3429 be triggered as regular activity on the file descriptor set. 3430 3431 Add API function libusb_pollfds_handle_timeouts() to detect whether 3432 you're on a platform with the timing headache, and flesh out the 3433 surrounding documentation. 3434 3435 commit 9b120c2b3735566533c179aa8ca758fe45899a38 3436 Author: Daniel Drake <dsd@gentoo.org> 3437 Date: Sat Nov 7 10:03:07 2009 +0000 3438 3439 Use AM_SILENT_RULES for building 3440 3441 commit ef6ea6c3ae38e4524f10e16e8cb88177d39c4826 3442 Author: Daniel Drake <dsd@gentoo.org> 3443 Date: Fri Nov 6 21:54:08 2009 +0000 3444 3445 v1.0.4 release 3446 3447 commit 217f57617e0cff0d1bd6d726b243f04c6b179773 3448 Author: David Moore <dcm@acm.org> 3449 Date: Fri Nov 6 21:37:25 2009 +0000 3450 3451 Linux: Add support for the new URB_BULK_CONTINUATION flag 3452 3453 Add support for the new USBDEVFS_URB_BULK_CONTINUATION flag to libusb. 3454 3455 This flag, which is expected to be available in usbfs starting with 3456 kernel 2.6.32, allows the kernel to cancel multiple URBs upon receipt 3457 of a short packet. This capability allows libusb to preserve data 3458 integrity of large bulk transfers that are split into multiple URBs. 3459 Without this support, these URBs must be canceled in userspace upon 3460 receipt of a short packet, a race condition against future transfers 3461 which might partially fill these canceled URBs. 3462 3463 This patch automatically detects whether a supported kernel is present 3464 and enables the use of the flag when possible. 3465 3466 [dsd: tweaks to supported kernel detection, and some inline 3467 documentation of this mechanism] 3468 3469 commit 69830057547396f893f0d7b3125a05d016313b10 3470 Author: Daniel Drake <dsd@gentoo.org> 3471 Date: Wed Oct 28 15:13:22 2009 +0545 3472 3473 Transfer locking 3474 3475 At least on Linux, there were some possible races that could occur if 3476 a transfer is cancelled from one thread while another thread is handling 3477 an event for that transfer, or for if a transfer completes while it is 3478 still being submitted from another thread, etc. 3479 3480 On the global level, transfers could be submitted and cancelled at the 3481 same time. 3482 3483 Fix those issues with transfer-level locks. 3484 3485 commit 98f1b30d24359cb3185051b8df9ebb663cc10369 3486 Author: Daniel Drake <dsd@gentoo.org> 3487 Date: Mon Sep 14 08:01:24 2009 +0100 3488 3489 Clarify that timeout 0 means unlimited timeout 3490 3491 commit 858684f0dd25921e09565034a88709dbf6f6c61b 3492 Author: Daniel Drake <dsd@gentoo.org> 3493 Date: Fri Sep 11 22:09:12 2009 +0100 3494 3495 Linux: more flexibility with monotonic clock 3496 3497 Some users have reported that CLOCK_MONOTONIC does not work on their 3498 systems - I suspect it is available on x86 but perhaps not some 3499 of the more uncommon architectures. We should fall back on 3500 CLOCK_REALTIME in these cases. 3501 3502 Also, CLOCK_MONOTONIC_RAW seems even more monotonic, so we should use 3503 that if it is available. 3504 3505 We now test different clock IDs during initialization to find the 3506 best one that works. 3507 3508 commit fe0d8dce1ed704915d501e7da700440c78144211 3509 Author: Nathan Hjelm <hjelmn@mac.com> 3510 Date: Fri Sep 11 18:00:29 2009 +0100 3511 3512 Darwin: handle overflows 3513 3514 commit f46716f42040986203fa6e873bfdabe1be2900ec 3515 Author: Daniel Drake <dsd@gentoo.org> 3516 Date: Thu Aug 27 21:14:54 2009 +0545 3517 3518 v1.0.3 release 3519 3520 commit 5b489b8b2a5aba7b8b804e5af6d2628735548238 3521 Author: Toby Peterson <toby@macports.org> 3522 Date: Sun Aug 23 10:04:59 2009 +0545 3523 3524 Darwin: 64-bit type fixes 3525 3526 commit ad8ae04d0b52009af0b1180e005f7554d2bbb26c 3527 Author: Nathan Hjelm <hjelmn@mac.com> 3528 Date: Sun Aug 23 10:02:55 2009 +0545 3529 3530 Darwin: fix crash when reading descriptors after close 3531 3532 Fix a crash which occurs if the user does the following sequence on a 3533 device: open, close, get_configuration_descriptor. 3534 3535 commit 45ae2aecf5512dcff059b2a416534e81c6a00c88 3536 Author: Daniel Drake <dsd@gentoo.org> 3537 Date: Sat Aug 1 13:55:15 2009 +0545 3538 3539 move bug info to bug tracker 3540 3541 Protection needed: http://www.libusb.org/ticket/4 3542 Losing data: fixed in previous commit 3543 3544 commit 126129e174062c2a27423817a459e5113f777789 3545 Author: Daniel Drake <dsd@gentoo.org> 3546 Date: Thu Jul 9 22:09:04 2009 +0100 3547 3548 Linux: try harder not to lose any data 3549 3550 We would previously lose any data that was present on a cancelled URB. 3551 Work harder to make sure this doesn't happen. 3552 3553 commit 0334ee642b47dfe1ca9db64b22e7702ea14b3f09 3554 Author: Daniel Drake <dsd@gentoo.org> 3555 Date: Sun Jun 28 19:49:10 2009 +0100 3556 3557 Add libusb_get_max_iso_packet_size() 3558 3559 As pointed out by Dennis Muhlestein, libusb_get_max_packet_size() 3560 doesn't really do what the documentation might suggest because it 3561 does not consider the number of transaction opportunities per 3562 microframe. 3563 3564 Add a new function to do what is useful for isochronous I/O. 3565 3566 commit 615f18e64e96ae4ecc8e43d0de00933059a5209a 3567 Author: Daniel Drake <dsd@gentoo.org> 3568 Date: Sat Jun 20 22:33:21 2009 +0100 3569 3570 Linux: fix sending of zero length bulk packets 3571 3572 Note that there are is a kernel bug preventing this from working 3573 properly at the moment, even after this fix. 3574 3575 commit 86f79fbf61c2018bdf009c7ebf92b38f3a16fd0c 3576 Author: Nathan Hjelm <hjelmn@mac.com> 3577 Date: Fri Jun 19 22:18:44 2009 +0100 3578 3579 Darwin: Don't cancel transfers on timeout 3580 3581 ...because the OS does this for us. 3582 3583 commit d4bd9ed4de19a9c766f7a23eea8c852cdd61c18f 3584 Author: Daniel Drake <dsd@gentoo.org> 3585 Date: Sun Jun 14 19:23:21 2009 +0100 3586 3587 Don't terminate enums with commas 3588 3589 g++ -pedantic doesn't like this 3590 Reported by Eberhard Mattes 3591 3592 commit 8be256082eb9bd8e243d89529f742926bb29a21b 3593 Author: Daniel Drake <dsd@gentoo.org> 3594 Date: Sat Jun 13 17:19:07 2009 +0100 3595 3596 v1.0.2 release 3597 3598 commit 060e006e663fd59c281be29b71eb197e02b210e8 3599 Author: Daniel Drake <dsd@gentoo.org> 3600 Date: Wed Jun 10 21:42:05 2009 +0100 3601 3602 Linux: fix config descriptor parsing on big-endian systems 3603 3604 Multi-byte fields in the configuration descriptors that come back from 3605 usbfs are always in bus endian format. 3606 3607 Thanks to Joe Jezak for help investigating and fixing this. 3608 3609 commit c4a905022f684da9a4a853eb9232a81a53df2652 3610 Author: Nathan Hjelm <hjelmn@mac.com> 3611 Date: Sun Jun 7 22:29:35 2009 +0100 3612 3613 Darwin: improve handling of disconnected devices 3614 3615 commit 6b69f54451762ef590b9c938ab000c07cf9099a3 3616 Author: Nathan Hjelm <hjelmn@mac.com> 3617 Date: Sun Jun 7 22:26:37 2009 +0100 3618 3619 Darwin: fix parsing of config descriptors 3620 3621 This was a confusion between configuration numbers and zero-based 3622 configuration indexes. 3623 3624 commit 2b3a9ffa776b383cb2dbc3c55e490e32e4c3c22b 3625 Author: Daniel Drake <dsd@gentoo.org> 3626 Date: Sun Jun 7 22:19:53 2009 +0100 3627 3628 Eliminate -Wsign-compare compiler warnings 3629 3630 This was due to an API inconsistency which can be safely worked around. 3631 Hopefully we'll remember to fix the API next time we come to break 3632 things. 3633 3634 commit cad5cb55c37137e94e35c74fdabfe42a5cbd229b 3635 Author: David Moore <dcm@acm.org> 3636 Date: Wed May 27 23:15:54 2009 -0700 3637 3638 Make synchronous transfer APIs robust against signal interruption 3639 3640 libusb_control_transfer and libusb_bulk_transfer are designed to be 3641 synchronous such that control is not returned until the transfer 3642 definitively succeeds or fails. That assumption is violated if a signal 3643 interrupts these functions because there is no way for the application 3644 to continue waiting for the transfer without resubmitting it. This 3645 patch changes these synchronous APIs so they do not abort in the case of 3646 a signal interruption. 3647 3648 Signed-off-by: David Moore <dcm@acm.org> 3649 3650 commit b501795985a23109f176d296e7b544b4c6354528 3651 Author: Alex Vatchenko <alex@fabulatech.com> 3652 Date: Thu May 28 15:58:50 2009 -0400 3653 3654 pre-gcc-3.4 compatibility 3655 3656 The -fvisibility and -Wno-pointer-sign options are not available on 3657 old GCC versions. 3658 3659 commit 00bb2805e994887f0a754a825c3ce03d22393386 3660 Author: Daniel Drake <dsd@gentoo.org> 3661 Date: Tue May 26 15:53:26 2009 -0400 3662 3663 Fix memory leak in config descriptor parsing 3664 3665 Pointed out by Martin Koegler. 3666 3667 commit 068ff5b8a83fec0a9a91c80535a25b89a9ae64e8 3668 Author: Daniel Drake <dsd@gentoo.org> 3669 Date: Tue May 12 19:20:51 2009 -0400 3670 3671 Update AUTHORS 3672 3673 commit aa24c04e4043e39674b59ff0d302b2365cd0078f 3674 Author: Daniel Drake <dsd@gentoo.org> 3675 Date: Tue May 12 19:03:37 2009 -0400 3676 3677 v1.0.1 release 3678 3679 commit 44767677447fae4267131f99c591b14117486cac 3680 Author: Daniel Drake <dsd@gentoo.org> 3681 Date: Tue May 12 19:01:44 2009 -0400 3682 3683 Add BUGS file 3684 3685 Probably missed a couple of outstanding issues 3686 3687 commit e0365a6f22e0e7f330ac931df031cf6f17f453d1 3688 Author: Nathan Hjelm <hjelmn@mac.com> 3689 Date: Sun Mar 22 21:13:29 2009 -0400 3690 3691 Darwin: get_config_descriptor bugfixes 3692 3693 commit 5fd0e8478240fece646a58a3c6114001a73be99f 3694 Author: Daniel Drake <dsd@gentoo.org> 3695 Date: Wed Feb 25 12:33:33 2009 -0300 3696 3697 Fix compilation of Darwin backend 3698 3699 My fault. Reported by ihryamzik@gmail.com 3700 3701 commit b49f6bf5c910d0fd694ecf165d7927673707bff9 3702 Author: Nathan Hjelm <hjelmn@mac.com> 3703 Date: Mon Feb 16 21:39:29 2009 -0300 3704 3705 Darwin backend 3706 3707 commit d859158581e9a3250f36cdeeb8ea67cda04053bd 3708 Author: Nathan Hjelm <hjelmn@mac.com> 3709 Date: Mon Feb 16 21:30:49 2009 -0300 3710 3711 Make endianness macros endian-independent 3712 3713 Implementation suggested by David Moore. Needed for proper universal 3714 code support on Darwin. 3715 3716 commit 9196f58bdc8b9e967261df39865215faa5d39cfa 3717 Author: Nathan Hjelm <hjelmn@mac.com> 3718 Date: Mon Feb 16 21:25:18 2009 -0300 3719 3720 Abstract clock reading into OS layer 3721 3722 This will differ on Linux and Darwin, at least. 3723 3724 [dsd: minor style tweaks] 3725 3726 commit e91207860cac09b3afaafc4c14221b78d585c59a 3727 Author: Daniel Drake <dsd@gentoo.org> 3728 Date: Mon Feb 16 21:20:28 2009 -0300 3729 3730 Fix endianness in device descriptors 3731 3732 Pointed out by Nathan Hjelm. 3733 3734 commit ccf6d3d2f6acf9b9a1cb5e1f1b03f382ae509b17 3735 Author: Nathan Hjelm <hjelmn@mac.com> 3736 Date: Mon Feb 16 21:13:52 2009 -0300 3737 3738 Only link with librt on Linux 3739 3740 [dsd: tweak configure.ac change] 3741 3742 commit 894539931e4b4bd85708fe98b956049243cd6fb0 3743 Author: Hans Ulrich Niedermann <hun@n-dimensional.de> 3744 Date: Mon Jan 26 00:31:48 2009 +0100 3745 3746 API docs: describe libusb_transfer_cb_fn type 3747 3748 Add some text describing the libusb_transfer_cb_fn function type 3749 with the semantics I have gathered from reading other parts of 3750 the API docs, referring to the proper section for more details. 3751 3752 [dsd: tweaked the description slightly] 3753 3754 commit abe34a2656f8f9f21e53603796c536585e6233ef 3755 Author: Hans Ulrich Niedermann <hun@n-dimensional.de> 3756 Date: Sun Jan 25 18:21:59 2009 +0100 3757 3758 Make empty array in struct compatible with C99 3759 3760 If the compiler is known to be running in C99 mode, 3761 use "flexible array members" ("foo[]"). 3762 3763 If the compiler is running in any other mode, continue 3764 using the non-standard but widely common "foo[0]" syntax. 3765 3766 commit 620075c7400764d9bb539b5c02065c45c2e8251e 3767 Author: Hans Ulrich Niedermann <hun@n-dimensional.de> 3768 Date: Sun Jan 25 18:20:45 2009 +0100 3769 3770 Avoid signedness errors in API docs example code 3771 3772 commit c754ae294cfe96ec4738d6641137c9e6c56330c7 3773 Author: Daniel Drake <dsd@gentoo.org> 3774 Date: Sat Jan 17 00:25:40 2009 +0000 3775 3776 Decrement poll() result when internal pipe has been handled 3777 3778 When we receive data on the internal control pipe, we need to correctly 3779 decrement the number of ready file descriptors before passing on the 3780 remaining work to the OS implementation. 3781 3782 commit b9ca960f2ba271d2b1a58e22b7c70464d69f6c8a 3783 Author: David Moore <dcm@acm.org> 3784 Date: Sun Jan 11 21:46:17 2009 -0800 3785 3786 Prevent transfer from being submitted twice or improperly canceled 3787 3788 This ensures that tpriv->urbs and tpriv->iso_urbs are always set to NULL 3789 whenever a transfer is not submitted. In this way, submit_*_transfer() 3790 and cancel_*_transfer() can error check to ensure that the transfer is 3791 in the correct state to be either submitted or canceled, preventing 3792 potential memory leaks or double frees. 3793 3794 Signed-off-by: David Moore <dcm@acm.org> 3795 3796 commit d2a8ec2da8abcd8f4648ed118da16191011982dd 3797 Author: David Moore <dcm@acm.org> 3798 Date: Wed Jan 7 22:31:09 2009 -0800 3799 3800 Linux: Fix race condition in cancel_bulk_transfer() 3801 3802 This fixes a race condition in cancel_bulk_transfer(). In the old 3803 version, awaiting_reap and awaiting_discard are incremented in 3804 cancel_bulk_transfer() and decremented in handle_bulk_completion(). 3805 However, since these events may take place in two different threads, 3806 these variables may reach zero before all URBs have been canceled, 3807 triggered spurious callbacks and duplicate frees. 3808 3809 This changes the logic to use a single variable "num_retired" to replace 3810 both awaiting_reap and awaiting_discard. num_retired is incremented 3811 only in handle_bulk_completion() and thus there is no race. The handler 3812 will know that all URBs have been canceled when num_retired becomes 3813 equal to num_urbs. 3814 3815 This change also simplifies a great deal of the logic in both functions 3816 and is a net reduction in the amount of code. 3817 3818 Note that some variables such as "reap_action" probably need to still be 3819 protected by a mutex, and this patch does not address that issue. 3820 3821 Signed-off-by: David Moore <dcm@acm.org> 3822 3823 commit 34b9eebe35d8167d43cffb6ad6175f6b2251b572 3824 Author: Daniel Drake <dsd@gentoo.org> 3825 Date: Sat Dec 13 20:06:49 2008 +0000 3826 3827 v1.0.0 release 3828 3829 It's here! 3830 3831 commit b1d636dde418dc8fe6a8f037dea0d800e57c6b94 3832 Author: Mikhail Gusarov <dottedmag@dottedmag.ent> 3833 Date: Wed Dec 10 15:24:05 2008 +0600 3834 3835 EOL-whitespace fixes 3836 3837 Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.ent> 3838 3839 commit 4a9ac382ba5149ae5b3d0962d6a840b5e0dc13aa 3840 Author: Daniel Drake <dsd@gentoo.org> 3841 Date: Tue Dec 9 21:43:37 2008 +0000 3842 3843 Linux: fix reading of active configuration 3844 3845 Shannon Chuang pointed out that we only read 1 byte into an 3846 uninitialized integer, and then return the whole thing. 3847 3848 commit 81a7310d92461ba7b1d98aeff7c4c007fab07120 3849 Author: Daniel Drake <dsd@gentoo.org> 3850 Date: Tue Dec 9 21:39:11 2008 +0000 3851 3852 Fix double free in descriptor parsing error path 3853 3854 Pointed out by Shannon Chuang. 3855 3856 commit 9b4b53453db56ba9c1d707a645bbe6c7a02a3c81 3857 Author: Daniel Drake <dsd@gentoo.org> 3858 Date: Fri Nov 21 13:28:32 2008 +0000 3859 3860 Improvements to multi-threaded I/O system 3861 3862 Documentation brushed up, and I realised that another function is 3863 needed for tight event handling loops -- they must be able to check 3864 if an open/close operation is trying to interrupt it. 3865 3866 commit 0e5b0fcb77a90b8bd95ad23669da472af31ef069 3867 Author: Daniel Drake <dsd@gentoo.org> 3868 Date: Fri Nov 21 11:00:47 2008 +0000 3869 3870 SourceForge website upload system changed 3871 3872 commit a133875e6e2f52eff53ac03f505d59cbdd33e178 3873 Author: Daniel Drake <dsd@gentoo.org> 3874 Date: Fri Nov 21 10:54:57 2008 +0000 3875 3876 v0.9.4 release 3877 3878 commit c32aa662769b676ff3247778664fccc71fc427ec 3879 Author: Daniel Drake <dsd@gentoo.org> 3880 Date: Thu Nov 20 15:31:10 2008 +0000 3881 3882 Pause event handling while opening and closing devices 3883 3884 Ludovic Rousseau found that crashes often occur if you close a device 3885 while another thread is doing event handling. 3886 3887 Fix this by adding an internal control pipe, which the close routines 3888 use to interrupt the event handler and obtain the event handling lock, 3889 ensuring that no other thread is handling events while the device is 3890 closed. After the close completes, it signals all the event handlers 3891 to start up again using the usual mechanism. 3892 3893 Also modified libusb_open() to do a similar thing, so that event 3894 handlers are interrupted in order to realise that a new poll fd has 3895 appeared. 3896 3897 commit 1d7cf3d0fa8698eae25097cbda1870be90ff6f5e 3898 Author: Bastien Nocera <hadess@hadess.net> 3899 Date: Thu Oct 30 14:35:23 2008 +0000 3900 3901 Add libusb_attach_kernel_driver() 3902 3903 Add support for re-attaching a driver to a device under Linux. 3904 3905 [dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case] 3906 3907 commit 914a4e70657c86b5094770aa2d898c978b1cdf41 3908 Author: Daniel Drake <dsd@gentoo.org> 3909 Date: Sun Nov 2 21:45:54 2008 +0000 3910 3911 Linux: handle low-level transfer errors 3912 3913 Handle more URB error status codes, thanks to Lou and Alan Stern. 3914 3915 commit d25b566b3b8febafdda4211de724b4727dd4b7e0 3916 Author: Aurelien Jarno <aurelien@aurel32.net> 3917 Date: Thu Sep 4 13:50:49 2008 +0200 3918 3919 Support for out-of-tree building 3920 3921 Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building 3922 for the documentation part. This patch fixes that by using a 3923 doxygen.cfg.in file, which contains @top_srcdir@ to refer to the 3924 location of the libusb source code. 3925 3926 commit 8674c67ef78e1cf89db1fa584a4304f7c5ddcc5f 3927 Author: Daniel Drake <dsd@gentoo.org> 3928 Date: Sun Nov 2 15:00:39 2008 +0000 3929 3930 Document the logging style 3931 3932 Suggested by Lou. 3933 3934 commit 94936cbcfe3f02eb65c8b91e29896604316259d8 3935 Author: Daniel Drake <dsd@gentoo.org> 3936 Date: Wed Aug 27 22:44:24 2008 -0500 3937 3938 Async I/O documentation touchups 3939 3940 commit 2f8f1b1a900f5b9828e5e2ff93c2b26a44fd9de2 3941 Author: Daniel Drake <dsd@gentoo.org> 3942 Date: Wed Aug 27 21:23:10 2008 -0500 3943 3944 Doc: fix typo in events lock section 3945 3946 commit 046e681e4ac6b697e40458ee0f5baf3cd8763bb0 3947 Author: Daniel Drake <dsd@gentoo.org> 3948 Date: Sat Aug 23 01:00:21 2008 -0500 3949 3950 v0.9.3 release 3951 3952 commit fec6eaa4eecdf7e0b8299157a5dabef94417f193 3953 Author: Daniel Drake <dsd@gentoo.org> 3954 Date: Sat Aug 23 00:57:44 2008 -0500 3955 3956 Reset internal transfer flags on submit 3957 3958 This fixes a problem pointed out by Lou, where resubmitting a transfer 3959 that previously timed out never timed out again, as if the timeout had 3960 been set to 0. 3961 3962 commit 81627bd38900ec9701ab69c141aa51a9abea1f60 3963 Author: Daniel Drake <dsd@gentoo.org> 3964 Date: Sun Aug 10 17:09:48 2008 -0500 3965 3966 Add libusb_get_configuration prototype 3967 3968 Pointed out by Lou 3969 3970 commit 1631eaefcc7cdf7047c6b9225618a9aa1b3d87d1 3971 Author: Daniel Drake <dsd@gentoo.org> 3972 Date: Sat Jul 19 17:51:28 2008 -0500 3973 3974 v0.9.2 release 3975 3976 commit 0d9c40d7f3eee15ada624b5caab2cfb912144fdc 3977 Author: Daniel Drake <dsd@gentoo.org> 3978 Date: Wed Jul 16 09:22:12 2008 -0500 3979 3980 Linux: fix sysfs directory handling 3981 3982 The length of the directory name varies, e.g. when you have nested hubs. 3983 Use dynamic allocation to be able to deal with any length of name. 3984 3985 commit 66c9847ad54b126ccafd4877292454ab57d0c115 3986 Author: David Engraf <dogge2k@gmx.de> 3987 Date: Wed Jul 16 09:16:38 2008 -0500 3988 3989 Linux: correct usage of MAX_PATH 3990 3991 Thanks to clarification from Artem Egorkine, MAX_PATH already includes 3992 space for the trailing NULL. 3993 3994 commit 6494f07a6d1b73ce786ae581c4ff691e39e61d19 3995 Author: Daniel Drake <dsd@gentoo.org> 3996 Date: Tue Jul 8 21:15:54 2008 -0500 3997 3998 Linux: fix bulk/iso transfer double-cancellation 3999 4000 Reset counters to 0 so that it's possible to cancel a transfer twice 4001 without breaking things. Not sure that I want to support this properly, 4002 but this makes it work at least. 4003 4004 commit 9140f5b414e37a3714cde9c6d6c87c963338a83a 4005 Author: Daniel Drake <dsd@gentoo.org> 4006 Date: Sat Jun 28 21:28:44 2008 -0500 4007 4008 v0.9.1 release 4009 4010 commit 83a029062c1d2bfb584d7a6ee94915583d37464c 4011 Author: Daniel Drake <dsd@gentoo.org> 4012 Date: Sat Jun 28 21:24:49 2008 -0500 4013 4014 Add missing GET_CONTEXT() 4015 4016 commit fbad9a5426f0369394c88987355a8fb06a741ca1 4017 Author: Daniel Drake <dsd@gentoo.org> 4018 Date: Sat Jun 28 21:18:41 2008 -0500 4019 4020 Linux: Compatibility with new sysfs descriptors file 4021 4022 As of 2.6.26, the descriptors file now includes all descriptors, not 4023 just the active one. 4024 4025 commit 819e65f880ca43526036e56c65c415042c91f58f 4026 Author: Daniel Drake <dsd@gentoo.org> 4027 Date: Thu Jun 26 22:47:05 2008 -0500 4028 4029 Allow user data pointer to be passed through pollfd notification API 4030 4031 commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90 4032 Author: Daniel Drake <dsd@gentoo.org> 4033 Date: Tue Jun 24 23:01:51 2008 -0500 4034 4035 Introduce contexts to the API 4036 4037 Suggested by David Zeuthen. This allows multiple libraries in the same 4038 process to independently use libusb without interfering. 4039 4040 commit 9818151c60a85aea6af24cb0996a92c3726c9864 4041 Author: Daniel Drake <dsd@gentoo.org> 4042 Date: Tue Jun 24 21:31:13 2008 -0500 4043 4044 Revert "Temporary workaround for event handling serialization issue" 4045 4046 This reverts commit 2d3a1111caff40ebb87983c861ff548cdc9e5946. 4047 This was based on the assumption that dying threads would automatically 4048 release mutexes, which is not the case. 4049 4050 commit d5f82893fab3f1c13b1af4ba17aac72479bad7d5 4051 Author: Daniel Drake <dsd@gentoo.org> 4052 Date: Fri Jun 20 23:04:53 2008 -0500 4053 4054 Overflow handling 4055 4056 commit 546dee211eefbdd280fd1fc9dee84a9b52105078 4057 Author: Artem Egorkine <arteme@gmail.com> 4058 Date: Tue Jun 17 18:27:38 2008 -0500 4059 4060 a fix for SIGSEGV in handle_bulk_completion() 4061 4062 We cannot dereference tpriv after calling 4063 usbi_handle_transfer_cancellation() because that function may invoke 4064 the user-supplied callback which may free the transfer. 4065 4066 commit 947ba8056456a5215724fb502e3e09d50016f699 4067 Author: Daniel Drake <dsd@gentoo.org> 4068 Date: Mon Jun 16 22:50:50 2008 -0500 4069 4070 Refine configuration selection again 4071 4072 At Alan Stern's suggestion, just offer the bare "set configuration" and 4073 "get configuration" functionality, and let applications worry about the 4074 specific race conditions and unusual situations. 4075 4076 commit e7a7a49d0331ee0e14145f6e7ec39763b36314ac 4077 Author: Daniel Drake <dsd@gentoo.org> 4078 Date: Sun Jun 15 15:29:38 2008 -0500 4079 4080 docs update 4081 4082 Add a THANKS file, make copyright notices easily accessible, update TODO 4083 4084 commit 217534e4b396081e038ee5f94c813d1668963673 4085 Author: Daniel Drake <dsd@gentoo.org> 4086 Date: Sun Jun 15 15:23:29 2008 -0500 4087 4088 round up poll timeout 4089 4090 Pointed out by Richard Röjfors, otherwise we end up busy-looping with 4091 a poll() timeout of 0. 4092 4093 commit 5ad79b324bc5e11a75a585398a1e81c26f05e758 4094 Author: Felipe Balbi <me@felipebalbi.com> 4095 Date: Sun Jun 8 12:34:48 2008 +0300 4096 4097 fix doc about libusb_open() 4098 4099 libusb_open() returns int instead of libusb_device_handle. 4100 4101 Signed-off-by: Felipe Balbi <me@felipebalbi.com> 4102 [dsd: small correction] 4103 4104 commit 2d3a1111caff40ebb87983c861ff548cdc9e5946 4105 Author: Daniel Drake <dsd@gentoo.org> 4106 Date: Thu May 29 17:26:26 2008 +0100 4107 4108 Temporary workaround for event handling serialization issue 4109 4110 Ludovic Rousseau pointed out that libusb_unlock_events() is not called 4111 when a thread gets terminated with a signal, meaning that event waiters 4112 will not be woken up in this case. 4113 4114 Add a temporary hack to libusb_event_handler_active() so that at least 4115 the other threads will realise on the next iteration of their event 4116 handling loop. 4117 4118 The real fix will likely involve reworking most of this. 4119 4120 commit 514bb8790cfe8b93ccfff82bc17081b1030acce0 4121 Author: Daniel Drake <dsd@gentoo.org> 4122 Date: Thu May 29 12:35:01 2008 +0100 4123 4124 Refine libusb_set_configuration() semantics 4125 4126 Applications will generally want to set a configuration before claiming 4127 interfaces. The problem is that the interface may already be set, and 4128 someone else may have claimed an interface (meaning that all calls to 4129 set_configuration will fail, even if it's for the same configuration). 4130 4131 There are now 2 options: 4132 1. Use the new libusb_get_configuration() to determine active 4133 configuration before calling libusb_set_configuration() 4134 2. Or just call libusb_set_configuration() as usual, which will do 4135 nothing if that configuration is already active. 4136 4137 commit d1292f8e7300051239a7ed2769d221dc7a6f9fca 4138 Author: Daniel Drake <dsd@gentoo.org> 4139 Date: Sun May 25 23:42:42 2008 +0100 4140 4141 v0.9.0 release 4142 4143 First libusb-1.0 beta release 4144 4145 commit 4cd249388e4ed2ca03f1263984ab67df5030bb65 4146 Author: Daniel Drake <dsd@gentoo.org> 4147 Date: Sun May 25 22:59:09 2008 +0100 4148 4149 Take lock before raising event waiters condition 4150 4151 This avoids a race between the user checking for active event handler 4152 and then blocking on the condition variable 4153 4154 commit 7c525480ab3c4db9205bfe30bb0d2bef9096c444 4155 Author: Daniel Drake <dsd@gentoo.org> 4156 Date: Fri May 23 15:57:07 2008 +0100 4157 4158 Implement serialization of event handlers 4159 4160 Now offers a mechanism to wait for events while another thread is 4161 doing the event handling. Complicates things for MT async apps, but 4162 then again it's a bit of a tricky combination to start with. 4163 4164 commit ff0660a415ecfd0879600eaad1c5899b6d93a30a 4165 Author: Daniel Drake <dsd@gentoo.org> 4166 Date: Sat May 24 21:28:31 2008 +0100 4167 4168 allow LIBUSB_DEBUG env var to control message verbosity at runtime 4169 4170 Based on ideas from Ludovic Rousseau 4171 4172 commit 4d788967e3f8d75eaf3a1ac1ee8e2e8bed0601c1 4173 Author: Daniel Drake <dsd@gentoo.org> 4174 Date: Fri May 23 15:58:11 2008 +0100 4175 4176 don't print messages by default 4177 4178 Add libusb_set_debug() API to set message verbosity. 4179 4180 Ludovic Rousseau pointed out that applications may close stdout/stderr 4181 descriptors, which might then be reused. 4182 4183 commit bef33bb9eba0da04ee7488d9cd5e6ab12bc61c0c 4184 Author: Daniel Drake <dsd@gentoo.org> 4185 Date: Mon May 19 15:43:27 2008 +0100 4186 4187 Fix memory leak in libusb_control_transfer 4188 4189 Pointed out by David Engraf: we weren't freeing the transfer buffer 4190 4191 commit a345bacb6f07ebb2122402041a9e8092d4a20a4d 4192 Author: David Engraf <david.engraf@netcom.eu> 4193 Date: Mon May 19 15:16:32 2008 +0100 4194 4195 Linux: fix handling of ioctl failure 4196 4197 The return value of some ioctl commands in linux_usbfs.c are not 4198 handeled correct. The ioctl function returns != 0 and errno is set with 4199 the error code. 4200 4201 commit e44396a458ecea9e5edd9a7577e617571c76860d 4202 Author: David Engraf <david.engraf@netcom.eu> 4203 Date: Mon May 19 15:13:38 2008 +0100 4204 4205 critical memory leak in handle_events 4206 4207 This patch closes a critical memory leak in handle_events. The fds 4208 variable is malloced but never freed. When I'm calling 4209 handle_events with a timeout of 0, my system runs out of memory after a 4210 few seconds. 4211 4212 commit eb25630f52bc9848b444e439632c899977d887b0 4213 Author: Daniel Drake <dsd@gentoo.org> 4214 Date: Fri May 16 23:50:20 2008 +0100 4215 4216 More informative libusb_open() return code 4217 4218 Hopefully one of the last API tweaks... 4219 4220 commit 2b2e9c40b195261b09ac52ebdb93eef25c79de90 4221 Author: Daniel Drake <dsd@gentoo.org> 4222 Date: Fri May 16 22:37:56 2008 +0100 4223 4224 Fix endianness with descriptor handling 4225 4226 Alan Stern pointed out that usbfs gives host-endian data, but sysfs gives 4227 bus-endian. 4228 4229 commit 1298c51f516a7bf04ca9add1b7db14417cdc66f3 4230 Author: Daniel Drake <dsd@gentoo.org> 4231 Date: Mon May 12 18:46:37 2008 +0100 4232 4233 Backend documentation for porting efforts 4234 4235 Hopefully comprehensive enough for people to get started. 4236 4237 commit ade26afc42c34ceb1c45afcadd2ea5e8240eaca4 4238 Author: Daniel Drake <dsd@gentoo.org> 4239 Date: Mon May 12 15:43:30 2008 +0100 4240 4241 Linux: fix caching of guessed configuration 4242 4243 Reported and tested by Xiaofan Chen 4244 4245 commit e25d590a9198995b4f0b6afeb41ecae318715e7e 4246 Author: Rob Walker <rob@tenfoot.org.uk> 4247 Date: Sun May 11 21:14:18 2008 +0100 4248 4249 Linux: fix bulk transfer early completion 4250 4251 We were forgetting about the remaining urbs when a non-final urb 4252 completed early. 4253 4254 [dsd: some touchups and a warning message for a corner case that we don't handle] 4255 4256 commit fec7c84163e25b8f811632828334d75da82bcb16 4257 Author: Daniel Drake <dsd@gentoo.org> 4258 Date: Sun May 11 20:31:58 2008 +0100 4259 4260 Handle hot-unplugging 4261 4262 This involved moving from select() to poll() because there is no way to 4263 distinguish usbfs's POLLERR condition with select(). 4264 4265 commit aeb905fa5d78cdbba80a680aa7a2bb7338f27f65 4266 Author: Daniel Drake <dsd@gentoo.org> 4267 Date: Sun May 11 16:04:35 2008 +0100 4268 4269 Documentation work 4270 4271 commit ba5d9a45c06311204f51faef41d1ee215bb5b823 4272 Author: Daniel Drake <dsd@gentoo.org> 4273 Date: Sun May 11 15:36:24 2008 +0100 4274 4275 Endianness of control setup packets 4276 4277 Document behaviour where host-endian and bus-endian (little) should be 4278 used respectively. 4279 4280 Also remove packed attribute from libusb_control_setup as all fields 4281 are naturally aligned. 4282 4283 commit 7bedc3b2683f35ee1dd39a2ebe0ec05be0019f38 4284 Author: Daniel Drake <dsd@gentoo.org> 4285 Date: Sun May 11 15:11:59 2008 +0100 4286 4287 Document that releasing interface causes SET_INTERFACE control request 4288 4289 commit f2ede9876cd4f5cfa7751b975670fa449187fe3d 4290 Author: Daniel Drake <dsd@gentoo.org> 4291 Date: Sat May 10 21:45:42 2008 +0100 4292 4293 Support unconfigured devices 4294 4295 commit 8ebb4ccdfaf5f095a1c38787d909d280ea64405c 4296 Author: Daniel Drake <dsd@gentoo.org> 4297 Date: Sat May 10 20:56:44 2008 +0100 4298 4299 Linux: fix caching of active configuration for non-sysfs 4300 4301 commit c3844f7aeb2176636ce6e6ef697659fdb0b30048 4302 Author: Daniel Drake <dsd@gentoo.org> 4303 Date: Sat May 10 14:42:43 2008 +0100 4304 4305 Fetch configurations by index (not value) 4306 4307 Otherwise there is no way to know which values to look for. 4308 4309 commit d77052c0d630e33737c38d601fd633155f6b2229 4310 Author: Daniel Drake <dsd@gentoo.org> 4311 Date: Sat May 10 00:12:53 2008 +0100 4312 4313 Linux: comprehensive sysfs vs usbfs access 4314 4315 Be more flexible when certain parts of sysfs are not available. 4316 4317 commit 74bc842bac1a32a26323da6c3e8af2f66e1b5cfa 4318 Author: Daniel Drake <dsd@gentoo.org> 4319 Date: Fri May 9 19:38:13 2008 +0100 4320 4321 Linux: no need to store usbfs node path 4322 4323 This can be computed from bus number and device address 4324 4325 commit fe4adcc99e30115204ab832ad3e0170c9aca7629 4326 Author: Daniel Drake <dsd@gentoo.org> 4327 Date: Fri May 9 14:34:31 2008 +0100 4328 4329 Rework configuration handling 4330 4331 libusb no longer caches descriptors in libusb_device but backends are 4332 intended to be able to provide copies from memory. In the common linux 4333 case we can use sysfs. 4334 4335 commit 5741bfe01a2481b8c3830c80edc3637bf62a7e16 4336 Author: Daniel Drake <dsd@gentoo.org> 4337 Date: Fri May 9 14:36:14 2008 +0100 4338 4339 libusb_get_device_list() can return negative error code 4340 4341 commit 45413101b78298e9332b22a34bc6bc159000ad8a 4342 Author: Daniel Drake <dsd@gentoo.org> 4343 Date: Thu May 8 23:09:21 2008 +0100 4344 4345 Linux: fix clear_halt implementation 4346 4347 The ioctl expects an integer. 4348 Bug found with the assistance of Soumen Mondal 4349 4350 commit 10d4e427cc171dfd6ad7f43a33ce3cfebcd7aa04 4351 Author: Daniel Drake <dsd@gentoo.org> 4352 Date: Thu May 8 23:04:52 2008 +0100 4353 4354 Documentation work 4355 4356 Partially based on some libusb-devel discussions 4357 4358 commit ded0a249322571a075e3ed3528021864247dfa55 4359 Author: Daniel Drake <dsd@gentoo.org> 4360 Date: Mon May 5 22:57:48 2008 +0100 4361 4362 Linux: enumerate devices and descriptors from sysfs 4363 4364 Suggested by Alan Stern. This avoids waking up any suspended USB devices. 4365 sysfs is not available on all systems, so the usbfs mechanism is still 4366 in place as a fallback. 4367 4368 commit 885c2a5de69d6b7d8902bb55d6d83680a5a1a6e5 4369 Author: Daniel Drake <dsd@gentoo.org> 4370 Date: Mon May 5 21:34:31 2008 +0100 4371 4372 documentation touchups 4373 4374 commit 59c205d542b43d79fe28622dbe8f03a3a3300b6f 4375 Author: Daniel Drake <dsd@gentoo.org> 4376 Date: Mon May 5 21:17:03 2008 +0100 4377 4378 more error code sanitization 4379 4380 commit 88055d4b5913102a90ff666f75fd922c74860dc5 4381 Author: Daniel Drake <dsd@gentoo.org> 4382 Date: Mon May 5 20:57:43 2008 +0100 4383 4384 Isochronous transfer helper functions 4385 4386 commit a95c943ed301dcd20e92b0b3b255568899a4c42e 4387 Author: Daniel Drake <dsd@gentoo.org> 4388 Date: Mon May 5 17:54:33 2008 +0100 4389 4390 free open devices on exit 4391 4392 commit b27fff633843824744df7d334cb89ece329cafa6 4393 Author: Daniel Drake <dsd@gentoo.org> 4394 Date: Mon May 5 17:47:49 2008 +0100 4395 4396 move descriptor parsing into main library 4397 4398 OS modules now provide functionality for fetching device/config 4399 descriptors 4400 4401 commit a304eca71f22c6df7d70a901483b30f1b8e93378 4402 Author: Daniel Drake <dsd@gentoo.org> 4403 Date: Mon May 5 16:22:33 2008 +0100 4404 4405 Detect endpoint halts and unsupported control requests 4406 4407 commit 7da521954ba661d3f537440c31a84b66e974d56b 4408 Author: Daniel Drake <dsd@gentoo.org> 4409 Date: Mon May 5 01:00:31 2008 +0100 4410 4411 Linux: fix logical URB allocation 4412 4413 We were allocating the wrong number of URBs for transfers of size 4414 multiples of 16k. 4415 4416 commit 470b1bc42bf53373ce678fc76bab9160a54d6881 4417 Author: Daniel Drake <dsd@gentoo.org> 4418 Date: Sun May 4 16:51:23 2008 +0100 4419 4420 add functionality for querying and detaching kernel driver 4421 4422 commit 17ecfb0ecc833596c43755c80d461cddb9b3b0d7 4423 Author: Daniel Drake <dsd@gentoo.org> 4424 Date: Sun May 4 16:20:46 2008 +0100 4425 4426 Descriptor reading functionality 4427 4428 commit bdce367d1bd8691465844b2411c85215498f517d 4429 Author: Daniel Drake <dsd@gentoo.org> 4430 Date: Sun May 4 14:22:16 2008 +0100 4431 4432 sanitized error returns from synchronous I/O functions 4433 4434 commit bfe74e9cd9c17a40fff042ea0647326f51cfecae 4435 Author: Daniel Drake <dsd@gentoo.org> 4436 Date: Sun May 4 14:10:19 2008 +0100 4437 4438 implement libusb_reset_device() 4439 4440 commit c01f744ce07bbeccbe353e956479f0cc5a811a6f 4441 Author: Daniel Drake <dsd@gentoo.org> 4442 Date: Sun May 4 13:46:41 2008 +0100 4443 4444 Add functionality to clear endpoint halt conditions 4445 4446 commit 5878daa85e3364bb3885190425d4f9deaa2d8c36 4447 Author: Daniel Drake <dsd@gentoo.org> 4448 Date: Sun May 4 00:51:59 2008 +0100 4449 4450 Fix libusb_get_device_list return value 4451 4452 It was documented to return the list length, but was returning 0. 4453 4454 commit a74106a9b48b88bae0e099be34a18d653a8f1238 4455 Author: Daniel Drake <dsd@gentoo.org> 4456 Date: Sat May 3 16:50:58 2008 +0100 4457 4458 Well-defined error codes for some operations 4459 4460 Also renamed set_interface_altsetting to set_interface_alt_setting for 4461 better consistency 4462 4463 commit 0f463fe671455670efcf4a93e526b2a9082b0afe 4464 Author: Daniel Drake <dsd@gentoo.org> 4465 Date: Sat May 3 16:24:11 2008 +0100 4466 4467 Add libusb_set_configuration() 4468 4469 commit e65608994f795f97e4d6adac20329ca08709db2d 4470 Author: Daniel Drake <dsd@gentoo.org> 4471 Date: Sat May 3 15:40:23 2008 +0100 4472 4473 rename LIBUSB_ERROR_NOMEM to LIBUSB_ERROR_NO_MEM 4474 improves consistency 4475 4476 commit 5384bbf300779e7936eac9ebd33ee38f5b533f8e 4477 Author: Daniel Drake <dsd@gentoo.org> 4478 Date: Sat May 3 14:34:54 2008 +0100 4479 4480 Linux: better EACCES handling 4481 4482 commit 1936eeeba3f933a078df1005cc7c1533a8ec2bac 4483 Author: Daniel Drake <dsd@gentoo.org> 4484 Date: Sat May 3 14:26:56 2008 +0100 4485 4486 Rename reference counting API 4487 4488 This improves consistency with the naming style of other functions 4489 4490 commit e2f822b4f17342f614ab2455179a80975fca6cb0 4491 Author: Daniel Drake <dsd@gentoo.org> 4492 Date: Sat May 3 14:24:40 2008 +0100 4493 4494 Linux: use read-only access to enumerate devices and descriptors 4495 4496 Write access is not needed until later. 4497 Also fix handling of open() error code. 4498 4499 commit 81204eed3d0a7744b89b68bd90d567b68d191a91 4500 Author: Daniel Drake <dsd@gentoo.org> 4501 Date: Fri May 2 17:45:23 2008 +0100 4502 4503 document pollfd notifiers 4504 4505 commit e20f8281fb7da32587f81b5eea5818af1eab0fe0 4506 Author: Daniel Drake <dsd@gentoo.org> 4507 Date: Fri May 2 17:33:52 2008 +0100 4508 4509 Allow multiple interfaces to be claimed 4510 4511 commit 66685ff25d81a1f1a2a3dbda882d407638d00672 4512 Author: Daniel Drake <dsd@gentoo.org> 4513 Date: Fri May 2 16:55:36 2008 +0100 4514 4515 Documentation improvements 4516 4517 commit 55bce39cbe0c9746a428b66751d1afe551d86381 4518 Author: Daniel Drake <dsd@gentoo.org> 4519 Date: Fri May 2 12:55:34 2008 +0100 4520 4521 detect short descriptor reads 4522 4523 commit f3f17846dcced6b2dc40f899ed6a2aba151c264b 4524 Author: Daniel Drake <dsd@gentoo.org> 4525 Date: Fri May 2 12:32:46 2008 +0100 4526 4527 remove "references" and "referenced by" listings in documentation 4528 4529 commit fbb017dd9a26ce449578482b95157b3c850fa446 4530 Author: Daniel Drake <dsd@gentoo.org> 4531 Date: Fri May 2 12:32:08 2008 +0100 4532 4533 Use typedef ptr types in parameters and return types 4534 4535 This is passed through to the docs 4536 4537 commit 3675e978fb7a1042f8601931255658bcd14a2298 4538 Author: Daniel Drake <dsd@gentoo.org> 4539 Date: Fri May 2 12:28:31 2008 +0100 4540 4541 Expose bus number and device address 4542 4543 commit 2012898ffc492317cb428d97077bf5ee0e98e1da 4544 Author: Daniel Drake <dsd@gentoo.org> 4545 Date: Tue Apr 29 15:26:46 2008 +0100 4546 4547 standardised error codes 4548 4549 commit 0269c75ae3de7acb2dc555e45928750e35fdb320 4550 Author: Daniel Drake <dsd@gentoo.org> 4551 Date: Tue Apr 29 13:34:26 2008 +0100 4552 4553 Fix descriptor handling memory leaks 4554 4555 commit d3ab4e3bd4068cba41c1e12c4b175018dc3cb343 4556 Author: Daniel Drake <dsd@gentoo.org> 4557 Date: Sun Apr 27 23:50:01 2008 +0100 4558 4559 Rename endpoint_type to transfer_type 4560 4561 Matches the USB specs more closely 4562 4563 commit 379e90e0fdcef6f4db1849fa0a7fd524407cf564 4564 Author: Daniel Drake <dsd@gentoo.org> 4565 Date: Sun Apr 27 23:41:24 2008 +0100 4566 4567 Remove a FIXME comment 4568 4569 it can't. 4570 4571 commit 2ddf81420557d016bbcbf28dda0d8d1c64d16264 4572 Author: Daniel Drake <dsd@gentoo.org> 4573 Date: Sun Apr 27 23:30:34 2008 +0100 4574 4575 Fix unlocked flying_transfers list access 4576 4577 commit 7ac0a405b4c57db42e88cbcba5f135697f03b646 4578 Author: Daniel Drake <dsd@gentoo.org> 4579 Date: Sun Apr 27 23:27:04 2008 +0100 4580 4581 Remove libusb_cancel_transfer_sync 4582 4583 This wasn't a particularly nice API. Cancellation should be handled by 4584 the completion handler. 4585 4586 commit a5006fd7b9dae6f1db7969c8744086ba3a7c027b 4587 Author: Daniel Drake <dsd@gentoo.org> 4588 Date: Sun Apr 27 19:56:02 2008 +0100 4589 4590 remove extra timeout check 4591 4592 If select() didn't timeout then don't check for more timeouts 4593 4594 commit 3bdafaa359d9c65e1af360b5338e1f25528a8066 4595 Author: Daniel Drake <dsd@gentoo.org> 4596 Date: Sun Apr 27 19:53:51 2008 +0100 4597 4598 Documentation touchups 4599 4600 Detail that interrupt polling interval is fixed to endpoint bInterval, 4601 and that data may be transferred even on a timeout condition. 4602 4603 commit e12618c79d520955b1abf80a277e881d91907162 4604 Author: Daniel Drake <dsd@gentoo.org> 4605 Date: Sat Apr 19 16:17:53 2008 +0100 4606 4607 add threaded example program 4608 4609 commit 1fcdb0678b759569db7cd530457dbc0a5f86fb1d 4610 Author: Daniel Drake <dsd@gentoo.org> 4611 Date: Fri Apr 18 23:58:54 2008 +0100 4612 4613 libusb_device mutex protection 4614 4615 commit 0efd2efa65d5513e5754d717d522b2c5c45332e2 4616 Author: Daniel Drake <dsd@gentoo.org> 4617 Date: Fri Apr 18 23:42:40 2008 +0100 4618 4619 mutex protection for device and handle lists 4620 4621 commit d2ff2b14a15e5099ff0214502944de30f141a39c 4622 Author: Daniel Drake <dsd@gentoo.org> 4623 Date: Fri Apr 18 20:00:31 2008 +0100 4624 4625 lock flying_transfers during transfer removal 4626 4627 commit 2569980762cb66804da31e54bef243702da8dfe9 4628 Author: Daniel Drake <dsd@gentoo.org> 4629 Date: Fri Apr 18 19:59:56 2008 +0100 4630 4631 pollfds mutex protection 4632 4633 commit f5a33e08ec0da51ccb5e95a5adec50c5211a9bf5 4634 Author: Daniel Drake <dsd@gentoo.org> 4635 Date: Thu Apr 17 18:24:54 2008 +0100 4636 4637 flying_transfers mutex protection 4638 4639 This marks the beginnings of thread safety 4640 4641 commit 85e1994123545125ce0653415d122f9790f8d041 4642 Author: Daniel Drake <dsd@gentoo.org> 4643 Date: Thu Apr 17 17:44:28 2008 +0100 4644 4645 Linux: fix control transfer cancellation 4646 4647 commit cf9b831f7bfd97ba88721c1d934aeda522f3692c 4648 Author: Daniel Drake <dsd@gentoo.org> 4649 Date: Mon Apr 14 20:03:27 2008 +0100 4650 4651 set correct endpoint type for isochronous transfers 4652 4653 Pointed out by Felix Domke 4654 4655 commit ad6e2b712c5b54af44424e58a2776686314e26b7 4656 Author: Daniel Drake <dsd@gentoo.org> 4657 Date: Fri Apr 11 21:40:07 2008 +0100 4658 4659 Linux: fire multiple URBs at once for split transfers 4660 4661 This results in a significant performance increase for bulk transfers 4662 larger than 16kb, and fixes a bug where data would be spliced and mixed 4663 between two simultaneously submitted transfers to the same endpoint. 4664 4665 It also allows isochronous transfers larger than 16kb to be submitted. 4666 4667 This commit also improves cancellation - the library now understands 4668 what is going on. 4669 4670 commit d9b2ce2894ed43d34de6850f2dac50ccabf1db55 4671 Author: Daniel Drake <dsd@gentoo.org> 4672 Date: Tue Apr 1 23:28:32 2008 +0100 4673 4674 Constify some return data 4675 4676 Make it clear that apps should not mess with these structures 4677 4678 commit 8d809854e2b19c2b7c27ab05e5d76b34e2a5cead 4679 Author: Daniel Drake <dsd@gentoo.org> 4680 Date: Sun Mar 30 22:19:00 2008 +0100 4681 4682 Rename libusb_poll() to libusb_handle_events() 4683 4684 commit 211f80c9f2a4a58cd2bbf5b7751f45089c8961e7 4685 Author: Daniel Drake <dsd@gentoo.org> 4686 Date: Tue Mar 25 16:24:30 2008 +0000 4687 4688 Isochronous endpoint I/O 4689 4690 Due to variable-sized structures, this involved changing allocation 4691 mechanism. All transfers must now be allocated and freed through 4692 libusb. 4693 4694 A synchronous function is missing, and I could do with writing a few 4695 more helper functions to simplify things. 4696 4697 commit b1ade6fca668d8aa156d5b5bf3a933f116144dc2 4698 Author: Daniel Drake <dsd@gentoo.org> 4699 Date: Sun Mar 23 21:17:32 2008 +0000 4700 4701 distcheck fix for docs 4702 4703 commit 62077b7fa5b222e1bb9dea3467585aed69d596e2 4704 Author: Daniel Drake <dsd@gentoo.org> 4705 Date: Sun Mar 23 21:13:14 2008 +0000 4706 4707 Support for changing altsetting 4708 4709 Will probably be suject to later consideration w.r.t. claiming of endpoints 4710 4711 commit 0499e9f418607b5786ac0c3e97bc46737a609ca3 4712 Author: Daniel Drake <dsd@gentoo.org> 4713 Date: Thu Mar 20 21:10:01 2008 +0000 4714 4715 it's called bmRequestType 4716 4717 commit 88884ae4bbe721dac117d5190303cb67852fa5d3 4718 Author: Daniel Drake <dsd@gentoo.org> 4719 Date: Thu Mar 20 21:07:00 2008 +0000 4720 4721 Save transfer flags before invoking callback 4722 4723 The callback may free the transfer, in which case we can't read the flags 4724 after it has returned. 4725 4726 commit ead09cde6895df0034a685516987ce253575e9a7 4727 Author: Daniel Drake <dsd@gentoo.org> 4728 Date: Sat Mar 15 16:35:12 2008 +0000 4729 4730 API documentation 4731 4732 Hopefully mostly complete. Some constants were renamed and move into 4733 enums. 4734 4735 commit 285724cc14ea5f993e2c4c92fe0aaf6c335bc139 4736 Author: Vasily Khoruzhick <anarsoul@gmail.com> 4737 Date: Sat Mar 15 13:50:53 2008 +0200 4738 4739 Fix get_device_list for realloc case 4740 4741 get_device_list can modify pointer passed to it with realloc, but this 4742 case wasn't handled and caused crash on my machine. Fixed 4743 4744 Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> 4745 4746 commit c0c9432d38b22784070dce3a7874c62c31786a27 4747 Author: Daniel Drake <dsd@gentoo.org> 4748 Date: Thu Mar 13 12:36:56 2008 +0000 4749 4750 Beginnings of cross-platform abstraction 4751 4752 This also includes a libusb_get_pollfds API change 4753 4754 commit de4c5341d168697baa4c0901c406deb47e78aae7 4755 Author: Daniel Drake <dsd@gentoo.org> 4756 Date: Mon Mar 10 18:38:15 2008 +0000 4757 4758 Add transfer flags 4759 4760 commit aae05f688dc26a013166ab9436fd25018b49d76a 4761 Author: Daniel Drake <dsd@gentoo.org> 4762 Date: Mon Mar 10 11:32:15 2008 +0000 4763 4764 Simplify libusb_fill_control_transfer() 4765 4766 Transfer length can be inferred from the setup packet. 4767 4768 commit 7c5ea95297c2f3f6afc42f60c1bf1bef777bb1fb 4769 Author: Daniel Drake <dsd@gentoo.org> 4770 Date: Mon Mar 10 11:29:24 2008 +0000 4771 4772 get_device fixup 4773 4774 Rename API away from "devh" and fix implementation to match header 4775 4776 commit 9e89d1aa82cbe7e21672ee3e2e545238fffc5318 4777 Author: Daniel Drake <dsd@gentoo.org> 4778 Date: Sun Mar 9 16:27:06 2008 +0000 4779 4780 Rename descriptor-getting functions 4781 4782 Based on feedback from Tim Roberts 4783 4784 commit 283ae96c3ccbcee1c3950fce18ae47093ae8200e 4785 Author: Daniel Drake <dsd@gentoo.org> 4786 Date: Sun Mar 9 16:15:02 2008 +0000 4787 4788 Simplify cancellation API 4789 4790 No need to provide the device here. 4791 4792 commit ebad1c79688ba603ad017ed0fe2f3c0dc8edd1ad 4793 Author: Daniel Drake <dsd@gentoo.org> 4794 Date: Sun Mar 9 16:12:08 2008 +0000 4795 4796 Rename libusb_dev_handle to libusb_device_handle 4797 4798 commit 1ac0a7d88f282b6f293c456fac8edb143cbaca3d 4799 Author: Daniel Drake <dsd@gentoo.org> 4800 Date: Sun Mar 9 01:01:57 2008 +0000 4801 4802 Move synchronous I/O implementation to its own file 4803 4804 commit 66348c90ea4570bf999ac301089e006d0cce1926 4805 Author: Daniel Drake <dsd@gentoo.org> 4806 Date: Sun Mar 9 00:58:09 2008 +0000 4807 4808 Separate transfer allocation and submission 4809 4810 Leads to some hefty API changes. Now we're much more similar to the 4811 Linux kernel model. 4812 4813 Problems with dealing with asynchronous control transfers are passed 4814 on to the user, basically you must allocate a buffer, start with the 4815 setup, and put the data after. This won't make much sense until 4816 documented (soon...) 4817 4818 commit d21ebe47ce578c93cd8969be1c933d503e32e5d4 4819 Author: Daniel Drake <dsd@gentoo.org> 4820 Date: Sat Mar 8 12:48:35 2008 +0000 4821 4822 Rework URB API naming 4823 4824 Now refer to everything as "transfers" as consistent with the USB spec 4825 libusb_transfer is now a kind of transfer handle. To reduce confusion 4826 with libusb_bulk_transfer and libusb_control_transfer, those have been 4827 renamed to libusb_{control,bulk}_transfer_request. 4828 4829 commit fd6fb3cc093ad47271353a0e468d16547f991382 4830 Author: Daniel Drake <dsd@gentoo.org> 4831 Date: Sat Mar 8 11:53:33 2008 +0000 4832 4833 Add fallback on /proc/bus/usb 4834 4835 /dev/bus/usb is a relatively new thing probably not present on every 4836 system 4837 4838 commit f3fdf447916289cd92b7190377681894e8ab611a 4839 Author: Daniel Drake <dsd@gentoo.org> 4840 Date: Sat Mar 8 00:10:16 2008 +0000 4841 4842 Persistent libusb_device storage 4843 4844 Devices are now assigned a session ID (currently busnum:devaddr) which 4845 is used to distinguish unique devices. 4846 4847 Now multiple callers of libusb_get_device_list will get the same 4848 libusb_device structure instances. 4849 4850 commit 23f8fb8bafeeda93ce234cb40eb7219d2e36c19c 4851 Author: Daniel Drake <dsd@gentoo.org> 4852 Date: Thu Mar 6 23:43:57 2008 +0000 4853 4854 Add convenience function to find and open a device by USB VID+PID 4855 4856 Lots of libusb apps I write are simple test apps not intended to be real 4857 apps. Having a function available to quickly locate my device will be 4858 handy in such situations. 4859 4860 commit 9cfdb494fccac53a4277da7c8b6d15f1a72a4959 4861 Author: Daniel Drake <dsd@gentoo.org> 4862 Date: Thu Mar 6 23:25:20 2008 +0000 4863 4864 Rework device discovery API 4865 4866 libusb_find_devices and libusb_get_devices are no more 4867 4868 libusb_get_device_list obtains a list of libusb_device structures for all 4869 known devices in the system. 4870 4871 Each libusb_device now has a reference count, defaulting to 1 on 4872 instantiation. The reference count of 1 refers to the fact that it is 4873 present in the list in this scenario. 4874 4875 Opening a device adds a pointer to the libusb_device structure in the 4876 handle, so that also adds a reference. Closing the device removes that 4877 reference. 4878 4879 The function to free the device list can optionally unref all the devices 4880 inside. 4881 4882 In future we will make the libusb_device instances all "global" so that if 4883 the app calls get_device_list twice it actually gets the same libusb_device 4884 structure references back. This way we can start to track disconnects, and 4885 we can investigate adding a unique "session ID" to each libusb_device, an 4886 identifier guaranteed to be unique to that device until reboot. 4887 4888 commit 77cea822788e024c848c7f554915f771a2dc1e0f 4889 Author: Daniel Drake <dsd@gentoo.org> 4890 Date: Thu Mar 6 17:05:04 2008 +0000 4891 4892 Remove ctrl debug code 4893 4894 This was unintentionally committed 4895 4896 commit b873521a6f575628d535f89278bb67888004d0ca 4897 Author: Daniel Drake <dsd@gentoo.org> 4898 Date: Tue Feb 26 22:11:34 2008 +0000 4899 4900 Notifications for changes to the fd set 4901 4902 Applications can now be notified when they should start and stop polling 4903 new file descriptors. 4904 4905 commit ca66e16a370c828d08a5bc3f9f203db145c81a4c 4906 Author: Daniel Drake <dsd@gentoo.org> 4907 Date: Fri Feb 1 12:20:20 2008 +0000 4908 4909 Fix header installation path 4910 4911 commit e583100a4086c411093eef5c450880b965df6b1b 4912 Author: Daniel Drake <dsd@gentoo.org> 4913 Date: Wed Jan 30 13:24:54 2008 +0000 4914 4915 TODO update 4916 4917 commit 637a8d7ff8a11a23588925d9d3003a609bda8075 4918 Author: Daniel Drake <dsd@gentoo.org> 4919 Date: Wed Jan 30 13:19:10 2008 +0000 4920 4921 Remove timers and signalfd 4922 4923 Instead of timers, add a mechanism for informing the parent app when the 4924 next timeout is due to happen, so that it can call us at that time. 4925 4926 As we no longer use signals, signalfd has also been removed. 4927 4928 commit 8c56abe2e13ed4dd8c15737c21be7b6b1e5cf2ac 4929 Author: Daniel Drake <dsd@gentoo.org> 4930 Date: Sat Jan 26 18:16:56 2008 +0000 4931 4932 Poll usbfs descriptors directly 4933 4934 We don't need to use signalfd for this functionality because we can poll 4935 the file descriptors for write events. 4936 4937 commit e3ce855acec33d37dd833bca5dad5e8c3773003a 4938 Author: Daniel Drake <dsd@gentoo.org> 4939 Date: Sat Jan 26 17:26:40 2008 +0000 4940 4941 Fix dpfp example compilation 4942 4943 commit 1d41a5cda2fefe826877ee4445199af30aa188b7 4944 Author: Daniel Drake <dsd@gentoo.org> 4945 Date: Sat Jan 26 17:22:53 2008 +0000 4946 4947 C++ header safety 4948 4949 Pointed out by JF 4950 4951 commit 37b7f9a112eb1441d352467f661205b8872d0553 4952 Author: Daniel Drake <dsd@gentoo.org> 4953 Date: Sat Jan 26 14:03:43 2008 +0000 4954 4955 Only use -fgnu89-inline when supported 4956 4957 J F pointed out that this option only works on gcc 4.3 and newer. 4958 4959 commit e3a09ca0b9cb6f46d54a0130f678c6097240a2bd 4960 Author: Daniel Drake <dsd@gentoo.org> 4961 Date: Sat Jan 5 21:59:40 2008 +0000 4962 4963 Remove more fpusb remnants 4964 4965 commit dcd5e0075fa84601d997d29bb60bc8370b97a375 4966 Author: Daniel Drake <dsd@gentoo.org> 4967 Date: Fri Jan 4 01:19:07 2008 +0000 4968 4969 TODO update 4970 4971 Start listing the things I want to discuss/reconsider before 1.0 API 4972 is final. 4973 4974 commit de53d972ed9c1f21f86ffd585560520e986f212c 4975 Author: Daniel Drake <dsd@gentoo.org> 4976 Date: Fri Jan 4 01:17:06 2008 +0000 4977 4978 Rename some _devh_ functions 4979 4980 Decided against naming functions in this style based on advice from 4981 Tim Roberts. Still not really sure about devh naming in general. 4982 4983 commit 132d84bf8ae34bd0892b3d8207a53d87cc0a9cba 4984 Author: Daniel Drake <dsd@gentoo.org> 4985 Date: Fri Jan 4 01:13:25 2008 +0000 4986 4987 Use "transfer" instead of "msg" 4988 4989 Based on a discussion with Tim Roberts. 4990 4991 commit ea6af58a8643137eb01eeb7d2f65404e390feb1b 4992 Author: Daniel Drake <dsd@gentoo.org> 4993 Date: Fri Jan 4 00:57:00 2008 +0000 4994 4995 Plural of bus is busses 4996 4997 SF #1633043 4998 4999 commit dbb3fd871e3972b4e670f3161e7cd2f58f357600 5000 Author: Daniel Drake <dsd@gentoo.org> 5001 Date: Fri Jan 4 00:54:57 2008 +0000 5002 5003 API renaming: remove fpi and usb_ stuff 5004 5005 fpi changed to usbi. 5006 5007 We should not expose structures with prefix "usb_" in the public 5008 namespace as it is quite likely there will be some conflict somewhere. 5009 Instead, using "libusb_" should be safer. 5010 5011 commit e9364d72151ae1de9cce4175f330fe1529f02511 5012 Author: Daniel Drake <dsd@gentoo.org> 5013 Date: Fri Jan 4 00:40:49 2008 +0000 5014 5015 Rename to libusb-1.0 5016 5017 I've taken over the libusb project, and what was previously known as fpusb 5018 will eventually be released as libusb-1.0. 5019 5020 commit f4ed0b6a3e0a20555fdfc9e9b8be7e8a2c8ae192 5021 Author: Daniel Drake <dsd@gentoo.org> 5022 Date: Sun Dec 30 22:09:50 2007 +0000 5023 5024 Compiler flags update 5025 5026 Also fix some warnings 5027 5028 commit d3d671efe27491baf1d2ceadbfeeb4e7428d6f9a 5029 Author: Daniel Drake <dsd@gentoo.org> 5030 Date: Sun Dec 30 22:05:17 2007 +0000 5031 5032 Fix signalfd structure size on x86 5033 5034 ptr is a 64-bit value 5035 5036 commit dfac6756faad76071a92945e3e3a16b8a841a7ea 5037 Author: Daniel Drake <dsd@gentoo.org> 5038 Date: Wed Dec 12 23:32:54 2007 +0000 5039 5040 Don't pass ctrl_msg/bulk_msg structures through async paths 5041 5042 These are easiest to construct on the stack, but in the async case it is 5043 likely that the submitting function returns (hence stack is destroyed) 5044 before URB completion. 5045 5046 commit a8d2881eb7c273892acf2ff6e1f3f552631d1d11 5047 Author: Daniel Drake <dsd@gentoo.org> 5048 Date: Mon Dec 3 23:29:22 2007 +0000 5049 5050 Add functionality to access device descriptors 5051 5052 commit b5a7a411087b37a6bf56b4688a9e3290daaed153 5053 Author: Daniel Drake <dsd@gentoo.org> 5054 Date: Mon Dec 3 22:27:21 2007 +0000 5055 5056 Rename fpusb_device_handle functions to devh 5057 5058 Prevents confusion with functions that work on fpusb_dev structures. 5059 5060 commit eacf4505a473df0f521d1b69d5b45448f0709e2d 5061 Author: Daniel Drake <dsd@gentoo.org> 5062 Date: Sun Dec 2 23:16:57 2007 +0000 5063 5064 Add API to access poll fd 5065 5066 Almost forgot... :) 5067 5068 commit 852bba4754ec57679c823f33e8feba6e4a564cbe 5069 Author: Daniel Drake <dsd@gentoo.org> 5070 Date: Wed Nov 28 13:48:45 2007 +0000 5071 5072 Initial commit 5073 5074 Basic library structure which supports enumerating detected USB devices 1 For detailed information about the changes below, please see the git log or 2 visit: http://log.libusb.info 3 4 2016-10-01: v1.0.21: 5 * Core: Refactor code related to transfer flags and timeout handling 6 * Darwin: Ignore root hub simulation devices 7 * Darwin: Improved support for OS X El Capitan 8 * Darwin: Work around devices with buggy endpoint descriptors 9 * Darwin: Do not use objc_registerThreadWithCollector after its deprecation 10 * Darwin: Use C11 atomics on 10.12+ as the OS atomics are now deprecated 11 * Linux: Support preallocating kernel memory for zerocopy USB 12 * Linux: Deal with receiving POLLERR before all transfers have completed 13 * Solaris: Add solaris backend 14 * Windows: Add Visual Studio 2015 support 15 * Windows: Add usbdk backend 16 * Prevent attempts to recursively handle events 17 * Fix race condition in handle_timeout() 18 * Allow transferred argument to be optional in bulk APIs 19 * Various other bug fixes and improvements 20 21 2015-09-13: v1.0.20 22 * Add Haiku support 23 * Fix multiple memory and resource leaks (#16, #52, #76, #81) 24 * Fix possible deadlock when executing transfer callback 25 * New libusb_free_pollfds() API 26 * Darwin: Fix devices not being detected on OS X 10.8 (#48) 27 * Linux: Allow larger isochronous transfer submission (#23) 28 * Windows: Fix broken builds Cygwin/MinGW builds and compiler warnings 29 * Windows: Fix broken bus number lookup 30 * Windows: Improve submission of control requests for composite devices 31 * Examples: Add two-stage load support to fxload (#12) 32 * Correctly report cancellations due to timeouts 33 * Improve efficiency of event handling 34 * Improve speed of transfer submission in multi-threaded environments 35 * Various other bug fixes and improvements 36 The (#xx) numbers are libusb issue numbers, see ie: 37 https://github.com/libusb/libusb/issues/16 38 39 2014-05-30: v1.0.19 40 * Add support for USB bulk streams on Linux and Mac OS X (#11) 41 * Windows: Add AMD and Intel USB-3.0 root hub support 42 * Windows: Fix USB 3.0 speed detection on Windows 8 or later (#10) 43 * Added Russian translation for libusb_strerror strings 44 * All: Various small fixes and cleanups 45 46 2014-01-25: v1.0.18 47 * Fix multiple memory leaks 48 * Fix a crash when HID transfers return no data on Windows 49 * Ensure all pending events are consumed 50 * Improve Android and ucLinux support 51 * Multiple Windows improvements (error logging, VS2013, VIA xHCI support) 52 * Multiple OS X improvements (broken compilation, SIGFPE, 64bit support) 53 54 2013-09-06: v1.0.17 55 * Hotplug callbacks now always get passed a libusb_context, even if it is 56 the default context. Previously NULL would be passed for the default context, 57 but since the first context created is the default context, and most apps 58 use only 1 context, this meant that apps explicitly creating a context would 59 still get passed NULL 60 * Android: Add .mk files to build with the Android NDK 61 * Darwin: Add Xcode project 62 * Darwin: Fix crash on unplug (#121) 63 * Linux: Fix hang (deadlock) on libusb_exit 64 * Linux: Fix libusb build failure with --disable-udev (#124) 65 * Linux: Fix libusb_get_device_list() hang with --disable-udev (#130) 66 * OpenBSD: Update OpenBSD backend with support for control transfers to 67 non-ugen(4) devices and make get_configuration() no longer generate I/O. 68 Note that using this libusb version on OpenBSD requires using 69 OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised 70 to stay with the libusb shipped with OpenBSD (mpi) 71 * Windows: fix libusb_dll_2010.vcxproj link errors (#129) 72 * Various other bug fixes and improvements 73 74 2013-07-11: v1.0.16 75 * Add hotplug support for Darwin and Linux (#9) 76 * Add superspeed endpoint companion descriptor support (#15) 77 * Add BOS descriptor support (#15) 78 * Make descriptor parsing code more robust 79 * New libusb_get_port_numbers API, this is libusb_get_port_path without 80 the unnecessary context parameter, libusb_get_port_path is now deprecated 81 * New libusb_strerror API (#14) 82 * New libusb_set_auto_detach_kernel_driver API (#17) 83 * Improve topology API docs (#95) 84 * Logging now use a single write call per log-message, avoiding log-message 85 "interlacing" when using multiple threads. 86 * Android: use Android logging when building on Android (#101) 87 * Darwin: make libusb_reset reenumerate device on descriptors change (#89) 88 * Darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET flag (#91) 89 * Darwin: add a device cache (#112, #114) 90 * Examples: Add sam3u_benchmark isochronous example by Harald Welte (#109) 91 * Many other bug fixes and improvements 92 The (#xx) numbers are libusbx issue numbers, see ie: 93 https://github.com/libusbx/libusbx/issues/9 94 95 2013-04-15: v1.0.15 96 * Improve transfer cancellation and avoid short read failures on broken descriptors 97 * Filter out 8-bit characters in libusb_get_string_descriptor_ascii() 98 * Add WinCE support 99 * Add library stress tests 100 * Add Cypress FX3 firmware upload support for fxload sample 101 * Add HID and kernel driver detach support capabilities detection 102 * Add SuperSpeed detection on OS X 103 * Fix bInterval value interpretation on OS X 104 * Fix issues with autoclaim, composite HID devices, interface autoclaim and 105 early abort in libusb_close() on Windows. Also add VS2012 solution files. 106 * Improve fd event handling on Linux 107 * Other bug fixes and improvements 108 109 2012-09-26: v1.0.14 110 * Reverts the previous API change with regards to bMaxPower. 111 If this doesn't matter to you, you are encouraged to keep using v1.0.13, 112 as it will use the same attribute as v2.0, to be released soon. 113 * Note that LIBUSB_API_VERSION is *decreased* to 0x010000FF and the previous 114 guidelines with regards to concurrent use of MaxPower/bMaxPower still apply. 115 116 2012-09-20: v1.0.13 117 * [MAJOR] Fix a typo in the API with struct libusb_config_descriptor where 118 MaxPower was used instead of bMaxPower, as defined in the specs. If your 119 application was accessing the MaxPower attribute, and you need to maintain 120 compatibility with libusb or older versions, see APPENDIX A below. 121 * Fix broken support for the 0.1 -> 1.0 libusb-compat layer 122 * Fix unwanted cancellation of pending timeouts as well as major timeout related bugs 123 * Fix handling of HID and composite devices on Windows 124 * Introduce LIBUSB_API_VERSION macro 125 * Add Cypress FX/FX2 firmware upload sample, based on fxload from 126 http://linux-hotplug.sourceforge.net 127 * Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while 128 the drivers allow it, isochronous transfers are not supported yet in libusb. Also 129 not supported yet is the use of libusb-win32 filter drivers on composite interfaces 130 * Add support for the new get_capabilities ioctl on Linux and avoid unnecessary 131 splitting of bulk transfers 132 * Improve support for newer Intel and Renesas USB 3.0 controllers on Windows 133 * Harmonize the device number for root hubs across platforms 134 * Other bug fixes and improvements 135 136 2012-06-15: v1.0.12 137 * Fix a potential major regression with pthread on Linux 138 * Fix missing thread ID from debug log output on cygwin 139 * Fix possible crash when using longjmp and MinGW's gcc 4.6 140 * Add topology calls: libusb_get_port_number(), libusb_get_parent() & libusb_get_port_path() 141 * Add toggleable debug, using libusb_set_debug() or the LIBUSB_DEBUG environment variable 142 * Define log levels in libusb.h and set timestamp origin to first libusb_init() call 143 * All logging is now sent to to stderr (info was sent to stdout previously) 144 * Update log messages severity and avoid polluting log output on OS-X 145 * Add HID driver support on Windows 146 * Enable interchangeability of MSVC and MinGW DLLs 147 * Additional bug fixes and improvements 148 149 2012-05-08: v1.0.11 150 * Revert removal of critical Windows event handling that was introduced in 1.0.10 151 * Fix a possible deadlock in Windows when submitting transfers 152 * Add timestamped logging 153 * Add NetBSD support (experimental) and BSD libusb_get_device_speed() data 154 * Add bootstrap.sh alongside autogen.sh (bootstrap.sh doesn't invoke configure) 155 * Search for device nodes in /dev for Android support 156 * Other bug fixes 157 158 2012-04-17: v1.0.10 159 * Public release 160 * Add libusb_get_version 161 * Add Visual Studio 2010 project files 162 * Some Windows code cleanup 163 * Fix xusb sample warnings 164 165 2012-04-02: v1.0.9 166 * First libusbx release 167 * Add libusb_get_device_speed (all, except BSD) and libusb_error_name 168 * Add Windows support (WinUSB driver only) 169 * Add OpenBSD support 170 * Add xusb sample 171 * Tons of bug fixes 172 173 2010-05-07: v1.0.8 174 * Bug fixes 175 176 2010-04-19: v1.0.7 177 * Bug fixes and documentation tweaks 178 * Add more interface class definitions 179 180 2009-11-22: v1.0.6 181 * Bug fixes 182 * Increase libusb_handle_events() timeout to 60s for powersaving 183 184 2009-11-15: v1.0.5 185 * Use timerfd when available for timer management 186 * Small fixes/updates 187 188 2009-11-06: v1.0.4 release 189 * Bug fixes including transfer locking to fix some potential threading races 190 * More flexibility with clock types on Linux 191 * Use new bulk continuation tracking in Linux 2.6.32 for improved handling 192 of short/failed transfers 193 194 2009-08-27: v1.0.3 release 195 * Bug fixes 196 * Add libusb_get_max_iso_packet_size() 197 198 2009-06-13: v1.0.2 release 199 * Bug fixes 200 201 2009-05-12: v1.0.1 release 202 * Bug fixes 203 * Darwin backend 204 205 2008-12-13: v1.0.0 release 206 * Bug fixes 207 208 2008-11-21: v0.9.4 release 209 * Bug fixes 210 * Add libusb_attach_kernel_driver() 211 212 2008-08-23: v0.9.3 release 213 * Bug fixes 214 215 2008-07-19: v0.9.2 release 216 * Bug fixes 217 218 2008-06-28: v0.9.1 release 219 * Bug fixes 220 * Introduce contexts to the API 221 * Compatibility with new Linux kernel features 222 223 2008-05-25: v0.9.0 release 224 * First libusb-1.0 beta release 225 226 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 227 228 APPENDIX A - How to maintain code compatibility with versions of libusb and 229 libusb that use MaxPower: 230 231 If you must to maintain compatibility with versions of the library that aren't 232 using the bMaxPower attribute in struct libusb_config_descriptor, the 233 recommended way is to use the new LIBUSB_API_VERSION macro with an #ifdef. 234 For instance, if your code was written as follows: 235 236 if (dev->config[0].MaxPower < 250) 237 238 Then you should modify it to have: 239 240 #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000100) 241 if (dev->config[0].bMaxPower < 250) 242 #else 243 if (dev->config[0].MaxPower < 250) 244 #endif -
TabularUnified libusb1/trunk/INSTALL ¶
r1876 r1882 2 2 ************************* 3 3 4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 5 2006 Free Software Foundation, Inc. 6 7 This file is free documentation; the Free Software Foundation gives 8 unlimited permission to copy, distribute and modify it. 4 Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, 5 Inc. 6 7 Copying and distribution of this file, with or without modification, 8 are permitted in any medium without royalty provided the copyright 9 notice and this notice are preserved. This file is offered as-is, 10 without warranty of any kind. 9 11 10 12 Basic Installation 11 13 ================== 12 14 13 Briefly, the shell commands `./configure; make; make install' should 14 configure, build, and install this package. The following15 Briefly, the shell command `./configure && make && make install' 16 should configure, build, and install this package. The following 15 17 more-detailed instructions are generic; see the `README' file for 16 instructions specific to this package. 18 instructions specific to this package. Some packages provide this 19 `INSTALL' file but do not implement all of the features documented 20 below. The lack of an optional feature in a given package is not 21 necessarily a bug. More recommendations for GNU packages can be found 22 in *note Makefile Conventions: (standards)Makefile Conventions. 17 23 18 24 The `configure' shell script attempts to guess correct values for … … 43 49 of `autoconf'. 44 50 45 The simplest way to compile this package is:51 The simplest way to compile this package is: 46 52 47 53 1. `cd' to the directory containing the package's source code and type … … 54 60 55 61 3. Optionally, type `make check' to run any self-tests that come with 56 the package .62 the package, generally using the just-built uninstalled binaries. 57 63 58 64 4. Type `make install' to install the programs and any data files and 59 documentation. 60 61 5. You can remove the program binaries and object files from the 65 documentation. When installing into a prefix owned by root, it is 66 recommended that the package be configured and built as a regular 67 user, and only the `make install' phase executed with root 68 privileges. 69 70 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 this time using the binaries in their final installed location. 72 This target does not install anything. Running this target as a 73 regular user, particularly if the prior `make install' required 74 root privileges, verifies that the installation completed 75 correctly. 76 77 6. You can remove the program binaries and object files from the 62 78 source code directory by typing `make clean'. To also remove the 63 79 files that `configure' created (so you can compile the package for … … 68 84 with the distribution. 69 85 86 7. Often, you can also type `make uninstall' to remove the installed 87 files again. In practice, not all packages have tested that 88 uninstallation works correctly, even though it is required by the 89 GNU Coding Standards. 90 91 8. Some packages, particularly those that use Automake, provide `make 92 distcheck', which can by used by developers to test that all other 93 targets like `make install' and `make uninstall' work correctly. 94 This target is generally not run by end users. 95 70 96 Compilers and Options 71 97 ===================== 72 98 73 Some systems require unusual options for compilation or linking that the 74 `configure' script does not know about. Run `./configure --help' for 75 details on some of the pertinent environment variables.99 Some systems require unusual options for compilation or linking that 100 the `configure' script does not know about. Run `./configure --help' 101 for details on some of the pertinent environment variables. 76 102 77 103 You can give `configure' initial values for configuration parameters … … 86 112 ==================================== 87 113 88 You can compile the package for more than one kind of computer at the114 You can compile the package for more than one kind of computer at the 89 115 same time, by placing the object files for each architecture in their 90 116 own directory. To do this, you can use GNU `make'. `cd' to the 91 117 directory where you want the object files and executables to go and run 92 118 the `configure' script. `configure' automatically checks for the 93 source code in the directory that `configure' is in and in `..'. 119 source code in the directory that `configure' is in and in `..'. This 120 is known as a "VPATH" build. 94 121 95 122 With a non-GNU `make', it is safer to compile the package for one … … 98 125 reconfiguring for another architecture. 99 126 127 On MacOS X 10.5 and later systems, you can create libraries and 128 executables that work on multiple system types--known as "fat" or 129 "universal" binaries--by specifying multiple `-arch' options to the 130 compiler but only a single `-arch' option to the preprocessor. Like 131 this: 132 133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 CPP="gcc -E" CXXCPP="g++ -E" 136 137 This is not guaranteed to produce working output in all cases, you 138 may have to build one architecture at a time and combine the results 139 using the `lipo' tool if you have problems. 140 100 141 Installation Names 101 142 ================== 102 143 103 By default, `make install' installs the package's commands under144 By default, `make install' installs the package's commands under 104 145 `/usr/local/bin', include files under `/usr/local/include', etc. You 105 146 can specify an installation prefix other than `/usr/local' by giving 106 `configure' the option `--prefix=PREFIX'. 147 `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 absolute file name. 107 149 108 150 You can specify separate installation prefixes for … … 115 157 options like `--bindir=DIR' to specify different values for particular 116 158 kinds of files. Run `configure --help' for a list of the directories 117 you can set and what kinds of files go in them. 159 you can set and what kinds of files go in them. In general, the 160 default for these options is expressed in terms of `${prefix}', so that 161 specifying just `--prefix' will affect all of the other directory 162 specifications that were not explicitly provided. 163 164 The most portable way to affect installation locations is to pass the 165 correct locations to `configure'; however, many packages provide one or 166 both of the following shortcuts of passing variable assignments to the 167 `make install' command line to change installation locations without 168 having to reconfigure or recompile. 169 170 The first method involves providing an override variable for each 171 affected directory. For example, `make install 172 prefix=/alternate/directory' will choose an alternate location for all 173 directory configuration variables that were expressed in terms of 174 `${prefix}'. Any directories that were specified during `configure', 175 but not in terms of `${prefix}', must each be overridden at install 176 time for the entire installation to be relocated. The approach of 177 makefile variable overrides for each directory variable is required by 178 the GNU Coding Standards, and ideally causes no recompilation. 179 However, some platforms have known limitations with the semantics of 180 shared libraries that end up requiring recompilation when using this 181 method, particularly noticeable in packages that use GNU Libtool. 182 183 The second method involves providing the `DESTDIR' variable. For 184 example, `make install DESTDIR=/alternate/directory' will prepend 185 `/alternate/directory' before all installation names. The approach of 186 `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 does not work on platforms that have drive letters. On the other hand, 188 it does better at avoiding recompilation issues, and works well even 189 when some directory options were not specified in terms of `${prefix}' 190 at `configure' time. 191 192 Optional Features 193 ================= 118 194 119 195 If the package supports it, you can cause programs to be installed … … 121 197 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 122 198 123 Optional Features 124 ================= 125 126 Some packages pay attention to `--enable-FEATURE' options to 199 Some packages pay attention to `--enable-FEATURE' options to 127 200 `configure', where FEATURE indicates an optional part of the package. 128 201 They may also pay attention to `--with-PACKAGE' options, where PACKAGE … … 136 209 `--x-libraries=DIR' to specify their locations. 137 210 211 Some packages offer the ability to configure how verbose the 212 execution of `make' will be. For these packages, running `./configure 213 --enable-silent-rules' sets the default to minimal output, which can be 214 overridden with `make V=1'; while running `./configure 215 --disable-silent-rules' sets the default to verbose, which can be 216 overridden with `make V=0'. 217 218 Particular systems 219 ================== 220 221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 CC is not installed, it is recommended to use the following options in 223 order to use an ANSI C compiler: 224 225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 227 and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 229 HP-UX `make' updates targets which have the same time stamps as 230 their prerequisites, which makes it generally unusable when shipped 231 generated files such as `configure' are involved. Use GNU `make' 232 instead. 233 234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 235 parse its `<wchar.h>' header file. The option `-nodtk' can be used as 236 a workaround. If GNU CC is not installed, it is therefore recommended 237 to try 238 239 ./configure CC="cc" 240 241 and if that doesn't work, try 242 243 ./configure CC="cc -nodtk" 244 245 On Solaris, don't put `/usr/ucb' early in your `PATH'. This 246 directory contains several dysfunctional programs; working variants of 247 these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 248 in your `PATH', put it _after_ `/usr/bin'. 249 250 On Haiku, software installed for all users goes in `/boot/common', 251 not `/usr/local'. It is recommended to use the following options: 252 253 ./configure --prefix=/boot/common 254 138 255 Specifying the System Type 139 256 ========================== 140 257 141 There may be some features `configure' cannot figure out automatically, 142 but needs to determine by the type of machine the package will run on. 143 Usually, assuming the package is built to be run on the _same_ 144 architectures, `configure' can figure that out, but if it prints a 145 message saying it cannot guess the machine type, give it the258 There may be some features `configure' cannot figure out 259 automatically, but needs to determine by the type of machine the package 260 will run on. Usually, assuming the package is built to be run on the 261 _same_ architectures, `configure' can figure that out, but if it prints 262 a message saying it cannot guess the machine type, give it the 146 263 `--build=TYPE' option. TYPE can either be a short name for the system 147 264 type, such as `sun4', or a canonical name which has the form: … … 151 268 where SYSTEM can have one of these forms: 152 269 153 OS KERNEL-OS 270 OS 271 KERNEL-OS 154 272 155 273 See the file `config.sub' for the possible values of each field. If … … 169 287 ================ 170 288 171 If you want to set default values for `configure' scripts to share, you 172 can create a site shell script called `config.site' that gives default 173 values for variables like `CC', `cache_file', and `prefix'.289 If you want to set default values for `configure' scripts to share, 290 you can create a site shell script called `config.site' that gives 291 default values for variables like `CC', `cache_file', and `prefix'. 174 292 `configure' looks for `PREFIX/share/config.site' if it exists, then 175 293 `PREFIX/etc/config.site' if it exists. Or, you can set the … … 180 298 ================== 181 299 182 Variables not defined in a site shell script can be set in the300 Variables not defined in a site shell script can be set in the 183 301 environment passed to `configure'. However, some packages may run 184 302 configure again during the build, and the customized values of these … … 192 310 193 311 Unfortunately, this technique does not work for `CONFIG_SHELL' due to 194 an Autoconf bug. Until the bug is fixed you can use this workaround: 195 196 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 312 an Autoconf limitation. Until the limitation is lifted, you can use 313 this workaround: 314 315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 197 316 198 317 `configure' Invocation 199 318 ====================== 200 319 201 `configure' recognizes the following options to control how it operates. 320 `configure' recognizes the following options to control how it 321 operates. 202 322 203 323 `--help' 204 324 `-h' 205 Print a summary of the options to `configure', and exit. 325 Print a summary of all of the options to `configure', and exit. 326 327 `--help=short' 328 `--help=recursive' 329 Print a summary of the options unique to this package's 330 `configure', and exit. The `short' variant lists options used 331 only in the top level, while the `recursive' variant lists options 332 also present in any nested packages. 206 333 207 334 `--version' … … 230 357 `configure' can determine that directory automatically. 231 358 359 `--prefix=DIR' 360 Use DIR as the installation prefix. *note Installation Names:: 361 for more details, including other options available for fine-tuning 362 the installation locations. 363 364 `--no-create' 365 `-n' 366 Run the configure checks, but stop before creating any output 367 files. 368 232 369 `configure' also accepts some other, not widely useful, options. Run 233 370 `configure --help' for more details. 234 -
TabularUnified libusb1/trunk/Makefile.am ¶
r1876 r1882 2 2 ACLOCAL_AMFLAGS = -I m4 3 3 DISTCLEANFILES = libusb-1.0.pc 4 MAINTAINERCLEANFILES = ChangeLog 5 EXTRA_DIST = TODO PORTING msvc 4 EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \ 5 examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \ 6 android Xcode 6 7 SUBDIRS = libusb doc 7 8 … … 10 11 endif 11 12 13 if BUILD_TESTS 14 SUBDIRS += tests 15 endif 16 12 17 pkgconfigdir=$(libdir)/pkgconfig 13 18 pkgconfig_DATA=libusb-1.0.pc 14 19 15 .PHONY: ChangeLog dist-up 16 ChangeLog: 17 git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog 18 19 dist-hook: ChangeLog 20 .PHONY: dist-up 20 21 21 22 reldir = .release/$(distdir) … … 26 27 rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/ 27 28 rm -rf $(reldir) 28 -
TabularUnified libusb1/trunk/Makefile.in ¶
r1879 r1882 1 # Makefile.in generated by automake 1.1 1.1 from Makefile.am.1 # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 # Inc. 4 # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 7 6 # This Makefile.in is free software; the Free Software Foundation 8 7 # gives unlimited permission to copy and/or distribute it, … … 17 16 18 17 VPATH = @srcdir@ 18 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 19 am__make_running_with_option = \ 20 case $${target_option-} in \ 21 ?) ;; \ 22 *) echo "am__make_running_with_option: internal error: invalid" \ 23 "target option '$${target_option-}' specified" >&2; \ 24 exit 1;; \ 25 esac; \ 26 has_opt=no; \ 27 sane_makeflags=$$MAKEFLAGS; \ 28 if $(am__is_gnu_make); then \ 29 sane_makeflags=$$MFLAGS; \ 30 else \ 31 case $$MAKEFLAGS in \ 32 *\\[\ \ ]*) \ 33 bs=\\; \ 34 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 35 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 36 esac; \ 37 fi; \ 38 skip_next=no; \ 39 strip_trailopt () \ 40 { \ 41 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 42 }; \ 43 for flg in $$sane_makeflags; do \ 44 test $$skip_next = yes && { skip_next=no; continue; }; \ 45 case $$flg in \ 46 *=*|--*) continue;; \ 47 -*I) strip_trailopt 'I'; skip_next=yes;; \ 48 -*I?*) strip_trailopt 'I';; \ 49 -*O) strip_trailopt 'O'; skip_next=yes;; \ 50 -*O?*) strip_trailopt 'O';; \ 51 -*l) strip_trailopt 'l'; skip_next=yes;; \ 52 -*l?*) strip_trailopt 'l';; \ 53 -[dEDm]) skip_next=yes;; \ 54 -[JT]) skip_next=yes;; \ 55 esac; \ 56 case $$flg in \ 57 *$$target_option*) has_opt=yes; break;; \ 58 esac; \ 59 done; \ 60 test $$has_opt = yes 61 am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 62 am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 19 63 pkgdatadir = $(datadir)/@PACKAGE@ 20 64 pkgincludedir = $(includedir)/@PACKAGE@ … … 36 80 host_triplet = @host@ 37 81 @BUILD_EXAMPLES_TRUE@am__append_1 = examples 82 @BUILD_TESTS_TRUE@am__append_2 = tests 38 83 subdir = . 39 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ 40 $(srcdir)/Makefile.in $(srcdir)/config.h.in \ 41 $(srcdir)/libusb-1.0.pc.in $(top_srcdir)/configure AUTHORS \ 42 COPYING ChangeLog INSTALL NEWS THANKS TODO compile \ 43 config.guess config.sub depcomp install-sh ltmain.sh missing 84 DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ 85 $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 86 $(top_srcdir)/configure $(am__configure_deps) \ 87 $(srcdir)/config.h.in $(srcdir)/libusb-1.0.pc.in COPYING TODO \ 88 compile config.guess config.sub depcomp install-sh missing \ 89 ltmain.sh 44 90 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 45 91 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ … … 55 101 CONFIG_CLEAN_FILES = libusb-1.0.pc 56 102 CONFIG_CLEAN_VPATH_FILES = 57 AM_V_GEN = $(am__v_GEN_$(V)) 58 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) 59 am__v_GEN_0 = @echo " GEN " $@; 60 AM_V_at = $(am__v_at_$(V)) 61 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) 103 AM_V_P = $(am__v_P_@AM_V@) 104 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 105 am__v_P_0 = false 106 am__v_P_1 = : 107 AM_V_GEN = $(am__v_GEN_@AM_V@) 108 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 109 am__v_GEN_0 = @echo " GEN " $@; 110 am__v_GEN_1 = 111 AM_V_at = $(am__v_at_@AM_V@) 112 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 62 113 am__v_at_0 = @ 114 am__v_at_1 = 63 115 SOURCES = 64 116 DIST_SOURCES = 65 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 66 html-recursive info-recursive install-data-recursive \ 67 install-dvi-recursive install-exec-recursive \ 68 install-html-recursive install-info-recursive \ 69 install-pdf-recursive install-ps-recursive install-recursive \ 70 installcheck-recursive installdirs-recursive pdf-recursive \ 71 ps-recursive uninstall-recursive 117 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ 118 ctags-recursive dvi-recursive html-recursive info-recursive \ 119 install-data-recursive install-dvi-recursive \ 120 install-exec-recursive install-html-recursive \ 121 install-info-recursive install-pdf-recursive \ 122 install-ps-recursive install-recursive installcheck-recursive \ 123 installdirs-recursive pdf-recursive ps-recursive \ 124 tags-recursive uninstall-recursive 125 am__can_run_installinfo = \ 126 case $$AM_UPDATE_INFO_DIR in \ 127 n|no|NO) false;; \ 128 *) (install-info --version) >/dev/null 2>&1;; \ 129 esac 72 130 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 73 131 am__vpath_adj = case $$p in \ … … 91 149 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 92 150 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 151 am__uninstall_files_from_dir = { \ 152 test -z "$$files" \ 153 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 154 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 155 $(am__cd) "$$dir" && rm -f $$files; }; \ 156 } 93 157 am__installdirs = "$(DESTDIR)$(pkgconfigdir)" 94 158 DATA = $(pkgconfig_DATA) 95 159 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 96 160 distclean-recursive maintainer-clean-recursive 97 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 98 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 99 distdir dist dist-all distcheck 161 am__recursive_targets = \ 162 $(RECURSIVE_TARGETS) \ 163 $(RECURSIVE_CLEAN_TARGETS) \ 164 $(am__extra_recursive_targets) 165 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ 166 cscope distdir dist dist-all distcheck 167 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 168 $(LISP)config.h.in 169 # Read a list of newline-separated strings from the standard input, 170 # and print each of them once, without duplicates. Input order is 171 # *not* preserved. 172 am__uniquify_input = $(AWK) '\ 173 BEGIN { nonempty = 0; } \ 174 { items[$$0] = 1; nonempty = 1; } \ 175 END { if (nonempty) { for (i in items) print i; }; } \ 176 ' 177 # Make sure the list of sources is unique. This is necessary because, 178 # e.g., the same source file might be shared among _SOURCES variables 179 # for different programs/libraries. 180 am__define_uniq_tagged_files = \ 181 list='$(am__tagged_files)'; \ 182 unique=`for i in $$list; do \ 183 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 184 done | $(am__uniquify_input)` 100 185 ETAGS = etags 101 186 CTAGS = ctags 102 DIST_SUBDIRS = libusb doc examples 187 CSCOPE = cscope 188 DIST_SUBDIRS = libusb doc examples tests 103 189 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 104 190 distdir = $(PACKAGE)-$(VERSION) 105 191 top_distdir = $(distdir) 106 192 am__remove_distdir = \ 107 { test ! -d "$(distdir)" \ 108 || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 109 && rm -fr "$(distdir)"; }; } 193 if test -d "$(distdir)"; then \ 194 find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 195 && rm -rf "$(distdir)" \ 196 || { sleep 5 && rm -rf "$(distdir)"; }; \ 197 else :; fi 198 am__post_remove_distdir = $(am__remove_distdir) 110 199 am__relativize = \ 111 200 dir0=`pwd`; \ … … 135 224 GZIP_ENV = --best 136 225 DIST_ARCHIVES = $(distdir).tar.bz2 226 DIST_TARGETS = dist-bzip2 137 227 distuninstallcheck_listfiles = find . -type f -print 228 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 229 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 138 230 distcleancheck_listfiles = find . -type f -print 139 231 ACLOCAL = @ACLOCAL@ … … 151 243 CPP = @CPP@ 152 244 CPPFLAGS = @CPPFLAGS@ 245 CXX = @CXX@ 246 CXXCPP = @CXXCPP@ 247 CXXDEPMODE = @CXXDEPMODE@ 248 CXXFLAGS = @CXXFLAGS@ 153 249 CYGPATH_W = @CYGPATH_W@ 154 250 DEFS = @DEFS@ … … 178 274 LTLDFLAGS = @LTLDFLAGS@ 179 275 LTLIBOBJS = @LTLIBOBJS@ 180 MAINT = @MAINT@181 276 MAKEINFO = @MAKEINFO@ 182 277 MANIFEST_TOOL = @MANIFEST_TOOL@ … … 187 282 OBJEXT = @OBJEXT@ 188 283 OS_DARWIN = @OS_DARWIN@ 284 OS_HAIKU = @OS_HAIKU@ 189 285 OS_LINUX = @OS_LINUX@ 286 OS_NETBSD = @OS_NETBSD@ 190 287 OS_OPENBSD = @OS_OPENBSD@ 191 OS_ OS2 = @OS_OS2@288 OS_SUNOS = @OS_SUNOS@ 192 289 OS_WINDOWS = @OS_WINDOWS@ 193 290 OTOOL = @OTOOL@ … … 201 298 PACKAGE_VERSION = @PACKAGE_VERSION@ 202 299 PATH_SEPARATOR = @PATH_SEPARATOR@ 203 PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@204 300 RANLIB = @RANLIB@ 205 301 RC = @RC@ … … 208 304 SHELL = @SHELL@ 209 305 STRIP = @STRIP@ 210 THREAD_CFLAGS = @THREAD_CFLAGS@211 306 USE_UDEV = @USE_UDEV@ 307 USE_USBDK = @USE_USBDK@ 212 308 VERSION = @VERSION@ 213 VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@214 309 abs_builddir = @abs_builddir@ 215 310 abs_srcdir = @abs_srcdir@ … … 218 313 ac_ct_AR = @ac_ct_AR@ 219 314 ac_ct_CC = @ac_ct_CC@ 315 ac_ct_CXX = @ac_ct_CXX@ 220 316 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 221 317 am__include = @am__include@ … … 267 363 ACLOCAL_AMFLAGS = -I m4 268 364 DISTCLEANFILES = libusb-1.0.pc 269 MAINTAINERCLEANFILES = ChangeLog 270 EXTRA_DIST = TODO PORTING msvc 271 SUBDIRS = libusb doc $(am__append_1) 365 EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \ 366 examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \ 367 android Xcode 368 369 SUBDIRS = libusb doc $(am__append_1) $(am__append_2) 272 370 pkgconfigdir = $(libdir)/pkgconfig 273 371 pkgconfig_DATA = libusb-1.0.pc … … 277 375 278 376 .SUFFIXES: 279 am--refresh: 377 am--refresh: Makefile 280 378 @: 281 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)379 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 282 380 @for dep in $?; do \ 283 381 case '$(am__configure_deps)' in \ … … 306 404 $(SHELL) ./config.status --recheck 307 405 308 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)406 $(top_srcdir)/configure: $(am__configure_deps) 309 407 $(am__cd) $(srcdir) && $(AUTOCONF) 310 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)408 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 311 409 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 312 410 $(am__aclocal_m4_deps): 313 411 314 412 config.h: stamp-h1 315 @if test ! -f $@; then \ 316 rm -f stamp-h1; \ 317 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ 318 else :; fi 413 @test -f $@ || rm -f stamp-h1 414 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 319 415 320 416 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 321 417 @rm -f stamp-h1 322 418 cd $(top_builddir) && $(SHELL) ./config.status config.h 323 $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(am__configure_deps)419 $(srcdir)/config.h.in: $(am__configure_deps) 324 420 ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 325 421 rm -f stamp-h1 … … 341 437 install-pkgconfigDATA: $(pkgconfig_DATA) 342 438 @$(NORMAL_INSTALL) 343 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"344 439 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ 440 if test -n "$$list"; then \ 441 echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ 442 $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ 443 fi; \ 345 444 for p in $$list; do \ 346 445 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ … … 356 455 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ 357 456 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 358 test -n "$$files" || exit 0; \ 359 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ 360 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files 457 dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) 361 458 362 459 # This directory's subdirectories are mostly independent; you can cd 363 # into them and run `make' without going through this Makefile. 364 # To change the values of `make' variables: instead of editing Makefiles, 365 # (1) if the variable is set in `config.status', edit `config.status' 366 # (which will cause the Makefiles to be regenerated when you run `make'); 367 # (2) otherwise, pass the desired values on the `make' command line. 368 $(RECURSIVE_TARGETS): 369 @fail= failcom='exit 1'; \ 370 for f in x $$MAKEFLAGS; do \ 371 case $$f in \ 372 *=* | --[!k]*);; \ 373 *k*) failcom='fail=yes';; \ 374 esac; \ 375 done; \ 460 # into them and run 'make' without going through this Makefile. 461 # To change the values of 'make' variables: instead of editing Makefiles, 462 # (1) if the variable is set in 'config.status', edit 'config.status' 463 # (which will cause the Makefiles to be regenerated when you run 'make'); 464 # (2) otherwise, pass the desired values on the 'make' command line. 465 $(am__recursive_targets): 466 @fail=; \ 467 if $(am__make_keepgoing); then \ 468 failcom='fail=yes'; \ 469 else \ 470 failcom='exit 1'; \ 471 fi; \ 376 472 dot_seen=no; \ 377 473 target=`echo $@ | sed s/-recursive//`; \ 378 list='$(SUBDIRS)'; for subdir in $$list; do \ 474 case "$@" in \ 475 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 476 *) list='$(SUBDIRS)' ;; \ 477 esac; \ 478 for subdir in $$list; do \ 379 479 echo "Making $$target in $$subdir"; \ 380 480 if test "$$subdir" = "."; then \ … … 391 491 fi; test -z "$$fail" 392 492 393 $(RECURSIVE_CLEAN_TARGETS): 394 @fail= failcom='exit 1'; \ 395 for f in x $$MAKEFLAGS; do \ 396 case $$f in \ 397 *=* | --[!k]*);; \ 398 *k*) failcom='fail=yes';; \ 399 esac; \ 400 done; \ 401 dot_seen=no; \ 402 case "$@" in \ 403 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 404 *) list='$(SUBDIRS)' ;; \ 405 esac; \ 406 rev=''; for subdir in $$list; do \ 407 if test "$$subdir" = "."; then :; else \ 408 rev="$$subdir $$rev"; \ 409 fi; \ 410 done; \ 411 rev="$$rev ."; \ 412 target=`echo $@ | sed s/-recursive//`; \ 413 for subdir in $$rev; do \ 414 echo "Making $$target in $$subdir"; \ 415 if test "$$subdir" = "."; then \ 416 local_target="$$target-am"; \ 417 else \ 418 local_target="$$target"; \ 419 fi; \ 420 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 421 || eval $$failcom; \ 422 done && test -z "$$fail" 423 tags-recursive: 424 list='$(SUBDIRS)'; for subdir in $$list; do \ 425 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 426 done 427 ctags-recursive: 428 list='$(SUBDIRS)'; for subdir in $$list; do \ 429 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 430 done 431 432 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 433 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 434 unique=`for i in $$list; do \ 435 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 436 done | \ 437 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 438 END { if (nonempty) { for (i in files) print i; }; }'`; \ 439 mkid -fID $$unique 440 tags: TAGS 441 442 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 443 $(TAGS_FILES) $(LISP) 493 ID: $(am__tagged_files) 494 $(am__define_uniq_tagged_files); mkid -fID $$unique 495 tags: tags-recursive 496 TAGS: tags 497 498 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 444 499 set x; \ 445 500 here=`pwd`; \ … … 457 512 fi; \ 458 513 done; \ 459 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 460 unique=`for i in $$list; do \ 461 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 462 done | \ 463 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 464 END { if (nonempty) { for (i in files) print i; }; }'`; \ 514 $(am__define_uniq_tagged_files); \ 465 515 shift; \ 466 516 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ … … 474 524 fi; \ 475 525 fi 476 ctags: CTAGS 477 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 478 $(TAGS_FILES) $(LISP) 479 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 480 unique=`for i in $$list; do \ 481 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 482 done | \ 483 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 484 END { if (nonempty) { for (i in files) print i; }; }'`; \ 526 ctags: ctags-recursive 527 528 CTAGS: ctags 529 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 530 $(am__define_uniq_tagged_files); \ 485 531 test -z "$(CTAGS_ARGS)$$unique" \ 486 532 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ … … 491 537 && $(am__cd) $(top_srcdir) \ 492 538 && gtags -i $(GTAGS_ARGS) "$$here" 539 cscope: cscope.files 540 test ! -s cscope.files \ 541 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) 542 clean-cscope: 543 -rm -f cscope.files 544 cscope.files: clean-cscope cscopelist 545 cscopelist: cscopelist-recursive 546 547 cscopelist-am: $(am__tagged_files) 548 list='$(am__tagged_files)'; \ 549 case "$(srcdir)" in \ 550 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 551 *) sdir=$(subdir)/$(srcdir) ;; \ 552 esac; \ 553 for i in $$list; do \ 554 if test -f "$$i"; then \ 555 echo "$(subdir)/$$i"; \ 556 else \ 557 echo "$$sdir/$$i"; \ 558 fi; \ 559 done >> $(top_builddir)/cscope.files 493 560 494 561 distclean-tags: 495 562 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 563 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 496 564 497 565 distdir: $(DISTFILES) … … 529 597 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 530 598 if test "$$subdir" = .; then :; else \ 531 test -d "$(distdir)/$$subdir" \ 532 || $(MKDIR_P) "$(distdir)/$$subdir" \ 533 || exit 1; \ 534 fi; \ 535 done 536 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 537 if test "$$subdir" = .; then :; else \ 599 $(am__make_dryrun) \ 600 || test -d "$(distdir)/$$subdir" \ 601 || $(MKDIR_P) "$(distdir)/$$subdir" \ 602 || exit 1; \ 538 603 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 539 604 $(am__relativize); \ … … 555 620 fi; \ 556 621 done 557 $(MAKE) $(AM_MAKEFLAGS) \558 top_distdir="$(top_distdir)" distdir="$(distdir)" \559 dist-hook560 622 -test -n "$(am__skip_mode_fix)" \ 561 623 || find "$(distdir)" -type d ! -perm -755 \ … … 567 629 dist-gzip: distdir 568 630 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 569 $(am__ remove_distdir)631 $(am__post_remove_distdir) 570 632 dist-bzip2: distdir 571 tardir=$(distdir) && $(am__tar) | bzip2 -9-c >$(distdir).tar.bz2572 $(am__ remove_distdir)573 574 dist-lz ma: distdir575 tardir=$(distdir) && $(am__tar) | lz ma -9 -c >$(distdir).tar.lzma576 $(am__ remove_distdir)633 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 634 $(am__post_remove_distdir) 635 636 dist-lzip: distdir 637 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 638 $(am__post_remove_distdir) 577 639 578 640 dist-xz: distdir 579 tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz580 $(am__ remove_distdir)641 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 642 $(am__post_remove_distdir) 581 643 582 644 dist-tarZ: distdir 645 @echo WARNING: "Support for shar distribution archives is" \ 646 "deprecated." >&2 647 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 583 648 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 584 $(am__ remove_distdir)649 $(am__post_remove_distdir) 585 650 586 651 dist-shar: distdir 652 @echo WARNING: "Support for distribution archives compressed with" \ 653 "legacy program 'compress' is deprecated." >&2 654 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 587 655 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 588 $(am__ remove_distdir)656 $(am__post_remove_distdir) 589 657 590 658 dist-zip: distdir 591 659 -rm -f $(distdir).zip 592 660 zip -rq $(distdir).zip $(distdir) 593 $(am__ remove_distdir)594 595 dist dist-all: distdir596 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2597 $(am__ remove_distdir)661 $(am__post_remove_distdir) 662 663 dist dist-all: 664 $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' 665 $(am__post_remove_distdir) 598 666 599 667 # This target untars the dist file and tries a VPATH configuration. Then … … 606 674 *.tar.bz2*) \ 607 675 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 608 *.tar.lz ma*) \609 lz ma -dc $(distdir).tar.lzma| $(am__untar) ;;\676 *.tar.lz*) \ 677 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 610 678 *.tar.xz*) \ 611 679 xz -dc $(distdir).tar.xz | $(am__untar) ;;\ … … 617 685 unzip $(distdir).zip ;;\ 618 686 esac 619 chmod -R a-w $(distdir) ; chmod a+w $(distdir)620 mkdir $(distdir)/_build621 mkdir $(distdir)/_ inst687 chmod -R a-w $(distdir) 688 chmod u+w $(distdir) 689 mkdir $(distdir)/_build $(distdir)/_inst 622 690 chmod a-w $(distdir) 623 691 test -d $(distdir)/_build || exit 0; \ … … 626 694 && am__cwd=`pwd` \ 627 695 && $(am__cd) $(distdir)/_build \ 628 && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 696 && ../configure \ 697 $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 629 698 $(DISTCHECK_CONFIGURE_FLAGS) \ 699 --srcdir=.. --prefix="$$dc_install_base" \ 630 700 && $(MAKE) $(AM_MAKEFLAGS) \ 631 701 && $(MAKE) $(AM_MAKEFLAGS) dvi \ … … 650 720 && cd "$$am__cwd" \ 651 721 || exit 1 652 $(am__ remove_distdir)722 $(am__post_remove_distdir) 653 723 @(echo "$(distdir) archives ready for distribution: "; \ 654 724 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 655 725 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 656 726 distuninstallcheck: 657 @$(am__cd) '$(distuninstallcheck_dir)' \ 658 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 727 @test -n '$(distuninstallcheck_dir)' || { \ 728 echo 'ERROR: trying to run $@ with an empty' \ 729 '$$(distuninstallcheck_dir)' >&2; \ 730 exit 1; \ 731 }; \ 732 $(am__cd) '$(distuninstallcheck_dir)' || { \ 733 echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 734 exit 1; \ 735 }; \ 736 test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 659 737 || { echo "ERROR: files left after uninstall:" ; \ 660 738 if test -n "$(DESTDIR)"; then \ … … 690 768 installcheck: installcheck-recursive 691 769 install-strip: 692 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 693 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 694 `test -z '$(STRIP)' || \ 695 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 770 if test -z '$(STRIP)'; then \ 771 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 772 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 773 install; \ 774 else \ 775 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 776 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 777 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 778 fi 696 779 mostlyclean-generic: 697 780 … … 706 789 @echo "This command is intended for maintainers to use" 707 790 @echo "it deletes files that may require special tools to rebuild." 708 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)709 791 clean: clean-recursive 710 792 … … 777 859 uninstall-am: uninstall-pkgconfigDATA 778 860 779 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ 780 ctags-recursive install-am install-strip tags-recursive 781 782 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 783 all all-am am--refresh check check-am clean clean-generic \ 784 clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ 785 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ 786 dist-zip distcheck distclean distclean-generic distclean-hdr \ 787 distclean-libtool distclean-tags distcleancheck distdir \ 788 distuninstallcheck dvi dvi-am html html-am info info-am \ 789 install install-am install-data install-data-am install-dvi \ 790 install-dvi-am install-exec install-exec-am install-html \ 791 install-html-am install-info install-info-am install-man \ 792 install-pdf install-pdf-am install-pkgconfigDATA install-ps \ 793 install-ps-am install-strip installcheck installcheck-am \ 794 installdirs installdirs-am maintainer-clean \ 861 .MAKE: $(am__recursive_targets) all install-am install-strip 862 863 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ 864 am--refresh check check-am clean clean-cscope clean-generic \ 865 clean-libtool cscope cscopelist-am ctags ctags-am dist \ 866 dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ 867 dist-xz dist-zip distcheck distclean distclean-generic \ 868 distclean-hdr distclean-libtool distclean-tags distcleancheck \ 869 distdir distuninstallcheck dvi dvi-am html html-am info \ 870 info-am install install-am install-data install-data-am \ 871 install-dvi install-dvi-am install-exec install-exec-am \ 872 install-html install-html-am install-info install-info-am \ 873 install-man install-pdf install-pdf-am install-pkgconfigDATA \ 874 install-ps install-ps-am install-strip installcheck \ 875 installcheck-am installdirs installdirs-am maintainer-clean \ 795 876 maintainer-clean-generic mostlyclean mostlyclean-generic \ 796 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ 797 uninstall uninstall-am uninstall-pkgconfigDATA 798 799 800 .PHONY: ChangeLog dist-up 801 ChangeLog: 802 git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog 803 804 dist-hook: ChangeLog 877 mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ 878 uninstall-am uninstall-pkgconfigDATA 879 880 881 .PHONY: dist-up 805 882 dist-up: dist 806 883 rm -rf $(reldir) -
TabularUnified libusb1/trunk/NEWS ¶
r1876 r1882 1 This file lists notable changes in each release. For the full history of all 2 changes, see ChangeLog. 3 4 2012-04-20: 1.0.9 5 * Numerous bug fixes and improvements 6 * Backend for Windows, for devices using the WinUSB.sys driver 7 * Backend for OpenBSD and NetBSD, for devices using the ugen driver 8 * Add libusb_get_device_speed() 9 * Add libusb_has_capability() 10 * Add libusb_error_name() 11 * Add libusb_get_version() 12 13 2010-05-07: v1.0.8 14 * Bug fixes 15 16 2010-04-19: v1.0.7 17 * Bug fixes and documentation tweaks 18 * Add more interface class definitions 19 20 2009-11-22: v1.0.6 21 * Bug fixes 22 * Increase libusb_handle_events() timeout to 60s for powersaving 23 24 2009-11-15: v1.0.5 25 * Use timerfd when available for timer management 26 * Small fixes/updates 27 28 2009-11-06: v1.0.4 release 29 * Bug fixes including transfer locking to fix some potential threading races 30 * More flexibility with clock types on Linux 31 * Use new bulk continuation tracking in Linux 2.6.32 for improved handling 32 of short/failed transfers 33 34 2009-08-27: v1.0.3 release 35 * Bug fixes 36 * Add libusb_get_max_iso_packet_size() 37 38 2009-06-13: v1.0.2 release 39 * Bug fixes 40 41 2009-05-12: v1.0.1 release 42 * Bug fixes 43 * Darwin backend 44 45 2008-12-13: v1.0.0 release 46 * Bug fixes 47 48 2008-11-21: v0.9.4 release 49 * Bug fixes 50 * Add libusb_attach_kernel_driver() 51 52 2008-08-23: v0.9.3 release 53 * Bug fixes 54 55 2008-07-19: v0.9.2 release 56 * Bug fixes 57 58 2008-06-28: v0.9.1 release 59 * Bug fixes 60 * Introduce contexts to the API 61 * Compatibility with new Linux kernel features 62 63 2008-05-25: v0.9.0 release 64 * First libusb-1.0 beta release 65 1 For the latest libusb news, please refer to the ChangeLog file, or visit: 2 http://libusb.info -
TabularUnified libusb1/trunk/PORTING ¶
r1876 r1882 93 93 submissions). Even if you do not make such changes yourself, please do raise 94 94 the issues on the mailing list at the very minimum. 95 -
TabularUnified libusb1/trunk/README ¶
r1876 r1882 1 libusb 2 ====== 1 # libusb 2 3 [](https://travis-ci.org/libusb/libusb) 4 [](https://ci.appveyor.com/project/LudovicRousseau/libusb) 5 [](https://scan.coverity.com/projects/libusb-libusb) 3 6 4 7 libusb is a library for USB device access from Linux, Mac OS X, 5 OpenBSD, NetBSD, and Windows userspace. 6 It is written in C and licensed under the LGPL-2.1 (see COPYING). 8 Windows, OpenBSD/NetBSD and Haiku userspace. 9 It is written in C (Haiku backend in C++) and licensed under the GNU 10 Lesser General Public License version 2.1 or, at your option, any later 11 version (see [COPYING](COPYING)). 7 12 8 13 libusb is abstracted internally in such a way that it can hopefully 9 be ported to other operating systems. See the PORTING file for some10 information, if you fancy a challenge. :) 14 be ported to other operating systems. Please see the [PORTING](PORTING) 15 file for more information. 11 16 12 17 libusb homepage: 13 http://libusb. org/18 http://libusb.info/ 14 19 15 20 Developers will wish to consult the API documentation: 16 http:// libusb.sourceforge.net/api-1.0/21 http://api.libusb.info 17 22 18 23 Use the mailing list for questions, comments, etc: 19 http:// libusb.org/wiki/MailingList24 http://mailing-list.libusb.info 20 25 21 - Peter Stuge <peter@stuge.se> 22 (use the mailing list rather than mailing developers directly) 26 - Pete Batard <pete@akeo.ie> 27 - Hans de Goede <hdegoede@redhat.com> 28 - Xiaofan Chen <xiaofanc@gmail.com> 29 - Ludovic Rousseau <ludovic.rousseau@gmail.com> 30 - Nathan Hjelm <hjelmn@cs.unm.edu> 31 - Chris Dickens <christopher.a.dickens@gmail.com> 32 33 (Please use the mailing list rather than mailing developers directly) -
TabularUnified libusb1/trunk/TODO ¶
r1876 r1882 1 for 1.1 or future 2 ================== 3 optional timerfd support (runtime detection) 4 notifications of hotplugged/unplugged devices 5 offer API to create/destroy handle_events thread 6 isochronous sync I/O? 7 exposing of parent-child device relationships 8 "usb primer" introduction docs 9 more examples 1 Please see the libusb roadmap by visiting: 2 https://github.com/libusb/libusb/milestones?direction=asc&sort=due_date&state=open -
TabularUnified libusb1/trunk/aclocal.m4 ¶
r1879 r1882 1 # generated automatically by aclocal 1.1 1.1 -*- Autoconf -*-2 3 # Copyright (C) 1996 , 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,4 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 1 # generated automatically by aclocal 1.14.1 -*- Autoconf -*- 2 3 # Copyright (C) 1996-2013 Free Software Foundation, Inc. 4 5 5 # This file is free software; the Free Software Foundation 6 6 # gives unlimited permission to copy and/or distribute it, … … 12 12 # PARTICULAR PURPOSE. 13 13 14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 14 15 m4_ifndef([AC_AUTOCONF_VERSION], 15 16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.6 4],,17 [m4_warning([this file was generated for autoconf 2.6 4.17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18 [m4_warning([this file was generated for autoconf 2.69. 18 19 You have another version of autoconf. It may work, but is not guaranteed to. 19 20 If you have problems, you may need to regenerate the build system entirely. 20 To do so, use the procedure documented by the package, typically `autoreconf'.])])21 22 # Copyright (C) 2002 , 2003, 2005, 2006, 2007, 2008Free Software Foundation, Inc.21 To do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22 23 # Copyright (C) 2002-2013 Free Software Foundation, Inc. 23 24 # 24 25 # This file is free software; the Free Software Foundation … … 32 33 # (This private macro should not be called outside this file.) 33 34 AC_DEFUN([AM_AUTOMAKE_VERSION], 34 [am__api_version='1.1 1'35 [am__api_version='1.14' 35 36 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36 37 dnl require some minimum version. Point them to the right macro. 37 m4_if([$1], [1.1 1.1], [],38 m4_if([$1], [1.14.1], [], 38 39 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39 40 ]) … … 51 52 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52 53 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53 [AM_AUTOMAKE_VERSION([1.1 1.1])dnl54 [AM_AUTOMAKE_VERSION([1.14.1])dnl 54 55 m4_ifndef([AC_AUTOCONF_VERSION], 55 56 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl … … 58 59 # AM_AUX_DIR_EXPAND -*- Autoconf -*- 59 60 60 # Copyright (C) 2001 , 2003, 2005Free Software Foundation, Inc.61 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 61 62 # 62 63 # This file is free software; the Free Software Foundation … … 65 66 66 67 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to68 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.68 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 69 # '$srcdir', '$srcdir/..', or '$srcdir/../..'. 69 70 # 70 71 # Of course, Automake must honor this variable whenever it calls a … … 85 86 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86 87 # are both prefixed by $srcdir. In an in-source build this is usually 87 # harmless because $srcdir is `.', but things will broke when you88 # harmless because $srcdir is '.', but things will broke when you 88 89 # start a VPATH build or use an absolute $srcdir. 89 90 # … … 111 112 # AM_CONDITIONAL -*- Autoconf -*- 112 113 113 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114 # Free Software Foundation, Inc. 115 # 116 # This file is free software; the Free Software Foundation 117 # gives unlimited permission to copy and/or distribute it, 118 # with or without modifications, as long as this notice is preserved. 119 120 # serial 9 114 # Copyright (C) 1997-2013 Free Software Foundation, Inc. 115 # 116 # This file is free software; the Free Software Foundation 117 # gives unlimited permission to copy and/or distribute it, 118 # with or without modifications, as long as this notice is preserved. 121 119 122 120 # AM_CONDITIONAL(NAME, SHELL-CONDITION) … … 124 122 # Define a conditional. 125 123 AC_DEFUN([AM_CONDITIONAL], 126 [AC_PREREQ( 2.52)dnl127 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],128 124 [AC_PREREQ([2.52])dnl 125 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 126 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129 127 AC_SUBST([$1_TRUE])dnl 130 128 AC_SUBST([$1_FALSE])dnl … … 145 143 fi])]) 146 144 147 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148 # Free Software Foundation, Inc. 149 # 150 # This file is free software; the Free Software Foundation 151 # gives unlimited permission to copy and/or distribute it, 152 # with or without modifications, as long as this notice is preserved. 153 154 # serial 10 155 156 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 145 # Copyright (C) 1999-2013 Free Software Foundation, Inc. 146 # 147 # This file is free software; the Free Software Foundation 148 # gives unlimited permission to copy and/or distribute it, 149 # with or without modifications, as long as this notice is preserved. 150 151 152 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 157 153 # written in clear, in which case automake, when reading aclocal.m4, 158 154 # will think it sees a *use*, and therefore will trigger all it's … … 164 160 # ---------------------- 165 161 # See how the compiler implements dependency checking. 166 # NAME is "CC", "CXX", " GCJ", or "OBJC".162 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 167 163 # We try a few techniques and use that to set a single cache variable. 168 164 # … … 177 173 AC_REQUIRE([AM_DEP_TRACK])dnl 178 174 179 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180 [$1], CXX, [depcc="$CXX" am_compiler_list=], 181 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182 [$1], UPC, [depcc="$UPC" am_compiler_list=], 183 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184 [depcc="$$1" am_compiler_list=]) 175 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 176 [$1], [CXX], [depcc="$CXX" am_compiler_list=], 177 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 178 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 179 [$1], [UPC], [depcc="$UPC" am_compiler_list=], 180 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 181 [depcc="$$1" am_compiler_list=]) 185 182 186 183 AC_CACHE_CHECK([dependency style of $depcc], … … 190 187 # making bogus files that we don't know about and never remove. For 191 188 # instance it was reported that on HP-UX the gcc test will end up 192 # making a dummy file named `D' -- because `-MD' means `put the output 193 # in D'. 189 # making a dummy file named 'D' -- because '-MD' means "put the output 190 # in D". 191 rm -rf conftest.dir 194 192 mkdir conftest.dir 195 193 # Copy depcomp to subdir because otherwise we won't find it if we're … … 230 228 for i in 1 2 3 4 5 6; do 231 229 echo '#include "conftst'$i'.h"' >> sub/conftest.c 232 # Using `: > sub/conftst$i.h'creates only sub/conftst1.h with233 # Solaris 8's {/usr,}/bin/sh.234 touchsub/conftst$i.h230 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 231 # Solaris 10 /bin/sh. 232 echo '/* dummy */' > sub/conftst$i.h 235 233 done 236 234 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237 235 238 # We check with `-c' and `-o' for the sake of the "dashmstdout"236 # We check with '-c' and '-o' for the sake of the "dashmstdout" 239 237 # mode. It turns out that the SunPro C++ compiler does not properly 240 # handle `-M -o', and we need to detect this. Also, some Intel241 # versions had trouble with output in subdirs 238 # handle '-M -o', and we need to detect this. Also, some Intel 239 # versions had trouble with output in subdirs. 242 240 am__obj=sub/conftest.${OBJEXT-o} 243 241 am__minus_obj="-o $am__obj" … … 248 246 ;; 249 247 nosideeffect) 250 # after this tag, mechanisms are not by side-effect, so they'll251 # only be used when explicitly requested 248 # After this tag, mechanisms are not by side-effect, so they'll 249 # only be used when explicitly requested. 252 250 if test "x$enable_dependency_tracking" = xyes; then 253 251 continue … … 256 254 fi 257 255 ;; 258 msv isualcpp | msvcmsys)259 # This compiler won't grok `-c -o', but also, the minuso test has256 msvc7 | msvc7msys | msvisualcpp | msvcmsys) 257 # This compiler won't grok '-c -o', but also, the minuso test has 260 258 # not run yet. These depmodes are late enough in the game, and 261 259 # so weak that their functioning should not be impacted. … … 305 303 # ------------- 306 304 # Choose a directory name for dependency files. 307 # This macro is AC_REQUIREd in _AM_DEPENDENCIES 305 # This macro is AC_REQUIREd in _AM_DEPENDENCIES. 308 306 AC_DEFUN([AM_SET_DEPDIR], 309 307 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl … … 315 313 # ------------ 316 314 AC_DEFUN([AM_DEP_TRACK], 317 [AC_ARG_ENABLE(dependency-tracking, 318 [ --disable-dependency-tracking speeds up one-time build 319 --enable-dependency-tracking do not reject slow dependency extractors]) 315 [AC_ARG_ENABLE([dependency-tracking], [dnl 316 AS_HELP_STRING( 317 [--enable-dependency-tracking], 318 [do not reject slow dependency extractors]) 319 AS_HELP_STRING( 320 [--disable-dependency-tracking], 321 [speeds up one-time build])]) 320 322 if test "x$enable_dependency_tracking" != xno; then 321 323 am_depcomp="$ac_aux_dir/depcomp" 322 324 AMDEPBACKSLASH='\' 325 am__nodep='_no' 323 326 fi 324 327 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325 328 AC_SUBST([AMDEPBACKSLASH])dnl 326 329 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 330 AC_SUBST([am__nodep])dnl 331 _AM_SUBST_NOTMAKE([am__nodep])dnl 327 332 ]) 328 333 329 334 # Generate code to set up dependency tracking. -*- Autoconf -*- 330 335 331 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332 # Free Software Foundation, Inc. 333 # 334 # This file is free software; the Free Software Foundation 335 # gives unlimited permission to copy and/or distribute it, 336 # with or without modifications, as long as this notice is preserved. 337 338 #serial 5 336 # Copyright (C) 1999-2013 Free Software Foundation, Inc. 337 # 338 # This file is free software; the Free Software Foundation 339 # gives unlimited permission to copy and/or distribute it, 340 # with or without modifications, as long as this notice is preserved. 341 339 342 340 343 # _AM_OUTPUT_DEPENDENCY_COMMANDS … … 342 345 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343 346 [{ 344 # Autoconf 2.62quotes --file arguments for eval, but not when files347 # Older Autoconf quotes --file arguments for eval, but not when files 345 348 # are listed without --file. Let's play safe and only enable the eval 346 349 # if we detect the quoting. … … 355 358 mf=`echo "$mf" | sed -e 's/:.*$//'` 356 359 # Check whether this is an Automake generated Makefile or not. 357 # We used to match only the files named `Makefile.in', but360 # We used to match only the files named 'Makefile.in', but 358 361 # some people rename them; so instead we look at the file content. 359 362 # Grep'ing the first line is not enough: some people post-process … … 367 370 fi 368 371 # Extract the definition of DEPDIR, am__include, and am__quote 369 # from the Makefile without running `make'.372 # from the Makefile without running 'make'. 370 373 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371 374 test -z "$DEPDIR" && continue 372 375 am__include=`sed -n 's/^am__include = //p' < "$mf"` 373 test -z " am__include" && continue376 test -z "$am__include" && continue 374 377 am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375 # When using ansi2knr, U may be empty or an underscore; expand it376 U=`sed -n 's/^U = //p' < "$mf"`377 378 # Find all dependency output files, they are included files with 378 379 # $(DEPDIR) in their names. We invoke sed twice because it is the … … 381 382 for file in `sed -n " 382 383 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do384 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 384 385 # Make sure the directory exists. 385 386 test -f "$dirpart/$file" && continue … … 399 400 # 400 401 # This code is only required when automatic dependency tracking 401 # is enabled. FIXME. This creates each `.P' file that we will402 # is enabled. FIXME. This creates each '.P' file that we will 402 403 # need in order to bootstrap the dependency handling code. 403 404 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], … … 409 410 # Do all the work for Automake. -*- Autoconf -*- 410 411 411 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 412 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 413 # 414 # This file is free software; the Free Software Foundation 415 # gives unlimited permission to copy and/or distribute it, 416 # with or without modifications, as long as this notice is preserved. 417 418 # serial 16 412 # Copyright (C) 1996-2013 Free Software Foundation, Inc. 413 # 414 # This file is free software; the Free Software Foundation 415 # gives unlimited permission to copy and/or distribute it, 416 # with or without modifications, as long as this notice is preserved. 419 417 420 418 # This macro actually does too much. Some checks are only needed if 421 419 # your package does certain things. But this isn't really a big deal. 420 421 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 422 m4_define([AC_PROG_CC], 423 m4_defn([AC_PROG_CC]) 424 [_AM_PROG_CC_C_O 425 ]) 422 426 423 427 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) … … 433 437 # release and drop the old call support. 434 438 AC_DEFUN([AM_INIT_AUTOMAKE], 435 [AC_PREREQ([2.6 2])dnl439 [AC_PREREQ([2.65])dnl 436 440 dnl Autoconf wants to disallow AM_ names. We explicitly allow 437 441 dnl the ones we care about. … … 462 466 dnl Distinguish between old-style and new-style calls. 463 467 m4_ifval([$2], 464 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 468 [AC_DIAGNOSE([obsolete], 469 [$0: two- and three-arguments forms are deprecated.]) 470 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 465 471 AC_SUBST([PACKAGE], [$1])dnl 466 472 AC_SUBST([VERSION], [$2])], 467 473 [_AM_SET_OPTIONS([$1])dnl 468 474 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 469 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 475 m4_if( 476 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), 477 [ok:ok],, 470 478 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 471 479 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl … … 473 481 474 482 _AM_IF_OPTION([no-define],, 475 [AC_DEFINE_UNQUOTED( PACKAGE, "$PACKAGE", [Name of package])476 AC_DEFINE_UNQUOTED( VERSION, "$VERSION", [Version number of package])])dnl483 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 484 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 477 485 478 486 # Some tools Automake needs. 479 487 AC_REQUIRE([AM_SANITY_CHECK])dnl 480 488 AC_REQUIRE([AC_ARG_PROGRAM])dnl 481 AM_MISSING_PROG( ACLOCAL, aclocal-${am__api_version})482 AM_MISSING_PROG( AUTOCONF, autoconf)483 AM_MISSING_PROG( AUTOMAKE, automake-${am__api_version})484 AM_MISSING_PROG( AUTOHEADER, autoheader)485 AM_MISSING_PROG( MAKEINFO, makeinfo)489 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 490 AM_MISSING_PROG([AUTOCONF], [autoconf]) 491 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 492 AM_MISSING_PROG([AUTOHEADER], [autoheader]) 493 AM_MISSING_PROG([MAKEINFO], [makeinfo]) 486 494 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 487 495 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 488 AC_REQUIRE([AM_PROG_MKDIR_P])dnl 496 AC_REQUIRE([AC_PROG_MKDIR_P])dnl 497 # For better backward compatibility. To be removed once Automake 1.9.x 498 # dies out for good. For more background, see: 499 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 500 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 501 AC_SUBST([mkdir_p], ['$(MKDIR_P)']) 489 502 # We need awk for the "check" target. The system "awk" is bad on 490 503 # some platforms. … … 497 510 _AM_IF_OPTION([no-dependencies],, 498 511 [AC_PROVIDE_IFELSE([AC_PROG_CC], 499 [_AM_DEPENDENCIES( CC)],500 [ define([AC_PROG_CC],501 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl512 [_AM_DEPENDENCIES([CC])], 513 [m4_define([AC_PROG_CC], 514 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 502 515 AC_PROVIDE_IFELSE([AC_PROG_CXX], 503 [_AM_DEPENDENCIES( CXX)],504 [ define([AC_PROG_CXX],505 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl516 [_AM_DEPENDENCIES([CXX])], 517 [m4_define([AC_PROG_CXX], 518 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 506 519 AC_PROVIDE_IFELSE([AC_PROG_OBJC], 507 [_AM_DEPENDENCIES(OBJC)], 508 [define([AC_PROG_OBJC], 509 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 510 ]) 511 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 512 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 513 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 514 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 520 [_AM_DEPENDENCIES([OBJC])], 521 [m4_define([AC_PROG_OBJC], 522 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 523 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 524 [_AM_DEPENDENCIES([OBJCXX])], 525 [m4_define([AC_PROG_OBJCXX], 526 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 527 ]) 528 AC_REQUIRE([AM_SILENT_RULES])dnl 529 dnl The testsuite driver may need to know about EXEEXT, so add the 530 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 531 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 515 532 AC_CONFIG_COMMANDS_PRE(dnl 516 533 [m4_provide_if([_AM_COMPILER_EXEEXT], 517 534 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 518 ]) 519 520 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 535 536 # POSIX will say in a future version that running "rm -f" with no argument 537 # is OK; and we want to be able to make that assumption in our Makefile 538 # recipes. So use an aggressive probe to check that the usage we want is 539 # actually supported "in the wild" to an acceptable degree. 540 # See automake bug#10828. 541 # To make any issue more visible, cause the running configure to be aborted 542 # by default if the 'rm' program in use doesn't match our expectations; the 543 # user can still override this though. 544 if rm -f && rm -fr && rm -rf; then : OK; else 545 cat >&2 <<'END' 546 Oops! 547 548 Your 'rm' program seems unable to run without file operands specified 549 on the command line, even when the '-f' option is present. This is contrary 550 to the behaviour of most rm programs out there, and not conforming with 551 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 552 553 Please tell bug-automake@gnu.org about your system, including the value 554 of your $PATH and any error possibly output before this message. This 555 can help us improve future automake versions. 556 557 END 558 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 559 echo 'Configuration will proceed anyway, since you have set the' >&2 560 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 561 echo >&2 562 else 563 cat >&2 <<'END' 564 Aborting the configuration process, to ensure you take notice of the issue. 565 566 You can download and install GNU coreutils to get an 'rm' implementation 567 that behaves properly: <http://www.gnu.org/software/coreutils/>. 568 569 If you want to complete the configuration process using your problematic 570 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 571 to "yes", and re-run configure. 572 573 END 574 AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 575 fi 576 fi]) 577 578 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 521 579 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 522 580 dnl mangled by Autoconf and run in a shell conditional statement. 523 581 m4_define([_AC_COMPILER_EXEEXT], 524 582 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 525 526 583 527 584 # When config.status generates a header, we must update the stamp-h file. … … 546 603 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 547 604 548 # Copyright (C) 2001 , 2003, 2005, 2008Free Software Foundation, Inc.605 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 549 606 # 550 607 # This file is free software; the Free Software Foundation … … 565 622 esac 566 623 fi 567 AC_SUBST(install_sh)]) 568 569 # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 570 # 571 # This file is free software; the Free Software Foundation 572 # gives unlimited permission to copy and/or distribute it, 573 # with or without modifications, as long as this notice is preserved. 574 575 # serial 2 624 AC_SUBST([install_sh])]) 625 626 # Copyright (C) 2003-2013 Free Software Foundation, Inc. 627 # 628 # This file is free software; the Free Software Foundation 629 # gives unlimited permission to copy and/or distribute it, 630 # with or without modifications, as long as this notice is preserved. 576 631 577 632 # Check whether the underlying file-system supports filenames … … 588 643 AC_SUBST([am__leading_dot])]) 589 644 590 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-591 # From Jim Meyering592 593 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008594 # Free Software Foundation, Inc.595 #596 # This file is free software; the Free Software Foundation597 # gives unlimited permission to copy and/or distribute it,598 # with or without modifications, as long as this notice is preserved.599 600 # serial 5601 602 # AM_MAINTAINER_MODE([DEFAULT-MODE])603 # ----------------------------------604 # Control maintainer-specific portions of Makefiles.605 # Default is to disable them, unless `enable' is passed literally.606 # For symmetry, `disable' may be passed as well. Anyway, the user607 # can override the default with the --enable/--disable switch.608 AC_DEFUN([AM_MAINTAINER_MODE],609 [m4_case(m4_default([$1], [disable]),610 [enable], [m4_define([am_maintainer_other], [disable])],611 [disable], [m4_define([am_maintainer_other], [enable])],612 [m4_define([am_maintainer_other], [enable])613 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])614 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])615 dnl maintainer-mode's default is 'disable' unless 'enable' is passed616 AC_ARG_ENABLE([maintainer-mode],617 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful618 (and sometimes confusing) to the casual installer],619 [USE_MAINTAINER_MODE=$enableval],620 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))621 AC_MSG_RESULT([$USE_MAINTAINER_MODE])622 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])623 MAINT=$MAINTAINER_MODE_TRUE624 AC_SUBST([MAINT])dnl625 ]626 )627 628 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])629 630 645 # Check to see how 'make' treats includes. -*- Autoconf -*- 631 646 632 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 633 # 634 # This file is free software; the Free Software Foundation 635 # gives unlimited permission to copy and/or distribute it, 636 # with or without modifications, as long as this notice is preserved. 637 638 # serial 4 647 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 648 # 649 # This file is free software; the Free Software Foundation 650 # gives unlimited permission to copy and/or distribute it, 651 # with or without modifications, as long as this notice is preserved. 639 652 640 653 # AM_MAKE_INCLUDE() … … 655 668 # First try GNU make style include. 656 669 echo "include confinc" > confmf 657 # Ignore all kinds of additional output from `make'.670 # Ignore all kinds of additional output from 'make'. 658 671 case `$am_make -s -f confmf 2> /dev/null` in #( 659 672 *the\ am__doit\ target*) … … 680 693 ]) 681 694 682 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008683 # Free Software Foundation, Inc.684 #685 # This file is free software; the Free Software Foundation686 # gives unlimited permission to copy and/or distribute it,687 # with or without modifications, as long as this notice is preserved.688 689 # serial 6690 691 # AM_PROG_CC_C_O692 # --------------693 # Like AC_PROG_CC_C_O, but changed for automake.694 AC_DEFUN([AM_PROG_CC_C_O],695 [AC_REQUIRE([AC_PROG_CC_C_O])dnl696 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl697 AC_REQUIRE_AUX_FILE([compile])dnl698 # FIXME: we rely on the cache variable name because699 # there is no other way.700 set dummy $CC701 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`702 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o703 if test "$am_t" != yes; then704 # Losing compiler, so override with the script.705 # FIXME: It is wrong to rewrite CC.706 # But if we don't then we get into trouble of one sort or another.707 # A longer-term fix would be to have automake use am__CC in this case,708 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"709 CC="$am_aux_dir/compile $CC"710 fi711 dnl Make sure AC_PROG_CC is never called again, or it will override our712 dnl setting of CC.713 m4_define([AC_PROG_CC],714 [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])715 ])716 717 695 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 718 696 719 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 720 # Free Software Foundation, Inc. 721 # 722 # This file is free software; the Free Software Foundation 723 # gives unlimited permission to copy and/or distribute it, 724 # with or without modifications, as long as this notice is preserved. 725 726 # serial 6 697 # Copyright (C) 1997-2013 Free Software Foundation, Inc. 698 # 699 # This file is free software; the Free Software Foundation 700 # gives unlimited permission to copy and/or distribute it, 701 # with or without modifications, as long as this notice is preserved. 727 702 728 703 # AM_MISSING_PROG(NAME, PROGRAM) … … 733 708 AC_SUBST($1)]) 734 709 735 736 710 # AM_MISSING_HAS_RUN 737 711 # ------------------ 738 # Define MISSING if not defined so far and test if it supports --run.739 # If it does, set am_missing_run to use it, otherwise, to nothing.712 # Define MISSING if not defined so far and test if it is modern enough. 713 # If it is, set am_missing_run to use it, otherwise, to nothing. 740 714 AC_DEFUN([AM_MISSING_HAS_RUN], 741 715 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl … … 750 724 fi 751 725 # Use eval to expand $SHELL 752 if eval "$MISSING -- run true"; then753 am_missing_run="$MISSING --run"726 if eval "$MISSING --is-lightweight"; then 727 am_missing_run="$MISSING " 754 728 else 755 729 am_missing_run= 756 AC_MSG_WARN([`missing' script is too old or missing]) 757 fi 758 ]) 759 760 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 761 # 762 # This file is free software; the Free Software Foundation 763 # gives unlimited permission to copy and/or distribute it, 764 # with or without modifications, as long as this notice is preserved. 765 766 # AM_PROG_MKDIR_P 767 # --------------- 768 # Check for `mkdir -p'. 769 AC_DEFUN([AM_PROG_MKDIR_P], 770 [AC_PREREQ([2.60])dnl 771 AC_REQUIRE([AC_PROG_MKDIR_P])dnl 772 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 773 dnl while keeping a definition of mkdir_p for backward compatibility. 774 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 775 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 776 dnl Makefile.ins that do not define MKDIR_P, so we do our own 777 dnl adjustment using top_builddir (which is defined more often than 778 dnl MKDIR_P). 779 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 780 case $mkdir_p in 781 [[\\/$]]* | ?:[[\\/]]*) ;; 782 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 783 esac 730 AC_MSG_WARN(['missing' script is too old or missing]) 731 fi 784 732 ]) 785 733 786 734 # Helper functions for option handling. -*- Autoconf -*- 787 735 788 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 789 # 790 # This file is free software; the Free Software Foundation 791 # gives unlimited permission to copy and/or distribute it, 792 # with or without modifications, as long as this notice is preserved. 793 794 # serial 4 736 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 737 # 738 # This file is free software; the Free Software Foundation 739 # gives unlimited permission to copy and/or distribute it, 740 # with or without modifications, as long as this notice is preserved. 795 741 796 742 # _AM_MANGLE_OPTION(NAME) … … 800 746 801 747 # _AM_SET_OPTION(NAME) 802 # -------------------- ----------748 # -------------------- 803 749 # Set option NAME. Presently that only means defining a flag for this option. 804 750 AC_DEFUN([_AM_SET_OPTION], 805 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])751 [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 806 752 807 753 # _AM_SET_OPTIONS(OPTIONS) 808 # ------------------------ ----------754 # ------------------------ 809 755 # OPTIONS is a space-separated list of Automake options. 810 756 AC_DEFUN([_AM_SET_OPTIONS], … … 817 763 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 818 764 765 # Copyright (C) 1999-2013 Free Software Foundation, Inc. 766 # 767 # This file is free software; the Free Software Foundation 768 # gives unlimited permission to copy and/or distribute it, 769 # with or without modifications, as long as this notice is preserved. 770 771 # _AM_PROG_CC_C_O 772 # --------------- 773 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 774 # to automatically call this. 775 AC_DEFUN([_AM_PROG_CC_C_O], 776 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 777 AC_REQUIRE_AUX_FILE([compile])dnl 778 AC_LANG_PUSH([C])dnl 779 AC_CACHE_CHECK( 780 [whether $CC understands -c and -o together], 781 [am_cv_prog_cc_c_o], 782 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 783 # Make sure it works both with $CC and with simple cc. 784 # Following AC_PROG_CC_C_O, we do the test twice because some 785 # compilers refuse to overwrite an existing .o file with -o, 786 # though they will create one. 787 am_cv_prog_cc_c_o=yes 788 for am_i in 1 2; do 789 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 790 && test -f conftest2.$ac_objext; then 791 : OK 792 else 793 am_cv_prog_cc_c_o=no 794 break 795 fi 796 done 797 rm -f core conftest* 798 unset am_i]) 799 if test "$am_cv_prog_cc_c_o" != yes; then 800 # Losing compiler, so override with the script. 801 # FIXME: It is wrong to rewrite CC. 802 # But if we don't then we get into trouble of one sort or another. 803 # A longer-term fix would be to have automake use am__CC in this case, 804 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 805 CC="$am_aux_dir/compile $CC" 806 fi 807 AC_LANG_POP([C])]) 808 809 # For backward compatibility. 810 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 811 812 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 813 # 814 # This file is free software; the Free Software Foundation 815 # gives unlimited permission to copy and/or distribute it, 816 # with or without modifications, as long as this notice is preserved. 817 818 # AM_RUN_LOG(COMMAND) 819 # ------------------- 820 # Run COMMAND, save the exit status in ac_status, and log it. 821 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 822 AC_DEFUN([AM_RUN_LOG], 823 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 824 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 825 ac_status=$? 826 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 827 (exit $ac_status); }]) 828 819 829 # Check to make sure that the build environment is sane. -*- Autoconf -*- 820 830 821 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 822 # Free Software Foundation, Inc. 823 # 824 # This file is free software; the Free Software Foundation 825 # gives unlimited permission to copy and/or distribute it, 826 # with or without modifications, as long as this notice is preserved. 827 828 # serial 5 831 # Copyright (C) 1996-2013 Free Software Foundation, Inc. 832 # 833 # This file is free software; the Free Software Foundation 834 # gives unlimited permission to copy and/or distribute it, 835 # with or without modifications, as long as this notice is preserved. 829 836 830 837 # AM_SANITY_CHECK … … 832 839 AC_DEFUN([AM_SANITY_CHECK], 833 840 [AC_MSG_CHECKING([whether build environment is sane]) 834 # Just in case835 sleep 1836 echo timestamp > conftest.file837 841 # Reject unsafe characters in $srcdir or the absolute working directory 838 842 # name. Accept space and tab only in the latter. … … 845 849 case $srcdir in 846 850 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 847 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;851 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 848 852 esac 849 853 850 # Do `set' in a subshell so we don't clobber the current shell's854 # Do 'set' in a subshell so we don't clobber the current shell's 851 855 # arguments. Must try -L first in case configure is actually a 852 856 # symlink; some systems play weird games with the mod time of symlinks … … 854 858 # directory). 855 859 if ( 856 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 857 if test "$[*]" = "X"; then 858 # -L didn't work. 859 set X `ls -t "$srcdir/configure" conftest.file` 860 fi 861 rm -f conftest.file 862 if test "$[*]" != "X $srcdir/configure conftest.file" \ 863 && test "$[*]" != "X conftest.file $srcdir/configure"; then 864 865 # If neither matched, then we have a broken ls. This can happen 866 # if, for instance, CONFIG_SHELL is bash and it inherits a 867 # broken ls alias from the environment. This has actually 868 # happened. Such a system could not be considered "sane". 869 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 870 alias in your environment]) 871 fi 872 860 am_has_slept=no 861 for am_try in 1 2; do 862 echo "timestamp, slept: $am_has_slept" > conftest.file 863 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 864 if test "$[*]" = "X"; then 865 # -L didn't work. 866 set X `ls -t "$srcdir/configure" conftest.file` 867 fi 868 if test "$[*]" != "X $srcdir/configure conftest.file" \ 869 && test "$[*]" != "X conftest.file $srcdir/configure"; then 870 871 # If neither matched, then we have a broken ls. This can happen 872 # if, for instance, CONFIG_SHELL is bash and it inherits a 873 # broken ls alias from the environment. This has actually 874 # happened. Such a system could not be considered "sane". 875 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 876 alias in your environment]) 877 fi 878 if test "$[2]" = conftest.file || test $am_try -eq 2; then 879 break 880 fi 881 # Just in case. 882 sleep 1 883 am_has_slept=yes 884 done 873 885 test "$[2]" = conftest.file 874 886 ) … … 880 892 Check your system clock]) 881 893 fi 882 AC_MSG_RESULT(yes)]) 883 884 # Copyright (C) 2009 Free Software Foundation, Inc. 885 # 886 # This file is free software; the Free Software Foundation 887 # gives unlimited permission to copy and/or distribute it, 888 # with or without modifications, as long as this notice is preserved. 889 890 # serial 1 894 AC_MSG_RESULT([yes]) 895 # If we didn't sleep, we still need to ensure time stamps of config.status and 896 # generated files are strictly newer. 897 am_sleep_pid= 898 if grep 'slept: no' conftest.file >/dev/null 2>&1; then 899 ( sleep 1 ) & 900 am_sleep_pid=$! 901 fi 902 AC_CONFIG_COMMANDS_PRE( 903 [AC_MSG_CHECKING([that generated files are newer than configure]) 904 if test -n "$am_sleep_pid"; then 905 # Hide warnings about reused PIDs. 906 wait $am_sleep_pid 2>/dev/null 907 fi 908 AC_MSG_RESULT([done])]) 909 rm -f conftest.file 910 ]) 911 912 # Copyright (C) 2009-2013 Free Software Foundation, Inc. 913 # 914 # This file is free software; the Free Software Foundation 915 # gives unlimited permission to copy and/or distribute it, 916 # with or without modifications, as long as this notice is preserved. 891 917 892 918 # AM_SILENT_RULES([DEFAULT]) 893 919 # -------------------------- 894 920 # Enable less verbose build rules; with the default set to DEFAULT 895 # ( `yes' being less verbose, `no'or empty being verbose).921 # ("yes" being less verbose, "no" or empty being verbose). 896 922 AC_DEFUN([AM_SILENT_RULES], 897 [AC_ARG_ENABLE([silent-rules], 898 [ --enable-silent-rules less verbose build output (undo: `make V=1') 899 --disable-silent-rules verbose build output (undo: `make V=0')]) 900 case $enable_silent_rules in 901 yes) AM_DEFAULT_VERBOSITY=0;; 902 no) AM_DEFAULT_VERBOSITY=1;; 903 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 923 [AC_ARG_ENABLE([silent-rules], [dnl 924 AS_HELP_STRING( 925 [--enable-silent-rules], 926 [less verbose build output (undo: "make V=1")]) 927 AS_HELP_STRING( 928 [--disable-silent-rules], 929 [verbose build output (undo: "make V=0")])dnl 930 ]) 931 case $enable_silent_rules in @%:@ ((( 932 yes) AM_DEFAULT_VERBOSITY=0;; 933 no) AM_DEFAULT_VERBOSITY=1;; 934 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 904 935 esac 936 dnl 937 dnl A few 'make' implementations (e.g., NonStop OS and NextStep) 938 dnl do not support nested variable expansions. 939 dnl See automake bug#9928 and bug#10237. 940 am_make=${MAKE-make} 941 AC_CACHE_CHECK([whether $am_make supports nested variables], 942 [am_cv_make_support_nested_variables], 943 [if AS_ECHO([['TRUE=$(BAR$(V)) 944 BAR0=false 945 BAR1=true 946 V=1 947 am__doit: 948 @$(TRUE) 949 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 950 am_cv_make_support_nested_variables=yes 951 else 952 am_cv_make_support_nested_variables=no 953 fi]) 954 if test $am_cv_make_support_nested_variables = yes; then 955 dnl Using '$V' instead of '$(V)' breaks IRIX make. 956 AM_V='$(V)' 957 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 958 else 959 AM_V=$AM_DEFAULT_VERBOSITY 960 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 961 fi 962 AC_SUBST([AM_V])dnl 963 AM_SUBST_NOTMAKE([AM_V])dnl 964 AC_SUBST([AM_DEFAULT_V])dnl 965 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 905 966 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl 906 967 AM_BACKSLASH='\' … … 909 970 ]) 910 971 911 # Copyright (C) 2001 , 2003, 2005Free Software Foundation, Inc.972 # Copyright (C) 2001-2013 Free Software Foundation, Inc. 912 973 # 913 974 # This file is free software; the Free Software Foundation … … 917 978 # AM_PROG_INSTALL_STRIP 918 979 # --------------------- 919 # One issue with vendor `install' (even GNU) is that you can't980 # One issue with vendor 'install' (even GNU) is that you can't 920 981 # specify the program used to strip binaries. This is especially 921 982 # annoying in cross-compiling environments, where the build's strip 922 983 # is unlikely to handle the host's binaries. 923 984 # Fortunately install-sh will honor a STRIPPROG variable, so we 924 # always use install-sh in `make install-strip', and initialize985 # always use install-sh in "make install-strip", and initialize 925 986 # STRIPPROG with the value of the STRIP variable (set by the user). 926 987 AC_DEFUN([AM_PROG_INSTALL_STRIP], 927 988 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 928 # Installed binaries are usually stripped using `strip' when the user929 # run `make install-strip'. However `strip' might not be the right989 # Installed binaries are usually stripped using 'strip' when the user 990 # run "make install-strip". However 'strip' might not be the right 930 991 # tool to use in cross-compilation environments, therefore Automake 931 # will honor the `STRIP' environment variable to overrule this program.932 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.992 # will honor the 'STRIP' environment variable to overrule this program. 993 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 933 994 if test "$cross_compiling" != no; then 934 995 AC_CHECK_TOOL([STRIP], [strip], :) … … 937 998 AC_SUBST([INSTALL_STRIP_PROGRAM])]) 938 999 939 # Copyright (C) 2006, 2008 Free Software Foundation, Inc. 940 # 941 # This file is free software; the Free Software Foundation 942 # gives unlimited permission to copy and/or distribute it, 943 # with or without modifications, as long as this notice is preserved. 944 945 # serial 2 1000 # Copyright (C) 2006-2013 Free Software Foundation, Inc. 1001 # 1002 # This file is free software; the Free Software Foundation 1003 # gives unlimited permission to copy and/or distribute it, 1004 # with or without modifications, as long as this notice is preserved. 946 1005 947 1006 # _AM_SUBST_NOTMAKE(VARIABLE) … … 952 1011 953 1012 # AM_SUBST_NOTMAKE(VARIABLE) 954 # -------------------------- -1013 # -------------------------- 955 1014 # Public sister of _AM_SUBST_NOTMAKE. 956 1015 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) … … 958 1017 # Check how to create a tarball. -*- Autoconf -*- 959 1018 960 # Copyright (C) 2004, 2005 Free Software Foundation, Inc. 961 # 962 # This file is free software; the Free Software Foundation 963 # gives unlimited permission to copy and/or distribute it, 964 # with or without modifications, as long as this notice is preserved. 965 966 # serial 2 1019 # Copyright (C) 2004-2013 Free Software Foundation, Inc. 1020 # 1021 # This file is free software; the Free Software Foundation 1022 # gives unlimited permission to copy and/or distribute it, 1023 # with or without modifications, as long as this notice is preserved. 967 1024 968 1025 # _AM_PROG_TAR(FORMAT) 969 1026 # -------------------- 970 1027 # Check how to create a tarball in format FORMAT. 971 # FORMAT should be one of `v7', `ustar', or `pax'.1028 # FORMAT should be one of 'v7', 'ustar', or 'pax'. 972 1029 # 973 1030 # Substitute a variable $(am__tar) that is a command … … 979 1036 # a tarball read from stdin. 980 1037 # $(am__untar) < result.tar 1038 # 981 1039 AC_DEFUN([_AM_PROG_TAR], 982 [# Always define AMTAR for backward compatibility. 983 AM_MISSING_PROG([AMTAR], [tar]) 1040 [# Always define AMTAR for backward compatibility. Yes, it's still used 1041 # in the wild :-( We should find a proper way to deprecate it ... 1042 AC_SUBST([AMTAR], ['$${TAR-tar}']) 1043 1044 # We'll loop over all known methods to create a tar archive until one works. 1045 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 1046 984 1047 m4_if([$1], [v7], 985 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 986 [m4_case([$1], [ustar],, [pax],, 987 [m4_fatal([Unknown tar format])]) 988 AC_MSG_CHECKING([how to create a $1 tar archive]) 989 # Loop over all known methods to create a tar archive until one works. 990 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 991 _am_tools=${am_cv_prog_tar_$1-$_am_tools} 992 # Do not fold the above two line into one, because Tru64 sh and 993 # Solaris sh will not grok spaces in the rhs of `-'. 994 for _am_tool in $_am_tools 995 do 996 case $_am_tool in 997 gnutar) 998 for _am_tar in tar gnutar gtar; 999 do 1000 AM_RUN_LOG([$_am_tar --version]) && break 1001 done 1002 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1003 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1004 am__untar="$_am_tar -xf -" 1005 ;; 1006 plaintar) 1007 # Must skip GNU tar: if it does not support --format= it doesn't create 1008 # ustar tarball either. 1009 (tar --version) >/dev/null 2>&1 && continue 1010 am__tar='tar chf - "$$tardir"' 1011 am__tar_='tar chf - "$tardir"' 1012 am__untar='tar xf -' 1013 ;; 1014 pax) 1015 am__tar='pax -L -x $1 -w "$$tardir"' 1016 am__tar_='pax -L -x $1 -w "$tardir"' 1017 am__untar='pax -r' 1018 ;; 1019 cpio) 1020 am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1021 am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1022 am__untar='cpio -i -H $1 -d' 1023 ;; 1024 none) 1025 am__tar=false 1026 am__tar_=false 1027 am__untar=false 1028 ;; 1029 esac 1030 1031 # If the value was cached, stop now. We just wanted to have am__tar 1032 # and am__untar set. 1033 test -n "${am_cv_prog_tar_$1}" && break 1034 1035 # tar/untar a dummy directory, and stop if the command works 1048 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 1049 1050 [m4_case([$1], 1051 [ustar], 1052 [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 1053 # There is notably a 21 bits limit for the UID and the GID. In fact, 1054 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 1055 # and bug#13588). 1056 am_max_uid=2097151 # 2^21 - 1 1057 am_max_gid=$am_max_uid 1058 # The $UID and $GID variables are not portable, so we need to resort 1059 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 1060 # below are definitely unexpected, so allow the users to see them 1061 # (that is, avoid stderr redirection). 1062 am_uid=`id -u || echo unknown` 1063 am_gid=`id -g || echo unknown` 1064 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 1065 if test $am_uid -le $am_max_uid; then 1066 AC_MSG_RESULT([yes]) 1067 else 1068 AC_MSG_RESULT([no]) 1069 _am_tools=none 1070 fi 1071 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 1072 if test $am_gid -le $am_max_gid; then 1073 AC_MSG_RESULT([yes]) 1074 else 1075 AC_MSG_RESULT([no]) 1076 _am_tools=none 1077 fi], 1078 1079 [pax], 1080 [], 1081 1082 [m4_fatal([Unknown tar format])]) 1083 1084 AC_MSG_CHECKING([how to create a $1 tar archive]) 1085 1086 # Go ahead even if we have the value already cached. We do so because we 1087 # need to set the values for the 'am__tar' and 'am__untar' variables. 1088 _am_tools=${am_cv_prog_tar_$1-$_am_tools} 1089 1090 for _am_tool in $_am_tools; do 1091 case $_am_tool in 1092 gnutar) 1093 for _am_tar in tar gnutar gtar; do 1094 AM_RUN_LOG([$_am_tar --version]) && break 1095 done 1096 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1097 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1098 am__untar="$_am_tar -xf -" 1099 ;; 1100 plaintar) 1101 # Must skip GNU tar: if it does not support --format= it doesn't create 1102 # ustar tarball either. 1103 (tar --version) >/dev/null 2>&1 && continue 1104 am__tar='tar chf - "$$tardir"' 1105 am__tar_='tar chf - "$tardir"' 1106 am__untar='tar xf -' 1107 ;; 1108 pax) 1109 am__tar='pax -L -x $1 -w "$$tardir"' 1110 am__tar_='pax -L -x $1 -w "$tardir"' 1111 am__untar='pax -r' 1112 ;; 1113 cpio) 1114 am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1115 am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1116 am__untar='cpio -i -H $1 -d' 1117 ;; 1118 none) 1119 am__tar=false 1120 am__tar_=false 1121 am__untar=false 1122 ;; 1123 esac 1124 1125 # If the value was cached, stop now. We just wanted to have am__tar 1126 # and am__untar set. 1127 test -n "${am_cv_prog_tar_$1}" && break 1128 1129 # tar/untar a dummy directory, and stop if the command works. 1130 rm -rf conftest.dir 1131 mkdir conftest.dir 1132 echo GrepMe > conftest.dir/file 1133 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1134 rm -rf conftest.dir 1135 if test -s conftest.tar; then 1136 AM_RUN_LOG([$am__untar <conftest.tar]) 1137 AM_RUN_LOG([cat conftest.dir/file]) 1138 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1139 fi 1140 done 1036 1141 rm -rf conftest.dir 1037 mkdir conftest.dir 1038 echo GrepMe > conftest.dir/file 1039 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1040 rm -rf conftest.dir 1041 if test -s conftest.tar; then 1042 AM_RUN_LOG([$am__untar <conftest.tar]) 1043 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1044 fi 1045 done 1046 rm -rf conftest.dir 1047 1048 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1049 AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1142 1143 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1144 AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1145 1050 1146 AC_SUBST([am__tar]) 1051 1147 AC_SUBST([am__untar]) -
TabularUnified libusb1/trunk/compile ¶
r1876 r1882 2 2 # Wrapper for compilers which do not understand '-c -o'. 3 3 4 scriptversion=2012- 03-05.13; # UTC5 6 # Copyright (C) 1999-201 2Free Software Foundation, Inc.4 scriptversion=2012-10-14.11; # UTC 5 6 # Copyright (C) 1999-2013 Free Software Foundation, Inc. 7 7 # Written by Tom Tromey <tromey@cygnus.com>. 8 8 # … … 113 113 break 114 114 fi 115 if test -f "$dir/lib$lib.a"; then 116 found=yes 117 lib=$dir/lib$lib.a 118 break 119 fi 115 120 done 116 121 IFS=$save_IFS -
TabularUnified libusb1/trunk/config.guess ¶
r1876 r1882 1 1 #! /bin/sh 2 2 # Attempt to guess a canonical system name. 3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 5 # 2011, 2012 Free Software Foundation, Inc. 6 7 timestamp='2012-06-10' 3 # Copyright 1992-2013 Free Software Foundation, Inc. 4 5 timestamp='2013-11-29' 8 6 9 7 # This file is free software; you can redistribute it and/or modify it 10 8 # under the terms of the GNU General Public License as published by 11 # the Free Software Foundation; either version 2of the License, or9 # the Free Software Foundation; either version 3 of the License, or 12 10 # (at your option) any later version. 13 11 # … … 23 21 # distribute this file as part of a program that contains a 24 22 # configuration script generated by Autoconf, you may include it under 25 # the same distribution terms that you use for the rest of that program. 26 27 28 # Originally written by Per Bothner. Please send patches (context 29 # diff format) to <config-patches@gnu.org> and include a ChangeLog 30 # entry. 23 # the same distribution terms that you use for the rest of that 24 # program. This Exception is an additional permission under section 7 25 # of the GNU General Public License, version 3 ("GPLv3"). 31 26 # 32 # This script attempts to guess a canonical system name similar to 33 # config.sub. If it succeeds, it prints the system name on stdout, and 34 # exits with 0. Otherwise, it exits with 1. 27 # Originally written by Per Bothner. 35 28 # 36 29 # You can get the latest version of this script from: 37 30 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 31 # 32 # Please send patches with a ChangeLog entry to config-patches@gnu.org. 33 38 34 39 35 me=`echo "$0" | sed -e 's,.*/,,'` … … 55 51 56 52 Originally written by Per Bothner. 57 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 58 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 59 Free Software Foundation, Inc. 53 Copyright 1992-2013 Free Software Foundation, Inc. 60 54 61 55 This is free software; see the source for copying conditions. There is NO … … 138 132 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 139 133 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 134 135 case "${UNAME_SYSTEM}" in 136 Linux|GNU|GNU/*) 137 # If the system lacks a compiler, then just pick glibc. 138 # We could probably try harder. 139 LIBC=gnu 140 141 eval $set_cc_for_build 142 cat <<-EOF > $dummy.c 143 #include <features.h> 144 #if defined(__UCLIBC__) 145 LIBC=uclibc 146 #elif defined(__dietlibc__) 147 LIBC=dietlibc 148 #else 149 LIBC=gnu 150 #endif 151 EOF 152 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 153 ;; 154 esac 140 155 141 156 # Note: order is significant - the case branches are not exclusive. … … 200 215 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 201 216 echo "${machine}-${os}${release}" 217 exit ;; 218 *:Bitrig:*:*) 219 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 220 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 202 221 exit ;; 203 222 *:OpenBSD:*:*) … … 303 322 echo arm-acorn-riscix${UNAME_RELEASE} 304 323 exit ;; 305 arm :riscos:*:*|arm:RISCOS:*:*)324 arm*:riscos:*:*|arm*:RISCOS:*:*) 306 325 echo arm-unknown-riscos 307 326 exit ;; … … 802 821 echo ${UNAME_MACHINE}-pc-cygwin 803 822 exit ;; 823 *:MINGW64*:*) 824 echo ${UNAME_MACHINE}-pc-mingw64 825 exit ;; 804 826 *:MINGW*:*) 805 827 echo ${UNAME_MACHINE}-pc-mingw32 … … 853 875 *:GNU:*:*) 854 876 # the GNU system 855 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown- gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`877 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 856 878 exit ;; 857 879 *:GNU/*:*:*) 858 880 # other systems with GNU libc and userland 859 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`- gnu881 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 860 882 exit ;; 861 883 i*86:Minix:*:*) … … 863 885 exit ;; 864 886 aarch64:Linux:*:*) 865 echo ${UNAME_MACHINE}-unknown-linux- gnu887 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 866 888 exit ;; 867 889 aarch64_be:Linux:*:*) 868 890 UNAME_MACHINE=aarch64_be 869 echo ${UNAME_MACHINE}-unknown-linux- gnu891 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 870 892 exit ;; 871 893 alpha:Linux:*:*) … … 880 902 esac 881 903 objdump --private-headers /bin/sh | grep -q ld.so.1 882 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 883 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 904 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 906 exit ;; 907 arc:Linux:*:* | arceb:Linux:*:*) 908 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 884 909 exit ;; 885 910 arm*:Linux:*:*) … … 888 913 | grep -q __ARM_EABI__ 889 914 then 890 echo ${UNAME_MACHINE}-unknown-linux- gnu915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 891 916 else 892 917 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 893 918 | grep -q __ARM_PCS_VFP 894 919 then 895 echo ${UNAME_MACHINE}-unknown-linux- gnueabi920 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 896 921 else 897 echo ${UNAME_MACHINE}-unknown-linux- gnueabihf922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 898 923 fi 899 924 fi 900 925 exit ;; 901 926 avr32*:Linux:*:*) 902 echo ${UNAME_MACHINE}-unknown-linux- gnu927 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 903 928 exit ;; 904 929 cris:Linux:*:*) 905 echo ${UNAME_MACHINE}-axis-linux- gnu930 echo ${UNAME_MACHINE}-axis-linux-${LIBC} 906 931 exit ;; 907 932 crisv32:Linux:*:*) 908 echo ${UNAME_MACHINE}-axis-linux- gnu933 echo ${UNAME_MACHINE}-axis-linux-${LIBC} 909 934 exit ;; 910 935 frv:Linux:*:*) 911 echo ${UNAME_MACHINE}-unknown-linux- gnu936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 912 937 exit ;; 913 938 hexagon:Linux:*:*) 914 echo ${UNAME_MACHINE}-unknown-linux- gnu939 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 915 940 exit ;; 916 941 i*86:Linux:*:*) 917 LIBC=gnu 918 eval $set_cc_for_build 919 sed 's/^ //' << EOF >$dummy.c 920 #ifdef __dietlibc__ 921 LIBC=dietlibc 922 #endif 923 EOF 924 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 925 echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 942 echo ${UNAME_MACHINE}-pc-linux-${LIBC} 926 943 exit ;; 927 944 ia64:Linux:*:*) 928 echo ${UNAME_MACHINE}-unknown-linux- gnu945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 929 946 exit ;; 930 947 m32r*:Linux:*:*) 931 echo ${UNAME_MACHINE}-unknown-linux- gnu948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 932 949 exit ;; 933 950 m68*:Linux:*:*) 934 echo ${UNAME_MACHINE}-unknown-linux- gnu951 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 935 952 exit ;; 936 953 mips:Linux:*:* | mips64:Linux:*:*) … … 951 968 EOF 952 969 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 953 test x"${CPU}" != x && { echo "${CPU}-unknown-linux- gnu"; exit; }970 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 954 971 ;; 972 or1k:Linux:*:*) 973 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 974 exit ;; 955 975 or32:Linux:*:*) 956 echo ${UNAME_MACHINE}-unknown-linux- gnu976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 957 977 exit ;; 958 978 padre:Linux:*:*) 959 echo sparc-unknown-linux- gnu979 echo sparc-unknown-linux-${LIBC} 960 980 exit ;; 961 981 parisc64:Linux:*:* | hppa64:Linux:*:*) 962 echo hppa64-unknown-linux- gnu982 echo hppa64-unknown-linux-${LIBC} 963 983 exit ;; 964 984 parisc:Linux:*:* | hppa:Linux:*:*) 965 985 # Look for CPU level 966 986 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 967 PA7*) echo hppa1.1-unknown-linux- gnu;;968 PA8*) echo hppa2.0-unknown-linux- gnu;;969 *) echo hppa-unknown-linux- gnu;;987 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 988 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 989 *) echo hppa-unknown-linux-${LIBC} ;; 970 990 esac 971 991 exit ;; 972 992 ppc64:Linux:*:*) 973 echo powerpc64-unknown-linux- gnu993 echo powerpc64-unknown-linux-${LIBC} 974 994 exit ;; 975 995 ppc:Linux:*:*) 976 echo powerpc-unknown-linux-gnu 996 echo powerpc-unknown-linux-${LIBC} 997 exit ;; 998 ppc64le:Linux:*:*) 999 echo powerpc64le-unknown-linux-${LIBC} 1000 exit ;; 1001 ppcle:Linux:*:*) 1002 echo powerpcle-unknown-linux-${LIBC} 977 1003 exit ;; 978 1004 s390:Linux:*:* | s390x:Linux:*:*) 979 echo ${UNAME_MACHINE}-ibm-linux 1005 echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 980 1006 exit ;; 981 1007 sh64*:Linux:*:*) 982 echo ${UNAME_MACHINE}-unknown-linux- gnu1008 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 983 1009 exit ;; 984 1010 sh*:Linux:*:*) 985 echo ${UNAME_MACHINE}-unknown-linux- gnu1011 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 986 1012 exit ;; 987 1013 sparc:Linux:*:* | sparc64:Linux:*:*) 988 echo ${UNAME_MACHINE}-unknown-linux- gnu1014 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 989 1015 exit ;; 990 1016 tile*:Linux:*:*) 991 echo ${UNAME_MACHINE}-unknown-linux- gnu1017 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 992 1018 exit ;; 993 1019 vax:Linux:*:*) 994 echo ${UNAME_MACHINE}-dec-linux- gnu1020 echo ${UNAME_MACHINE}-dec-linux-${LIBC} 995 1021 exit ;; 996 1022 x86_64:Linux:*:*) 997 echo ${UNAME_MACHINE}-unknown-linux- gnu1023 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 998 1024 exit ;; 999 1025 xtensa*:Linux:*:*) 1000 echo ${UNAME_MACHINE}-unknown-linux- gnu1026 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1001 1027 exit ;; 1002 1028 i*86:DYNIX/ptx:4*:*) … … 1202 1228 echo i586-pc-haiku 1203 1229 exit ;; 1230 x86_64:Haiku:*:*) 1231 echo x86_64-unknown-haiku 1232 exit ;; 1204 1233 SX-4:SUPER-UX:*:*) 1205 1234 echo sx4-nec-superux${UNAME_RELEASE} … … 1228 1257 *:Darwin:*:*) 1229 1258 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1230 case $UNAME_PROCESSOR in 1231 i386) 1232 eval $set_cc_for_build 1233 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1234 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1235 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1236 grep IS_64BIT_ARCH >/dev/null 1237 then 1238 UNAME_PROCESSOR="x86_64" 1239 fi 1240 fi ;; 1241 unknown) UNAME_PROCESSOR=powerpc ;; 1242 esac 1259 eval $set_cc_for_build 1260 if test "$UNAME_PROCESSOR" = unknown ; then 1261 UNAME_PROCESSOR=powerpc 1262 fi 1263 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then 1264 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1265 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1266 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1267 grep IS_64BIT_ARCH >/dev/null 1268 then 1269 case $UNAME_PROCESSOR in 1270 i386) UNAME_PROCESSOR=x86_64 ;; 1271 powerpc) UNAME_PROCESSOR=powerpc64 ;; 1272 esac 1273 fi 1274 fi 1275 elif test "$UNAME_PROCESSOR" = i386 ; then 1276 # Avoid executing cc on OS X 10.9, as it ships with a stub 1277 # that puts up a graphical alert prompting to install 1278 # developer tools. Any system running Mac OS X 10.7 or 1279 # later (Darwin 11 and later) is required to have a 64-bit 1280 # processor. This is not true of the ARM version of Darwin 1281 # that Apple uses in portable devices. 1282 UNAME_PROCESSOR=x86_64 1283 fi 1243 1284 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1244 1285 exit ;; … … 1330 1371 exit ;; 1331 1372 esac 1332 1333 #echo '(No uname command or uname output not recognized.)' 1>&21334 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&21335 1373 1336 1374 eval $set_cc_for_build -
TabularUnified libusb1/trunk/config.h.in ¶
r1879 r1882 4 4 #undef DEFAULT_VISIBILITY 5 5 6 /* Debug message logging*/6 /* Start with debug message logging enabled */ 7 7 #undef ENABLE_DEBUG_LOGGING 8 8 9 9 /* Message logging */ 10 10 #undef ENABLE_LOGGING 11 12 /* Define to 1 if you have the <asm/types.h> header file. */ 13 #undef HAVE_ASM_TYPES_H 11 14 12 15 /* Define to 1 if you have the <dlfcn.h> header file. */ … … 25 28 #undef HAVE_LIBUDEV_H 26 29 27 /* Define to 1 if you have the <linux/filter.h> header file. */28 #undef HAVE_LINUX_FILTER_H29 30 30 /* Define to 1 if you have the <linux/netlink.h> header file. */ 31 31 #undef HAVE_LINUX_NETLINK_H … … 36 36 /* Define to 1 if you have the <poll.h> header file. */ 37 37 #undef HAVE_POLL_H 38 39 /* Define to 1 if you have the <signal.h> header file. */ 40 #undef HAVE_SIGNAL_H 38 41 39 42 /* Define to 1 if you have the <stdint.h> header file. */ … … 51 54 /* Define to 1 if the system has the type `struct timespec'. */ 52 55 #undef HAVE_STRUCT_TIMESPEC 56 57 /* syslog() function available */ 58 #undef HAVE_SYSLOG_FUNC 59 60 /* Define to 1 if you have the <syslog.h> header file. */ 61 #undef HAVE_SYSLOG_H 62 63 /* Define to 1 if you have the <sys/socket.h> header file. */ 64 #undef HAVE_SYS_SOCKET_H 53 65 54 66 /* Define to 1 if you have the <sys/stat.h> header file. */ … … 68 80 #undef LT_OBJDIR 69 81 70 /* Define to 1 if your C compiler doesn't accept -c and -o together. */71 #undef NO_MINUS_C_MINUS_O72 73 82 /* Darwin backend */ 74 83 #undef OS_DARWIN 75 84 85 /* Haiku backend */ 86 #undef OS_HAIKU 87 76 88 /* Linux backend */ 77 89 #undef OS_LINUX 90 91 /* NetBSD backend */ 92 #undef OS_NETBSD 78 93 79 94 /* OpenBSD backend */ … … 82 97 /* OS/2 backend */ 83 98 #undef OS_OS2 99 100 /* SunOS backend */ 101 #undef OS_SUNOS 84 102 85 103 /* Windows backend */ … … 119 137 #undef USBI_TIMERFD_AVAILABLE 120 138 139 /* Enable output to system log */ 140 #undef USE_SYSTEM_LOGGING_FACILITY 141 121 142 /* Use udev for device enumeration/hotplug */ 122 143 #undef USE_UDEV 123 144 145 /* Use UsbDk Windows backend */ 146 #undef USE_USBDK 147 124 148 /* Version number of package */ 125 149 #undef VERSION 150 151 /* Oldest Windows version supported */ 152 #undef WINVER 126 153 127 154 /* Use GNU extensions */ -
TabularUnified libusb1/trunk/config.sub ¶
r1876 r1882 1 1 #! /bin/sh 2 2 # Configuration validation subroutine script. 3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 5 # 2011, 2012 Free Software Foundation, Inc. 6 7 timestamp='2012-04-18' 8 9 # This file is (in principle) common to ALL GNU software. 10 # The presence of a machine in this file suggests that SOME GNU software 11 # can handle that machine. It does not imply ALL GNU software can. 12 # 13 # This file is free software; you can redistribute it and/or modify 14 # it under the terms of the GNU General Public License as published by 15 # the Free Software Foundation; either version 2 of the License, or 3 # Copyright 1992-2013 Free Software Foundation, Inc. 4 5 timestamp='2013-10-01' 6 7 # This file is free software; you can redistribute it and/or modify it 8 # under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 16 10 # (at your option) any later version. 17 11 # 18 # This program is distributed in the hope that it will be useful, 19 # butWITHOUT ANY WARRANTY; without even the implied warranty of20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 # G NU General Public License for more details.12 # This program is distributed in the hope that it will be useful, but 13 # WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 # General Public License for more details. 22 16 # 23 17 # You should have received a copy of the GNU General Public License … … 27 21 # distribute this file as part of a program that contains a 28 22 # configuration script generated by Autoconf, you may include it under 29 # the same distribution terms that you use for the rest of that program. 30 31 32 # Please send patches to <config-patches@gnu.org>. Submit a context 33 # diff and a properly formatted GNU ChangeLog entry. 23 # the same distribution terms that you use for the rest of that 24 # program. This Exception is an additional permission under section 7 25 # of the GNU General Public License, version 3 ("GPLv3"). 26 27 28 # Please send patches with a ChangeLog entry to config-patches@gnu.org. 34 29 # 35 30 # Configuration subroutine to validate and canonicalize a configuration type. … … 74 69 GNU config.sub ($timestamp) 75 70 76 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 77 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 78 Free Software Foundation, Inc. 71 Copyright 1992-2013 Free Software Foundation, Inc. 79 72 80 73 This is free software; see the source for copying conditions. There is NO … … 124 117 case $maybe_os in 125 118 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ 126 linux- uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \119 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ 127 120 knetbsd*-gnu* | netbsd*-gnu* | \ 128 121 kopensolaris*-gnu* | \ … … 157 150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 158 151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 159 -apple | -axis | -knuth | -cray | -microblaze )152 -apple | -axis | -knuth | -cray | -microblaze*) 160 153 os= 161 154 basic_machine=$1 … … 260 253 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ 261 254 | am33_2.0 \ 262 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ 263 | be32 | be64 \ 255 | arc | arceb \ 256 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ 257 | avr | avr32 \ 258 | be32 | be64 \ 264 259 | bfin \ 265 | c4x | c lipper \260 | c4x | c8051 | clipper \ 266 261 | d10v | d30v | dlx | dsp16xx \ 267 262 | epiphany \ … … 271 266 | i370 | i860 | i960 | ia64 \ 272 267 | ip2k | iq2000 \ 268 | k1om \ 273 269 | le32 | le64 \ 274 270 | lm32 \ 275 271 | m32c | m32r | m32rle | m68000 | m68k | m88k \ 276 | maxq | mb | microblaze | m core | mep | metag \272 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ 277 273 | mips | mipsbe | mipseb | mipsel | mipsle \ 278 274 | mips16 \ … … 292 288 | mipsisa64sb1 | mipsisa64sb1el \ 293 289 | mipsisa64sr71k | mipsisa64sr71kel \ 290 | mipsr5900 | mipsr5900el \ 294 291 | mipstx39 | mipstx39el \ 295 292 | mn10200 | mn10300 \ … … 298 295 | msp430 \ 299 296 | nds32 | nds32le | nds32be \ 300 | nios | nios2 \297 | nios | nios2 | nios2eb | nios2el \ 301 298 | ns16k | ns32k \ 302 299 | open8 \ 303 | or 32 \300 | or1k | or32 \ 304 301 | pdp10 | pdp11 | pj | pjl \ 305 302 | powerpc | powerpc64 | powerpc64le | powerpcle \ … … 329 326 basic_machine=tic6x-unknown 330 327 ;; 331 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)328 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) 332 329 basic_machine=$basic_machine-unknown 333 330 os=-none … … 371 368 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 372 369 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ 373 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \370 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ 374 371 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 375 372 | avr-* | avr32-* \ … … 377 374 | bfin-* | bs2000-* \ 378 375 | c[123]* | c30-* | [cjt]90-* | c4x-* \ 379 | c lipper-* | craynv-* | cydra-* \376 | c8051-* | clipper-* | craynv-* | cydra-* \ 380 377 | d10v-* | d30v-* | dlx-* \ 381 378 | elxsi-* \ … … 386 383 | i*86-* | i860-* | i960-* | ia64-* \ 387 384 | ip2k-* | iq2000-* \ 385 | k1om-* \ 388 386 | le32-* | le64-* \ 389 387 | lm32-* \ 390 388 | m32c-* | m32r-* | m32rle-* \ 391 389 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ 392 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ 390 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ 391 | microblaze-* | microblazeel-* \ 393 392 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 394 393 | mips16-* \ … … 408 407 | mipsisa64sb1-* | mipsisa64sb1el-* \ 409 408 | mipsisa64sr71k-* | mipsisa64sr71kel-* \ 409 | mipsr5900-* | mipsr5900el-* \ 410 410 | mipstx39-* | mipstx39el-* \ 411 411 | mmix-* \ … … 413 413 | msp430-* \ 414 414 | nds32-* | nds32le-* | nds32be-* \ 415 | nios-* | nios2-* \415 | nios-* | nios2-* | nios2eb-* | nios2el-* \ 416 416 | none-* | np1-* | ns16k-* | ns32k-* \ 417 417 | open8-* \ … … 789 789 os=-sysv 790 790 ;; 791 microblaze )791 microblaze*) 792 792 basic_machine=microblaze-xilinx 793 793 ;; 794 mingw64) 795 basic_machine=x86_64-pc 796 os=-mingw64 797 ;; 794 798 mingw32) 795 basic_machine=i 386-pc799 basic_machine=i686-pc 796 800 os=-mingw32 797 801 ;; … … 829 833 ;; 830 834 msys) 831 basic_machine=i 386-pc835 basic_machine=i686-pc 832 836 os=-msys 833 837 ;; … … 1020 1024 os=-pw32 1021 1025 ;; 1022 rdos) 1026 rdos | rdos64) 1027 basic_machine=x86_64-pc 1028 os=-rdos 1029 ;; 1030 rdos32) 1023 1031 basic_machine=i386-pc 1024 1032 os=-rdos … … 1347 1355 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 1348 1356 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 1349 | -sym* | -kopensolaris* \1357 | -sym* | -kopensolaris* | -plan9* \ 1350 1358 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1351 1359 | -aos* | -aros* \ … … 1353 1361 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1354 1362 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ 1355 | - openbsd* | -solidbsd* \1363 | -bitrig* | -openbsd* | -solidbsd* \ 1356 1364 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 1357 1365 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ … … 1360 1368 | -chorusos* | -chorusrdb* | -cegcc* \ 1361 1369 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1362 | -mingw32* | - linux-gnu* | -linux-android* \1363 | -linux-newlib* | -linux- uclibc* \1370 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ 1371 | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 1364 1372 | -uxpv* | -beos* | -mpeix* | -udk* \ 1365 1373 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ … … 1493 1501 os=-aros 1494 1502 ;; 1495 -kaos*)1496 os=-kaos1497 ;;1498 1503 -zvmoe) 1499 1504 os=-zvmoe … … 1544 1549 os=-coff 1545 1550 ;; 1551 c8051-*) 1552 os=-elf 1553 ;; 1546 1554 hexagon-*) 1547 1555 os=-elf … … 1585 1593 ;; 1586 1594 mips*-*) 1595 os=-elf 1596 ;; 1597 or1k-*) 1587 1598 os=-elf 1588 1599 ;; -
TabularUnified libusb1/trunk/configure ¶
r1879 r1882 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.6 4 for libusb 1.0.16-rc6.3 # Generated by GNU Autoconf 2.69 for libusb 1.0.21. 4 4 # 5 5 # Report bugs to <libusb-devel@lists.sourceforge.net>. 6 6 # 7 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,8 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software9 # Foundation, Inc.7 # 8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 9 # 10 10 # 11 11 # This configure script is free software; the Free Software Foundation … … 90 90 91 91 # Find who we are. Look in the path if we contain no directory separator. 92 as_myself= 92 93 case $0 in #(( 93 94 *[\\/]* ) as_myself=$0 ;; … … 134 135 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 135 136 137 # Use a proper internal environment variable to ensure we don't fall 138 # into an infinite loop, continuously re-executing ourselves. 139 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then 140 _as_can_reexec=no; export _as_can_reexec; 141 # We cannot yet assume a decent shell, so we have to provide a 142 # neutralization value for shells without unset; and this also 143 # works around shells that cannot unset nonexistent variables. 144 # Preserve -v and -x to the replacement shell. 145 BASH_ENV=/dev/null 146 ENV=/dev/null 147 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV 148 case $- in # (((( 149 *v*x* | *x*v* ) as_opts=-vx ;; 150 *v* ) as_opts=-v ;; 151 *x* ) as_opts=-x ;; 152 * ) as_opts= ;; 153 esac 154 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} 155 # Admittedly, this is quite paranoid, since all the known shells bail 156 # out after a failed `exec'. 157 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 158 as_fn_exit 255 159 fi 160 # We don't want this to propagate to other subprocesses. 161 { _as_can_reexec=; unset _as_can_reexec;} 136 162 if test "x$CONFIG_SHELL" = x; then 137 163 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : … … 167 193 exitcode=1; echo positional parameters were not saved. 168 194 fi 169 test x\$exitcode = x0 || exit 1" 195 test x\$exitcode = x0 || exit 1 196 test -x / || exit 1" 170 197 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO 171 198 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO … … 220 247 221 248 if test "x$CONFIG_SHELL" != x; then : 222 # We cannot yet assume a decent shell, so we have to provide a 223 # neutralization value for shells without unset; and this also 224 # works around shells that cannot unset nonexistent variables. 225 BASH_ENV=/dev/null 226 ENV=/dev/null 227 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV 228 export CONFIG_SHELL 229 exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} 249 export CONFIG_SHELL 250 # We cannot yet assume a decent shell, so we have to provide a 251 # neutralization value for shells without unset; and this also 252 # works around shells that cannot unset nonexistent variables. 253 # Preserve -v and -x to the replacement shell. 254 BASH_ENV=/dev/null 255 ENV=/dev/null 256 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV 257 case $- in # (((( 258 *v*x* | *x*v* ) as_opts=-vx ;; 259 *v* ) as_opts=-v ;; 260 *x* ) as_opts=-x ;; 261 * ) as_opts= ;; 262 esac 263 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} 264 # Admittedly, this is quite paranoid, since all the known shells bail 265 # out after a failed `exec'. 266 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 267 exit 255 230 268 fi 231 269 … … 326 364 done 327 365 test -z "$as_dirs" || eval "mkdir $as_dirs" 328 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"366 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 329 367 330 368 331 369 } # as_fn_mkdir_p 370 371 # as_fn_executable_p FILE 372 # ----------------------- 373 # Test if FILE is an executable regular file. 374 as_fn_executable_p () 375 { 376 test -f "$1" && test -x "$1" 377 } # as_fn_executable_p 332 378 # as_fn_append VAR VALUE 333 379 # ---------------------- … … 366 412 367 413 368 # as_fn_error ERROR [LINENO LOG_FD]369 # --------------------------------- 414 # as_fn_error STATUS ERROR [LINENO LOG_FD] 415 # ---------------------------------------- 370 416 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 371 417 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the 372 # script with status $?, using 1 if that was 0.418 # script with STATUS, using 1 if that was 0. 373 419 as_fn_error () 374 420 { 375 as_status=$ ?; test $as_status -eq 0 && as_status=1376 if test "$ 3"; then377 as_lineno=${as_lineno-"$ 2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack378 $as_echo "$as_me:${as_lineno-$LINENO}: error: $ 1" >&$3421 as_status=$1; test $as_status -eq 0 && as_status=1 422 if test "$4"; then 423 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 424 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 379 425 fi 380 $as_echo "$as_me: error: $ 1" >&2426 $as_echo "$as_me: error: $2" >&2 381 427 as_fn_exit $as_status 382 428 } # as_fn_error … … 451 497 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } 452 498 499 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have 500 # already done that, so ensure we don't try to do so again and fall 501 # in an infinite loop. This has already happened in practice. 502 _as_can_reexec=no; export _as_can_reexec 453 503 # Don't try to exec as it changes $[0], causing all sort of problems 454 504 # (the dirname of $[0] is not the place where we might find the … … 485 535 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. 486 536 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. 487 # In both cases, we have to default to `cp -p '.537 # In both cases, we have to default to `cp -pR'. 488 538 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || 489 as_ln_s='cp -p '539 as_ln_s='cp -pR' 490 540 elif ln conf$$.file conf$$ 2>/dev/null; then 491 541 as_ln_s=ln 492 542 else 493 as_ln_s='cp -p '543 as_ln_s='cp -pR' 494 544 fi 495 545 else 496 as_ln_s='cp -p '546 as_ln_s='cp -pR' 497 547 fi 498 548 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file … … 506 556 fi 507 557 508 if test -x / >/dev/null 2>&1; then 509 as_test_x='test -x' 510 else 511 if ls -dL / >/dev/null 2>&1; then 512 as_ls_L_option=L 513 else 514 as_ls_L_option= 515 fi 516 as_test_x=' 517 eval sh -c '\'' 518 if test -d "$1"; then 519 test -d "$1/."; 520 else 521 case $1 in #( 522 -*)set "./$1";; 523 esac; 524 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( 525 ???[sx]*):;;*)false;;esac;fi 526 '\'' sh 527 ' 528 fi 529 as_executable_p=$as_test_x 558 as_test_x='test -x' 559 as_executable_p=as_fn_executable_p 530 560 531 561 # Sed expression to map a string onto a valid CPP name. … … 538 568 539 569 540 exec 7<&0 </dev/null 6>&1 570 test -n "$DJDIR" || exec 7<&0 </dev/null 571 exec 6>&1 541 572 542 573 # Name of the host. 543 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,574 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, 544 575 # so uname gets run too. 545 576 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` … … 560 591 PACKAGE_NAME='libusb' 561 592 PACKAGE_TARNAME='libusb' 562 PACKAGE_VERSION='1.0. 16-rc6'563 PACKAGE_STRING='libusb 1.0. 16-rc6'593 PACKAGE_VERSION='1.0.21' 594 PACKAGE_STRING='libusb 1.0.21' 564 595 PACKAGE_BUGREPORT='libusb-devel@lists.sourceforge.net' 565 PACKAGE_URL='http:// www.libusb.org/'596 PACKAGE_URL='http://libusb.info' 566 597 567 598 ac_unique_file="libusb/core.c" … … 608 639 LTLDFLAGS 609 640 AM_CFLAGS 610 VISIBILITY_CFLAGS611 641 HAVE_SIGACTION_FALSE 612 642 HAVE_SIGACTION_TRUE 643 BUILD_TESTS_FALSE 644 BUILD_TESTS_TRUE 613 645 BUILD_EXAMPLES_FALSE 614 646 BUILD_EXAMPLES_TRUE 647 USE_USBDK_FALSE 648 USE_USBDK_TRUE 615 649 USE_UDEV_FALSE 616 650 USE_UDEV_TRUE 651 CREATE_IMPORT_LIB_FALSE 652 CREATE_IMPORT_LIB_TRUE 617 653 THREADS_POSIX_FALSE 618 654 THREADS_POSIX_TRUE 619 OS_ OS2_FALSE620 OS_ OS2_TRUE655 OS_HAIKU_FALSE 656 OS_HAIKU_TRUE 621 657 OS_WINDOWS_FALSE 622 658 OS_WINDOWS_TRUE 659 OS_NETBSD_FALSE 660 OS_NETBSD_TRUE 661 OS_SUNOS_FALSE 662 OS_SUNOS_TRUE 623 663 OS_OPENBSD_FALSE 624 664 OS_OPENBSD_TRUE … … 627 667 OS_LINUX_FALSE 628 668 OS_LINUX_TRUE 629 PC_LIBS_PRIVATE 630 THREAD_CFLAGS 631 OS_OS2 669 OS_HAIKU 670 USE_USBDK 632 671 OS_WINDOWS 672 OS_NETBSD 673 OS_SUNOS 633 674 OS_OPENBSD 634 675 OS_DARWIN … … 636 677 OS_LINUX 637 678 RC 679 CXXCPP 638 680 CPP 639 681 OTOOL64 … … 666 708 build 667 709 LIBTOOL 710 am__fastdepCXX_FALSE 711 am__fastdepCXX_TRUE 712 CXXDEPMODE 713 ac_ct_CXX 714 CXXFLAGS 715 CXX 668 716 am__fastdepCC_FALSE 669 717 am__fastdepCC_TRUE 670 718 CCDEPMODE 719 am__nodep 671 720 AMDEPBACKSLASH 672 721 AMDEP_FALSE … … 684 733 AM_BACKSLASH 685 734 AM_DEFAULT_VERBOSITY 686 MAINT 687 MAINTAINER_MODE_FALSE 688 MAINTAINER_MODE_TRUE 735 AM_DEFAULT_V 736 AM_V 689 737 am__untar 690 738 am__tar … … 751 799 ac_user_opts=' 752 800 enable_option_checking 753 enable_maintainer_mode754 801 enable_silent_rules 755 802 enable_dependency_tracking … … 762 809 enable_libtool_lock 763 810 enable_udev 811 enable_usbdk 764 812 enable_timerfd 765 813 enable_log 766 814 enable_debug_log 815 enable_system_log 767 816 enable_examples_build 817 enable_tests_build 768 818 ' 769 819 ac_precious_vars='build_alias … … 775 825 LIBS 776 826 CPPFLAGS 777 CPP' 827 CXX 828 CXXFLAGS 829 CCC 830 CPP 831 CXXCPP' 778 832 779 833 … … 838 892 839 893 case $ac_option in 840 *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; 841 *) ac_optarg=yes ;; 894 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; 895 *=) ac_optarg= ;; 896 *) ac_optarg=yes ;; 842 897 esac 843 898 … … 884 939 # Reject names that are not valid shell variable names. 885 940 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 886 as_fn_error "invalid feature name: $ac_useropt"941 as_fn_error $? "invalid feature name: $ac_useropt" 887 942 ac_useropt_orig=$ac_useropt 888 943 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` … … 910 965 # Reject names that are not valid shell variable names. 911 966 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 912 as_fn_error "invalid feature name: $ac_useropt"967 as_fn_error $? "invalid feature name: $ac_useropt" 913 968 ac_useropt_orig=$ac_useropt 914 969 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` … … 1114 1169 # Reject names that are not valid shell variable names. 1115 1170 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1116 as_fn_error "invalid package name: $ac_useropt"1171 as_fn_error $? "invalid package name: $ac_useropt" 1117 1172 ac_useropt_orig=$ac_useropt 1118 1173 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` … … 1130 1185 # Reject names that are not valid shell variable names. 1131 1186 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1132 as_fn_error "invalid package name: $ac_useropt"1187 as_fn_error $? "invalid package name: $ac_useropt" 1133 1188 ac_useropt_orig=$ac_useropt 1134 1189 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` … … 1160 1215 x_libraries=$ac_optarg ;; 1161 1216 1162 -*) as_fn_error "unrecognized option: \`$ac_option'1163 Try \`$0 --help' for more information ."1217 -*) as_fn_error $? "unrecognized option: \`$ac_option' 1218 Try \`$0 --help' for more information" 1164 1219 ;; 1165 1220 … … 1169 1224 case $ac_envvar in #( 1170 1225 '' | [0-9]* | *[!_$as_cr_alnum]* ) 1171 as_fn_error "invalid variable name: \`$ac_envvar'" ;;1226 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; 1172 1227 esac 1173 1228 eval $ac_envvar=\$ac_optarg … … 1179 1234 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 1180 1235 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 1181 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}1236 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" 1182 1237 ;; 1183 1238 … … 1187 1242 if test -n "$ac_prev"; then 1188 1243 ac_option=--`echo $ac_prev | sed 's/_/-/g'` 1189 as_fn_error "missing argument to $ac_option"1244 as_fn_error $? "missing argument to $ac_option" 1190 1245 fi 1191 1246 … … 1193 1248 case $enable_option_checking in 1194 1249 no) ;; 1195 fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;1250 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; 1196 1251 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; 1197 1252 esac … … 1216 1271 NONE | '' ) case $ac_var in *prefix ) continue;; esac;; 1217 1272 esac 1218 as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"1273 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 1219 1274 done 1220 1275 … … 1230 1285 if test "x$build_alias" = x; then 1231 1286 cross_compiling=maybe 1232 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.1233 If a cross compiler is detected then cross compile mode will be used." >&21234 1287 elif test "x$build_alias" != "x$host_alias"; then 1235 1288 cross_compiling=yes … … 1246 1299 ac_ls_di=`ls -di .` && 1247 1300 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || 1248 as_fn_error "working directory cannot be determined"1301 as_fn_error $? "working directory cannot be determined" 1249 1302 test "X$ac_ls_di" = "X$ac_pwd_ls_di" || 1250 as_fn_error "pwd does not report name of working directory"1303 as_fn_error $? "pwd does not report name of working directory" 1251 1304 1252 1305 … … 1287 1340 if test ! -r "$srcdir/$ac_unique_file"; then 1288 1341 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." 1289 as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"1342 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" 1290 1343 fi 1291 1344 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" 1292 1345 ac_abs_confdir=`( 1293 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"1346 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 1294 1347 pwd)` 1295 1348 # When building in place, set srcdir=. … … 1317 1370 # This message is too long to be a string in the A/UX 3.1 sh. 1318 1371 cat <<_ACEOF 1319 \`configure' configures libusb 1.0. 16-rc6to adapt to many kinds of systems.1372 \`configure' configures libusb 1.0.21 to adapt to many kinds of systems. 1320 1373 1321 1374 Usage: $0 [OPTION]... [VAR=VALUE]... … … 1331 1384 --help=recursive display the short help of all the included packages 1332 1385 -V, --version display version information and exit 1333 -q, --quiet, --silent do not print \`checking ...' messages1386 -q, --quiet, --silent do not print \`checking ...' messages 1334 1387 --cache-file=FILE cache test results in FILE [disabled] 1335 1388 -C, --config-cache alias for \`--cache-file=config.cache' … … 1387 1440 if test -n "$ac_init_help"; then 1388 1441 case $ac_init_help in 1389 short | recursive ) echo "Configuration of libusb 1.0. 16-rc6:";;1442 short | recursive ) echo "Configuration of libusb 1.0.21:";; 1390 1443 esac 1391 1444 cat <<\_ACEOF … … 1395 1448 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1396 1449 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1397 --enable- maintainer-mode enable make rules and dependencies not useful1398 (and sometimes confusing) to the casual installer 1399 --enable- silent-rules less verbose build output (undo: `make V=1')1400 --disable-silent-rules verbose build output (undo: `make V=0')1401 --disable-dependency-tracking speeds up one-time build1402 --enable-dependency-tracking do not reject slow dependency extractors1450 --enable-silent-rules less verbose build output (undo: "make V=1") 1451 --disable-silent-rules verbose build output (undo: "make V=0") 1452 --enable-dependency-tracking 1453 do not reject slow dependency extractors 1454 --disable-dependency-tracking 1455 speeds up one-time build 1403 1456 --enable-shared[=PKGS] build shared libraries [default=yes] 1404 1457 --enable-static[=PKGS] build static libraries [default=yes] … … 1406 1459 optimize for fast installation [default=yes] 1407 1460 --disable-libtool-lock avoid locking (might break parallel builds) 1408 --with-udev use udev for device enumeration and hotplug support 1409 (recommended, default: yes) 1410 --enable-timerfd use timerfd for timing (default auto) 1461 --enable-udev use udev for device enumeration and hotplug support 1462 (recommended) [default=yes] 1463 --enable-usbdk use UsbDk Windows backend [default=no] 1464 --enable-timerfd use timerfd for timing [default=auto] 1411 1465 --disable-log disable all logging 1412 --enable-debug-log enable debug logging (default n) 1413 --enable-examples-build build example applications (default n) 1466 --enable-debug-log start with debug message logging enabled 1467 [default=no] 1468 --enable-system-log output logging messages to system wide log, if 1469 supported by the OS [default=no] 1470 --enable-examples-build build example applications [default=no] 1471 --enable-tests-build build test applications [default=no] 1414 1472 1415 1473 Optional Packages: … … 1428 1486 nonstandard directory <lib dir> 1429 1487 LIBS libraries to pass to the linker, e.g. -l<library> 1430 CPPFLAGS C/C++/Objective Cpreprocessor flags, e.g. -I<include dir> if1488 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if 1431 1489 you have headers in a nonstandard directory <include dir> 1490 CXX C++ compiler command 1491 CXXFLAGS C++ compiler flags 1432 1492 CPP C preprocessor 1493 CXXCPP C++ preprocessor 1433 1494 1434 1495 Use these variables to override the choices made by `configure' or to help … … 1436 1497 1437 1498 Report bugs to <libusb-devel@lists.sourceforge.net>. 1438 libusb home page: <http:// www.libusb.org/>.1499 libusb home page: <http://libusb.info>. 1439 1500 _ACEOF 1440 1501 ac_status=$? … … 1499 1560 if $ac_init_version; then 1500 1561 cat <<\_ACEOF 1501 libusb configure 1.0. 16-rc61502 generated by GNU Autoconf 2.6 41503 1504 Copyright (C) 20 09Free Software Foundation, Inc.1562 libusb configure 1.0.21 1563 generated by GNU Autoconf 2.69 1564 1565 Copyright (C) 2012 Free Software Foundation, Inc. 1505 1566 This configure script is free software; the Free Software Foundation 1506 1567 gives unlimited permission to copy, distribute and modify it. … … 1546 1607 ac_retval=1 1547 1608 fi 1548 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1549 return$ac_retval1609 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1610 as_fn_set_status $ac_retval 1550 1611 1551 1612 } # ac_fn_c_try_compile 1613 1614 # ac_fn_cxx_try_compile LINENO 1615 # ---------------------------- 1616 # Try to compile conftest.$ac_ext, and return whether this succeeded. 1617 ac_fn_cxx_try_compile () 1618 { 1619 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1620 rm -f conftest.$ac_objext 1621 if { { ac_try="$ac_compile" 1622 case "(($ac_try" in 1623 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 1624 *) ac_try_echo=$ac_try;; 1625 esac 1626 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 1627 $as_echo "$ac_try_echo"; } >&5 1628 (eval "$ac_compile") 2>conftest.err 1629 ac_status=$? 1630 if test -s conftest.err; then 1631 grep -v '^ *+' conftest.err >conftest.er1 1632 cat conftest.er1 >&5 1633 mv -f conftest.er1 conftest.err 1634 fi 1635 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1636 test $ac_status = 0; } && { 1637 test -z "$ac_cxx_werror_flag" || 1638 test ! -s conftest.err 1639 } && test -s conftest.$ac_objext; then : 1640 ac_retval=0 1641 else 1642 $as_echo "$as_me: failed program was:" >&5 1643 sed 's/^/| /' conftest.$ac_ext >&5 1644 1645 ac_retval=1 1646 fi 1647 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1648 as_fn_set_status $ac_retval 1649 1650 } # ac_fn_cxx_try_compile 1552 1651 1553 1652 # ac_fn_c_try_link LINENO … … 1578 1677 } && test -s conftest$ac_exeext && { 1579 1678 test "$cross_compiling" = yes || 1580 $as_test_x conftest$ac_exeext1679 test -x conftest$ac_exeext 1581 1680 }; then : 1582 1681 ac_retval=0 … … 1592 1691 # left behind by Apple's compiler. We do this before executing the actions. 1593 1692 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 1594 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1595 return$ac_retval1693 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1694 as_fn_set_status $ac_retval 1596 1695 1597 1696 } # ac_fn_c_try_link … … 1606 1705 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1607 1706 $as_echo_n "checking for $2... " >&6; } 1608 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :1707 if eval \${$3+:} false; then : 1609 1708 $as_echo_n "(cached) " >&6 1610 1709 else … … 1624 1723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 1625 1724 $as_echo "$ac_res" >&6; } 1626 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1725 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1627 1726 1628 1727 } # ac_fn_c_check_header_compile … … 1649 1748 fi 1650 1749 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1651 test $ac_status = 0; } > /dev/null&& {1750 test $ac_status = 0; } > conftest.i && { 1652 1751 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 1653 1752 test ! -s conftest.err … … 1660 1759 ac_retval=1 1661 1760 fi 1662 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1663 return$ac_retval1761 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1762 as_fn_set_status $ac_retval 1664 1763 1665 1764 } # ac_fn_c_try_cpp … … 1702 1801 fi 1703 1802 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 1704 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1705 return$ac_retval1803 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1804 as_fn_set_status $ac_retval 1706 1805 1707 1806 } # ac_fn_c_try_run … … 1715 1814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1716 1815 $as_echo_n "checking for $2... " >&6; } 1717 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :1816 if eval \${$3+:} false; then : 1718 1817 $as_echo_n "(cached) " >&6 1719 1818 else … … 1770 1869 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 1771 1870 $as_echo "$ac_res" >&6; } 1772 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}1871 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1773 1872 1774 1873 } # ac_fn_c_check_func 1874 1875 # ac_fn_cxx_try_cpp LINENO 1876 # ------------------------ 1877 # Try to preprocess conftest.$ac_ext, and return whether this succeeded. 1878 ac_fn_cxx_try_cpp () 1879 { 1880 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1881 if { { ac_try="$ac_cpp conftest.$ac_ext" 1882 case "(($ac_try" in 1883 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 1884 *) ac_try_echo=$ac_try;; 1885 esac 1886 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 1887 $as_echo "$ac_try_echo"; } >&5 1888 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err 1889 ac_status=$? 1890 if test -s conftest.err; then 1891 grep -v '^ *+' conftest.err >conftest.er1 1892 cat conftest.er1 >&5 1893 mv -f conftest.er1 conftest.err 1894 fi 1895 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1896 test $ac_status = 0; } > conftest.i && { 1897 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || 1898 test ! -s conftest.err 1899 }; then : 1900 ac_retval=0 1901 else 1902 $as_echo "$as_me: failed program was:" >&5 1903 sed 's/^/| /' conftest.$ac_ext >&5 1904 1905 ac_retval=1 1906 fi 1907 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1908 as_fn_set_status $ac_retval 1909 1910 } # ac_fn_cxx_try_cpp 1911 1912 # ac_fn_cxx_try_link LINENO 1913 # ------------------------- 1914 # Try to link conftest.$ac_ext, and return whether this succeeded. 1915 ac_fn_cxx_try_link () 1916 { 1917 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1918 rm -f conftest.$ac_objext conftest$ac_exeext 1919 if { { ac_try="$ac_link" 1920 case "(($ac_try" in 1921 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 1922 *) ac_try_echo=$ac_try;; 1923 esac 1924 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 1925 $as_echo "$ac_try_echo"; } >&5 1926 (eval "$ac_link") 2>conftest.err 1927 ac_status=$? 1928 if test -s conftest.err; then 1929 grep -v '^ *+' conftest.err >conftest.er1 1930 cat conftest.er1 >&5 1931 mv -f conftest.er1 conftest.err 1932 fi 1933 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1934 test $ac_status = 0; } && { 1935 test -z "$ac_cxx_werror_flag" || 1936 test ! -s conftest.err 1937 } && test -s conftest$ac_exeext && { 1938 test "$cross_compiling" = yes || 1939 test -x conftest$ac_exeext 1940 }; then : 1941 ac_retval=0 1942 else 1943 $as_echo "$as_me: failed program was:" >&5 1944 sed 's/^/| /' conftest.$ac_ext >&5 1945 1946 ac_retval=1 1947 fi 1948 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information 1949 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would 1950 # interfere with the next link command; also delete a directory that is 1951 # left behind by Apple's compiler. We do this before executing the actions. 1952 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 1953 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1954 as_fn_set_status $ac_retval 1955 1956 } # ac_fn_cxx_try_link 1775 1957 1776 1958 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES … … 1782 1964 { 1783 1965 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1784 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :1966 if eval \${$3+:} false; then : 1785 1967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1786 1968 $as_echo_n "checking for $2... " >&6; } 1787 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :1969 if eval \${$3+:} false; then : 1788 1970 $as_echo_n "(cached) " >&6 1789 1971 fi … … 1821 2003 ac_header_preproc=no 1822 2004 fi 1823 rm -f conftest.err conftest. $ac_ext2005 rm -f conftest.err conftest.i conftest.$ac_ext 1824 2006 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 1825 2007 $as_echo "$ac_header_preproc" >&6; } … … 1844 2026 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 1845 2027 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} 1846 ( cat <<\_ASBOX 1847 ## ------------------------------------------------- ## 2028 ( $as_echo "## ------------------------------------------------- ## 1848 2029 ## Report this to libusb-devel@lists.sourceforge.net ## 1849 ## ------------------------------------------------- ## 1850 _ASBOX 2030 ## ------------------------------------------------- ##" 1851 2031 ) | sed "s/^/$as_me: WARNING: /" >&2 1852 2032 ;; … … 1854 2034 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1855 2035 $as_echo_n "checking for $2... " >&6; } 1856 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :2036 if eval \${$3+:} false; then : 1857 2037 $as_echo_n "(cached) " >&6 1858 2038 else … … 1863 2043 $as_echo "$ac_res" >&6; } 1864 2044 fi 1865 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}2045 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1866 2046 1867 2047 } # ac_fn_c_check_header_mongrel … … 1876 2056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1877 2057 $as_echo_n "checking for $2... " >&6; } 1878 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :2058 if eval \${$3+:} false; then : 1879 2059 $as_echo_n "(cached) " >&6 1880 2060 else … … 1917 2097 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 1918 2098 $as_echo "$ac_res" >&6; } 1919 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}2099 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1920 2100 1921 2101 } # ac_fn_c_check_type 1922 2102 1923 # ac_fn_c_check_decl LINENO SYMBOL VAR 1924 # ------------------------------------ 1925 # Tests whether SYMBOL is declared, setting cache variable VAR accordingly. 2103 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES 2104 # --------------------------------------------- 2105 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR 2106 # accordingly. 1926 2107 ac_fn_c_check_decl () 1927 2108 { 1928 2109 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 1930 $as_echo_n "checking whether $2 is declared... " >&6; } 1931 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 2110 as_decl_name=`echo $2|sed 's/ *(.*//'` 2111 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` 2112 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 2113 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } 2114 if eval \${$3+:} false; then : 1932 2115 $as_echo_n "(cached) " >&6 1933 2116 else … … 1938 2121 main () 1939 2122 { 1940 #ifndef $2 1941 (void) $2; 2123 #ifndef $as_decl_name 2124 #ifdef __cplusplus 2125 (void) $as_decl_use; 2126 #else 2127 (void) $as_decl_name; 2128 #endif 1942 2129 #endif 1943 2130 … … 1956 2143 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 1957 2144 $as_echo "$ac_res" >&6; } 1958 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}2145 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1959 2146 1960 2147 } # ac_fn_c_check_decl … … 1963 2150 running configure, to aid debugging if configure makes a mistake. 1964 2151 1965 It was created by libusb $as_me 1.0. 16-rc6, which was1966 generated by GNU Autoconf 2.6 4. Invocation command line was2152 It was created by libusb $as_me 1.0.21, which was 2153 generated by GNU Autoconf 2.69. Invocation command line was 1967 2154 1968 2155 $ $0 $@ … … 2074 2261 echo 2075 2262 2076 cat <<\_ASBOX 2077 ## ---------------- ## 2263 $as_echo "## ---------------- ## 2078 2264 ## Cache variables. ## 2079 ## ---------------- ## 2080 _ASBOX 2265 ## ---------------- ##" 2081 2266 echo 2082 2267 # The following way of writing the cache mishandles newlines in values, … … 2112 2297 echo 2113 2298 2114 cat <<\_ASBOX 2115 ## ----------------- ## 2299 $as_echo "## ----------------- ## 2116 2300 ## Output variables. ## 2117 ## ----------------- ## 2118 _ASBOX 2301 ## ----------------- ##" 2119 2302 echo 2120 2303 for ac_var in $ac_subst_vars … … 2129 2312 2130 2313 if test -n "$ac_subst_files"; then 2131 cat <<\_ASBOX 2132 ## ------------------- ## 2314 $as_echo "## ------------------- ## 2133 2315 ## File substitutions. ## 2134 ## ------------------- ## 2135 _ASBOX 2316 ## ------------------- ##" 2136 2317 echo 2137 2318 for ac_var in $ac_subst_files … … 2147 2328 2148 2329 if test -s confdefs.h; then 2149 cat <<\_ASBOX 2150 ## ----------- ## 2330 $as_echo "## ----------- ## 2151 2331 ## confdefs.h. ## 2152 ## ----------- ## 2153 _ASBOX 2332 ## ----------- ##" 2154 2333 echo 2155 2334 cat confdefs.h … … 2206 2385 ac_site_file2=NONE 2207 2386 if test -n "$CONFIG_SITE"; then 2208 ac_site_file1=$CONFIG_SITE 2387 # We do not want a PATH search for config.site. 2388 case $CONFIG_SITE in #(( 2389 -*) ac_site_file1=./$CONFIG_SITE;; 2390 */*) ac_site_file1=$CONFIG_SITE;; 2391 *) ac_site_file1=./$CONFIG_SITE;; 2392 esac 2209 2393 elif test "x$prefix" != xNONE; then 2210 2394 ac_site_file1=$prefix/share/config.site … … 2217 2401 do 2218 2402 test "x$ac_site_file" = xNONE && continue 2219 if test -r "$ac_site_file"; then2403 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then 2220 2404 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 2221 2405 $as_echo "$as_me: loading site script $ac_site_file" >&6;} 2222 2406 sed 's/^/| /' "$ac_site_file" >&5 2223 . "$ac_site_file" 2407 . "$ac_site_file" \ 2408 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2409 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2410 as_fn_error $? "failed to load site script $ac_site_file 2411 See \`config.log' for more details" "$LINENO" 5; } 2224 2412 fi 2225 2413 done 2226 2414 2227 2415 if test -r "$cache_file"; then 2228 # Some versions of bash will fail to source /dev/null (special 2229 # files actually), so we avoid doing that.2230 if test -f "$cache_file"; then2416 # Some versions of bash will fail to source /dev/null (special files 2417 # actually), so we avoid doing that. DJGPP emulates it as a regular file. 2418 if test /dev/null != "$cache_file" && test -f "$cache_file"; then 2231 2419 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 2232 2420 $as_echo "$as_me: loading cache $cache_file" >&6;} … … 2297 2485 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 2298 2486 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} 2299 as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 52487 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 2300 2488 fi 2301 2489 ## -------------------- ## … … 2315 2503 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 2316 2504 # http://sourceware.org/autobook/autobook/autobook_91.html 2317 lt_current=" 2"2505 lt_current="1" 2318 2506 lt_revision="0" 2319 lt_age=" 0"2507 lt_age="1" 2320 2508 LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" 2321 2509 2322 am__api_version='1.1 1'2510 am__api_version='1.14' 2323 2511 2324 2512 ac_aux_dir= 2325 2513 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do 2326 for ac_t in install-sh install.sh shtool; do 2327 if test -f "$ac_dir/$ac_t"; then 2328 ac_aux_dir=$ac_dir 2329 ac_install_sh="$ac_aux_dir/$ac_t -c" 2330 break 2 2331 fi 2332 done 2514 if test -f "$ac_dir/install-sh"; then 2515 ac_aux_dir=$ac_dir 2516 ac_install_sh="$ac_aux_dir/install-sh -c" 2517 break 2518 elif test -f "$ac_dir/install.sh"; then 2519 ac_aux_dir=$ac_dir 2520 ac_install_sh="$ac_aux_dir/install.sh -c" 2521 break 2522 elif test -f "$ac_dir/shtool"; then 2523 ac_aux_dir=$ac_dir 2524 ac_install_sh="$ac_aux_dir/shtool install -c" 2525 break 2526 fi 2333 2527 done 2334 2528 if test -z "$ac_aux_dir"; then 2335 as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 52529 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 2336 2530 fi 2337 2531 … … 2362 2556 $as_echo_n "checking for a BSD-compatible install... " >&6; } 2363 2557 if test -z "$INSTALL"; then 2364 if test "${ac_cv_path_install+set}" = set; then :2558 if ${ac_cv_path_install+:} false; then : 2365 2559 $as_echo_n "(cached) " >&6 2366 2560 else … … 2382 2576 for ac_prog in ginstall scoinst install; do 2383 2577 for ac_exec_ext in '' $ac_executable_extensions; do 2384 if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then2578 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then 2385 2579 if test $ac_prog = install && 2386 2580 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then … … 2440 2634 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 2441 2635 $as_echo_n "checking whether build environment is sane... " >&6; } 2442 # Just in case2443 sleep 12444 echo timestamp > conftest.file2445 2636 # Reject unsafe characters in $srcdir or the absolute working directory 2446 2637 # name. Accept space and tab only in the latter. … … 2449 2640 case `pwd` in 2450 2641 *[\\\"\#\$\&\'\`$am_lf]*) 2451 as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;2642 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; 2452 2643 esac 2453 2644 case $srcdir in 2454 2645 *[\\\"\#\$\&\'\`$am_lf\ \ ]*) 2455 as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;2646 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; 2456 2647 esac 2457 2648 2458 # Do `set' in a subshell so we don't clobber the current shell's2649 # Do 'set' in a subshell so we don't clobber the current shell's 2459 2650 # arguments. Must try -L first in case configure is actually a 2460 2651 # symlink; some systems play weird games with the mod time of symlinks … … 2462 2653 # directory). 2463 2654 if ( 2464 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 2465 if test "$*" = "X"; then 2466 # -L didn't work. 2467 set X `ls -t "$srcdir/configure" conftest.file` 2468 fi 2469 rm -f conftest.file 2470 if test "$*" != "X $srcdir/configure conftest.file" \ 2471 && test "$*" != "X conftest.file $srcdir/configure"; then 2472 2473 # If neither matched, then we have a broken ls. This can happen 2474 # if, for instance, CONFIG_SHELL is bash and it inherits a 2475 # broken ls alias from the environment. This has actually 2476 # happened. Such a system could not be considered "sane". 2477 as_fn_error "ls -t appears to fail. Make sure there is not a broken 2478 alias in your environment" "$LINENO" 5 2479 fi 2480 2655 am_has_slept=no 2656 for am_try in 1 2; do 2657 echo "timestamp, slept: $am_has_slept" > conftest.file 2658 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 2659 if test "$*" = "X"; then 2660 # -L didn't work. 2661 set X `ls -t "$srcdir/configure" conftest.file` 2662 fi 2663 if test "$*" != "X $srcdir/configure conftest.file" \ 2664 && test "$*" != "X conftest.file $srcdir/configure"; then 2665 2666 # If neither matched, then we have a broken ls. This can happen 2667 # if, for instance, CONFIG_SHELL is bash and it inherits a 2668 # broken ls alias from the environment. This has actually 2669 # happened. Such a system could not be considered "sane". 2670 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken 2671 alias in your environment" "$LINENO" 5 2672 fi 2673 if test "$2" = conftest.file || test $am_try -eq 2; then 2674 break 2675 fi 2676 # Just in case. 2677 sleep 1 2678 am_has_slept=yes 2679 done 2481 2680 test "$2" = conftest.file 2482 2681 ) … … 2485 2684 : 2486 2685 else 2487 as_fn_error "newly created file is older than distributed files!2686 as_fn_error $? "newly created file is older than distributed files! 2488 2687 Check your system clock" "$LINENO" 5 2489 2688 fi 2490 2689 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 2491 2690 $as_echo "yes" >&6; } 2691 # If we didn't sleep, we still need to ensure time stamps of config.status and 2692 # generated files are strictly newer. 2693 am_sleep_pid= 2694 if grep 'slept: no' conftest.file >/dev/null 2>&1; then 2695 ( sleep 1 ) & 2696 am_sleep_pid=$! 2697 fi 2698 2699 rm -f conftest.file 2700 2492 2701 test "$program_prefix" != NONE && 2493 2702 program_transform_name="s&^&$program_prefix&;$program_transform_name" … … 2512 2721 fi 2513 2722 # Use eval to expand $SHELL 2514 if eval "$MISSING -- run true"; then2515 am_missing_run="$MISSING --run"2723 if eval "$MISSING --is-lightweight"; then 2724 am_missing_run="$MISSING " 2516 2725 else 2517 2726 am_missing_run= 2518 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&52519 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}2727 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 2728 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} 2520 2729 fi 2521 2730 … … 2529 2738 fi 2530 2739 2531 # Installed binaries are usually stripped using `strip' when the user2532 # run `make install-strip'. However `strip' might not be the right2740 # Installed binaries are usually stripped using 'strip' when the user 2741 # run "make install-strip". However 'strip' might not be the right 2533 2742 # tool to use in cross-compilation environments, therefore Automake 2534 # will honor the `STRIP' environment variable to overrule this program.2743 # will honor the 'STRIP' environment variable to overrule this program. 2535 2744 if test "$cross_compiling" != no; then 2536 2745 if test -n "$ac_tool_prefix"; then … … 2539 2748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2540 2749 $as_echo_n "checking for $ac_word... " >&6; } 2541 if test "${ac_cv_prog_STRIP+set}" = set; then :2750 if ${ac_cv_prog_STRIP+:} false; then : 2542 2751 $as_echo_n "(cached) " >&6 2543 2752 else … … 2551 2760 test -z "$as_dir" && as_dir=. 2552 2761 for ac_exec_ext in '' $ac_executable_extensions; do 2553 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then2762 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2554 2763 ac_cv_prog_STRIP="${ac_tool_prefix}strip" 2555 2764 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2579 2788 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2580 2789 $as_echo_n "checking for $ac_word... " >&6; } 2581 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :2790 if ${ac_cv_prog_ac_ct_STRIP+:} false; then : 2582 2791 $as_echo_n "(cached) " >&6 2583 2792 else … … 2591 2800 test -z "$as_dir" && as_dir=. 2592 2801 for ac_exec_ext in '' $ac_executable_extensions; do 2593 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then2802 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2594 2803 ac_cv_prog_ac_ct_STRIP="strip" 2595 2804 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2632 2841 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } 2633 2842 if test -z "$MKDIR_P"; then 2634 if test "${ac_cv_path_mkdir+set}" = set; then :2843 if ${ac_cv_path_mkdir+:} false; then : 2635 2844 $as_echo_n "(cached) " >&6 2636 2845 else … … 2642 2851 for ac_prog in mkdir gmkdir; do 2643 2852 for ac_exec_ext in '' $ac_executable_extensions; do 2644 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }|| continue2853 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue 2645 2854 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 2646 2855 'mkdir (GNU coreutils) '* | \ … … 2657 2866 fi 2658 2867 2868 test -d ./--version && rmdir ./--version 2659 2869 if test "${ac_cv_path_mkdir+set}" = set; then 2660 2870 MKDIR_P="$ac_cv_path_mkdir -p" … … 2664 2874 # break other packages using the cache if that directory is 2665 2875 # removed, or if the value is a relative name. 2666 test -d ./--version && rmdir ./--version2667 2876 MKDIR_P="$ac_install_sh -d" 2668 2877 fi … … 2670 2879 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 2671 2880 $as_echo "$MKDIR_P" >&6; } 2672 2673 mkdir_p="$MKDIR_P"2674 case $mkdir_p in2675 [\\/$]* | ?:[\\/]*) ;;2676 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;2677 esac2678 2881 2679 2882 for ac_prog in gawk mawk nawk awk … … 2683 2886 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2684 2887 $as_echo_n "checking for $ac_word... " >&6; } 2685 if test "${ac_cv_prog_AWK+set}" = set; then :2888 if ${ac_cv_prog_AWK+:} false; then : 2686 2889 $as_echo_n "(cached) " >&6 2687 2890 else … … 2695 2898 test -z "$as_dir" && as_dir=. 2696 2899 for ac_exec_ext in '' $ac_executable_extensions; do 2697 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then2900 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2698 2901 ac_cv_prog_AWK="$ac_prog" 2699 2902 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2723 2926 set x ${MAKE-make} 2724 2927 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 2725 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :2928 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : 2726 2929 $as_echo_n "(cached) " >&6 2727 2930 else … … 2731 2934 @echo '@@@%%%=$(MAKE)=@@@%%%' 2732 2935 _ACEOF 2733 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.2936 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 2734 2937 case `${MAKE-make} -f conftest.make 2>/dev/null` in 2735 2938 *@@@%%%=?*=@@@%%%*) … … 2759 2962 rmdir .tst 2>/dev/null 2760 2963 2964 # Check whether --enable-silent-rules was given. 2965 if test "${enable_silent_rules+set}" = set; then : 2966 enableval=$enable_silent_rules; 2967 fi 2968 2969 case $enable_silent_rules in # ((( 2970 yes) AM_DEFAULT_VERBOSITY=0;; 2971 no) AM_DEFAULT_VERBOSITY=1;; 2972 *) AM_DEFAULT_VERBOSITY=1;; 2973 esac 2974 am_make=${MAKE-make} 2975 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 2976 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } 2977 if ${am_cv_make_support_nested_variables+:} false; then : 2978 $as_echo_n "(cached) " >&6 2979 else 2980 if $as_echo 'TRUE=$(BAR$(V)) 2981 BAR0=false 2982 BAR1=true 2983 V=1 2984 am__doit: 2985 @$(TRUE) 2986 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then 2987 am_cv_make_support_nested_variables=yes 2988 else 2989 am_cv_make_support_nested_variables=no 2990 fi 2991 fi 2992 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 2993 $as_echo "$am_cv_make_support_nested_variables" >&6; } 2994 if test $am_cv_make_support_nested_variables = yes; then 2995 AM_V='$(V)' 2996 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 2997 else 2998 AM_V=$AM_DEFAULT_VERBOSITY 2999 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 3000 fi 3001 AM_BACKSLASH='\' 3002 2761 3003 if test "`cd $srcdir && pwd`" != "`pwd`"; then 2762 3004 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output … … 2765 3007 # test to see if srcdir already configured 2766 3008 if test -f $srcdir/config.status; then 2767 as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 53009 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 2768 3010 fi 2769 3011 fi … … 2781 3023 # Define the identity of the package. 2782 3024 PACKAGE='libusb' 2783 VERSION='1.0. 16-rc6'3025 VERSION='1.0.21' 2784 3026 2785 3027 … … 2809 3051 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} 2810 3052 3053 # For better backward compatibility. To be removed once Automake 1.9.x 3054 # dies out for good. For more background, see: 3055 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 3056 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 3057 mkdir_p='$(MKDIR_P)' 3058 2811 3059 # We need awk for the "check" target. The system "awk" is bad on 2812 3060 # some platforms. 2813 # Always define AMTAR for backward compatibility. 2814 2815 AMTAR=${AMTAR-"${am_missing_run}tar"} 2816 2817 am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' 2818 2819 2820 2821 2822 2823 2824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 2825 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } 2826 # Check whether --enable-maintainer-mode was given. 2827 if test "${enable_maintainer_mode+set}" = set; then : 2828 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval 2829 else 2830 USE_MAINTAINER_MODE=no 2831 fi 2832 2833 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 2834 $as_echo "$USE_MAINTAINER_MODE" >&6; } 2835 if test $USE_MAINTAINER_MODE = yes; then 2836 MAINTAINER_MODE_TRUE= 2837 MAINTAINER_MODE_FALSE='#' 2838 else 2839 MAINTAINER_MODE_TRUE='#' 2840 MAINTAINER_MODE_FALSE= 2841 fi 2842 2843 MAINT=$MAINTAINER_MODE_TRUE 2844 2845 3061 # Always define AMTAR for backward compatibility. Yes, it's still used 3062 # in the wild :-( We should find a proper way to deprecate it ... 3063 AMTAR='$${TAR-tar}' 3064 3065 3066 # We'll loop over all known methods to create a tar archive until one works. 3067 _am_tools='gnutar pax cpio none' 3068 3069 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' 3070 3071 3072 3073 3074 3075 3076 # POSIX will say in a future version that running "rm -f" with no argument 3077 # is OK; and we want to be able to make that assumption in our Makefile 3078 # recipes. So use an aggressive probe to check that the usage we want is 3079 # actually supported "in the wild" to an acceptable degree. 3080 # See automake bug#10828. 3081 # To make any issue more visible, cause the running configure to be aborted 3082 # by default if the 'rm' program in use doesn't match our expectations; the 3083 # user can still override this though. 3084 if rm -f && rm -fr && rm -rf; then : OK; else 3085 cat >&2 <<'END' 3086 Oops! 3087 3088 Your 'rm' program seems unable to run without file operands specified 3089 on the command line, even when the '-f' option is present. This is contrary 3090 to the behaviour of most rm programs out there, and not conforming with 3091 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 3092 3093 Please tell bug-automake@gnu.org about your system, including the value 3094 of your $PATH and any error possibly output before this message. This 3095 can help us improve future automake versions. 3096 3097 END 3098 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 3099 echo 'Configuration will proceed anyway, since you have set the' >&2 3100 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 3101 echo >&2 3102 else 3103 cat >&2 <<'END' 3104 Aborting the configuration process, to ensure you take notice of the issue. 3105 3106 You can download and install GNU coreutils to get an 'rm' implementation 3107 that behaves properly: <http://www.gnu.org/software/coreutils/>. 3108 3109 If you want to complete the configuration process using your problematic 3110 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 3111 to "yes", and re-run configure. 3112 3113 END 3114 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 3115 fi 3116 fi 2846 3117 2847 3118 … … 2854 3125 fi 2855 3126 2856 case $enable_silent_rules in 2857 yes) AM_DEFAULT_VERBOSITY=0;;2858 no)AM_DEFAULT_VERBOSITY=1;;2859 *)AM_DEFAULT_VERBOSITY=0;;3127 case $enable_silent_rules in # ((( 3128 yes) AM_DEFAULT_VERBOSITY=0;; 3129 no) AM_DEFAULT_VERBOSITY=1;; 3130 *) AM_DEFAULT_VERBOSITY=0;; 2860 3131 esac 3132 am_make=${MAKE-make} 3133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 3134 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } 3135 if ${am_cv_make_support_nested_variables+:} false; then : 3136 $as_echo_n "(cached) " >&6 3137 else 3138 if $as_echo 'TRUE=$(BAR$(V)) 3139 BAR0=false 3140 BAR1=true 3141 V=1 3142 am__doit: 3143 @$(TRUE) 3144 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then 3145 am_cv_make_support_nested_variables=yes 3146 else 3147 am_cv_make_support_nested_variables=no 3148 fi 3149 fi 3150 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 3151 $as_echo "$am_cv_make_support_nested_variables" >&6; } 3152 if test $am_cv_make_support_nested_variables = yes; then 3153 AM_V='$(V)' 3154 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 3155 else 3156 AM_V=$AM_DEFAULT_VERBOSITY 3157 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 3158 fi 2861 3159 AM_BACKSLASH='\' 2862 3160 … … 2873 3171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2874 3172 $as_echo_n "checking for $ac_word... " >&6; } 2875 if test "${ac_cv_prog_CC+set}" = set; then :3173 if ${ac_cv_prog_CC+:} false; then : 2876 3174 $as_echo_n "(cached) " >&6 2877 3175 else … … 2885 3183 test -z "$as_dir" && as_dir=. 2886 3184 for ac_exec_ext in '' $ac_executable_extensions; do 2887 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3185 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2888 3186 ac_cv_prog_CC="${ac_tool_prefix}gcc" 2889 3187 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2913 3211 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2914 3212 $as_echo_n "checking for $ac_word... " >&6; } 2915 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :3213 if ${ac_cv_prog_ac_ct_CC+:} false; then : 2916 3214 $as_echo_n "(cached) " >&6 2917 3215 else … … 2925 3223 test -z "$as_dir" && as_dir=. 2926 3224 for ac_exec_ext in '' $ac_executable_extensions; do 2927 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3225 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2928 3226 ac_cv_prog_ac_ct_CC="gcc" 2929 3227 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2966 3264 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2967 3265 $as_echo_n "checking for $ac_word... " >&6; } 2968 if test "${ac_cv_prog_CC+set}" = set; then :3266 if ${ac_cv_prog_CC+:} false; then : 2969 3267 $as_echo_n "(cached) " >&6 2970 3268 else … … 2978 3276 test -z "$as_dir" && as_dir=. 2979 3277 for ac_exec_ext in '' $ac_executable_extensions; do 2980 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3278 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2981 3279 ac_cv_prog_CC="${ac_tool_prefix}cc" 2982 3280 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3006 3304 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 3007 3305 $as_echo_n "checking for $ac_word... " >&6; } 3008 if test "${ac_cv_prog_CC+set}" = set; then :3306 if ${ac_cv_prog_CC+:} false; then : 3009 3307 $as_echo_n "(cached) " >&6 3010 3308 else … … 3019 3317 test -z "$as_dir" && as_dir=. 3020 3318 for ac_exec_ext in '' $ac_executable_extensions; do 3021 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3319 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3022 3320 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then 3023 3321 ac_prog_rejected=yes … … 3065 3363 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 3066 3364 $as_echo_n "checking for $ac_word... " >&6; } 3067 if test "${ac_cv_prog_CC+set}" = set; then :3365 if ${ac_cv_prog_CC+:} false; then : 3068 3366 $as_echo_n "(cached) " >&6 3069 3367 else … … 3077 3375 test -z "$as_dir" && as_dir=. 3078 3376 for ac_exec_ext in '' $ac_executable_extensions; do 3079 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3377 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3080 3378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog" 3081 3379 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3109 3407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 3110 3408 $as_echo_n "checking for $ac_word... " >&6; } 3111 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :3409 if ${ac_cv_prog_ac_ct_CC+:} false; then : 3112 3410 $as_echo_n "(cached) " >&6 3113 3411 else … … 3121 3419 test -z "$as_dir" && as_dir=. 3122 3420 for ac_exec_ext in '' $ac_executable_extensions; do 3123 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3421 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3124 3422 ac_cv_prog_ac_ct_CC="$ac_prog" 3125 3423 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3163 3461 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3164 3462 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3165 as_fn_error "no acceptable C compiler found in \$PATH3166 See \`config.log' for more details ." "$LINENO" 5; }3463 as_fn_error $? "no acceptable C compiler found in \$PATH 3464 See \`config.log' for more details" "$LINENO" 5; } 3167 3465 3168 3466 # Provide some information about the compiler. … … 3185 3483 10q' conftest.err >conftest.er1 3186 3484 cat conftest.er1 >&5 3187 rm -f conftest.er1 conftest.err3188 3485 fi 3486 rm -f conftest.er1 conftest.err 3189 3487 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 3190 3488 test $ac_status = 0; } … … 3193 3491 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 3194 3492 /* end confdefs.h. */ 3195 #include <stdio.h> 3493 3196 3494 int 3197 3495 main () 3198 3496 { 3199 FILE *f = fopen ("conftest.out", "w");3200 return ferror (f) || fclose (f) != 0;3201 3497 3202 3498 ; … … 3205 3501 _ACEOF 3206 3502 ac_clean_files_save=$ac_clean_files 3207 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"3503 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" 3208 3504 # Try to create an executable without -o first, disregard a.out. 3209 3505 # It will help us diagnose broken compilers, and finding out an intuition 3210 3506 # of exeext. 3211 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&53212 $as_echo_n "checking for C compiler default output file name... " >&6; }3507 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 3508 $as_echo_n "checking whether the C compiler works... " >&6; } 3213 3509 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` 3214 3510 … … 3272 3568 ac_file='' 3273 3569 fi 3570 if test -z "$ac_file"; then : 3571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 3572 $as_echo "no" >&6; } 3573 $as_echo "$as_me: failed program was:" >&5 3574 sed 's/^/| /' conftest.$ac_ext >&5 3575 3576 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3577 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3578 as_fn_error 77 "C compiler cannot create executables 3579 See \`config.log' for more details" "$LINENO" 5; } 3580 else 3581 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3582 $as_echo "yes" >&6; } 3583 fi 3584 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 3585 $as_echo_n "checking for C compiler default output file name... " >&6; } 3274 3586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 3275 3587 $as_echo "$ac_file" >&6; } 3276 if test -z "$ac_file"; then :3277 $as_echo "$as_me: failed program was:" >&53278 sed 's/^/| /' conftest.$ac_ext >&53279 3280 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&53281 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}3282 { as_fn_set_status 773283 as_fn_error "C compiler cannot create executables3284 See \`config.log' for more details." "$LINENO" 5; }; }3285 fi3286 3588 ac_exeext=$ac_cv_exeext 3287 3589 3288 # Check that the compiler produces executables we can run. If not, either 3289 # the compiler is broken, or we cross compile. 3290 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 3291 $as_echo_n "checking whether the C compiler works... " >&6; } 3292 # If not cross compiling, check that we can run a simple program. 3293 if test "$cross_compiling" != yes; then 3294 if { ac_try='./$ac_file' 3295 { { case "(($ac_try" in 3296 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 3297 *) ac_try_echo=$ac_try;; 3298 esac 3299 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 3300 $as_echo "$ac_try_echo"; } >&5 3301 (eval "$ac_try") 2>&5 3302 ac_status=$? 3303 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 3304 test $ac_status = 0; }; }; then 3305 cross_compiling=no 3306 else 3307 if test "$cross_compiling" = maybe; then 3308 cross_compiling=yes 3309 else 3310 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3311 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3312 as_fn_error "cannot run C compiled programs. 3313 If you meant to cross compile, use \`--host'. 3314 See \`config.log' for more details." "$LINENO" 5; } 3315 fi 3316 fi 3317 fi 3318 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3319 $as_echo "yes" >&6; } 3320 3321 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out 3590 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out 3322 3591 ac_clean_files=$ac_clean_files_save 3323 # Check that the compiler produces executables we can run. If not, either3324 # the compiler is broken, or we cross compile.3325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&53326 $as_echo_n "checking whether we are cross compiling... " >&6; }3327 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&53328 $as_echo "$cross_compiling" >&6; }3329 3330 3592 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 3331 3593 $as_echo_n "checking for suffix of executables... " >&6; } … … 3357 3619 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3358 3620 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3359 as_fn_error "cannot compute suffix of executables: cannot compile and link3360 See \`config.log' for more details ." "$LINENO" 5; }3361 fi 3362 rm -f conftest $ac_cv_exeext3621 as_fn_error $? "cannot compute suffix of executables: cannot compile and link 3622 See \`config.log' for more details" "$LINENO" 5; } 3623 fi 3624 rm -f conftest conftest$ac_cv_exeext 3363 3625 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 3364 3626 $as_echo "$ac_cv_exeext" >&6; } … … 3367 3629 EXEEXT=$ac_cv_exeext 3368 3630 ac_exeext=$EXEEXT 3631 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 3632 /* end confdefs.h. */ 3633 #include <stdio.h> 3634 int 3635 main () 3636 { 3637 FILE *f = fopen ("conftest.out", "w"); 3638 return ferror (f) || fclose (f) != 0; 3639 3640 ; 3641 return 0; 3642 } 3643 _ACEOF 3644 ac_clean_files="$ac_clean_files conftest.out" 3645 # Check that the compiler produces executables we can run. If not, either 3646 # the compiler is broken, or we cross compile. 3647 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 3648 $as_echo_n "checking whether we are cross compiling... " >&6; } 3649 if test "$cross_compiling" != yes; then 3650 { { ac_try="$ac_link" 3651 case "(($ac_try" in 3652 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 3653 *) ac_try_echo=$ac_try;; 3654 esac 3655 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 3656 $as_echo "$ac_try_echo"; } >&5 3657 (eval "$ac_link") 2>&5 3658 ac_status=$? 3659 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 3660 test $ac_status = 0; } 3661 if { ac_try='./conftest$ac_cv_exeext' 3662 { { case "(($ac_try" in 3663 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 3664 *) ac_try_echo=$ac_try;; 3665 esac 3666 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 3667 $as_echo "$ac_try_echo"; } >&5 3668 (eval "$ac_try") 2>&5 3669 ac_status=$? 3670 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 3671 test $ac_status = 0; }; }; then 3672 cross_compiling=no 3673 else 3674 if test "$cross_compiling" = maybe; then 3675 cross_compiling=yes 3676 else 3677 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3678 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3679 as_fn_error $? "cannot run C compiled programs. 3680 If you meant to cross compile, use \`--host'. 3681 See \`config.log' for more details" "$LINENO" 5; } 3682 fi 3683 fi 3684 fi 3685 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 3686 $as_echo "$cross_compiling" >&6; } 3687 3688 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out 3689 ac_clean_files=$ac_clean_files_save 3369 3690 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 3370 3691 $as_echo_n "checking for suffix of object files... " >&6; } 3371 if test "${ac_cv_objext+set}" = set; then :3692 if ${ac_cv_objext+:} false; then : 3372 3693 $as_echo_n "(cached) " >&6 3373 3694 else … … 3409 3730 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3410 3731 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3411 as_fn_error "cannot compute suffix of object files: cannot compile3412 See \`config.log' for more details ." "$LINENO" 5; }3732 as_fn_error $? "cannot compute suffix of object files: cannot compile 3733 See \`config.log' for more details" "$LINENO" 5; } 3413 3734 fi 3414 3735 rm -f conftest.$ac_cv_objext conftest.$ac_ext … … 3420 3741 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 3421 3742 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } 3422 if test "${ac_cv_c_compiler_gnu+set}" = set; then :3743 if ${ac_cv_c_compiler_gnu+:} false; then : 3423 3744 $as_echo_n "(cached) " >&6 3424 3745 else … … 3457 3778 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 3458 3779 $as_echo_n "checking whether $CC accepts -g... " >&6; } 3459 if test "${ac_cv_prog_cc_g+set}" = set; then :3780 if ${ac_cv_prog_cc_g+:} false; then : 3460 3781 $as_echo_n "(cached) " >&6 3461 3782 else … … 3535 3856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 3536 3857 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } 3537 if test "${ac_cv_prog_cc_c89+set}" = set; then :3858 if ${ac_cv_prog_cc_c89+:} false; then : 3538 3859 $as_echo_n "(cached) " >&6 3539 3860 else … … 3544 3865 #include <stdarg.h> 3545 3866 #include <stdio.h> 3546 #include <sys/types.h> 3547 #include <sys/stat.h> 3867 struct stat; 3548 3868 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ 3549 3869 struct buf { int x; }; … … 3629 3949 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 3630 3950 ac_compiler_gnu=$ac_cv_c_compiler_gnu 3951 3952 ac_ext=c 3953 ac_cpp='$CPP $CPPFLAGS' 3954 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 3955 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 3956 ac_compiler_gnu=$ac_cv_c_compiler_gnu 3957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 3958 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } 3959 if ${am_cv_prog_cc_c_o+:} false; then : 3960 $as_echo_n "(cached) " >&6 3961 else 3962 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 3963 /* end confdefs.h. */ 3964 3965 int 3966 main () 3967 { 3968 3969 ; 3970 return 0; 3971 } 3972 _ACEOF 3973 # Make sure it works both with $CC and with simple cc. 3974 # Following AC_PROG_CC_C_O, we do the test twice because some 3975 # compilers refuse to overwrite an existing .o file with -o, 3976 # though they will create one. 3977 am_cv_prog_cc_c_o=yes 3978 for am_i in 1 2; do 3979 if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 3980 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 3981 ac_status=$? 3982 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3983 (exit $ac_status); } \ 3984 && test -f conftest2.$ac_objext; then 3985 : OK 3986 else 3987 am_cv_prog_cc_c_o=no 3988 break 3989 fi 3990 done 3991 rm -f core conftest* 3992 unset am_i 3993 fi 3994 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 3995 $as_echo "$am_cv_prog_cc_c_o" >&6; } 3996 if test "$am_cv_prog_cc_c_o" != yes; then 3997 # Losing compiler, so override with the script. 3998 # FIXME: It is wrong to rewrite CC. 3999 # But if we don't then we get into trouble of one sort or another. 4000 # A longer-term fix would be to have automake use am__CC in this case, 4001 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 4002 CC="$am_aux_dir/compile $CC" 4003 fi 4004 ac_ext=c 4005 ac_cpp='$CPP $CPPFLAGS' 4006 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 4007 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 4008 ac_compiler_gnu=$ac_cv_c_compiler_gnu 4009 3631 4010 DEPDIR="${am__leading_dot}deps" 3632 4011 … … 3648 4027 # First try GNU make style include. 3649 4028 echo "include confinc" > confmf 3650 # Ignore all kinds of additional output from `make'.4029 # Ignore all kinds of additional output from 'make'. 3651 4030 case `$am_make -s -f confmf 2> /dev/null` in #( 3652 4031 *the\ am__doit\ target*) … … 3681 4060 am_depcomp="$ac_aux_dir/depcomp" 3682 4061 AMDEPBACKSLASH='\' 4062 am__nodep='_no' 3683 4063 fi 3684 4064 if test "x$enable_dependency_tracking" != xno; then … … 3696 4076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 3697 4077 $as_echo_n "checking dependency style of $depcc... " >&6; } 3698 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :4078 if ${am_cv_CC_dependencies_compiler_type+:} false; then : 3699 4079 $as_echo_n "(cached) " >&6 3700 4080 else … … 3703 4083 # making bogus files that we don't know about and never remove. For 3704 4084 # instance it was reported that on HP-UX the gcc test will end up 3705 # making a dummy file named `D' -- because `-MD' means `put the output 3706 # in D'. 4085 # making a dummy file named 'D' -- because '-MD' means "put the output 4086 # in D". 4087 rm -rf conftest.dir 3707 4088 mkdir conftest.dir 3708 4089 # Copy depcomp to subdir because otherwise we won't find it if we're … … 3738 4119 for i in 1 2 3 4 5 6; do 3739 4120 echo '#include "conftst'$i'.h"' >> sub/conftest.c 3740 # Using `: > sub/conftst$i.h'creates only sub/conftst1.h with3741 # Solaris 8's {/usr,}/bin/sh.3742 touchsub/conftst$i.h4121 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 4122 # Solaris 10 /bin/sh. 4123 echo '/* dummy */' > sub/conftst$i.h 3743 4124 done 3744 4125 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 3745 4126 3746 # We check with `-c' and `-o' for the sake of the "dashmstdout"4127 # We check with '-c' and '-o' for the sake of the "dashmstdout" 3747 4128 # mode. It turns out that the SunPro C++ compiler does not properly 3748 # handle `-M -o', and we need to detect this. Also, some Intel3749 # versions had trouble with output in subdirs 4129 # handle '-M -o', and we need to detect this. Also, some Intel 4130 # versions had trouble with output in subdirs. 3750 4131 am__obj=sub/conftest.${OBJEXT-o} 3751 4132 am__minus_obj="-o $am__obj" … … 3756 4137 ;; 3757 4138 nosideeffect) 3758 # after this tag, mechanisms are not by side-effect, so they'll3759 # only be used when explicitly requested 4139 # After this tag, mechanisms are not by side-effect, so they'll 4140 # only be used when explicitly requested. 3760 4141 if test "x$enable_dependency_tracking" = xyes; then 3761 4142 continue … … 3764 4145 fi 3765 4146 ;; 3766 msv isualcpp | msvcmsys)3767 # This compiler won't grok `-c -o', but also, the minuso test has4147 msvc7 | msvc7msys | msvisualcpp | msvcmsys) 4148 # This compiler won't grok '-c -o', but also, the minuso test has 3768 4149 # not run yet. These depmodes are late enough in the game, and 3769 4150 # so weak that their functioning should not be impacted. … … 3819 4200 3820 4201 4202 ac_ext=cpp 4203 ac_cpp='$CXXCPP $CPPFLAGS' 4204 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 4205 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 4206 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 4207 if test -z "$CXX"; then 4208 if test -n "$CCC"; then 4209 CXX=$CCC 4210 else 4211 if test -n "$ac_tool_prefix"; then 4212 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 4213 do 4214 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. 4215 set dummy $ac_tool_prefix$ac_prog; ac_word=$2 4216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4217 $as_echo_n "checking for $ac_word... " >&6; } 4218 if ${ac_cv_prog_CXX+:} false; then : 4219 $as_echo_n "(cached) " >&6 4220 else 4221 if test -n "$CXX"; then 4222 ac_cv_prog_CXX="$CXX" # Let the user override the test. 4223 else 4224 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 4225 for as_dir in $PATH 4226 do 4227 IFS=$as_save_IFS 4228 test -z "$as_dir" && as_dir=. 4229 for ac_exec_ext in '' $ac_executable_extensions; do 4230 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4231 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" 4232 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 4233 break 2 4234 fi 4235 done 4236 done 4237 IFS=$as_save_IFS 4238 4239 fi 4240 fi 4241 CXX=$ac_cv_prog_CXX 4242 if test -n "$CXX"; then 4243 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 4244 $as_echo "$CXX" >&6; } 4245 else 4246 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 4247 $as_echo "no" >&6; } 4248 fi 4249 4250 4251 test -n "$CXX" && break 4252 done 4253 fi 4254 if test -z "$CXX"; then 4255 ac_ct_CXX=$CXX 4256 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 4257 do 4258 # Extract the first word of "$ac_prog", so it can be a program name with args. 4259 set dummy $ac_prog; ac_word=$2 4260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4261 $as_echo_n "checking for $ac_word... " >&6; } 4262 if ${ac_cv_prog_ac_ct_CXX+:} false; then : 4263 $as_echo_n "(cached) " >&6 4264 else 4265 if test -n "$ac_ct_CXX"; then 4266 ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. 4267 else 4268 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 4269 for as_dir in $PATH 4270 do 4271 IFS=$as_save_IFS 4272 test -z "$as_dir" && as_dir=. 4273 for ac_exec_ext in '' $ac_executable_extensions; do 4274 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4275 ac_cv_prog_ac_ct_CXX="$ac_prog" 4276 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 4277 break 2 4278 fi 4279 done 4280 done 4281 IFS=$as_save_IFS 4282 4283 fi 4284 fi 4285 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX 4286 if test -n "$ac_ct_CXX"; then 4287 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 4288 $as_echo "$ac_ct_CXX" >&6; } 4289 else 4290 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 4291 $as_echo "no" >&6; } 4292 fi 4293 4294 4295 test -n "$ac_ct_CXX" && break 4296 done 4297 4298 if test "x$ac_ct_CXX" = x; then 4299 CXX="g++" 4300 else 4301 case $cross_compiling:$ac_tool_warned in 4302 yes:) 4303 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 4304 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} 4305 ac_tool_warned=yes ;; 4306 esac 4307 CXX=$ac_ct_CXX 4308 fi 4309 fi 4310 4311 fi 4312 fi 4313 # Provide some information about the compiler. 4314 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 4315 set X $ac_compile 4316 ac_compiler=$2 4317 for ac_option in --version -v -V -qversion; do 4318 { { ac_try="$ac_compiler $ac_option >&5" 4319 case "(($ac_try" in 4320 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 4321 *) ac_try_echo=$ac_try;; 4322 esac 4323 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 4324 $as_echo "$ac_try_echo"; } >&5 4325 (eval "$ac_compiler $ac_option >&5") 2>conftest.err 4326 ac_status=$? 4327 if test -s conftest.err; then 4328 sed '10a\ 4329 ... rest of stderr output deleted ... 4330 10q' conftest.err >conftest.er1 4331 cat conftest.er1 >&5 4332 fi 4333 rm -f conftest.er1 conftest.err 4334 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 4335 test $ac_status = 0; } 4336 done 4337 4338 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 4339 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } 4340 if ${ac_cv_cxx_compiler_gnu+:} false; then : 4341 $as_echo_n "(cached) " >&6 4342 else 4343 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 4344 /* end confdefs.h. */ 4345 4346 int 4347 main () 4348 { 4349 #ifndef __GNUC__ 4350 choke me 4351 #endif 4352 4353 ; 4354 return 0; 4355 } 4356 _ACEOF 4357 if ac_fn_cxx_try_compile "$LINENO"; then : 4358 ac_compiler_gnu=yes 4359 else 4360 ac_compiler_gnu=no 4361 fi 4362 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 4363 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu 4364 4365 fi 4366 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 4367 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } 4368 if test $ac_compiler_gnu = yes; then 4369 GXX=yes 4370 else 4371 GXX= 4372 fi 4373 ac_test_CXXFLAGS=${CXXFLAGS+set} 4374 ac_save_CXXFLAGS=$CXXFLAGS 4375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 4376 $as_echo_n "checking whether $CXX accepts -g... " >&6; } 4377 if ${ac_cv_prog_cxx_g+:} false; then : 4378 $as_echo_n "(cached) " >&6 4379 else 4380 ac_save_cxx_werror_flag=$ac_cxx_werror_flag 4381 ac_cxx_werror_flag=yes 4382 ac_cv_prog_cxx_g=no 4383 CXXFLAGS="-g" 4384 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 4385 /* end confdefs.h. */ 4386 4387 int 4388 main () 4389 { 4390 4391 ; 4392 return 0; 4393 } 4394 _ACEOF 4395 if ac_fn_cxx_try_compile "$LINENO"; then : 4396 ac_cv_prog_cxx_g=yes 4397 else 4398 CXXFLAGS="" 4399 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 4400 /* end confdefs.h. */ 4401 4402 int 4403 main () 4404 { 4405 4406 ; 4407 return 0; 4408 } 4409 _ACEOF 4410 if ac_fn_cxx_try_compile "$LINENO"; then : 4411 4412 else 4413 ac_cxx_werror_flag=$ac_save_cxx_werror_flag 4414 CXXFLAGS="-g" 4415 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 4416 /* end confdefs.h. */ 4417 4418 int 4419 main () 4420 { 4421 4422 ; 4423 return 0; 4424 } 4425 _ACEOF 4426 if ac_fn_cxx_try_compile "$LINENO"; then : 4427 ac_cv_prog_cxx_g=yes 4428 fi 4429 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 4430 fi 4431 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 4432 fi 4433 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 4434 ac_cxx_werror_flag=$ac_save_cxx_werror_flag 4435 fi 4436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 4437 $as_echo "$ac_cv_prog_cxx_g" >&6; } 4438 if test "$ac_test_CXXFLAGS" = set; then 4439 CXXFLAGS=$ac_save_CXXFLAGS 4440 elif test $ac_cv_prog_cxx_g = yes; then 4441 if test "$GXX" = yes; then 4442 CXXFLAGS="-g -O2" 4443 else 4444 CXXFLAGS="-g" 4445 fi 4446 else 4447 if test "$GXX" = yes; then 4448 CXXFLAGS="-O2" 4449 else 4450 CXXFLAGS= 4451 fi 4452 fi 4453 ac_ext=c 4454 ac_cpp='$CPP $CPPFLAGS' 4455 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 4456 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 4457 ac_compiler_gnu=$ac_cv_c_compiler_gnu 4458 4459 depcc="$CXX" am_compiler_list= 4460 4461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 4462 $as_echo_n "checking dependency style of $depcc... " >&6; } 4463 if ${am_cv_CXX_dependencies_compiler_type+:} false; then : 4464 $as_echo_n "(cached) " >&6 4465 else 4466 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 4467 # We make a subdir and do the tests there. Otherwise we can end up 4468 # making bogus files that we don't know about and never remove. For 4469 # instance it was reported that on HP-UX the gcc test will end up 4470 # making a dummy file named 'D' -- because '-MD' means "put the output 4471 # in D". 4472 rm -rf conftest.dir 4473 mkdir conftest.dir 4474 # Copy depcomp to subdir because otherwise we won't find it if we're 4475 # using a relative directory. 4476 cp "$am_depcomp" conftest.dir 4477 cd conftest.dir 4478 # We will build objects and dependencies in a subdirectory because 4479 # it helps to detect inapplicable dependency modes. For instance 4480 # both Tru64's cc and ICC support -MD to output dependencies as a 4481 # side effect of compilation, but ICC will put the dependencies in 4482 # the current directory while Tru64 will put them in the object 4483 # directory. 4484 mkdir sub 4485 4486 am_cv_CXX_dependencies_compiler_type=none 4487 if test "$am_compiler_list" = ""; then 4488 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` 4489 fi 4490 am__universal=false 4491 case " $depcc " in #( 4492 *\ -arch\ *\ -arch\ *) am__universal=true ;; 4493 esac 4494 4495 for depmode in $am_compiler_list; do 4496 # Setup a source with many dependencies, because some compilers 4497 # like to wrap large dependency lists on column 80 (with \), and 4498 # we should not choose a depcomp mode which is confused by this. 4499 # 4500 # We need to recreate these files for each test, as the compiler may 4501 # overwrite some of them when testing with obscure command lines. 4502 # This happens at least with the AIX C compiler. 4503 : > sub/conftest.c 4504 for i in 1 2 3 4 5 6; do 4505 echo '#include "conftst'$i'.h"' >> sub/conftest.c 4506 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 4507 # Solaris 10 /bin/sh. 4508 echo '/* dummy */' > sub/conftst$i.h 4509 done 4510 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 4511 4512 # We check with '-c' and '-o' for the sake of the "dashmstdout" 4513 # mode. It turns out that the SunPro C++ compiler does not properly 4514 # handle '-M -o', and we need to detect this. Also, some Intel 4515 # versions had trouble with output in subdirs. 4516 am__obj=sub/conftest.${OBJEXT-o} 4517 am__minus_obj="-o $am__obj" 4518 case $depmode in 4519 gcc) 4520 # This depmode causes a compiler race in universal mode. 4521 test "$am__universal" = false || continue 4522 ;; 4523 nosideeffect) 4524 # After this tag, mechanisms are not by side-effect, so they'll 4525 # only be used when explicitly requested. 4526 if test "x$enable_dependency_tracking" = xyes; then 4527 continue 4528 else 4529 break 4530 fi 4531 ;; 4532 msvc7 | msvc7msys | msvisualcpp | msvcmsys) 4533 # This compiler won't grok '-c -o', but also, the minuso test has 4534 # not run yet. These depmodes are late enough in the game, and 4535 # so weak that their functioning should not be impacted. 4536 am__obj=conftest.${OBJEXT-o} 4537 am__minus_obj= 4538 ;; 4539 none) break ;; 4540 esac 4541 if depmode=$depmode \ 4542 source=sub/conftest.c object=$am__obj \ 4543 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 4544 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 4545 >/dev/null 2>conftest.err && 4546 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 4547 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 4548 grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 4549 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 4550 # icc doesn't choke on unknown options, it will just issue warnings 4551 # or remarks (even with -Werror). So we grep stderr for any message 4552 # that says an option was ignored or not supported. 4553 # When given -MP, icc 7.0 and 7.1 complain thusly: 4554 # icc: Command line warning: ignoring option '-M'; no argument required 4555 # The diagnosis changed in icc 8.0: 4556 # icc: Command line remark: option '-MP' not supported 4557 if (grep 'ignoring option' conftest.err || 4558 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 4559 am_cv_CXX_dependencies_compiler_type=$depmode 4560 break 4561 fi 4562 fi 4563 done 4564 4565 cd .. 4566 rm -rf conftest.dir 4567 else 4568 am_cv_CXX_dependencies_compiler_type=none 4569 fi 4570 4571 fi 4572 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 4573 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } 4574 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type 4575 4576 if 4577 test "x$enable_dependency_tracking" != xno \ 4578 && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then 4579 am__fastdepCXX_TRUE= 4580 am__fastdepCXX_FALSE='#' 4581 else 4582 am__fastdepCXX_TRUE='#' 4583 am__fastdepCXX_FALSE= 4584 fi 4585 4586 3821 4587 case `pwd` in 3822 4588 *\ * | *\ *) … … 3846 4612 # Make sure we can run config.sub. 3847 4613 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || 3848 as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 54614 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 3849 4615 3850 4616 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 3851 4617 $as_echo_n "checking build system type... " >&6; } 3852 if test "${ac_cv_build+set}" = set; then :4618 if ${ac_cv_build+:} false; then : 3853 4619 $as_echo_n "(cached) " >&6 3854 4620 else … … 3857 4623 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` 3858 4624 test "x$ac_build_alias" = x && 3859 as_fn_error "cannot guess build type; you must specify one" "$LINENO" 54625 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 3860 4626 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || 3861 as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 54627 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 3862 4628 3863 4629 fi … … 3866 4632 case $ac_cv_build in 3867 4633 *-*-*) ;; 3868 *) as_fn_error "invalid value of canonical build" "$LINENO" 5;;4634 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 3869 4635 esac 3870 4636 build=$ac_cv_build … … 3884 4650 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 3885 4651 $as_echo_n "checking host system type... " >&6; } 3886 if test "${ac_cv_host+set}" = set; then :4652 if ${ac_cv_host+:} false; then : 3887 4653 $as_echo_n "(cached) " >&6 3888 4654 else … … 3891 4657 else 3892 4658 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 3893 as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 54659 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 3894 4660 fi 3895 4661 … … 3899 4665 case $ac_cv_host in 3900 4666 *-*-*) ;; 3901 *) as_fn_error "invalid value of canonical host" "$LINENO" 5;;4667 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 3902 4668 esac 3903 4669 host=$ac_cv_host … … 3986 4752 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 3987 4753 $as_echo_n "checking for a sed that does not truncate output... " >&6; } 3988 if test "${ac_cv_path_SED+set}" = set; then :4754 if ${ac_cv_path_SED+:} false; then : 3989 4755 $as_echo_n "(cached) " >&6 3990 4756 else … … 4006 4772 for ac_exec_ext in '' $ac_executable_extensions; do 4007 4773 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" 4008 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; }|| continue4774 as_fn_executable_p "$ac_path_SED" || continue 4009 4775 # Check for GNU ac_path_SED and select it if it is found. 4010 4776 # Check for GNU $ac_path_SED … … 4041 4807 IFS=$as_save_IFS 4042 4808 if test -z "$ac_cv_path_SED"; then 4043 as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 54809 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 4044 4810 fi 4045 4811 else … … 4068 4834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 4069 4835 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } 4070 if test "${ac_cv_path_GREP+set}" = set; then :4836 if ${ac_cv_path_GREP+:} false; then : 4071 4837 $as_echo_n "(cached) " >&6 4072 4838 else … … 4082 4848 for ac_exec_ext in '' $ac_executable_extensions; do 4083 4849 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" 4084 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; }|| continue4850 as_fn_executable_p "$ac_path_GREP" || continue 4085 4851 # Check for GNU ac_path_GREP and select it if it is found. 4086 4852 # Check for GNU $ac_path_GREP … … 4117 4883 IFS=$as_save_IFS 4118 4884 if test -z "$ac_cv_path_GREP"; then 4119 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 54885 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 4120 4886 fi 4121 4887 else … … 4131 4897 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 4132 4898 $as_echo_n "checking for egrep... " >&6; } 4133 if test "${ac_cv_path_EGREP+set}" = set; then :4899 if ${ac_cv_path_EGREP+:} false; then : 4134 4900 $as_echo_n "(cached) " >&6 4135 4901 else … … 4148 4914 for ac_exec_ext in '' $ac_executable_extensions; do 4149 4915 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" 4150 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; }|| continue4916 as_fn_executable_p "$ac_path_EGREP" || continue 4151 4917 # Check for GNU ac_path_EGREP and select it if it is found. 4152 4918 # Check for GNU $ac_path_EGREP … … 4183 4949 IFS=$as_save_IFS 4184 4950 if test -z "$ac_cv_path_EGREP"; then 4185 as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 54951 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 4186 4952 fi 4187 4953 else … … 4198 4964 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 4199 4965 $as_echo_n "checking for fgrep... " >&6; } 4200 if test "${ac_cv_path_FGREP+set}" = set; then :4966 if ${ac_cv_path_FGREP+:} false; then : 4201 4967 $as_echo_n "(cached) " >&6 4202 4968 else … … 4215 4981 for ac_exec_ext in '' $ac_executable_extensions; do 4216 4982 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" 4217 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; }|| continue4983 as_fn_executable_p "$ac_path_FGREP" || continue 4218 4984 # Check for GNU ac_path_FGREP and select it if it is found. 4219 4985 # Check for GNU $ac_path_FGREP … … 4250 5016 IFS=$as_save_IFS 4251 5017 if test -z "$ac_cv_path_FGREP"; then 4252 as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 55018 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 4253 5019 fi 4254 5020 else … … 4329 5095 $as_echo_n "checking for non-GNU ld... " >&6; } 4330 5096 fi 4331 if test "${lt_cv_path_LD+set}" = set; then :5097 if ${lt_cv_path_LD+:} false; then : 4332 5098 $as_echo_n "(cached) " >&6 4333 5099 else … … 4366 5132 $as_echo "no" >&6; } 4367 5133 fi 4368 test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 55134 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 4369 5135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 4370 5136 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } 4371 if test "${lt_cv_prog_gnu_ld+set}" = set; then :5137 if ${lt_cv_prog_gnu_ld+:} false; then : 4372 5138 $as_echo_n "(cached) " >&6 4373 5139 else … … 4396 5162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 4397 5163 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } 4398 if test "${lt_cv_path_NM+set}" = set; then :5164 if ${lt_cv_path_NM+:} false; then : 4399 5165 $as_echo_n "(cached) " >&6 4400 5166 else … … 4459 5225 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4460 5226 $as_echo_n "checking for $ac_word... " >&6; } 4461 if test "${ac_cv_prog_DUMPBIN+set}" = set; then :5227 if ${ac_cv_prog_DUMPBIN+:} false; then : 4462 5228 $as_echo_n "(cached) " >&6 4463 5229 else … … 4471 5237 test -z "$as_dir" && as_dir=. 4472 5238 for ac_exec_ext in '' $ac_executable_extensions; do 4473 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then5239 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4474 5240 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" 4475 5241 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4503 5269 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4504 5270 $as_echo_n "checking for $ac_word... " >&6; } 4505 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :5271 if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : 4506 5272 $as_echo_n "(cached) " >&6 4507 5273 else … … 4515 5281 test -z "$as_dir" && as_dir=. 4516 5282 for ac_exec_ext in '' $ac_executable_extensions; do 4517 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then5283 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4518 5284 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" 4519 5285 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4575 5341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 4576 5342 $as_echo_n "checking the name lister ($NM) interface... " >&6; } 4577 if test "${lt_cv_nm_interface+set}" = set; then :5343 if ${lt_cv_nm_interface+:} false; then : 4578 5344 $as_echo_n "(cached) " >&6 4579 5345 else … … 4610 5376 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 4611 5377 $as_echo_n "checking the maximum length of command line arguments... " >&6; } 4612 if test "${lt_cv_sys_max_cmd_len+set}" = set; then :5378 if ${lt_cv_sys_max_cmd_len+:} false; then : 4613 5379 $as_echo_n "(cached) " >&6 4614 5380 else … … 4812 5578 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 4813 5579 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } 4814 if test "${lt_cv_to_host_file_cmd+set}" = set; then :5580 if ${lt_cv_to_host_file_cmd+:} false; then : 4815 5581 $as_echo_n "(cached) " >&6 4816 5582 else … … 4859 5625 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 4860 5626 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } 4861 if test "${lt_cv_to_tool_file_cmd+set}" = set; then :5627 if ${lt_cv_to_tool_file_cmd+:} false; then : 4862 5628 $as_echo_n "(cached) " >&6 4863 5629 else … … 4886 5652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 4887 5653 $as_echo_n "checking for $LD option to reload object files... " >&6; } 4888 if test "${lt_cv_ld_reload_flag+set}" = set; then :5654 if ${lt_cv_ld_reload_flag+:} false; then : 4889 5655 $as_echo_n "(cached) " >&6 4890 5656 else … … 4927 5693 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4928 5694 $as_echo_n "checking for $ac_word... " >&6; } 4929 if test "${ac_cv_prog_OBJDUMP+set}" = set; then :5695 if ${ac_cv_prog_OBJDUMP+:} false; then : 4930 5696 $as_echo_n "(cached) " >&6 4931 5697 else … … 4939 5705 test -z "$as_dir" && as_dir=. 4940 5706 for ac_exec_ext in '' $ac_executable_extensions; do 4941 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then5707 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4942 5708 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" 4943 5709 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4967 5733 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 4968 5734 $as_echo_n "checking for $ac_word... " >&6; } 4969 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :5735 if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : 4970 5736 $as_echo_n "(cached) " >&6 4971 5737 else … … 4979 5745 test -z "$as_dir" && as_dir=. 4980 5746 for ac_exec_ext in '' $ac_executable_extensions; do 4981 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then5747 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4982 5748 ac_cv_prog_ac_ct_OBJDUMP="objdump" 4983 5749 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5026 5792 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 5027 5793 $as_echo_n "checking how to recognize dependent libraries... " >&6; } 5028 if test "${lt_cv_deplibs_check_method+set}" = set; then :5794 if ${lt_cv_deplibs_check_method+:} false; then : 5029 5795 $as_echo_n "(cached) " >&6 5030 5796 else … … 5273 6039 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5274 6040 $as_echo_n "checking for $ac_word... " >&6; } 5275 if test "${ac_cv_prog_DLLTOOL+set}" = set; then :6041 if ${ac_cv_prog_DLLTOOL+:} false; then : 5276 6042 $as_echo_n "(cached) " >&6 5277 6043 else … … 5285 6051 test -z "$as_dir" && as_dir=. 5286 6052 for ac_exec_ext in '' $ac_executable_extensions; do 5287 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6053 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5288 6054 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" 5289 6055 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5313 6079 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5314 6080 $as_echo_n "checking for $ac_word... " >&6; } 5315 if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :6081 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : 5316 6082 $as_echo_n "(cached) " >&6 5317 6083 else … … 5325 6091 test -z "$as_dir" && as_dir=. 5326 6092 for ac_exec_ext in '' $ac_executable_extensions; do 5327 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6093 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5328 6094 ac_cv_prog_ac_ct_DLLTOOL="dlltool" 5329 6095 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5373 6139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 5374 6140 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } 5375 if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :6141 if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : 5376 6142 $as_echo_n "(cached) " >&6 5377 6143 else … … 5417 6183 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5418 6184 $as_echo_n "checking for $ac_word... " >&6; } 5419 if test "${ac_cv_prog_AR+set}" = set; then :6185 if ${ac_cv_prog_AR+:} false; then : 5420 6186 $as_echo_n "(cached) " >&6 5421 6187 else … … 5429 6195 test -z "$as_dir" && as_dir=. 5430 6196 for ac_exec_ext in '' $ac_executable_extensions; do 5431 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6197 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5432 6198 ac_cv_prog_AR="$ac_tool_prefix$ac_prog" 5433 6199 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5461 6227 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5462 6228 $as_echo_n "checking for $ac_word... " >&6; } 5463 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :6229 if ${ac_cv_prog_ac_ct_AR+:} false; then : 5464 6230 $as_echo_n "(cached) " >&6 5465 6231 else … … 5473 6239 test -z "$as_dir" && as_dir=. 5474 6240 for ac_exec_ext in '' $ac_executable_extensions; do 5475 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6241 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5476 6242 ac_cv_prog_ac_ct_AR="$ac_prog" 5477 6243 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5525 6291 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 5526 6292 $as_echo_n "checking for archiver @FILE support... " >&6; } 5527 if test "${lt_cv_ar_at_file+set}" = set; then :6293 if ${lt_cv_ar_at_file+:} false; then : 5528 6294 $as_echo_n "(cached) " >&6 5529 6295 else … … 5586 6352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5587 6353 $as_echo_n "checking for $ac_word... " >&6; } 5588 if test "${ac_cv_prog_STRIP+set}" = set; then :6354 if ${ac_cv_prog_STRIP+:} false; then : 5589 6355 $as_echo_n "(cached) " >&6 5590 6356 else … … 5598 6364 test -z "$as_dir" && as_dir=. 5599 6365 for ac_exec_ext in '' $ac_executable_extensions; do 5600 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6366 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5601 6367 ac_cv_prog_STRIP="${ac_tool_prefix}strip" 5602 6368 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5626 6392 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5627 6393 $as_echo_n "checking for $ac_word... " >&6; } 5628 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :6394 if ${ac_cv_prog_ac_ct_STRIP+:} false; then : 5629 6395 $as_echo_n "(cached) " >&6 5630 6396 else … … 5638 6404 test -z "$as_dir" && as_dir=. 5639 6405 for ac_exec_ext in '' $ac_executable_extensions; do 5640 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6406 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5641 6407 ac_cv_prog_ac_ct_STRIP="strip" 5642 6408 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5685 6451 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5686 6452 $as_echo_n "checking for $ac_word... " >&6; } 5687 if test "${ac_cv_prog_RANLIB+set}" = set; then :6453 if ${ac_cv_prog_RANLIB+:} false; then : 5688 6454 $as_echo_n "(cached) " >&6 5689 6455 else … … 5697 6463 test -z "$as_dir" && as_dir=. 5698 6464 for ac_exec_ext in '' $ac_executable_extensions; do 5699 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6465 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5700 6466 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" 5701 6467 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5725 6491 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 5726 6492 $as_echo_n "checking for $ac_word... " >&6; } 5727 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :6493 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : 5728 6494 $as_echo_n "(cached) " >&6 5729 6495 else … … 5737 6503 test -z "$as_dir" && as_dir=. 5738 6504 for ac_exec_ext in '' $ac_executable_extensions; do 5739 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then6505 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5740 6506 ac_cv_prog_ac_ct_RANLIB="ranlib" 5741 6507 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 5854 6620 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 5855 6621 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } 5856 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :6622 if ${lt_cv_sys_global_symbol_pipe+:} false; then : 5857 6623 $as_echo_n "(cached) " >&6 5858 6624 else … … 6152 6918 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 6153 6919 $as_echo "${with_sysroot}" >&6; } 6154 as_fn_error "The sysroot must be an absolute path." "$LINENO" 56920 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 6155 6921 ;; 6156 6922 esac … … 6288 7054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 6289 7055 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } 6290 if test "${lt_cv_cc_needs_belf+set}" = set; then :7056 if ${lt_cv_cc_needs_belf+:} false; then : 6291 7057 $as_echo_n "(cached) " >&6 6292 7058 else … … 6374 7140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6375 7141 $as_echo_n "checking for $ac_word... " >&6; } 6376 if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :7142 if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : 6377 7143 $as_echo_n "(cached) " >&6 6378 7144 else … … 6386 7152 test -z "$as_dir" && as_dir=. 6387 7153 for ac_exec_ext in '' $ac_executable_extensions; do 6388 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7154 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6389 7155 ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" 6390 7156 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6414 7180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6415 7181 $as_echo_n "checking for $ac_word... " >&6; } 6416 if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :7182 if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : 6417 7183 $as_echo_n "(cached) " >&6 6418 7184 else … … 6426 7192 test -z "$as_dir" && as_dir=. 6427 7193 for ac_exec_ext in '' $ac_executable_extensions; do 6428 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7194 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6429 7195 ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" 6430 7196 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6464 7230 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 6465 7231 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } 6466 if test "${lt_cv_path_mainfest_tool+set}" = set; then :7232 if ${lt_cv_path_mainfest_tool+:} false; then : 6467 7233 $as_echo_n "(cached) " >&6 6468 7234 else … … 6494 7260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6495 7261 $as_echo_n "checking for $ac_word... " >&6; } 6496 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :7262 if ${ac_cv_prog_DSYMUTIL+:} false; then : 6497 7263 $as_echo_n "(cached) " >&6 6498 7264 else … … 6506 7272 test -z "$as_dir" && as_dir=. 6507 7273 for ac_exec_ext in '' $ac_executable_extensions; do 6508 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7274 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6509 7275 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" 6510 7276 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6534 7300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6535 7301 $as_echo_n "checking for $ac_word... " >&6; } 6536 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :7302 if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : 6537 7303 $as_echo_n "(cached) " >&6 6538 7304 else … … 6546 7312 test -z "$as_dir" && as_dir=. 6547 7313 for ac_exec_ext in '' $ac_executable_extensions; do 6548 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7314 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6549 7315 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" 6550 7316 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6586 7352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6587 7353 $as_echo_n "checking for $ac_word... " >&6; } 6588 if test "${ac_cv_prog_NMEDIT+set}" = set; then :7354 if ${ac_cv_prog_NMEDIT+:} false; then : 6589 7355 $as_echo_n "(cached) " >&6 6590 7356 else … … 6598 7364 test -z "$as_dir" && as_dir=. 6599 7365 for ac_exec_ext in '' $ac_executable_extensions; do 6600 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7366 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6601 7367 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" 6602 7368 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6626 7392 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6627 7393 $as_echo_n "checking for $ac_word... " >&6; } 6628 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :7394 if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : 6629 7395 $as_echo_n "(cached) " >&6 6630 7396 else … … 6638 7404 test -z "$as_dir" && as_dir=. 6639 7405 for ac_exec_ext in '' $ac_executable_extensions; do 6640 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7406 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6641 7407 ac_cv_prog_ac_ct_NMEDIT="nmedit" 6642 7408 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6678 7444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6679 7445 $as_echo_n "checking for $ac_word... " >&6; } 6680 if test "${ac_cv_prog_LIPO+set}" = set; then :7446 if ${ac_cv_prog_LIPO+:} false; then : 6681 7447 $as_echo_n "(cached) " >&6 6682 7448 else … … 6690 7456 test -z "$as_dir" && as_dir=. 6691 7457 for ac_exec_ext in '' $ac_executable_extensions; do 6692 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7458 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6693 7459 ac_cv_prog_LIPO="${ac_tool_prefix}lipo" 6694 7460 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6718 7484 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6719 7485 $as_echo_n "checking for $ac_word... " >&6; } 6720 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :7486 if ${ac_cv_prog_ac_ct_LIPO+:} false; then : 6721 7487 $as_echo_n "(cached) " >&6 6722 7488 else … … 6730 7496 test -z "$as_dir" && as_dir=. 6731 7497 for ac_exec_ext in '' $ac_executable_extensions; do 6732 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7498 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6733 7499 ac_cv_prog_ac_ct_LIPO="lipo" 6734 7500 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6770 7536 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6771 7537 $as_echo_n "checking for $ac_word... " >&6; } 6772 if test "${ac_cv_prog_OTOOL+set}" = set; then :7538 if ${ac_cv_prog_OTOOL+:} false; then : 6773 7539 $as_echo_n "(cached) " >&6 6774 7540 else … … 6782 7548 test -z "$as_dir" && as_dir=. 6783 7549 for ac_exec_ext in '' $ac_executable_extensions; do 6784 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7550 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6785 7551 ac_cv_prog_OTOOL="${ac_tool_prefix}otool" 6786 7552 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6810 7576 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6811 7577 $as_echo_n "checking for $ac_word... " >&6; } 6812 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :7578 if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : 6813 7579 $as_echo_n "(cached) " >&6 6814 7580 else … … 6822 7588 test -z "$as_dir" && as_dir=. 6823 7589 for ac_exec_ext in '' $ac_executable_extensions; do 6824 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7590 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6825 7591 ac_cv_prog_ac_ct_OTOOL="otool" 6826 7592 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6862 7628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6863 7629 $as_echo_n "checking for $ac_word... " >&6; } 6864 if test "${ac_cv_prog_OTOOL64+set}" = set; then :7630 if ${ac_cv_prog_OTOOL64+:} false; then : 6865 7631 $as_echo_n "(cached) " >&6 6866 7632 else … … 6874 7640 test -z "$as_dir" && as_dir=. 6875 7641 for ac_exec_ext in '' $ac_executable_extensions; do 6876 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7642 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6877 7643 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" 6878 7644 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6902 7668 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 6903 7669 $as_echo_n "checking for $ac_word... " >&6; } 6904 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :7670 if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : 6905 7671 $as_echo_n "(cached) " >&6 6906 7672 else … … 6914 7680 test -z "$as_dir" && as_dir=. 6915 7681 for ac_exec_ext in '' $ac_executable_extensions; do 6916 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then7682 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 6917 7683 ac_cv_prog_ac_ct_OTOOL64="otool64" 6918 7684 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 6977 7743 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 6978 7744 $as_echo_n "checking for -single_module linker flag... " >&6; } 6979 if test "${lt_cv_apple_cc_single_mod+set}" = set; then :7745 if ${lt_cv_apple_cc_single_mod+:} false; then : 6980 7746 $as_echo_n "(cached) " >&6 6981 7747 else … … 7013 7779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 7014 7780 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } 7015 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :7781 if ${lt_cv_ld_exported_symbols_list+:} false; then : 7016 7782 $as_echo_n "(cached) " >&6 7017 7783 else … … 7046 7812 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 7047 7813 $as_echo_n "checking for -force_load linker flag... " >&6; } 7048 if test "${lt_cv_ld_force_load+set}" = set; then :7814 if ${lt_cv_ld_force_load+:} false; then : 7049 7815 $as_echo_n "(cached) " >&6 7050 7816 else … … 7125 7891 fi 7126 7892 if test -z "$CPP"; then 7127 if test "${ac_cv_prog_CPP+set}" = set; then :7893 if ${ac_cv_prog_CPP+:} false; then : 7128 7894 $as_echo_n "(cached) " >&6 7129 7895 else … … 7155 7921 continue 7156 7922 fi 7157 rm -f conftest.err conftest. $ac_ext7923 rm -f conftest.err conftest.i conftest.$ac_ext 7158 7924 7159 7925 # OK, works on sane cases. Now check whether nonexistent headers … … 7171 7937 break 7172 7938 fi 7173 rm -f conftest.err conftest. $ac_ext7939 rm -f conftest.err conftest.i conftest.$ac_ext 7174 7940 7175 7941 done 7176 7942 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 7177 rm -f conftest. err conftest.$ac_ext7943 rm -f conftest.i conftest.err conftest.$ac_ext 7178 7944 if $ac_preproc_ok; then : 7179 7945 break … … 7214 7980 continue 7215 7981 fi 7216 rm -f conftest.err conftest. $ac_ext7982 rm -f conftest.err conftest.i conftest.$ac_ext 7217 7983 7218 7984 # OK, works on sane cases. Now check whether nonexistent headers … … 7230 7996 break 7231 7997 fi 7232 rm -f conftest.err conftest. $ac_ext7998 rm -f conftest.err conftest.i conftest.$ac_ext 7233 7999 7234 8000 done 7235 8001 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 7236 rm -f conftest. err conftest.$ac_ext8002 rm -f conftest.i conftest.err conftest.$ac_ext 7237 8003 if $ac_preproc_ok; then : 7238 8004 … … 7240 8006 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 7241 8007 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7242 as_fn_error "C preprocessor \"$CPP\" fails sanity check7243 See \`config.log' for more details ." "$LINENO" 5; }8008 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 8009 See \`config.log' for more details" "$LINENO" 5; } 7244 8010 fi 7245 8011 … … 7253 8019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 7254 8020 $as_echo_n "checking for ANSI C header files... " >&6; } 7255 if test "${ac_cv_header_stdc+set}" = set; then :8021 if ${ac_cv_header_stdc+:} false; then : 7256 8022 $as_echo_n "(cached) " >&6 7257 8023 else … … 7370 8136 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 7371 8137 " 7372 eval as_val=\$$as_ac_Header 7373 if test "x$as_val" = x""yes; then : 8138 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 7374 8139 cat >>confdefs.h <<_ACEOF 7375 8140 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 … … 7385 8150 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default 7386 8151 " 7387 if test "x$ac_cv_header_dlfcn_h" = x ""yes; then :8152 if test "x$ac_cv_header_dlfcn_h" = xyes; then : 7388 8153 cat >>confdefs.h <<_ACEOF 7389 8154 #define HAVE_DLFCN_H 1 … … 7393 8158 7394 8159 done 8160 8161 8162 8163 8164 func_stripname_cnf () 8165 { 8166 case ${2} in 8167 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; 8168 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; 8169 esac 8170 } # func_stripname_cnf 7395 8171 7396 8172 … … 7591 8367 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 7592 8368 $as_echo_n "checking for objdir... " >&6; } 7593 if test "${lt_cv_objdir+set}" = set; then :8369 if ${lt_cv_objdir+:} false; then : 7594 8370 $as_echo_n "(cached) " >&6 7595 8371 else … … 7669 8445 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 7670 8446 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } 7671 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :8447 if ${lt_cv_path_MAGIC_CMD+:} false; then : 7672 8448 $as_echo_n "(cached) " >&6 7673 8449 else … … 7735 8511 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 7736 8512 $as_echo_n "checking for file... " >&6; } 7737 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :8513 if ${lt_cv_path_MAGIC_CMD+:} false; then : 7738 8514 $as_echo_n "(cached) " >&6 7739 8515 else … … 7877 8653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 7878 8654 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } 7879 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :8655 if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : 7880 8656 $as_echo_n "(cached) " >&6 7881 8657 else … … 8239 9015 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 8240 9016 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 8241 if test "${lt_cv_prog_compiler_pic+set}" = set; then :9017 if ${lt_cv_prog_compiler_pic+:} false; then : 8242 9018 $as_echo_n "(cached) " >&6 8243 9019 else … … 8254 9030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 8255 9031 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } 8256 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :9032 if ${lt_cv_prog_compiler_pic_works+:} false; then : 8257 9033 $as_echo_n "(cached) " >&6 8258 9034 else … … 8318 9094 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 8319 9095 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } 8320 if test "${lt_cv_prog_compiler_static_works+set}" = set; then :9096 if ${lt_cv_prog_compiler_static_works+:} false; then : 8321 9097 $as_echo_n "(cached) " >&6 8322 9098 else … … 8361 9137 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 8362 9138 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } 8363 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :9139 if ${lt_cv_prog_compiler_c_o+:} false; then : 8364 9140 $as_echo_n "(cached) " >&6 8365 9141 else … … 8416 9192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 8417 9193 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } 8418 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :9194 if ${lt_cv_prog_compiler_c_o+:} false; then : 8419 9195 $as_echo_n "(cached) " >&6 8420 9196 else … … 8979 9755 aix_libpath=$lt_cv_aix_libpath 8980 9756 else 8981 if test "${lt_cv_aix_libpath_+set}" = set; then :9757 if ${lt_cv_aix_libpath_+:} false; then : 8982 9758 $as_echo_n "(cached) " >&6 8983 9759 else … … 9032 9808 aix_libpath=$lt_cv_aix_libpath 9033 9809 else 9034 if test "${lt_cv_aix_libpath_+set}" = set; then :9810 if ${lt_cv_aix_libpath_+:} false; then : 9035 9811 $as_echo_n "(cached) " >&6 9036 9812 else … … 9301 10077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 9302 10078 $as_echo_n "checking if $CC understands -b... " >&6; } 9303 if test "${lt_cv_prog_compiler__b+set}" = set; then :10079 if ${lt_cv_prog_compiler__b+:} false; then : 9304 10080 $as_echo_n "(cached) " >&6 9305 10081 else … … 9370 10146 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 9371 10147 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } 9372 if test "${lt_cv_irix_exported_symbol+set}" = set; then :10148 if ${lt_cv_irix_exported_symbol+:} false; then : 9373 10149 $as_echo_n "(cached) " >&6 9374 10150 else … … 9686 10462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 9687 10463 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } 9688 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :10464 if ${lt_cv_archive_cmds_need_lc+:} false; then : 9689 10465 $as_echo_n "(cached) " >&6 9690 10466 else … … 10379 11155 10380 11156 # Some binutils ld are patched to set DT_RUNPATH 10381 if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :11157 if ${lt_cv_shlibpath_overrides_runpath+:} false; then : 10382 11158 $as_echo_n "(cached) " >&6 10383 11159 else … … 10799 11575 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 10800 11576 $as_echo_n "checking for dlopen in -ldl... " >&6; } 10801 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :11577 if ${ac_cv_lib_dl_dlopen+:} false; then : 10802 11578 $as_echo_n "(cached) " >&6 10803 11579 else … … 10833 11609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 10834 11610 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } 10835 if test "x$ac_cv_lib_dl_dlopen" = x ""yes; then :11611 if test "x$ac_cv_lib_dl_dlopen" = xyes; then : 10836 11612 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" 10837 11613 else … … 10847 11623 *) 10848 11624 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" 10849 if test "x$ac_cv_func_shl_load" = x ""yes; then :11625 if test "x$ac_cv_func_shl_load" = xyes; then : 10850 11626 lt_cv_dlopen="shl_load" 10851 11627 else 10852 11628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 10853 11629 $as_echo_n "checking for shl_load in -ldld... " >&6; } 10854 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :11630 if ${ac_cv_lib_dld_shl_load+:} false; then : 10855 11631 $as_echo_n "(cached) " >&6 10856 11632 else … … 10886 11662 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 10887 11663 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } 10888 if test "x$ac_cv_lib_dld_shl_load" = x ""yes; then :11664 if test "x$ac_cv_lib_dld_shl_load" = xyes; then : 10889 11665 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" 10890 11666 else 10891 11667 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" 10892 if test "x$ac_cv_func_dlopen" = x ""yes; then :11668 if test "x$ac_cv_func_dlopen" = xyes; then : 10893 11669 lt_cv_dlopen="dlopen" 10894 11670 else 10895 11671 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 10896 11672 $as_echo_n "checking for dlopen in -ldl... " >&6; } 10897 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :11673 if ${ac_cv_lib_dl_dlopen+:} false; then : 10898 11674 $as_echo_n "(cached) " >&6 10899 11675 else … … 10929 11705 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 10930 11706 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } 10931 if test "x$ac_cv_lib_dl_dlopen" = x ""yes; then :11707 if test "x$ac_cv_lib_dl_dlopen" = xyes; then : 10932 11708 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" 10933 11709 else 10934 11710 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 10935 11711 $as_echo_n "checking for dlopen in -lsvld... " >&6; } 10936 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :11712 if ${ac_cv_lib_svld_dlopen+:} false; then : 10937 11713 $as_echo_n "(cached) " >&6 10938 11714 else … … 10968 11744 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 10969 11745 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } 10970 if test "x$ac_cv_lib_svld_dlopen" = x ""yes; then :11746 if test "x$ac_cv_lib_svld_dlopen" = xyes; then : 10971 11747 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" 10972 11748 else 10973 11749 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 10974 11750 $as_echo_n "checking for dld_link in -ldld... " >&6; } 10975 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :11751 if ${ac_cv_lib_dld_dld_link+:} false; then : 10976 11752 $as_echo_n "(cached) " >&6 10977 11753 else … … 11007 11783 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 11008 11784 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } 11009 if test "x$ac_cv_lib_dld_dld_link" = x ""yes; then :11785 if test "x$ac_cv_lib_dld_dld_link" = xyes; then : 11010 11786 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" 11011 11787 fi … … 11048 11824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 11049 11825 $as_echo_n "checking whether a program can dlopen itself... " >&6; } 11050 if test "${lt_cv_dlopen_self+set}" = set; then :11826 if ${lt_cv_dlopen_self+:} false; then : 11051 11827 $as_echo_n "(cached) " >&6 11052 11828 else … … 11154 11930 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 11155 11931 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } 11156 if test "${lt_cv_dlopen_self_static+set}" = set; then :11932 if ${lt_cv_dlopen_self_static+:} false; then : 11157 11933 $as_echo_n "(cached) " >&6 11158 11934 else … … 11380 12156 CC="$lt_save_CC" 11381 12157 12158 if test -n "$CXX" && ( test "X$CXX" != "Xno" && 12159 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || 12160 (test "X$CXX" != "Xg++"))) ; then 12161 ac_ext=cpp 12162 ac_cpp='$CXXCPP $CPPFLAGS' 12163 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 12164 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 12165 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 12166 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 12167 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } 12168 if test -z "$CXXCPP"; then 12169 if ${ac_cv_prog_CXXCPP+:} false; then : 12170 $as_echo_n "(cached) " >&6 12171 else 12172 # Double quotes because CXXCPP needs to be expanded 12173 for CXXCPP in "$CXX -E" "/lib/cpp" 12174 do 12175 ac_preproc_ok=false 12176 for ac_cxx_preproc_warn_flag in '' yes 12177 do 12178 # Use a header file that comes with gcc, so configuring glibc 12179 # with a fresh cross-compiler works. 12180 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 12181 # <limits.h> exists even on freestanding compilers. 12182 # On the NeXT, cc -E runs the code through the compiler's parser, 12183 # not just through cpp. "Syntax error" is here to catch this case. 12184 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12185 /* end confdefs.h. */ 12186 #ifdef __STDC__ 12187 # include <limits.h> 12188 #else 12189 # include <assert.h> 12190 #endif 12191 Syntax error 12192 _ACEOF 12193 if ac_fn_cxx_try_cpp "$LINENO"; then : 12194 12195 else 12196 # Broken: fails on valid input. 12197 continue 12198 fi 12199 rm -f conftest.err conftest.i conftest.$ac_ext 12200 12201 # OK, works on sane cases. Now check whether nonexistent headers 12202 # can be detected and how. 12203 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12204 /* end confdefs.h. */ 12205 #include <ac_nonexistent.h> 12206 _ACEOF 12207 if ac_fn_cxx_try_cpp "$LINENO"; then : 12208 # Broken: success on invalid input. 12209 continue 12210 else 12211 # Passes both tests. 12212 ac_preproc_ok=: 12213 break 12214 fi 12215 rm -f conftest.err conftest.i conftest.$ac_ext 12216 12217 done 12218 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 12219 rm -f conftest.i conftest.err conftest.$ac_ext 12220 if $ac_preproc_ok; then : 12221 break 12222 fi 12223 12224 done 12225 ac_cv_prog_CXXCPP=$CXXCPP 12226 12227 fi 12228 CXXCPP=$ac_cv_prog_CXXCPP 12229 else 12230 ac_cv_prog_CXXCPP=$CXXCPP 12231 fi 12232 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 12233 $as_echo "$CXXCPP" >&6; } 12234 ac_preproc_ok=false 12235 for ac_cxx_preproc_warn_flag in '' yes 12236 do 12237 # Use a header file that comes with gcc, so configuring glibc 12238 # with a fresh cross-compiler works. 12239 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 12240 # <limits.h> exists even on freestanding compilers. 12241 # On the NeXT, cc -E runs the code through the compiler's parser, 12242 # not just through cpp. "Syntax error" is here to catch this case. 12243 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12244 /* end confdefs.h. */ 12245 #ifdef __STDC__ 12246 # include <limits.h> 12247 #else 12248 # include <assert.h> 12249 #endif 12250 Syntax error 12251 _ACEOF 12252 if ac_fn_cxx_try_cpp "$LINENO"; then : 12253 12254 else 12255 # Broken: fails on valid input. 12256 continue 12257 fi 12258 rm -f conftest.err conftest.i conftest.$ac_ext 12259 12260 # OK, works on sane cases. Now check whether nonexistent headers 12261 # can be detected and how. 12262 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12263 /* end confdefs.h. */ 12264 #include <ac_nonexistent.h> 12265 _ACEOF 12266 if ac_fn_cxx_try_cpp "$LINENO"; then : 12267 # Broken: success on invalid input. 12268 continue 12269 else 12270 # Passes both tests. 12271 ac_preproc_ok=: 12272 break 12273 fi 12274 rm -f conftest.err conftest.i conftest.$ac_ext 12275 12276 done 12277 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 12278 rm -f conftest.i conftest.err conftest.$ac_ext 12279 if $ac_preproc_ok; then : 12280 12281 else 12282 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 12283 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 12284 as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check 12285 See \`config.log' for more details" "$LINENO" 5; } 12286 fi 12287 12288 ac_ext=c 12289 ac_cpp='$CPP $CPPFLAGS' 12290 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 12291 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 12292 ac_compiler_gnu=$ac_cv_c_compiler_gnu 12293 12294 else 12295 _lt_caught_CXX_error=yes 12296 fi 12297 12298 ac_ext=cpp 12299 ac_cpp='$CXXCPP $CPPFLAGS' 12300 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 12301 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 12302 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 12303 12304 archive_cmds_need_lc_CXX=no 12305 allow_undefined_flag_CXX= 12306 always_export_symbols_CXX=no 12307 archive_expsym_cmds_CXX= 12308 compiler_needs_object_CXX=no 12309 export_dynamic_flag_spec_CXX= 12310 hardcode_direct_CXX=no 12311 hardcode_direct_absolute_CXX=no 12312 hardcode_libdir_flag_spec_CXX= 12313 hardcode_libdir_separator_CXX= 12314 hardcode_minus_L_CXX=no 12315 hardcode_shlibpath_var_CXX=unsupported 12316 hardcode_automatic_CXX=no 12317 inherit_rpath_CXX=no 12318 module_cmds_CXX= 12319 module_expsym_cmds_CXX= 12320 link_all_deplibs_CXX=unknown 12321 old_archive_cmds_CXX=$old_archive_cmds 12322 reload_flag_CXX=$reload_flag 12323 reload_cmds_CXX=$reload_cmds 12324 no_undefined_flag_CXX= 12325 whole_archive_flag_spec_CXX= 12326 enable_shared_with_static_runtimes_CXX=no 12327 12328 # Source file extension for C++ test sources. 12329 ac_ext=cpp 12330 12331 # Object file extension for compiled C++ test sources. 12332 objext=o 12333 objext_CXX=$objext 12334 12335 # No sense in running all these tests if we already determined that 12336 # the CXX compiler isn't working. Some variables (like enable_shared) 12337 # are currently assumed to apply to all compilers on this platform, 12338 # and will be corrupted by setting them based on a non-working compiler. 12339 if test "$_lt_caught_CXX_error" != yes; then 12340 # Code to be used in simple compile tests 12341 lt_simple_compile_test_code="int some_variable = 0;" 12342 12343 # Code to be used in simple link tests 12344 lt_simple_link_test_code='int main(int, char *[]) { return(0); }' 12345 12346 # ltmain only uses $CC for tagged configurations so make sure $CC is set. 12347 12348 12349 12350 12351 12352 12353 # If no C compiler was specified, use CC. 12354 LTCC=${LTCC-"$CC"} 12355 12356 # If no C compiler flags were specified, use CFLAGS. 12357 LTCFLAGS=${LTCFLAGS-"$CFLAGS"} 12358 12359 # Allow CC to be a program name with arguments. 12360 compiler=$CC 12361 12362 12363 # save warnings/boilerplate of simple test code 12364 ac_outfile=conftest.$ac_objext 12365 echo "$lt_simple_compile_test_code" >conftest.$ac_ext 12366 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 12367 _lt_compiler_boilerplate=`cat conftest.err` 12368 $RM conftest* 12369 12370 ac_outfile=conftest.$ac_objext 12371 echo "$lt_simple_link_test_code" >conftest.$ac_ext 12372 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 12373 _lt_linker_boilerplate=`cat conftest.err` 12374 $RM -r conftest* 12375 12376 12377 # Allow CC to be a program name with arguments. 12378 lt_save_CC=$CC 12379 lt_save_CFLAGS=$CFLAGS 12380 lt_save_LD=$LD 12381 lt_save_GCC=$GCC 12382 GCC=$GXX 12383 lt_save_with_gnu_ld=$with_gnu_ld 12384 lt_save_path_LD=$lt_cv_path_LD 12385 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then 12386 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx 12387 else 12388 $as_unset lt_cv_prog_gnu_ld 12389 fi 12390 if test -n "${lt_cv_path_LDCXX+set}"; then 12391 lt_cv_path_LD=$lt_cv_path_LDCXX 12392 else 12393 $as_unset lt_cv_path_LD 12394 fi 12395 test -z "${LDCXX+set}" || LD=$LDCXX 12396 CC=${CXX-"c++"} 12397 CFLAGS=$CXXFLAGS 12398 compiler=$CC 12399 compiler_CXX=$CC 12400 for cc_temp in $compiler""; do 12401 case $cc_temp in 12402 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; 12403 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; 12404 \-*) ;; 12405 *) break;; 12406 esac 12407 done 12408 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` 12409 12410 12411 if test -n "$compiler"; then 12412 # We don't want -fno-exception when compiling C++ code, so set the 12413 # no_builtin_flag separately 12414 if test "$GXX" = yes; then 12415 lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' 12416 else 12417 lt_prog_compiler_no_builtin_flag_CXX= 12418 fi 12419 12420 if test "$GXX" = yes; then 12421 # Set up default GNU C++ configuration 12422 12423 12424 12425 # Check whether --with-gnu-ld was given. 12426 if test "${with_gnu_ld+set}" = set; then : 12427 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes 12428 else 12429 with_gnu_ld=no 12430 fi 12431 12432 ac_prog=ld 12433 if test "$GCC" = yes; then 12434 # Check if gcc -print-prog-name=ld gives a path. 12435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 12436 $as_echo_n "checking for ld used by $CC... " >&6; } 12437 case $host in 12438 *-*-mingw*) 12439 # gcc leaves a trailing carriage return which upsets mingw 12440 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 12441 *) 12442 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 12443 esac 12444 case $ac_prog in 12445 # Accept absolute paths. 12446 [\\/]* | ?:[\\/]*) 12447 re_direlt='/[^/][^/]*/\.\./' 12448 # Canonicalize the pathname of ld 12449 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` 12450 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do 12451 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` 12452 done 12453 test -z "$LD" && LD="$ac_prog" 12454 ;; 12455 "") 12456 # If it fails, then pretend we aren't using GCC. 12457 ac_prog=ld 12458 ;; 12459 *) 12460 # If it is relative, then search for the first ld in PATH. 12461 with_gnu_ld=unknown 12462 ;; 12463 esac 12464 elif test "$with_gnu_ld" = yes; then 12465 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 12466 $as_echo_n "checking for GNU ld... " >&6; } 12467 else 12468 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 12469 $as_echo_n "checking for non-GNU ld... " >&6; } 12470 fi 12471 if ${lt_cv_path_LD+:} false; then : 12472 $as_echo_n "(cached) " >&6 12473 else 12474 if test -z "$LD"; then 12475 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 12476 for ac_dir in $PATH; do 12477 IFS="$lt_save_ifs" 12478 test -z "$ac_dir" && ac_dir=. 12479 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 12480 lt_cv_path_LD="$ac_dir/$ac_prog" 12481 # Check to see if the program is GNU ld. I'd rather use --version, 12482 # but apparently some variants of GNU ld only accept -v. 12483 # Break only if it was the GNU/non-GNU ld that we prefer. 12484 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in 12485 *GNU* | *'with BFD'*) 12486 test "$with_gnu_ld" != no && break 12487 ;; 12488 *) 12489 test "$with_gnu_ld" != yes && break 12490 ;; 12491 esac 12492 fi 12493 done 12494 IFS="$lt_save_ifs" 12495 else 12496 lt_cv_path_LD="$LD" # Let the user override the test with a path. 12497 fi 12498 fi 12499 12500 LD="$lt_cv_path_LD" 12501 if test -n "$LD"; then 12502 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 12503 $as_echo "$LD" >&6; } 12504 else 12505 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 12506 $as_echo "no" >&6; } 12507 fi 12508 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 12509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 12510 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } 12511 if ${lt_cv_prog_gnu_ld+:} false; then : 12512 $as_echo_n "(cached) " >&6 12513 else 12514 # I'd rather use --version here, but apparently some GNU lds only accept -v. 12515 case `$LD -v 2>&1 </dev/null` in 12516 *GNU* | *'with BFD'*) 12517 lt_cv_prog_gnu_ld=yes 12518 ;; 12519 *) 12520 lt_cv_prog_gnu_ld=no 12521 ;; 12522 esac 12523 fi 12524 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 12525 $as_echo "$lt_cv_prog_gnu_ld" >&6; } 12526 with_gnu_ld=$lt_cv_prog_gnu_ld 12527 12528 12529 12530 12531 12532 12533 12534 # Check if GNU C++ uses GNU ld as the underlying linker, since the 12535 # archiving commands below assume that GNU ld is being used. 12536 if test "$with_gnu_ld" = yes; then 12537 archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' 12538 archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 12539 12540 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' 12541 export_dynamic_flag_spec_CXX='${wl}--export-dynamic' 12542 12543 # If archive_cmds runs LD, not CC, wlarc should be empty 12544 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to 12545 # investigate it a little bit more. (MM) 12546 wlarc='${wl}' 12547 12548 # ancient GNU ld didn't support --whole-archive et. al. 12549 if eval "`$CC -print-prog-name=ld` --help 2>&1" | 12550 $GREP 'no-whole-archive' > /dev/null; then 12551 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 12552 else 12553 whole_archive_flag_spec_CXX= 12554 fi 12555 else 12556 with_gnu_ld=no 12557 wlarc= 12558 12559 # A generic and very simple default shared library creation 12560 # command for GNU C++ for the case where it uses the native 12561 # linker, instead of GNU ld. If possible, this setting should 12562 # overridden to take advantage of the native linker features on 12563 # the platform it is being used on. 12564 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 12565 fi 12566 12567 # Commands to make compiler produce verbose output that lists 12568 # what "hidden" libraries, object files and flags are used when 12569 # linking a shared library. 12570 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 12571 12572 else 12573 GXX=no 12574 with_gnu_ld=no 12575 wlarc= 12576 fi 12577 12578 # PORTME: fill in a description of your system's C++ link characteristics 12579 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 12580 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } 12581 ld_shlibs_CXX=yes 12582 case $host_os in 12583 aix3*) 12584 # FIXME: insert proper C++ library support 12585 ld_shlibs_CXX=no 12586 ;; 12587 aix[4-9]*) 12588 if test "$host_cpu" = ia64; then 12589 # On IA64, the linker does run time linking by default, so we don't 12590 # have to do anything special. 12591 aix_use_runtimelinking=no 12592 exp_sym_flag='-Bexport' 12593 no_entry_flag="" 12594 else 12595 aix_use_runtimelinking=no 12596 12597 # Test if we are trying to use run time linking or normal 12598 # AIX style linking. If -brtl is somewhere in LDFLAGS, we 12599 # need to do runtime linking. 12600 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) 12601 for ld_flag in $LDFLAGS; do 12602 case $ld_flag in 12603 *-brtl*) 12604 aix_use_runtimelinking=yes 12605 break 12606 ;; 12607 esac 12608 done 12609 ;; 12610 esac 12611 12612 exp_sym_flag='-bexport' 12613 no_entry_flag='-bnoentry' 12614 fi 12615 12616 # When large executables or shared objects are built, AIX ld can 12617 # have problems creating the table of contents. If linking a library 12618 # or program results in "error TOC overflow" add -mminimal-toc to 12619 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not 12620 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. 12621 12622 archive_cmds_CXX='' 12623 hardcode_direct_CXX=yes 12624 hardcode_direct_absolute_CXX=yes 12625 hardcode_libdir_separator_CXX=':' 12626 link_all_deplibs_CXX=yes 12627 file_list_spec_CXX='${wl}-f,' 12628 12629 if test "$GXX" = yes; then 12630 case $host_os in aix4.[012]|aix4.[012].*) 12631 # We only want to do this on AIX 4.2 and lower, the check 12632 # below for broken collect2 doesn't work under 4.3+ 12633 collect2name=`${CC} -print-prog-name=collect2` 12634 if test -f "$collect2name" && 12635 strings "$collect2name" | $GREP resolve_lib_name >/dev/null 12636 then 12637 # We have reworked collect2 12638 : 12639 else 12640 # We have old collect2 12641 hardcode_direct_CXX=unsupported 12642 # It fails to find uninstalled libraries when the uninstalled 12643 # path is not listed in the libpath. Setting hardcode_minus_L 12644 # to unsupported forces relinking 12645 hardcode_minus_L_CXX=yes 12646 hardcode_libdir_flag_spec_CXX='-L$libdir' 12647 hardcode_libdir_separator_CXX= 12648 fi 12649 esac 12650 shared_flag='-shared' 12651 if test "$aix_use_runtimelinking" = yes; then 12652 shared_flag="$shared_flag "'${wl}-G' 12653 fi 12654 else 12655 # not using gcc 12656 if test "$host_cpu" = ia64; then 12657 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release 12658 # chokes on -Wl,-G. The following line is correct: 12659 shared_flag='-G' 12660 else 12661 if test "$aix_use_runtimelinking" = yes; then 12662 shared_flag='${wl}-G' 12663 else 12664 shared_flag='${wl}-bM:SRE' 12665 fi 12666 fi 12667 fi 12668 12669 export_dynamic_flag_spec_CXX='${wl}-bexpall' 12670 # It seems that -bexpall does not export symbols beginning with 12671 # underscore (_), so it is better to generate a list of symbols to 12672 # export. 12673 always_export_symbols_CXX=yes 12674 if test "$aix_use_runtimelinking" = yes; then 12675 # Warning - without using the other runtime loading flags (-brtl), 12676 # -berok will link without error, but may produce a broken library. 12677 allow_undefined_flag_CXX='-berok' 12678 # Determine the default libpath from the value encoded in an empty 12679 # executable. 12680 if test "${lt_cv_aix_libpath+set}" = set; then 12681 aix_libpath=$lt_cv_aix_libpath 12682 else 12683 if ${lt_cv_aix_libpath__CXX+:} false; then : 12684 $as_echo_n "(cached) " >&6 12685 else 12686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12687 /* end confdefs.h. */ 12688 12689 int 12690 main () 12691 { 12692 12693 ; 12694 return 0; 12695 } 12696 _ACEOF 12697 if ac_fn_cxx_try_link "$LINENO"; then : 12698 12699 lt_aix_libpath_sed=' 12700 /Import File Strings/,/^$/ { 12701 /^0/ { 12702 s/^0 *\([^ ]*\) *$/\1/ 12703 p 12704 } 12705 }' 12706 lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 12707 # Check for a 64-bit object if we didn't find anything. 12708 if test -z "$lt_cv_aix_libpath__CXX"; then 12709 lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 12710 fi 12711 fi 12712 rm -f core conftest.err conftest.$ac_objext \ 12713 conftest$ac_exeext conftest.$ac_ext 12714 if test -z "$lt_cv_aix_libpath__CXX"; then 12715 lt_cv_aix_libpath__CXX="/usr/lib:/lib" 12716 fi 12717 12718 fi 12719 12720 aix_libpath=$lt_cv_aix_libpath__CXX 12721 fi 12722 12723 hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" 12724 12725 archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" 12726 else 12727 if test "$host_cpu" = ia64; then 12728 hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' 12729 allow_undefined_flag_CXX="-z nodefs" 12730 archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" 12731 else 12732 # Determine the default libpath from the value encoded in an 12733 # empty executable. 12734 if test "${lt_cv_aix_libpath+set}" = set; then 12735 aix_libpath=$lt_cv_aix_libpath 12736 else 12737 if ${lt_cv_aix_libpath__CXX+:} false; then : 12738 $as_echo_n "(cached) " >&6 12739 else 12740 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12741 /* end confdefs.h. */ 12742 12743 int 12744 main () 12745 { 12746 12747 ; 12748 return 0; 12749 } 12750 _ACEOF 12751 if ac_fn_cxx_try_link "$LINENO"; then : 12752 12753 lt_aix_libpath_sed=' 12754 /Import File Strings/,/^$/ { 12755 /^0/ { 12756 s/^0 *\([^ ]*\) *$/\1/ 12757 p 12758 } 12759 }' 12760 lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 12761 # Check for a 64-bit object if we didn't find anything. 12762 if test -z "$lt_cv_aix_libpath__CXX"; then 12763 lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 12764 fi 12765 fi 12766 rm -f core conftest.err conftest.$ac_objext \ 12767 conftest$ac_exeext conftest.$ac_ext 12768 if test -z "$lt_cv_aix_libpath__CXX"; then 12769 lt_cv_aix_libpath__CXX="/usr/lib:/lib" 12770 fi 12771 12772 fi 12773 12774 aix_libpath=$lt_cv_aix_libpath__CXX 12775 fi 12776 12777 hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" 12778 # Warning - without using the other run time loading flags, 12779 # -berok will link without error, but may produce a broken library. 12780 no_undefined_flag_CXX=' ${wl}-bernotok' 12781 allow_undefined_flag_CXX=' ${wl}-berok' 12782 if test "$with_gnu_ld" = yes; then 12783 # We only use this code for GNU lds that support --whole-archive. 12784 whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' 12785 else 12786 # Exported symbols can be pulled into shared objects from archives 12787 whole_archive_flag_spec_CXX='$convenience' 12788 fi 12789 archive_cmds_need_lc_CXX=yes 12790 # This is similar to how AIX traditionally builds its shared 12791 # libraries. 12792 archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' 12793 fi 12794 fi 12795 ;; 12796 12797 beos*) 12798 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then 12799 allow_undefined_flag_CXX=unsupported 12800 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc 12801 # support --undefined. This deserves some investigation. FIXME 12802 archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 12803 else 12804 ld_shlibs_CXX=no 12805 fi 12806 ;; 12807 12808 chorus*) 12809 case $cc_basename in 12810 *) 12811 # FIXME: insert proper C++ library support 12812 ld_shlibs_CXX=no 12813 ;; 12814 esac 12815 ;; 12816 12817 cygwin* | mingw* | pw32* | cegcc*) 12818 case $GXX,$cc_basename in 12819 ,cl* | no,cl*) 12820 # Native MSVC 12821 # hardcode_libdir_flag_spec is actually meaningless, as there is 12822 # no search path for DLLs. 12823 hardcode_libdir_flag_spec_CXX=' ' 12824 allow_undefined_flag_CXX=unsupported 12825 always_export_symbols_CXX=yes 12826 file_list_spec_CXX='@' 12827 # Tell ltmain to make .lib files, not .a files. 12828 libext=lib 12829 # Tell ltmain to make .dll files, not .so files. 12830 shrext_cmds=".dll" 12831 # FIXME: Setting linknames here is a bad hack. 12832 archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' 12833 archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 12834 $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; 12835 else 12836 $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; 12837 fi~ 12838 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ 12839 linknames=' 12840 # The linker will not automatically build a static lib if we build a DLL. 12841 # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' 12842 enable_shared_with_static_runtimes_CXX=yes 12843 # Don't use ranlib 12844 old_postinstall_cmds_CXX='chmod 644 $oldlib' 12845 postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ 12846 lt_tool_outputfile="@TOOL_OUTPUT@"~ 12847 case $lt_outputfile in 12848 *.exe|*.EXE) ;; 12849 *) 12850 lt_outputfile="$lt_outputfile.exe" 12851 lt_tool_outputfile="$lt_tool_outputfile.exe" 12852 ;; 12853 esac~ 12854 func_to_tool_file "$lt_outputfile"~ 12855 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then 12856 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; 12857 $RM "$lt_outputfile.manifest"; 12858 fi' 12859 ;; 12860 *) 12861 # g++ 12862 # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, 12863 # as there is no search path for DLLs. 12864 hardcode_libdir_flag_spec_CXX='-L$libdir' 12865 export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' 12866 allow_undefined_flag_CXX=unsupported 12867 always_export_symbols_CXX=no 12868 enable_shared_with_static_runtimes_CXX=yes 12869 12870 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then 12871 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' 12872 # If the export-symbols file already is a .def file (1st line 12873 # is EXPORTS), use it as is; otherwise, prepend... 12874 archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 12875 cp $export_symbols $output_objdir/$soname.def; 12876 else 12877 echo EXPORTS > $output_objdir/$soname.def; 12878 cat $export_symbols >> $output_objdir/$soname.def; 12879 fi~ 12880 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' 12881 else 12882 ld_shlibs_CXX=no 12883 fi 12884 ;; 12885 esac 12886 ;; 12887 darwin* | rhapsody*) 12888 12889 12890 archive_cmds_need_lc_CXX=no 12891 hardcode_direct_CXX=no 12892 hardcode_automatic_CXX=yes 12893 hardcode_shlibpath_var_CXX=unsupported 12894 if test "$lt_cv_ld_force_load" = "yes"; then 12895 whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' 12896 12897 else 12898 whole_archive_flag_spec_CXX='' 12899 fi 12900 link_all_deplibs_CXX=yes 12901 allow_undefined_flag_CXX="$_lt_dar_allow_undefined" 12902 case $cc_basename in 12903 ifort*) _lt_dar_can_shared=yes ;; 12904 *) _lt_dar_can_shared=$GCC ;; 12905 esac 12906 if test "$_lt_dar_can_shared" = "yes"; then 12907 output_verbose_link_cmd=func_echo_all 12908 archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" 12909 module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" 12910 archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" 12911 module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" 12912 if test "$lt_cv_apple_cc_single_mod" != "yes"; then 12913 archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" 12914 archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" 12915 fi 12916 12917 else 12918 ld_shlibs_CXX=no 12919 fi 12920 12921 ;; 12922 12923 dgux*) 12924 case $cc_basename in 12925 ec++*) 12926 # FIXME: insert proper C++ library support 12927 ld_shlibs_CXX=no 12928 ;; 12929 ghcx*) 12930 # Green Hills C++ Compiler 12931 # FIXME: insert proper C++ library support 12932 ld_shlibs_CXX=no 12933 ;; 12934 *) 12935 # FIXME: insert proper C++ library support 12936 ld_shlibs_CXX=no 12937 ;; 12938 esac 12939 ;; 12940 12941 freebsd2.*) 12942 # C++ shared libraries reported to be fairly broken before 12943 # switch to ELF 12944 ld_shlibs_CXX=no 12945 ;; 12946 12947 freebsd-elf*) 12948 archive_cmds_need_lc_CXX=no 12949 ;; 12950 12951 freebsd* | dragonfly*) 12952 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF 12953 # conventions 12954 ld_shlibs_CXX=yes 12955 ;; 12956 12957 gnu*) 12958 ;; 12959 12960 haiku*) 12961 archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 12962 link_all_deplibs_CXX=yes 12963 ;; 12964 12965 hpux9*) 12966 hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' 12967 hardcode_libdir_separator_CXX=: 12968 export_dynamic_flag_spec_CXX='${wl}-E' 12969 hardcode_direct_CXX=yes 12970 hardcode_minus_L_CXX=yes # Not in the search PATH, 12971 # but as the default 12972 # location of the library. 12973 12974 case $cc_basename in 12975 CC*) 12976 # FIXME: insert proper C++ library support 12977 ld_shlibs_CXX=no 12978 ;; 12979 aCC*) 12980 archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' 12981 # Commands to make compiler produce verbose output that lists 12982 # what "hidden" libraries, object files and flags are used when 12983 # linking a shared library. 12984 # 12985 # There doesn't appear to be a way to prevent this compiler from 12986 # explicitly linking system object files so we need to strip them 12987 # from the output so that they don't get included in the library 12988 # dependencies. 12989 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 12990 ;; 12991 *) 12992 if test "$GXX" = yes; then 12993 archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' 12994 else 12995 # FIXME: insert proper C++ library support 12996 ld_shlibs_CXX=no 12997 fi 12998 ;; 12999 esac 13000 ;; 13001 13002 hpux10*|hpux11*) 13003 if test $with_gnu_ld = no; then 13004 hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' 13005 hardcode_libdir_separator_CXX=: 13006 13007 case $host_cpu in 13008 hppa*64*|ia64*) 13009 ;; 13010 *) 13011 export_dynamic_flag_spec_CXX='${wl}-E' 13012 ;; 13013 esac 13014 fi 13015 case $host_cpu in 13016 hppa*64*|ia64*) 13017 hardcode_direct_CXX=no 13018 hardcode_shlibpath_var_CXX=no 13019 ;; 13020 *) 13021 hardcode_direct_CXX=yes 13022 hardcode_direct_absolute_CXX=yes 13023 hardcode_minus_L_CXX=yes # Not in the search PATH, 13024 # but as the default 13025 # location of the library. 13026 ;; 13027 esac 13028 13029 case $cc_basename in 13030 CC*) 13031 # FIXME: insert proper C++ library support 13032 ld_shlibs_CXX=no 13033 ;; 13034 aCC*) 13035 case $host_cpu in 13036 hppa*64*) 13037 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13038 ;; 13039 ia64*) 13040 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13041 ;; 13042 *) 13043 archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13044 ;; 13045 esac 13046 # Commands to make compiler produce verbose output that lists 13047 # what "hidden" libraries, object files and flags are used when 13048 # linking a shared library. 13049 # 13050 # There doesn't appear to be a way to prevent this compiler from 13051 # explicitly linking system object files so we need to strip them 13052 # from the output so that they don't get included in the library 13053 # dependencies. 13054 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 13055 ;; 13056 *) 13057 if test "$GXX" = yes; then 13058 if test $with_gnu_ld = no; then 13059 case $host_cpu in 13060 hppa*64*) 13061 archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13062 ;; 13063 ia64*) 13064 archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13065 ;; 13066 *) 13067 archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13068 ;; 13069 esac 13070 fi 13071 else 13072 # FIXME: insert proper C++ library support 13073 ld_shlibs_CXX=no 13074 fi 13075 ;; 13076 esac 13077 ;; 13078 13079 interix[3-9]*) 13080 hardcode_direct_CXX=no 13081 hardcode_shlibpath_var_CXX=no 13082 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' 13083 export_dynamic_flag_spec_CXX='${wl}-E' 13084 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. 13085 # Instead, shared libraries are loaded at an image base (0x10000000 by 13086 # default) and relocated if they conflict, which is a slow very memory 13087 # consuming and fragmenting process. To avoid this, we pick a random, 13088 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link 13089 # time. Moving up from 0x10000000 also allows more sbrk(2) space. 13090 archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' 13091 archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' 13092 ;; 13093 irix5* | irix6*) 13094 case $cc_basename in 13095 CC*) 13096 # SGI C++ 13097 archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' 13098 13099 # Archives containing C++ object files must be created using 13100 # "CC -ar", where "CC" is the IRIX C++ compiler. This is 13101 # necessary to make sure instantiated templates are included 13102 # in the archive. 13103 old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' 13104 ;; 13105 *) 13106 if test "$GXX" = yes; then 13107 if test "$with_gnu_ld" = no; then 13108 archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 13109 else 13110 archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' 13111 fi 13112 fi 13113 link_all_deplibs_CXX=yes 13114 ;; 13115 esac 13116 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' 13117 hardcode_libdir_separator_CXX=: 13118 inherit_rpath_CXX=yes 13119 ;; 13120 13121 linux* | k*bsd*-gnu | kopensolaris*-gnu) 13122 case $cc_basename in 13123 KCC*) 13124 # Kuck and Associates, Inc. (KAI) C++ Compiler 13125 13126 # KCC will only create a shared library if the output file 13127 # ends with ".so" (or ".sl" for HP-UX), so rename the library 13128 # to its proper name (with version) after linking. 13129 archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' 13130 archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' 13131 # Commands to make compiler produce verbose output that lists 13132 # what "hidden" libraries, object files and flags are used when 13133 # linking a shared library. 13134 # 13135 # There doesn't appear to be a way to prevent this compiler from 13136 # explicitly linking system object files so we need to strip them 13137 # from the output so that they don't get included in the library 13138 # dependencies. 13139 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 13140 13141 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' 13142 export_dynamic_flag_spec_CXX='${wl}--export-dynamic' 13143 13144 # Archives containing C++ object files must be created using 13145 # "CC -Bstatic", where "CC" is the KAI C++ compiler. 13146 old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' 13147 ;; 13148 icpc* | ecpc* ) 13149 # Intel C++ 13150 with_gnu_ld=yes 13151 # version 8.0 and above of icpc choke on multiply defined symbols 13152 # if we add $predep_objects and $postdep_objects, however 7.1 and 13153 # earlier do not add the objects themselves. 13154 case `$CC -V 2>&1` in 13155 *"Version 7."*) 13156 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' 13157 archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 13158 ;; 13159 *) # Version 8.0 or newer 13160 tmp_idyn= 13161 case $host_cpu in 13162 ia64*) tmp_idyn=' -i_dynamic';; 13163 esac 13164 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 13165 archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 13166 ;; 13167 esac 13168 archive_cmds_need_lc_CXX=no 13169 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' 13170 export_dynamic_flag_spec_CXX='${wl}--export-dynamic' 13171 whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' 13172 ;; 13173 pgCC* | pgcpp*) 13174 # Portland Group C++ compiler 13175 case `$CC -V` in 13176 *pgCC\ [1-5].* | *pgcpp\ [1-5].*) 13177 prelink_cmds_CXX='tpldir=Template.dir~ 13178 rm -rf $tpldir~ 13179 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ 13180 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' 13181 old_archive_cmds_CXX='tpldir=Template.dir~ 13182 rm -rf $tpldir~ 13183 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ 13184 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ 13185 $RANLIB $oldlib' 13186 archive_cmds_CXX='tpldir=Template.dir~ 13187 rm -rf $tpldir~ 13188 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ 13189 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' 13190 archive_expsym_cmds_CXX='tpldir=Template.dir~ 13191 rm -rf $tpldir~ 13192 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ 13193 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' 13194 ;; 13195 *) # Version 6 and above use weak symbols 13196 archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' 13197 archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' 13198 ;; 13199 esac 13200 13201 hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' 13202 export_dynamic_flag_spec_CXX='${wl}--export-dynamic' 13203 whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' 13204 ;; 13205 cxx*) 13206 # Compaq C++ 13207 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' 13208 archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' 13209 13210 runpath_var=LD_RUN_PATH 13211 hardcode_libdir_flag_spec_CXX='-rpath $libdir' 13212 hardcode_libdir_separator_CXX=: 13213 13214 # Commands to make compiler produce verbose output that lists 13215 # what "hidden" libraries, object files and flags are used when 13216 # linking a shared library. 13217 # 13218 # There doesn't appear to be a way to prevent this compiler from 13219 # explicitly linking system object files so we need to strip them 13220 # from the output so that they don't get included in the library 13221 # dependencies. 13222 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' 13223 ;; 13224 xl* | mpixl* | bgxl*) 13225 # IBM XL 8.0 on PPC, with GNU ld 13226 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' 13227 export_dynamic_flag_spec_CXX='${wl}--export-dynamic' 13228 archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 13229 if test "x$supports_anon_versioning" = xyes; then 13230 archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ 13231 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ 13232 echo "local: *; };" >> $output_objdir/$libname.ver~ 13233 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' 13234 fi 13235 ;; 13236 *) 13237 case `$CC -V 2>&1 | sed 5q` in 13238 *Sun\ C*) 13239 # Sun C++ 5.9 13240 no_undefined_flag_CXX=' -zdefs' 13241 archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13242 archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' 13243 hardcode_libdir_flag_spec_CXX='-R$libdir' 13244 whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' 13245 compiler_needs_object_CXX=yes 13246 13247 # Not sure whether something based on 13248 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 13249 # would be better. 13250 output_verbose_link_cmd='func_echo_all' 13251 13252 # Archives containing C++ object files must be created using 13253 # "CC -xar", where "CC" is the Sun C++ compiler. This is 13254 # necessary to make sure instantiated templates are included 13255 # in the archive. 13256 old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' 13257 ;; 13258 esac 13259 ;; 13260 esac 13261 ;; 13262 13263 lynxos*) 13264 # FIXME: insert proper C++ library support 13265 ld_shlibs_CXX=no 13266 ;; 13267 13268 m88k*) 13269 # FIXME: insert proper C++ library support 13270 ld_shlibs_CXX=no 13271 ;; 13272 13273 mvs*) 13274 case $cc_basename in 13275 cxx*) 13276 # FIXME: insert proper C++ library support 13277 ld_shlibs_CXX=no 13278 ;; 13279 *) 13280 # FIXME: insert proper C++ library support 13281 ld_shlibs_CXX=no 13282 ;; 13283 esac 13284 ;; 13285 13286 netbsd*) 13287 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then 13288 archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' 13289 wlarc= 13290 hardcode_libdir_flag_spec_CXX='-R$libdir' 13291 hardcode_direct_CXX=yes 13292 hardcode_shlibpath_var_CXX=no 13293 fi 13294 # Workaround some broken pre-1.5 toolchains 13295 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' 13296 ;; 13297 13298 *nto* | *qnx*) 13299 ld_shlibs_CXX=yes 13300 ;; 13301 13302 openbsd2*) 13303 # C++ shared libraries are fairly broken 13304 ld_shlibs_CXX=no 13305 ;; 13306 13307 openbsd*) 13308 if test -f /usr/libexec/ld.so; then 13309 hardcode_direct_CXX=yes 13310 hardcode_shlibpath_var_CXX=no 13311 hardcode_direct_absolute_CXX=yes 13312 archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 13313 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' 13314 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 13315 archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' 13316 export_dynamic_flag_spec_CXX='${wl}-E' 13317 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 13318 fi 13319 output_verbose_link_cmd=func_echo_all 13320 else 13321 ld_shlibs_CXX=no 13322 fi 13323 ;; 13324 13325 osf3* | osf4* | osf5*) 13326 case $cc_basename in 13327 KCC*) 13328 # Kuck and Associates, Inc. (KAI) C++ Compiler 13329 13330 # KCC will only create a shared library if the output file 13331 # ends with ".so" (or ".sl" for HP-UX), so rename the library 13332 # to its proper name (with version) after linking. 13333 archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' 13334 13335 hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' 13336 hardcode_libdir_separator_CXX=: 13337 13338 # Archives containing C++ object files must be created using 13339 # the KAI C++ compiler. 13340 case $host in 13341 osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; 13342 *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; 13343 esac 13344 ;; 13345 RCC*) 13346 # Rational C++ 2.4.1 13347 # FIXME: insert proper C++ library support 13348 ld_shlibs_CXX=no 13349 ;; 13350 cxx*) 13351 case $host in 13352 osf3*) 13353 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' 13354 archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' 13355 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' 13356 ;; 13357 *) 13358 allow_undefined_flag_CXX=' -expect_unresolved \*' 13359 archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' 13360 archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ 13361 echo "-hidden">> $lib.exp~ 13362 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ 13363 $RM $lib.exp' 13364 hardcode_libdir_flag_spec_CXX='-rpath $libdir' 13365 ;; 13366 esac 13367 13368 hardcode_libdir_separator_CXX=: 13369 13370 # Commands to make compiler produce verbose output that lists 13371 # what "hidden" libraries, object files and flags are used when 13372 # linking a shared library. 13373 # 13374 # There doesn't appear to be a way to prevent this compiler from 13375 # explicitly linking system object files so we need to strip them 13376 # from the output so that they don't get included in the library 13377 # dependencies. 13378 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' 13379 ;; 13380 *) 13381 if test "$GXX" = yes && test "$with_gnu_ld" = no; then 13382 allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' 13383 case $host in 13384 osf3*) 13385 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 13386 ;; 13387 *) 13388 archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 13389 ;; 13390 esac 13391 13392 hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' 13393 hardcode_libdir_separator_CXX=: 13394 13395 # Commands to make compiler produce verbose output that lists 13396 # what "hidden" libraries, object files and flags are used when 13397 # linking a shared library. 13398 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 13399 13400 else 13401 # FIXME: insert proper C++ library support 13402 ld_shlibs_CXX=no 13403 fi 13404 ;; 13405 esac 13406 ;; 13407 13408 psos*) 13409 # FIXME: insert proper C++ library support 13410 ld_shlibs_CXX=no 13411 ;; 13412 13413 sunos4*) 13414 case $cc_basename in 13415 CC*) 13416 # Sun C++ 4.x 13417 # FIXME: insert proper C++ library support 13418 ld_shlibs_CXX=no 13419 ;; 13420 lcc*) 13421 # Lucid 13422 # FIXME: insert proper C++ library support 13423 ld_shlibs_CXX=no 13424 ;; 13425 *) 13426 # FIXME: insert proper C++ library support 13427 ld_shlibs_CXX=no 13428 ;; 13429 esac 13430 ;; 13431 13432 solaris*) 13433 case $cc_basename in 13434 CC* | sunCC*) 13435 # Sun C++ 4.2, 5.x and Centerline C++ 13436 archive_cmds_need_lc_CXX=yes 13437 no_undefined_flag_CXX=' -zdefs' 13438 archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 13439 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ 13440 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' 13441 13442 hardcode_libdir_flag_spec_CXX='-R$libdir' 13443 hardcode_shlibpath_var_CXX=no 13444 case $host_os in 13445 solaris2.[0-5] | solaris2.[0-5].*) ;; 13446 *) 13447 # The compiler driver will combine and reorder linker options, 13448 # but understands `-z linker_flag'. 13449 # Supported since Solaris 2.6 (maybe 2.5.1?) 13450 whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' 13451 ;; 13452 esac 13453 link_all_deplibs_CXX=yes 13454 13455 output_verbose_link_cmd='func_echo_all' 13456 13457 # Archives containing C++ object files must be created using 13458 # "CC -xar", where "CC" is the Sun C++ compiler. This is 13459 # necessary to make sure instantiated templates are included 13460 # in the archive. 13461 old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' 13462 ;; 13463 gcx*) 13464 # Green Hills C++ Compiler 13465 archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' 13466 13467 # The C++ compiler must be used to create the archive. 13468 old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' 13469 ;; 13470 *) 13471 # GNU C++ compiler with Solaris linker 13472 if test "$GXX" = yes && test "$with_gnu_ld" = no; then 13473 no_undefined_flag_CXX=' ${wl}-z ${wl}defs' 13474 if $CC --version | $GREP -v '^2\.7' > /dev/null; then 13475 archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' 13476 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ 13477 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' 13478 13479 # Commands to make compiler produce verbose output that lists 13480 # what "hidden" libraries, object files and flags are used when 13481 # linking a shared library. 13482 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 13483 else 13484 # g++ 2.7 appears to require `-G' NOT `-shared' on this 13485 # platform. 13486 archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' 13487 archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ 13488 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' 13489 13490 # Commands to make compiler produce verbose output that lists 13491 # what "hidden" libraries, object files and flags are used when 13492 # linking a shared library. 13493 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' 13494 fi 13495 13496 hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' 13497 case $host_os in 13498 solaris2.[0-5] | solaris2.[0-5].*) ;; 13499 *) 13500 whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' 13501 ;; 13502 esac 13503 fi 13504 ;; 13505 esac 13506 ;; 13507 13508 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) 13509 no_undefined_flag_CXX='${wl}-z,text' 13510 archive_cmds_need_lc_CXX=no 13511 hardcode_shlibpath_var_CXX=no 13512 runpath_var='LD_RUN_PATH' 13513 13514 case $cc_basename in 13515 CC*) 13516 archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13517 archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13518 ;; 13519 *) 13520 archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13521 archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13522 ;; 13523 esac 13524 ;; 13525 13526 sysv5* | sco3.2v5* | sco5v6*) 13527 # Note: We can NOT use -z defs as we might desire, because we do not 13528 # link with -lc, and that would cause any symbols used from libc to 13529 # always be unresolved, which means just about no library would 13530 # ever link correctly. If we're not using GNU ld we use -z text 13531 # though, which does catch some bad symbols but isn't as heavy-handed 13532 # as -z defs. 13533 no_undefined_flag_CXX='${wl}-z,text' 13534 allow_undefined_flag_CXX='${wl}-z,nodefs' 13535 archive_cmds_need_lc_CXX=no 13536 hardcode_shlibpath_var_CXX=no 13537 hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' 13538 hardcode_libdir_separator_CXX=':' 13539 link_all_deplibs_CXX=yes 13540 export_dynamic_flag_spec_CXX='${wl}-Bexport' 13541 runpath_var='LD_RUN_PATH' 13542 13543 case $cc_basename in 13544 CC*) 13545 archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13546 archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13547 old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ 13548 '"$old_archive_cmds_CXX" 13549 reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ 13550 '"$reload_cmds_CXX" 13551 ;; 13552 *) 13553 archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13554 archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' 13555 ;; 13556 esac 13557 ;; 13558 13559 tandem*) 13560 case $cc_basename in 13561 NCC*) 13562 # NonStop-UX NCC 3.20 13563 # FIXME: insert proper C++ library support 13564 ld_shlibs_CXX=no 13565 ;; 13566 *) 13567 # FIXME: insert proper C++ library support 13568 ld_shlibs_CXX=no 13569 ;; 13570 esac 13571 ;; 13572 13573 vxworks*) 13574 # FIXME: insert proper C++ library support 13575 ld_shlibs_CXX=no 13576 ;; 13577 13578 *) 13579 # FIXME: insert proper C++ library support 13580 ld_shlibs_CXX=no 13581 ;; 13582 esac 13583 13584 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 13585 $as_echo "$ld_shlibs_CXX" >&6; } 13586 test "$ld_shlibs_CXX" = no && can_build_shared=no 13587 13588 GCC_CXX="$GXX" 13589 LD_CXX="$LD" 13590 13591 ## CAVEAT EMPTOR: 13592 ## There is no encapsulation within the following macros, do not change 13593 ## the running order or otherwise move them around unless you know exactly 13594 ## what you are doing... 13595 # Dependencies to place before and after the object being linked: 13596 predep_objects_CXX= 13597 postdep_objects_CXX= 13598 predeps_CXX= 13599 postdeps_CXX= 13600 compiler_lib_search_path_CXX= 13601 13602 cat > conftest.$ac_ext <<_LT_EOF 13603 class Foo 13604 { 13605 public: 13606 Foo (void) { a = 0; } 13607 private: 13608 int a; 13609 }; 13610 _LT_EOF 13611 13612 13613 _lt_libdeps_save_CFLAGS=$CFLAGS 13614 case "$CC $CFLAGS " in #( 13615 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; 13616 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; 13617 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; 13618 esac 13619 13620 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 13621 (eval $ac_compile) 2>&5 13622 ac_status=$? 13623 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 13624 test $ac_status = 0; }; then 13625 # Parse the compiler output and extract the necessary 13626 # objects, libraries and library flags. 13627 13628 # Sentinel used to keep track of whether or not we are before 13629 # the conftest object file. 13630 pre_test_object_deps_done=no 13631 13632 for p in `eval "$output_verbose_link_cmd"`; do 13633 case ${prev}${p} in 13634 13635 -L* | -R* | -l*) 13636 # Some compilers place space between "-{L,R}" and the path. 13637 # Remove the space. 13638 if test $p = "-L" || 13639 test $p = "-R"; then 13640 prev=$p 13641 continue 13642 fi 13643 13644 # Expand the sysroot to ease extracting the directories later. 13645 if test -z "$prev"; then 13646 case $p in 13647 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; 13648 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; 13649 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; 13650 esac 13651 fi 13652 case $p in 13653 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; 13654 esac 13655 if test "$pre_test_object_deps_done" = no; then 13656 case ${prev} in 13657 -L | -R) 13658 # Internal compiler library paths should come after those 13659 # provided the user. The postdeps already come after the 13660 # user supplied libs so there is no need to process them. 13661 if test -z "$compiler_lib_search_path_CXX"; then 13662 compiler_lib_search_path_CXX="${prev}${p}" 13663 else 13664 compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" 13665 fi 13666 ;; 13667 # The "-l" case would never come before the object being 13668 # linked, so don't bother handling this case. 13669 esac 13670 else 13671 if test -z "$postdeps_CXX"; then 13672 postdeps_CXX="${prev}${p}" 13673 else 13674 postdeps_CXX="${postdeps_CXX} ${prev}${p}" 13675 fi 13676 fi 13677 prev= 13678 ;; 13679 13680 *.lto.$objext) ;; # Ignore GCC LTO objects 13681 *.$objext) 13682 # This assumes that the test object file only shows up 13683 # once in the compiler output. 13684 if test "$p" = "conftest.$objext"; then 13685 pre_test_object_deps_done=yes 13686 continue 13687 fi 13688 13689 if test "$pre_test_object_deps_done" = no; then 13690 if test -z "$predep_objects_CXX"; then 13691 predep_objects_CXX="$p" 13692 else 13693 predep_objects_CXX="$predep_objects_CXX $p" 13694 fi 13695 else 13696 if test -z "$postdep_objects_CXX"; then 13697 postdep_objects_CXX="$p" 13698 else 13699 postdep_objects_CXX="$postdep_objects_CXX $p" 13700 fi 13701 fi 13702 ;; 13703 13704 *) ;; # Ignore the rest. 13705 13706 esac 13707 done 13708 13709 # Clean up. 13710 rm -f a.out a.exe 13711 else 13712 echo "libtool.m4: error: problem compiling CXX test program" 13713 fi 13714 13715 $RM -f confest.$objext 13716 CFLAGS=$_lt_libdeps_save_CFLAGS 13717 13718 # PORTME: override above test on systems where it is broken 13719 case $host_os in 13720 interix[3-9]*) 13721 # Interix 3.5 installs completely hosed .la files for C++, so rather than 13722 # hack all around it, let's just trust "g++" to DTRT. 13723 predep_objects_CXX= 13724 postdep_objects_CXX= 13725 postdeps_CXX= 13726 ;; 13727 13728 linux*) 13729 case `$CC -V 2>&1 | sed 5q` in 13730 *Sun\ C*) 13731 # Sun C++ 5.9 13732 13733 # The more standards-conforming stlport4 library is 13734 # incompatible with the Cstd library. Avoid specifying 13735 # it if it's in CXXFLAGS. Ignore libCrun as 13736 # -library=stlport4 depends on it. 13737 case " $CXX $CXXFLAGS " in 13738 *" -library=stlport4 "*) 13739 solaris_use_stlport4=yes 13740 ;; 13741 esac 13742 13743 if test "$solaris_use_stlport4" != yes; then 13744 postdeps_CXX='-library=Cstd -library=Crun' 13745 fi 13746 ;; 13747 esac 13748 ;; 13749 13750 solaris*) 13751 case $cc_basename in 13752 CC* | sunCC*) 13753 # The more standards-conforming stlport4 library is 13754 # incompatible with the Cstd library. Avoid specifying 13755 # it if it's in CXXFLAGS. Ignore libCrun as 13756 # -library=stlport4 depends on it. 13757 case " $CXX $CXXFLAGS " in 13758 *" -library=stlport4 "*) 13759 solaris_use_stlport4=yes 13760 ;; 13761 esac 13762 13763 # Adding this requires a known-good setup of shared libraries for 13764 # Sun compiler versions before 5.6, else PIC objects from an old 13765 # archive will be linked into the output, leading to subtle bugs. 13766 if test "$solaris_use_stlport4" != yes; then 13767 postdeps_CXX='-library=Cstd -library=Crun' 13768 fi 13769 ;; 13770 esac 13771 ;; 13772 esac 13773 13774 13775 case " $postdeps_CXX " in 13776 *" -lc "*) archive_cmds_need_lc_CXX=no ;; 13777 esac 13778 compiler_lib_search_dirs_CXX= 13779 if test -n "${compiler_lib_search_path_CXX}"; then 13780 compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` 13781 fi 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 lt_prog_compiler_wl_CXX= 13814 lt_prog_compiler_pic_CXX= 13815 lt_prog_compiler_static_CXX= 13816 13817 13818 # C++ specific cases for pic, static, wl, etc. 13819 if test "$GXX" = yes; then 13820 lt_prog_compiler_wl_CXX='-Wl,' 13821 lt_prog_compiler_static_CXX='-static' 13822 13823 case $host_os in 13824 aix*) 13825 # All AIX code is PIC. 13826 if test "$host_cpu" = ia64; then 13827 # AIX 5 now supports IA64 processor 13828 lt_prog_compiler_static_CXX='-Bstatic' 13829 fi 13830 ;; 13831 13832 amigaos*) 13833 case $host_cpu in 13834 powerpc) 13835 # see comment about AmigaOS4 .so support 13836 lt_prog_compiler_pic_CXX='-fPIC' 13837 ;; 13838 m68k) 13839 # FIXME: we need at least 68020 code to build shared libraries, but 13840 # adding the `-m68020' flag to GCC prevents building anything better, 13841 # like `-m68040'. 13842 lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' 13843 ;; 13844 esac 13845 ;; 13846 13847 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 13848 # PIC is the default for these OSes. 13849 ;; 13850 mingw* | cygwin* | os2* | pw32* | cegcc*) 13851 # This hack is so that the source file can tell whether it is being 13852 # built for inclusion in a dll (and should export symbols for example). 13853 # Although the cygwin gcc ignores -fPIC, still need this for old-style 13854 # (--disable-auto-import) libraries 13855 lt_prog_compiler_pic_CXX='-DDLL_EXPORT' 13856 ;; 13857 darwin* | rhapsody*) 13858 # PIC is the default on this platform 13859 # Common symbols not allowed in MH_DYLIB files 13860 lt_prog_compiler_pic_CXX='-fno-common' 13861 ;; 13862 *djgpp*) 13863 # DJGPP does not support shared libraries at all 13864 lt_prog_compiler_pic_CXX= 13865 ;; 13866 haiku*) 13867 # PIC is the default for Haiku. 13868 # The "-static" flag exists, but is broken. 13869 lt_prog_compiler_static_CXX= 13870 ;; 13871 interix[3-9]*) 13872 # Interix 3.x gcc -fpic/-fPIC options generate broken code. 13873 # Instead, we relocate shared libraries at runtime. 13874 ;; 13875 sysv4*MP*) 13876 if test -d /usr/nec; then 13877 lt_prog_compiler_pic_CXX=-Kconform_pic 13878 fi 13879 ;; 13880 hpux*) 13881 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit 13882 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag 13883 # sets the default TLS model and affects inlining. 13884 case $host_cpu in 13885 hppa*64*) 13886 ;; 13887 *) 13888 lt_prog_compiler_pic_CXX='-fPIC' 13889 ;; 13890 esac 13891 ;; 13892 *qnx* | *nto*) 13893 # QNX uses GNU C++, but need to define -shared option too, otherwise 13894 # it will coredump. 13895 lt_prog_compiler_pic_CXX='-fPIC -shared' 13896 ;; 13897 *) 13898 lt_prog_compiler_pic_CXX='-fPIC' 13899 ;; 13900 esac 13901 else 13902 case $host_os in 13903 aix[4-9]*) 13904 # All AIX code is PIC. 13905 if test "$host_cpu" = ia64; then 13906 # AIX 5 now supports IA64 processor 13907 lt_prog_compiler_static_CXX='-Bstatic' 13908 else 13909 lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' 13910 fi 13911 ;; 13912 chorus*) 13913 case $cc_basename in 13914 cxch68*) 13915 # Green Hills C++ Compiler 13916 # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" 13917 ;; 13918 esac 13919 ;; 13920 mingw* | cygwin* | os2* | pw32* | cegcc*) 13921 # This hack is so that the source file can tell whether it is being 13922 # built for inclusion in a dll (and should export symbols for example). 13923 lt_prog_compiler_pic_CXX='-DDLL_EXPORT' 13924 ;; 13925 dgux*) 13926 case $cc_basename in 13927 ec++*) 13928 lt_prog_compiler_pic_CXX='-KPIC' 13929 ;; 13930 ghcx*) 13931 # Green Hills C++ Compiler 13932 lt_prog_compiler_pic_CXX='-pic' 13933 ;; 13934 *) 13935 ;; 13936 esac 13937 ;; 13938 freebsd* | dragonfly*) 13939 # FreeBSD uses GNU C++ 13940 ;; 13941 hpux9* | hpux10* | hpux11*) 13942 case $cc_basename in 13943 CC*) 13944 lt_prog_compiler_wl_CXX='-Wl,' 13945 lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' 13946 if test "$host_cpu" != ia64; then 13947 lt_prog_compiler_pic_CXX='+Z' 13948 fi 13949 ;; 13950 aCC*) 13951 lt_prog_compiler_wl_CXX='-Wl,' 13952 lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' 13953 case $host_cpu in 13954 hppa*64*|ia64*) 13955 # +Z the default 13956 ;; 13957 *) 13958 lt_prog_compiler_pic_CXX='+Z' 13959 ;; 13960 esac 13961 ;; 13962 *) 13963 ;; 13964 esac 13965 ;; 13966 interix*) 13967 # This is c89, which is MS Visual C++ (no shared libs) 13968 # Anyone wants to do a port? 13969 ;; 13970 irix5* | irix6* | nonstopux*) 13971 case $cc_basename in 13972 CC*) 13973 lt_prog_compiler_wl_CXX='-Wl,' 13974 lt_prog_compiler_static_CXX='-non_shared' 13975 # CC pic flag -KPIC is the default. 13976 ;; 13977 *) 13978 ;; 13979 esac 13980 ;; 13981 linux* | k*bsd*-gnu | kopensolaris*-gnu) 13982 case $cc_basename in 13983 KCC*) 13984 # KAI C++ Compiler 13985 lt_prog_compiler_wl_CXX='--backend -Wl,' 13986 lt_prog_compiler_pic_CXX='-fPIC' 13987 ;; 13988 ecpc* ) 13989 # old Intel C++ for x86_64 which still supported -KPIC. 13990 lt_prog_compiler_wl_CXX='-Wl,' 13991 lt_prog_compiler_pic_CXX='-KPIC' 13992 lt_prog_compiler_static_CXX='-static' 13993 ;; 13994 icpc* ) 13995 # Intel C++, used to be incompatible with GCC. 13996 # ICC 10 doesn't accept -KPIC any more. 13997 lt_prog_compiler_wl_CXX='-Wl,' 13998 lt_prog_compiler_pic_CXX='-fPIC' 13999 lt_prog_compiler_static_CXX='-static' 14000 ;; 14001 pgCC* | pgcpp*) 14002 # Portland Group C++ compiler 14003 lt_prog_compiler_wl_CXX='-Wl,' 14004 lt_prog_compiler_pic_CXX='-fpic' 14005 lt_prog_compiler_static_CXX='-Bstatic' 14006 ;; 14007 cxx*) 14008 # Compaq C++ 14009 # Make sure the PIC flag is empty. It appears that all Alpha 14010 # Linux and Compaq Tru64 Unix objects are PIC. 14011 lt_prog_compiler_pic_CXX= 14012 lt_prog_compiler_static_CXX='-non_shared' 14013 ;; 14014 xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) 14015 # IBM XL 8.0, 9.0 on PPC and BlueGene 14016 lt_prog_compiler_wl_CXX='-Wl,' 14017 lt_prog_compiler_pic_CXX='-qpic' 14018 lt_prog_compiler_static_CXX='-qstaticlink' 14019 ;; 14020 *) 14021 case `$CC -V 2>&1 | sed 5q` in 14022 *Sun\ C*) 14023 # Sun C++ 5.9 14024 lt_prog_compiler_pic_CXX='-KPIC' 14025 lt_prog_compiler_static_CXX='-Bstatic' 14026 lt_prog_compiler_wl_CXX='-Qoption ld ' 14027 ;; 14028 esac 14029 ;; 14030 esac 14031 ;; 14032 lynxos*) 14033 ;; 14034 m88k*) 14035 ;; 14036 mvs*) 14037 case $cc_basename in 14038 cxx*) 14039 lt_prog_compiler_pic_CXX='-W c,exportall' 14040 ;; 14041 *) 14042 ;; 14043 esac 14044 ;; 14045 netbsd*) 14046 ;; 14047 *qnx* | *nto*) 14048 # QNX uses GNU C++, but need to define -shared option too, otherwise 14049 # it will coredump. 14050 lt_prog_compiler_pic_CXX='-fPIC -shared' 14051 ;; 14052 osf3* | osf4* | osf5*) 14053 case $cc_basename in 14054 KCC*) 14055 lt_prog_compiler_wl_CXX='--backend -Wl,' 14056 ;; 14057 RCC*) 14058 # Rational C++ 2.4.1 14059 lt_prog_compiler_pic_CXX='-pic' 14060 ;; 14061 cxx*) 14062 # Digital/Compaq C++ 14063 lt_prog_compiler_wl_CXX='-Wl,' 14064 # Make sure the PIC flag is empty. It appears that all Alpha 14065 # Linux and Compaq Tru64 Unix objects are PIC. 14066 lt_prog_compiler_pic_CXX= 14067 lt_prog_compiler_static_CXX='-non_shared' 14068 ;; 14069 *) 14070 ;; 14071 esac 14072 ;; 14073 psos*) 14074 ;; 14075 solaris*) 14076 case $cc_basename in 14077 CC* | sunCC*) 14078 # Sun C++ 4.2, 5.x and Centerline C++ 14079 lt_prog_compiler_pic_CXX='-KPIC' 14080 lt_prog_compiler_static_CXX='-Bstatic' 14081 lt_prog_compiler_wl_CXX='-Qoption ld ' 14082 ;; 14083 gcx*) 14084 # Green Hills C++ Compiler 14085 lt_prog_compiler_pic_CXX='-PIC' 14086 ;; 14087 *) 14088 ;; 14089 esac 14090 ;; 14091 sunos4*) 14092 case $cc_basename in 14093 CC*) 14094 # Sun C++ 4.x 14095 lt_prog_compiler_pic_CXX='-pic' 14096 lt_prog_compiler_static_CXX='-Bstatic' 14097 ;; 14098 lcc*) 14099 # Lucid 14100 lt_prog_compiler_pic_CXX='-pic' 14101 ;; 14102 *) 14103 ;; 14104 esac 14105 ;; 14106 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) 14107 case $cc_basename in 14108 CC*) 14109 lt_prog_compiler_wl_CXX='-Wl,' 14110 lt_prog_compiler_pic_CXX='-KPIC' 14111 lt_prog_compiler_static_CXX='-Bstatic' 14112 ;; 14113 esac 14114 ;; 14115 tandem*) 14116 case $cc_basename in 14117 NCC*) 14118 # NonStop-UX NCC 3.20 14119 lt_prog_compiler_pic_CXX='-KPIC' 14120 ;; 14121 *) 14122 ;; 14123 esac 14124 ;; 14125 vxworks*) 14126 ;; 14127 *) 14128 lt_prog_compiler_can_build_shared_CXX=no 14129 ;; 14130 esac 14131 fi 14132 14133 case $host_os in 14134 # For platforms which do not support PIC, -DPIC is meaningless: 14135 *djgpp*) 14136 lt_prog_compiler_pic_CXX= 14137 ;; 14138 *) 14139 lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" 14140 ;; 14141 esac 14142 14143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 14144 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 14145 if ${lt_cv_prog_compiler_pic_CXX+:} false; then : 14146 $as_echo_n "(cached) " >&6 14147 else 14148 lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX 14149 fi 14150 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 14151 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } 14152 lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX 14153 14154 # 14155 # Check to make sure the PIC flag actually works. 14156 # 14157 if test -n "$lt_prog_compiler_pic_CXX"; then 14158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 14159 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } 14160 if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : 14161 $as_echo_n "(cached) " >&6 14162 else 14163 lt_cv_prog_compiler_pic_works_CXX=no 14164 ac_outfile=conftest.$ac_objext 14165 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 14166 lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" 14167 # Insert the option either (1) after the last *FLAGS variable, or 14168 # (2) before a word containing "conftest.", or (3) at the end. 14169 # Note that $ac_compile itself does not contain backslashes and begins 14170 # with a dollar sign (not a hyphen), so the echo should work correctly. 14171 # The option is referenced via a variable to avoid confusing sed. 14172 lt_compile=`echo "$ac_compile" | $SED \ 14173 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ 14174 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 14175 -e 's:$: $lt_compiler_flag:'` 14176 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) 14177 (eval "$lt_compile" 2>conftest.err) 14178 ac_status=$? 14179 cat conftest.err >&5 14180 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14181 if (exit $ac_status) && test -s "$ac_outfile"; then 14182 # The compiler can only warn and ignore the option if not recognized 14183 # So say no if there are warnings other than the usual output. 14184 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp 14185 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 14186 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then 14187 lt_cv_prog_compiler_pic_works_CXX=yes 14188 fi 14189 fi 14190 $RM conftest* 14191 14192 fi 14193 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 14194 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } 14195 14196 if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then 14197 case $lt_prog_compiler_pic_CXX in 14198 "" | " "*) ;; 14199 *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; 14200 esac 14201 else 14202 lt_prog_compiler_pic_CXX= 14203 lt_prog_compiler_can_build_shared_CXX=no 14204 fi 14205 14206 fi 14207 14208 14209 14210 14211 14212 # 14213 # Check to make sure the static flag actually works. 14214 # 14215 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" 14216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 14217 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } 14218 if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : 14219 $as_echo_n "(cached) " >&6 14220 else 14221 lt_cv_prog_compiler_static_works_CXX=no 14222 save_LDFLAGS="$LDFLAGS" 14223 LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 14224 echo "$lt_simple_link_test_code" > conftest.$ac_ext 14225 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then 14226 # The linker can only warn and ignore the option if not recognized 14227 # So say no if there are warnings 14228 if test -s conftest.err; then 14229 # Append any errors to the config.log. 14230 cat conftest.err 1>&5 14231 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp 14232 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 14233 if diff conftest.exp conftest.er2 >/dev/null; then 14234 lt_cv_prog_compiler_static_works_CXX=yes 14235 fi 14236 else 14237 lt_cv_prog_compiler_static_works_CXX=yes 14238 fi 14239 fi 14240 $RM -r conftest* 14241 LDFLAGS="$save_LDFLAGS" 14242 14243 fi 14244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 14245 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } 14246 14247 if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then 14248 : 14249 else 14250 lt_prog_compiler_static_CXX= 14251 fi 14252 14253 14254 14255 14256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 14257 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } 14258 if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : 14259 $as_echo_n "(cached) " >&6 14260 else 14261 lt_cv_prog_compiler_c_o_CXX=no 14262 $RM -r conftest 2>/dev/null 14263 mkdir conftest 14264 cd conftest 14265 mkdir out 14266 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 14267 14268 lt_compiler_flag="-o out/conftest2.$ac_objext" 14269 # Insert the option either (1) after the last *FLAGS variable, or 14270 # (2) before a word containing "conftest.", or (3) at the end. 14271 # Note that $ac_compile itself does not contain backslashes and begins 14272 # with a dollar sign (not a hyphen), so the echo should work correctly. 14273 lt_compile=`echo "$ac_compile" | $SED \ 14274 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ 14275 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 14276 -e 's:$: $lt_compiler_flag:'` 14277 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) 14278 (eval "$lt_compile" 2>out/conftest.err) 14279 ac_status=$? 14280 cat out/conftest.err >&5 14281 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14282 if (exit $ac_status) && test -s out/conftest2.$ac_objext 14283 then 14284 # The compiler can only warn and ignore the option if not recognized 14285 # So say no if there are warnings 14286 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp 14287 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 14288 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then 14289 lt_cv_prog_compiler_c_o_CXX=yes 14290 fi 14291 fi 14292 chmod u+w . 2>&5 14293 $RM conftest* 14294 # SGI C++ compiler will create directory out/ii_files/ for 14295 # template instantiation 14296 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files 14297 $RM out/* && rmdir out 14298 cd .. 14299 $RM -r conftest 14300 $RM conftest* 14301 14302 fi 14303 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 14304 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } 14305 14306 14307 14308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 14309 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } 14310 if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : 14311 $as_echo_n "(cached) " >&6 14312 else 14313 lt_cv_prog_compiler_c_o_CXX=no 14314 $RM -r conftest 2>/dev/null 14315 mkdir conftest 14316 cd conftest 14317 mkdir out 14318 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 14319 14320 lt_compiler_flag="-o out/conftest2.$ac_objext" 14321 # Insert the option either (1) after the last *FLAGS variable, or 14322 # (2) before a word containing "conftest.", or (3) at the end. 14323 # Note that $ac_compile itself does not contain backslashes and begins 14324 # with a dollar sign (not a hyphen), so the echo should work correctly. 14325 lt_compile=`echo "$ac_compile" | $SED \ 14326 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ 14327 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 14328 -e 's:$: $lt_compiler_flag:'` 14329 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) 14330 (eval "$lt_compile" 2>out/conftest.err) 14331 ac_status=$? 14332 cat out/conftest.err >&5 14333 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14334 if (exit $ac_status) && test -s out/conftest2.$ac_objext 14335 then 14336 # The compiler can only warn and ignore the option if not recognized 14337 # So say no if there are warnings 14338 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp 14339 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 14340 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then 14341 lt_cv_prog_compiler_c_o_CXX=yes 14342 fi 14343 fi 14344 chmod u+w . 2>&5 14345 $RM conftest* 14346 # SGI C++ compiler will create directory out/ii_files/ for 14347 # template instantiation 14348 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files 14349 $RM out/* && rmdir out 14350 cd .. 14351 $RM -r conftest 14352 $RM conftest* 14353 14354 fi 14355 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 14356 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } 14357 14358 14359 14360 14361 hard_links="nottested" 14362 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then 14363 # do not overwrite the value of need_locks provided by the user 14364 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 14365 $as_echo_n "checking if we can lock with hard links... " >&6; } 14366 hard_links=yes 14367 $RM conftest* 14368 ln conftest.a conftest.b 2>/dev/null && hard_links=no 14369 touch conftest.a 14370 ln conftest.a conftest.b 2>&5 || hard_links=no 14371 ln conftest.a conftest.b 2>/dev/null && hard_links=no 14372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 14373 $as_echo "$hard_links" >&6; } 14374 if test "$hard_links" = no; then 14375 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 14376 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} 14377 need_locks=warn 14378 fi 14379 else 14380 need_locks=no 14381 fi 14382 14383 14384 14385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 14386 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } 14387 14388 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' 14389 exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' 14390 case $host_os in 14391 aix[4-9]*) 14392 # If we're using GNU nm, then we don't want the "-C" option. 14393 # -C means demangle to AIX nm, but means don't demangle with GNU nm 14394 # Also, AIX nm treats weak defined symbols like other global defined 14395 # symbols, whereas GNU nm marks them as "W". 14396 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then 14397 export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' 14398 else 14399 export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' 14400 fi 14401 ;; 14402 pw32*) 14403 export_symbols_cmds_CXX="$ltdll_cmds" 14404 ;; 14405 cygwin* | mingw* | cegcc*) 14406 case $cc_basename in 14407 cl*) 14408 exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' 14409 ;; 14410 *) 14411 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' 14412 exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 14413 ;; 14414 esac 14415 ;; 14416 *) 14417 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' 14418 ;; 14419 esac 14420 14421 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 14422 $as_echo "$ld_shlibs_CXX" >&6; } 14423 test "$ld_shlibs_CXX" = no && can_build_shared=no 14424 14425 with_gnu_ld_CXX=$with_gnu_ld 14426 14427 14428 14429 14430 14431 14432 # 14433 # Do we need to explicitly link libc? 14434 # 14435 case "x$archive_cmds_need_lc_CXX" in 14436 x|xyes) 14437 # Assume -lc should be added 14438 archive_cmds_need_lc_CXX=yes 14439 14440 if test "$enable_shared" = yes && test "$GCC" = yes; then 14441 case $archive_cmds_CXX in 14442 *'~'*) 14443 # FIXME: we may have to deal with multi-command sequences. 14444 ;; 14445 '$CC '*) 14446 # Test whether the compiler implicitly links with -lc since on some 14447 # systems, -lgcc has to come before -lc. If gcc already passes -lc 14448 # to ld, don't add -lc before -lgcc. 14449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 14450 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } 14451 if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : 14452 $as_echo_n "(cached) " >&6 14453 else 14454 $RM conftest* 14455 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 14456 14457 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 14458 (eval $ac_compile) 2>&5 14459 ac_status=$? 14460 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 14461 test $ac_status = 0; } 2>conftest.err; then 14462 soname=conftest 14463 lib=conftest 14464 libobjs=conftest.$ac_objext 14465 deplibs= 14466 wl=$lt_prog_compiler_wl_CXX 14467 pic_flag=$lt_prog_compiler_pic_CXX 14468 compiler_flags=-v 14469 linker_flags=-v 14470 verstring= 14471 output_objdir=. 14472 libname=conftest 14473 lt_save_allow_undefined_flag=$allow_undefined_flag_CXX 14474 allow_undefined_flag_CXX= 14475 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 14476 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 14477 ac_status=$? 14478 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 14479 test $ac_status = 0; } 14480 then 14481 lt_cv_archive_cmds_need_lc_CXX=no 14482 else 14483 lt_cv_archive_cmds_need_lc_CXX=yes 14484 fi 14485 allow_undefined_flag_CXX=$lt_save_allow_undefined_flag 14486 else 14487 cat conftest.err 1>&5 14488 fi 14489 $RM conftest* 14490 14491 fi 14492 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 14493 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } 14494 archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX 14495 ;; 14496 esac 14497 fi 14498 ;; 14499 esac 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 14563 $as_echo_n "checking dynamic linker characteristics... " >&6; } 14564 14565 library_names_spec= 14566 libname_spec='lib$name' 14567 soname_spec= 14568 shrext_cmds=".so" 14569 postinstall_cmds= 14570 postuninstall_cmds= 14571 finish_cmds= 14572 finish_eval= 14573 shlibpath_var= 14574 shlibpath_overrides_runpath=unknown 14575 version_type=none 14576 dynamic_linker="$host_os ld.so" 14577 sys_lib_dlsearch_path_spec="/lib /usr/lib" 14578 need_lib_prefix=unknown 14579 hardcode_into_libs=no 14580 14581 # when you set need_version to no, make sure it does not cause -set_version 14582 # flags to be left without arguments 14583 need_version=unknown 14584 14585 case $host_os in 14586 aix3*) 14587 version_type=linux # correct to gnu/linux during the next big refactor 14588 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' 14589 shlibpath_var=LIBPATH 14590 14591 # AIX 3 has no versioning support, so we append a major version to the name. 14592 soname_spec='${libname}${release}${shared_ext}$major' 14593 ;; 14594 14595 aix[4-9]*) 14596 version_type=linux # correct to gnu/linux during the next big refactor 14597 need_lib_prefix=no 14598 need_version=no 14599 hardcode_into_libs=yes 14600 if test "$host_cpu" = ia64; then 14601 # AIX 5 supports IA64 14602 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' 14603 shlibpath_var=LD_LIBRARY_PATH 14604 else 14605 # With GCC up to 2.95.x, collect2 would create an import file 14606 # for dependence libraries. The import file would start with 14607 # the line `#! .'. This would cause the generated library to 14608 # depend on `.', always an invalid library. This was fixed in 14609 # development snapshots of GCC prior to 3.0. 14610 case $host_os in 14611 aix4 | aix4.[01] | aix4.[01].*) 14612 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' 14613 echo ' yes ' 14614 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then 14615 : 14616 else 14617 can_build_shared=no 14618 fi 14619 ;; 14620 esac 14621 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct 14622 # soname into executable. Probably we can add versioning support to 14623 # collect2, so additional links can be useful in future. 14624 if test "$aix_use_runtimelinking" = yes; then 14625 # If using run time linking (on AIX 4.2 or later) use lib<name>.so 14626 # instead of lib<name>.a to let people know that these are not 14627 # typical AIX shared libraries. 14628 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14629 else 14630 # We preserve .a as extension for shared libraries through AIX4.2 14631 # and later when we are not doing run time linking. 14632 library_names_spec='${libname}${release}.a $libname.a' 14633 soname_spec='${libname}${release}${shared_ext}$major' 14634 fi 14635 shlibpath_var=LIBPATH 14636 fi 14637 ;; 14638 14639 amigaos*) 14640 case $host_cpu in 14641 powerpc) 14642 # Since July 2007 AmigaOS4 officially supports .so libraries. 14643 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. 14644 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14645 ;; 14646 m68k) 14647 library_names_spec='$libname.ixlibrary $libname.a' 14648 # Create ${libname}_ixlibrary.a entries in /sys/libs. 14649 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' 14650 ;; 14651 esac 14652 ;; 14653 14654 beos*) 14655 library_names_spec='${libname}${shared_ext}' 14656 dynamic_linker="$host_os ld.so" 14657 shlibpath_var=LIBRARY_PATH 14658 ;; 14659 14660 bsdi[45]*) 14661 version_type=linux # correct to gnu/linux during the next big refactor 14662 need_version=no 14663 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14664 soname_spec='${libname}${release}${shared_ext}$major' 14665 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' 14666 shlibpath_var=LD_LIBRARY_PATH 14667 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" 14668 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" 14669 # the default ld.so.conf also contains /usr/contrib/lib and 14670 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow 14671 # libtool to hard-code these into programs 14672 ;; 14673 14674 cygwin* | mingw* | pw32* | cegcc*) 14675 version_type=windows 14676 shrext_cmds=".dll" 14677 need_version=no 14678 need_lib_prefix=no 14679 14680 case $GCC,$cc_basename in 14681 yes,*) 14682 # gcc 14683 library_names_spec='$libname.dll.a' 14684 # DLL is installed to $(libdir)/../bin by postinstall_cmds 14685 postinstall_cmds='base_file=`basename \${file}`~ 14686 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ 14687 dldir=$destdir/`dirname \$dlpath`~ 14688 test -d \$dldir || mkdir -p \$dldir~ 14689 $install_prog $dir/$dlname \$dldir/$dlname~ 14690 chmod a+x \$dldir/$dlname~ 14691 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then 14692 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; 14693 fi' 14694 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ 14695 dlpath=$dir/\$dldll~ 14696 $RM \$dlpath' 14697 shlibpath_overrides_runpath=yes 14698 14699 case $host_os in 14700 cygwin*) 14701 # Cygwin DLLs use 'cyg' prefix rather than 'lib' 14702 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' 14703 14704 ;; 14705 mingw* | cegcc*) 14706 # MinGW DLLs use traditional 'lib' prefix 14707 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' 14708 ;; 14709 pw32*) 14710 # pw32 DLLs use 'pw' prefix rather than 'lib' 14711 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' 14712 ;; 14713 esac 14714 dynamic_linker='Win32 ld.exe' 14715 ;; 14716 14717 *,cl*) 14718 # Native MSVC 14719 libname_spec='$name' 14720 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' 14721 library_names_spec='${libname}.dll.lib' 14722 14723 case $build_os in 14724 mingw*) 14725 sys_lib_search_path_spec= 14726 lt_save_ifs=$IFS 14727 IFS=';' 14728 for lt_path in $LIB 14729 do 14730 IFS=$lt_save_ifs 14731 # Let DOS variable expansion print the short 8.3 style file name. 14732 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` 14733 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" 14734 done 14735 IFS=$lt_save_ifs 14736 # Convert to MSYS style. 14737 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` 14738 ;; 14739 cygwin*) 14740 # Convert to unix form, then to dos form, then back to unix form 14741 # but this time dos style (no spaces!) so that the unix form looks 14742 # like /cygdrive/c/PROGRA~1:/cygdr... 14743 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` 14744 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` 14745 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` 14746 ;; 14747 *) 14748 sys_lib_search_path_spec="$LIB" 14749 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then 14750 # It is most probably a Windows format PATH. 14751 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` 14752 else 14753 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` 14754 fi 14755 # FIXME: find the short name or the path components, as spaces are 14756 # common. (e.g. "Program Files" -> "PROGRA~1") 14757 ;; 14758 esac 14759 14760 # DLL is installed to $(libdir)/../bin by postinstall_cmds 14761 postinstall_cmds='base_file=`basename \${file}`~ 14762 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ 14763 dldir=$destdir/`dirname \$dlpath`~ 14764 test -d \$dldir || mkdir -p \$dldir~ 14765 $install_prog $dir/$dlname \$dldir/$dlname' 14766 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ 14767 dlpath=$dir/\$dldll~ 14768 $RM \$dlpath' 14769 shlibpath_overrides_runpath=yes 14770 dynamic_linker='Win32 link.exe' 14771 ;; 14772 14773 *) 14774 # Assume MSVC wrapper 14775 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' 14776 dynamic_linker='Win32 ld.exe' 14777 ;; 14778 esac 14779 # FIXME: first we should search . and the directory the executable is in 14780 shlibpath_var=PATH 14781 ;; 14782 14783 darwin* | rhapsody*) 14784 dynamic_linker="$host_os dyld" 14785 version_type=darwin 14786 need_lib_prefix=no 14787 need_version=no 14788 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' 14789 soname_spec='${libname}${release}${major}$shared_ext' 14790 shlibpath_overrides_runpath=yes 14791 shlibpath_var=DYLD_LIBRARY_PATH 14792 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' 14793 14794 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' 14795 ;; 14796 14797 dgux*) 14798 version_type=linux # correct to gnu/linux during the next big refactor 14799 need_lib_prefix=no 14800 need_version=no 14801 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' 14802 soname_spec='${libname}${release}${shared_ext}$major' 14803 shlibpath_var=LD_LIBRARY_PATH 14804 ;; 14805 14806 freebsd* | dragonfly*) 14807 # DragonFly does not have aout. When/if they implement a new 14808 # versioning mechanism, adjust this. 14809 if test -x /usr/bin/objformat; then 14810 objformat=`/usr/bin/objformat` 14811 else 14812 case $host_os in 14813 freebsd[23].*) objformat=aout ;; 14814 *) objformat=elf ;; 14815 esac 14816 fi 14817 version_type=freebsd-$objformat 14818 case $version_type in 14819 freebsd-elf*) 14820 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' 14821 need_version=no 14822 need_lib_prefix=no 14823 ;; 14824 freebsd-*) 14825 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' 14826 need_version=yes 14827 ;; 14828 esac 14829 shlibpath_var=LD_LIBRARY_PATH 14830 case $host_os in 14831 freebsd2.*) 14832 shlibpath_overrides_runpath=yes 14833 ;; 14834 freebsd3.[01]* | freebsdelf3.[01]*) 14835 shlibpath_overrides_runpath=yes 14836 hardcode_into_libs=yes 14837 ;; 14838 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ 14839 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) 14840 shlibpath_overrides_runpath=no 14841 hardcode_into_libs=yes 14842 ;; 14843 *) # from 4.6 on, and DragonFly 14844 shlibpath_overrides_runpath=yes 14845 hardcode_into_libs=yes 14846 ;; 14847 esac 14848 ;; 14849 14850 gnu*) 14851 version_type=linux # correct to gnu/linux during the next big refactor 14852 need_lib_prefix=no 14853 need_version=no 14854 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' 14855 soname_spec='${libname}${release}${shared_ext}$major' 14856 shlibpath_var=LD_LIBRARY_PATH 14857 shlibpath_overrides_runpath=no 14858 hardcode_into_libs=yes 14859 ;; 14860 14861 haiku*) 14862 version_type=linux # correct to gnu/linux during the next big refactor 14863 need_lib_prefix=no 14864 need_version=no 14865 dynamic_linker="$host_os runtime_loader" 14866 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' 14867 soname_spec='${libname}${release}${shared_ext}$major' 14868 shlibpath_var=LIBRARY_PATH 14869 shlibpath_overrides_runpath=yes 14870 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 14871 hardcode_into_libs=yes 14872 ;; 14873 14874 hpux9* | hpux10* | hpux11*) 14875 # Give a soname corresponding to the major version so that dld.sl refuses to 14876 # link against other versions. 14877 version_type=sunos 14878 need_lib_prefix=no 14879 need_version=no 14880 case $host_cpu in 14881 ia64*) 14882 shrext_cmds='.so' 14883 hardcode_into_libs=yes 14884 dynamic_linker="$host_os dld.so" 14885 shlibpath_var=LD_LIBRARY_PATH 14886 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. 14887 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14888 soname_spec='${libname}${release}${shared_ext}$major' 14889 if test "X$HPUX_IA64_MODE" = X32; then 14890 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" 14891 else 14892 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" 14893 fi 14894 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 14895 ;; 14896 hppa*64*) 14897 shrext_cmds='.sl' 14898 hardcode_into_libs=yes 14899 dynamic_linker="$host_os dld.sl" 14900 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH 14901 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. 14902 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14903 soname_spec='${libname}${release}${shared_ext}$major' 14904 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" 14905 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 14906 ;; 14907 *) 14908 shrext_cmds='.sl' 14909 dynamic_linker="$host_os dld.sl" 14910 shlibpath_var=SHLIB_PATH 14911 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH 14912 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14913 soname_spec='${libname}${release}${shared_ext}$major' 14914 ;; 14915 esac 14916 # HP-UX runs *really* slowly unless shared libraries are mode 555, ... 14917 postinstall_cmds='chmod 555 $lib' 14918 # or fails outright, so override atomically: 14919 install_override_mode=555 14920 ;; 14921 14922 interix[3-9]*) 14923 version_type=linux # correct to gnu/linux during the next big refactor 14924 need_lib_prefix=no 14925 need_version=no 14926 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' 14927 soname_spec='${libname}${release}${shared_ext}$major' 14928 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' 14929 shlibpath_var=LD_LIBRARY_PATH 14930 shlibpath_overrides_runpath=no 14931 hardcode_into_libs=yes 14932 ;; 14933 14934 irix5* | irix6* | nonstopux*) 14935 case $host_os in 14936 nonstopux*) version_type=nonstopux ;; 14937 *) 14938 if test "$lt_cv_prog_gnu_ld" = yes; then 14939 version_type=linux # correct to gnu/linux during the next big refactor 14940 else 14941 version_type=irix 14942 fi ;; 14943 esac 14944 need_lib_prefix=no 14945 need_version=no 14946 soname_spec='${libname}${release}${shared_ext}$major' 14947 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' 14948 case $host_os in 14949 irix5* | nonstopux*) 14950 libsuff= shlibsuff= 14951 ;; 14952 *) 14953 case $LD in # libtool.m4 will add one of these switches to LD 14954 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") 14955 libsuff= shlibsuff= libmagic=32-bit;; 14956 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") 14957 libsuff=32 shlibsuff=N32 libmagic=N32;; 14958 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") 14959 libsuff=64 shlibsuff=64 libmagic=64-bit;; 14960 *) libsuff= shlibsuff= libmagic=never-match;; 14961 esac 14962 ;; 14963 esac 14964 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH 14965 shlibpath_overrides_runpath=no 14966 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" 14967 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" 14968 hardcode_into_libs=yes 14969 ;; 14970 14971 # No shared lib support for Linux oldld, aout, or coff. 14972 linux*oldld* | linux*aout* | linux*coff*) 14973 dynamic_linker=no 14974 ;; 14975 14976 # This must be glibc/ELF. 14977 linux* | k*bsd*-gnu | kopensolaris*-gnu) 14978 version_type=linux # correct to gnu/linux during the next big refactor 14979 need_lib_prefix=no 14980 need_version=no 14981 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 14982 soname_spec='${libname}${release}${shared_ext}$major' 14983 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' 14984 shlibpath_var=LD_LIBRARY_PATH 14985 shlibpath_overrides_runpath=no 14986 14987 # Some binutils ld are patched to set DT_RUNPATH 14988 if ${lt_cv_shlibpath_overrides_runpath+:} false; then : 14989 $as_echo_n "(cached) " >&6 14990 else 14991 lt_cv_shlibpath_overrides_runpath=no 14992 save_LDFLAGS=$LDFLAGS 14993 save_libdir=$libdir 14994 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ 14995 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" 14996 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 14997 /* end confdefs.h. */ 14998 14999 int 15000 main () 15001 { 15002 15003 ; 15004 return 0; 15005 } 15006 _ACEOF 15007 if ac_fn_cxx_try_link "$LINENO"; then : 15008 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : 15009 lt_cv_shlibpath_overrides_runpath=yes 15010 fi 15011 fi 15012 rm -f core conftest.err conftest.$ac_objext \ 15013 conftest$ac_exeext conftest.$ac_ext 15014 LDFLAGS=$save_LDFLAGS 15015 libdir=$save_libdir 15016 15017 fi 15018 15019 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath 15020 15021 # This implies no fast_install, which is unacceptable. 15022 # Some rework will be needed to allow for fast_install 15023 # before this can be enabled. 15024 hardcode_into_libs=yes 15025 15026 # Append ld.so.conf contents to the search path 15027 if test -f /etc/ld.so.conf; then 15028 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` 15029 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" 15030 fi 15031 15032 # We used to test for /lib/ld.so.1 and disable shared libraries on 15033 # powerpc, because MkLinux only supported shared libraries with the 15034 # GNU dynamic linker. Since this was broken with cross compilers, 15035 # most powerpc-linux boxes support dynamic linking these days and 15036 # people can always --disable-shared, the test was removed, and we 15037 # assume the GNU/Linux dynamic linker is in use. 15038 dynamic_linker='GNU/Linux ld.so' 15039 ;; 15040 15041 netbsd*) 15042 version_type=sunos 15043 need_lib_prefix=no 15044 need_version=no 15045 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then 15046 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' 15047 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 15048 dynamic_linker='NetBSD (a.out) ld.so' 15049 else 15050 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' 15051 soname_spec='${libname}${release}${shared_ext}$major' 15052 dynamic_linker='NetBSD ld.elf_so' 15053 fi 15054 shlibpath_var=LD_LIBRARY_PATH 15055 shlibpath_overrides_runpath=yes 15056 hardcode_into_libs=yes 15057 ;; 15058 15059 newsos6) 15060 version_type=linux # correct to gnu/linux during the next big refactor 15061 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15062 shlibpath_var=LD_LIBRARY_PATH 15063 shlibpath_overrides_runpath=yes 15064 ;; 15065 15066 *nto* | *qnx*) 15067 version_type=qnx 15068 need_lib_prefix=no 15069 need_version=no 15070 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15071 soname_spec='${libname}${release}${shared_ext}$major' 15072 shlibpath_var=LD_LIBRARY_PATH 15073 shlibpath_overrides_runpath=no 15074 hardcode_into_libs=yes 15075 dynamic_linker='ldqnx.so' 15076 ;; 15077 15078 openbsd*) 15079 version_type=sunos 15080 sys_lib_dlsearch_path_spec="/usr/lib" 15081 need_lib_prefix=no 15082 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. 15083 case $host_os in 15084 openbsd3.3 | openbsd3.3.*) need_version=yes ;; 15085 *) need_version=no ;; 15086 esac 15087 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' 15088 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 15089 shlibpath_var=LD_LIBRARY_PATH 15090 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 15091 case $host_os in 15092 openbsd2.[89] | openbsd2.[89].*) 15093 shlibpath_overrides_runpath=no 15094 ;; 15095 *) 15096 shlibpath_overrides_runpath=yes 15097 ;; 15098 esac 15099 else 15100 shlibpath_overrides_runpath=yes 15101 fi 15102 ;; 15103 15104 os2*) 15105 libname_spec='$name' 15106 shrext_cmds=".dll" 15107 need_lib_prefix=no 15108 library_names_spec='$libname${shared_ext} $libname.a' 15109 dynamic_linker='OS/2 ld.exe' 15110 shlibpath_var=LIBPATH 15111 ;; 15112 15113 osf3* | osf4* | osf5*) 15114 version_type=osf 15115 need_lib_prefix=no 15116 need_version=no 15117 soname_spec='${libname}${release}${shared_ext}$major' 15118 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15119 shlibpath_var=LD_LIBRARY_PATH 15120 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" 15121 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" 15122 ;; 15123 15124 rdos*) 15125 dynamic_linker=no 15126 ;; 15127 15128 solaris*) 15129 version_type=linux # correct to gnu/linux during the next big refactor 15130 need_lib_prefix=no 15131 need_version=no 15132 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15133 soname_spec='${libname}${release}${shared_ext}$major' 15134 shlibpath_var=LD_LIBRARY_PATH 15135 shlibpath_overrides_runpath=yes 15136 hardcode_into_libs=yes 15137 # ldd complains unless libraries are executable 15138 postinstall_cmds='chmod +x $lib' 15139 ;; 15140 15141 sunos4*) 15142 version_type=sunos 15143 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' 15144 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' 15145 shlibpath_var=LD_LIBRARY_PATH 15146 shlibpath_overrides_runpath=yes 15147 if test "$with_gnu_ld" = yes; then 15148 need_lib_prefix=no 15149 fi 15150 need_version=yes 15151 ;; 15152 15153 sysv4 | sysv4.3*) 15154 version_type=linux # correct to gnu/linux during the next big refactor 15155 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15156 soname_spec='${libname}${release}${shared_ext}$major' 15157 shlibpath_var=LD_LIBRARY_PATH 15158 case $host_vendor in 15159 sni) 15160 shlibpath_overrides_runpath=no 15161 need_lib_prefix=no 15162 runpath_var=LD_RUN_PATH 15163 ;; 15164 siemens) 15165 need_lib_prefix=no 15166 ;; 15167 motorola) 15168 need_lib_prefix=no 15169 need_version=no 15170 shlibpath_overrides_runpath=no 15171 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' 15172 ;; 15173 esac 15174 ;; 15175 15176 sysv4*MP*) 15177 if test -d /usr/nec ;then 15178 version_type=linux # correct to gnu/linux during the next big refactor 15179 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' 15180 soname_spec='$libname${shared_ext}.$major' 15181 shlibpath_var=LD_LIBRARY_PATH 15182 fi 15183 ;; 15184 15185 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 15186 version_type=freebsd-elf 15187 need_lib_prefix=no 15188 need_version=no 15189 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' 15190 soname_spec='${libname}${release}${shared_ext}$major' 15191 shlibpath_var=LD_LIBRARY_PATH 15192 shlibpath_overrides_runpath=yes 15193 hardcode_into_libs=yes 15194 if test "$with_gnu_ld" = yes; then 15195 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' 15196 else 15197 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 15198 case $host_os in 15199 sco3.2v5*) 15200 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" 15201 ;; 15202 esac 15203 fi 15204 sys_lib_dlsearch_path_spec='/usr/lib' 15205 ;; 15206 15207 tpf*) 15208 # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 15209 version_type=linux # correct to gnu/linux during the next big refactor 15210 need_lib_prefix=no 15211 need_version=no 15212 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15213 shlibpath_var=LD_LIBRARY_PATH 15214 shlibpath_overrides_runpath=no 15215 hardcode_into_libs=yes 15216 ;; 15217 15218 uts4*) 15219 version_type=linux # correct to gnu/linux during the next big refactor 15220 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 15221 soname_spec='${libname}${release}${shared_ext}$major' 15222 shlibpath_var=LD_LIBRARY_PATH 15223 ;; 15224 15225 *) 15226 dynamic_linker=no 15227 ;; 15228 esac 15229 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 15230 $as_echo "$dynamic_linker" >&6; } 15231 test "$dynamic_linker" = no && can_build_shared=no 15232 15233 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" 15234 if test "$GCC" = yes; then 15235 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 15236 fi 15237 15238 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then 15239 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" 15240 fi 15241 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then 15242 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 15243 fi 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 15283 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } 15284 hardcode_action_CXX= 15285 if test -n "$hardcode_libdir_flag_spec_CXX" || 15286 test -n "$runpath_var_CXX" || 15287 test "X$hardcode_automatic_CXX" = "Xyes" ; then 15288 15289 # We can hardcode non-existent directories. 15290 if test "$hardcode_direct_CXX" != no && 15291 # If the only mechanism to avoid hardcoding is shlibpath_var, we 15292 # have to relink, otherwise we might link with an installed library 15293 # when we should be linking with a yet-to-be-installed one 15294 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && 15295 test "$hardcode_minus_L_CXX" != no; then 15296 # Linking always hardcodes the temporary library directory. 15297 hardcode_action_CXX=relink 15298 else 15299 # We can link without hardcoding, and we can hardcode nonexisting dirs. 15300 hardcode_action_CXX=immediate 15301 fi 15302 else 15303 # We cannot hardcode anything, or else we can only hardcode existing 15304 # directories. 15305 hardcode_action_CXX=unsupported 15306 fi 15307 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 15308 $as_echo "$hardcode_action_CXX" >&6; } 15309 15310 if test "$hardcode_action_CXX" = relink || 15311 test "$inherit_rpath_CXX" = yes; then 15312 # Fast installation is not supported 15313 enable_fast_install=no 15314 elif test "$shlibpath_overrides_runpath" = yes || 15315 test "$enable_shared" = no; then 15316 # Fast installation is not necessary 15317 enable_fast_install=needless 15318 fi 15319 15320 15321 15322 15323 15324 15325 15326 fi # test -n "$compiler" 15327 15328 CC=$lt_save_CC 15329 CFLAGS=$lt_save_CFLAGS 15330 LDCXX=$LD 15331 LD=$lt_save_LD 15332 GCC=$lt_save_GCC 15333 with_gnu_ld=$lt_save_with_gnu_ld 15334 lt_cv_path_LDCXX=$lt_cv_path_LD 15335 lt_cv_path_LD=$lt_save_path_LD 15336 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld 15337 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld 15338 fi # test "$_lt_caught_CXX_error" != yes 15339 15340 ac_ext=c 15341 ac_cpp='$CPP $CPPFLAGS' 15342 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 15343 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 15344 ac_compiler_gnu=$ac_cv_c_compiler_gnu 15345 11382 15346 11383 15347 … … 11407 15371 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 11408 15372 $as_echo_n "checking for $ac_word... " >&6; } 11409 if test "${ac_cv_prog_RC+set}" = set; then :15373 if ${ac_cv_prog_RC+:} false; then : 11410 15374 $as_echo_n "(cached) " >&6 11411 15375 else … … 11419 15383 test -z "$as_dir" && as_dir=. 11420 15384 for ac_exec_ext in '' $ac_executable_extensions; do 11421 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then15385 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 11422 15386 ac_cv_prog_RC="${ac_tool_prefix}windres" 11423 15387 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 11447 15411 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 11448 15412 $as_echo_n "checking for $ac_word... " >&6; } 11449 if test "${ac_cv_prog_ac_ct_RC+set}" = set; then :15413 if ${ac_cv_prog_ac_ct_RC+:} false; then : 11450 15414 $as_echo_n "(cached) " >&6 11451 15415 else … … 11459 15423 test -z "$as_dir" && as_dir=. 11460 15424 for ac_exec_ext in '' $ac_executable_extensions; do 11461 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then15425 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 11462 15426 ac_cv_prog_ac_ct_RC="windres" 11463 15427 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 11581 15545 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 11582 15546 $as_echo_n "checking for inline... " >&6; } 11583 if test "${ac_cv_c_inline+set}" = set; then :15547 if ${ac_cv_c_inline+:} false; then : 11584 15548 $as_echo_n "(cached) " >&6 11585 15549 else … … 11621 15585 esac 11622 15586 11623 if test "x$CC" != xcc; then11624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&511625 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }11626 else11627 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&511628 $as_echo_n "checking whether cc understands -c and -o together... " >&6; }11629 fi11630 set dummy $CC; ac_cc=`$as_echo "$2" |11631 sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`11632 if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :11633 $as_echo_n "(cached) " >&611634 else11635 cat confdefs.h - <<_ACEOF >conftest.$ac_ext11636 /* end confdefs.h. */11637 11638 int11639 main ()11640 {11641 11642 ;11643 return 0;11644 }11645 _ACEOF11646 # Make sure it works both with $CC and with simple cc.11647 # We do the test twice because some compilers refuse to overwrite an11648 # existing .o file with -o, though they will create one.11649 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'11650 rm -f conftest2.*11651 if { { case "(($ac_try" in11652 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;11653 *) ac_try_echo=$ac_try;;11654 esac11655 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""11656 $as_echo "$ac_try_echo"; } >&511657 (eval "$ac_try") 2>&511658 ac_status=$?11659 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&511660 test $ac_status = 0; } &&11661 test -f conftest2.$ac_objext && { { case "(($ac_try" in11662 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;11663 *) ac_try_echo=$ac_try;;11664 esac11665 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""11666 $as_echo "$ac_try_echo"; } >&511667 (eval "$ac_try") 2>&511668 ac_status=$?11669 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&511670 test $ac_status = 0; };11671 then11672 eval ac_cv_prog_cc_${ac_cc}_c_o=yes11673 if test "x$CC" != xcc; then11674 # Test first that cc exists at all.11675 if { ac_try='cc -c conftest.$ac_ext >&5'11676 { { case "(($ac_try" in11677 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;11678 *) ac_try_echo=$ac_try;;11679 esac11680 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""11681 $as_echo "$ac_try_echo"; } >&511682 (eval "$ac_try") 2>&511683 ac_status=$?11684 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&511685 test $ac_status = 0; }; }; then11686 ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'11687 rm -f conftest2.*11688 if { { case "(($ac_try" in11689 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;11690 *) ac_try_echo=$ac_try;;11691 esac11692 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""11693 $as_echo "$ac_try_echo"; } >&511694 (eval "$ac_try") 2>&511695 ac_status=$?11696 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&511697 test $ac_status = 0; } &&11698 test -f conftest2.$ac_objext && { { case "(($ac_try" in11699 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;11700 *) ac_try_echo=$ac_try;;11701 esac11702 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""11703 $as_echo "$ac_try_echo"; } >&511704 (eval "$ac_try") 2>&511705 ac_status=$?11706 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&511707 test $ac_status = 0; };11708 then11709 # cc works too.11710 :11711 else11712 # cc exists but doesn't like -o.11713 eval ac_cv_prog_cc_${ac_cc}_c_o=no11714 fi11715 fi11716 fi11717 else11718 eval ac_cv_prog_cc_${ac_cc}_c_o=no11719 fi11720 rm -f core conftest*11721 11722 fi11723 if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then11724 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&511725 $as_echo "yes" >&6; }11726 else11727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&511728 $as_echo "no" >&6; }11729 11730 $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h11731 11732 fi11733 11734 # FIXME: we rely on the cache variable name because11735 # there is no other way.11736 set dummy $CC11737 am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`11738 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o11739 if test "$am_t" != yes; then11740 # Losing compiler, so override with the script.11741 # FIXME: It is wrong to rewrite CC.11742 # But if we don't then we get into trouble of one sort or another.11743 # A longer-term fix would be to have automake use am__CC in this case,11744 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"11745 CC="$am_aux_dir/compile $CC"11746 fi11747 11748 15587 11749 15588 … … 11755 15594 { $as_echo "$as_me:${as_lineno-$LINENO}: checking operating system" >&5 11756 15595 $as_echo_n "checking operating system... " >&6; } 15596 11757 15597 case $host in 11758 *-linux*) 15598 *-linux-android*) 15599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: This is a Linux-Android system" >&5 15600 $as_echo "This is a Linux-Android system" >&6; } 15601 is_backend_android="yes" 15602 ;; 15603 *) 15604 is_backend_android="no" 15605 esac 15606 15607 case $host in 15608 *-linux* | *-uclinux*) 11759 15609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5 11760 15610 $as_echo "Linux" >&6; } 11761 15611 backend="linux" 15612 threads="posix" 11762 15613 ;; 11763 15614 *-darwin*) … … 11765 15616 $as_echo "Darwin/Mac OS X" >&6; } 11766 15617 backend="darwin" 15618 threads="posix" 11767 15619 ;; 11768 15620 *-openbsd*) … … 11770 15622 $as_echo "OpenBSD" >&6; } 11771 15623 backend="openbsd" 15624 threads="posix" 11772 15625 ;; 11773 15626 *-netbsd*) 11774 { $as_echo "$as_me:${as_lineno-$LINENO}: result: NetBSD (using OpenBSD backend)" >&5 11775 $as_echo "NetBSD (using OpenBSD backend)" >&6; } 11776 backend="openbsd" 15627 { $as_echo "$as_me:${as_lineno-$LINENO}: result: NetBSD" >&5 15628 $as_echo "NetBSD" >&6; } 15629 backend="netbsd" 15630 threads="posix" 11777 15631 ;; 11778 *-mingw* )15632 *-mingw* | *msys*) 11779 15633 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows" >&5 11780 15634 $as_echo "Windows" >&6; } 11781 15635 backend="windows" 11782 ;; 11783 *-os2-emx*) 11784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: OS2" >&5 11785 $as_echo "OS2" >&6; } 11786 backend="os2" 15636 threads="windows" 15637 create_import_lib="yes" 15638 AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer" 11787 15639 ;; 11788 15640 *-cygwin*) … … 11792 15644 threads="posix" 11793 15645 ;; 15646 *-haiku*) 15647 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Haiku" >&5 15648 $as_echo "Haiku" >&6; } 15649 backend="haiku" 15650 threads="posix" 15651 ;; 15652 *-solaris*) 15653 { $as_echo "$as_me:${as_lineno-$LINENO}: result: SunOS" >&5 15654 $as_echo "SunOS" >&6; } 15655 backend="sunos" 15656 threads="posix" 15657 ;; 11794 15658 *) 11795 as_fn_error "unsupported operating system" "$LINENO" 515659 as_fn_error $? "unsupported operating system $host" "$LINENO" 5 11796 15660 esac 15661 11797 15662 case $backend in 11798 15663 linux) … … 11801 15666 11802 15667 11803 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&511804 $as_echo_n "checking for clock_gettime in -lrt... " >&6; }11805 if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :15668 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 15669 $as_echo_n "checking for library containing clock_gettime... " >&6; } 15670 if ${ac_cv_search_clock_gettime+:} false; then : 11806 15671 $as_echo_n "(cached) " >&6 11807 15672 else 11808 ac_check_lib_save_LIBS=$LIBS 11809 LIBS="-lrt $LIBS" 15673 ac_func_search_save_LIBS=$LIBS 11810 15674 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 11811 15675 /* end confdefs.h. */ … … 11826 15690 } 11827 15691 _ACEOF 11828 if ac_fn_c_try_link "$LINENO"; then : 11829 ac_cv_lib_rt_clock_gettime=yes 11830 else 11831 ac_cv_lib_rt_clock_gettime=no 15692 for ac_lib in '' rt; do 15693 if test -z "$ac_lib"; then 15694 ac_res="none required" 15695 else 15696 ac_res=-l$ac_lib 15697 LIBS="-l$ac_lib -pthread $ac_func_search_save_LIBS" 15698 fi 15699 if ac_fn_c_try_link "$LINENO"; then : 15700 ac_cv_search_clock_gettime=$ac_res 11832 15701 fi 11833 15702 rm -f core conftest.err conftest.$ac_objext \ 11834 conftest$ac_exeext conftest.$ac_ext 11835 LIBS=$ac_check_lib_save_LIBS 11836 fi 11837 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 11838 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } 11839 if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then : 11840 PC_LIBS_PRIVATE="-lrt" 15703 conftest$ac_exeext 15704 if ${ac_cv_search_clock_gettime+:} false; then : 15705 break 15706 fi 15707 done 15708 if ${ac_cv_search_clock_gettime+:} false; then : 15709 15710 else 15711 ac_cv_search_clock_gettime=no 15712 fi 15713 rm conftest.$ac_ext 15714 LIBS=$ac_func_search_save_LIBS 15715 fi 15716 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 15717 $as_echo "$ac_cv_search_clock_gettime" >&6; } 15718 ac_res=$ac_cv_search_clock_gettime 15719 if test "$ac_res" != no; then : 15720 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 15721 11841 15722 fi 11842 15723 … … 11848 15729 fi 11849 15730 11850 11851 11852 15731 if test "x$enable_udev" = "xyes" ; then 15732 # system has udev. use it or fail! 15733 for ac_header in libudev.h 11853 15734 do : 11854 15735 ac_fn_c_check_header_mongrel "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default" 11855 if test "x$ac_cv_header_libudev_h" = x ""yes; then :15736 if test "x$ac_cv_header_libudev_h" = xyes; then : 11856 15737 cat >>confdefs.h <<_ACEOF 11857 15738 #define HAVE_LIBUDEV_H 1 … … 11859 15740 11860 15741 else 11861 as_fn_error "\"udev support requested but libudev not installed\"" "$LINENO" 515742 as_fn_error $? "\"udev support requested but libudev not installed\"" "$LINENO" 5 11862 15743 fi 11863 15744 11864 15745 done 11865 15746 11866 15747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev_new in -ludev" >&5 11867 15748 $as_echo_n "checking for udev_new in -ludev... " >&6; } 11868 if test "${ac_cv_lib_udev_udev_new+set}" = set; then :15749 if ${ac_cv_lib_udev_udev_new+:} false; then : 11869 15750 $as_echo_n "(cached) " >&6 11870 15751 else … … 11900 15781 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_new" >&5 11901 15782 $as_echo "$ac_cv_lib_udev_udev_new" >&6; } 11902 if test "x$ac_cv_lib_udev_udev_new" = x ""yes; then :15783 if test "x$ac_cv_lib_udev_udev_new" = xyes; then : 11903 15784 cat >>confdefs.h <<_ACEOF 11904 15785 #define HAVE_LIBUDEV 1 … … 11908 15789 11909 15790 else 11910 as_fn_error "\"udev support requested but libudev not installed\"" "$LINENO" 515791 as_fn_error $? "\"udev support requested but libudev not installed\"" "$LINENO" 5 11911 15792 fi 11912 15793 … … 11914 15795 $as_echo "#define USE_UDEV 1" >>confdefs.h 11915 15796 11916 else 11917 for ac_header in linux/netlink.h linux/filter.h 15797 else 15798 for ac_header in asm/types.h 15799 do : 15800 ac_fn_c_check_header_mongrel "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" 15801 if test "x$ac_cv_header_asm_types_h" = xyes; then : 15802 cat >>confdefs.h <<_ACEOF 15803 #define HAVE_ASM_TYPES_H 1 15804 _ACEOF 15805 15806 fi 15807 15808 done 15809 15810 for ac_header in sys/socket.h linux/netlink.h 11918 15811 do : 11919 15812 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 11920 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 11921 eval as_val=\$$as_ac_Header 11922 if test "x$as_val" = x""yes; then : 15813 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " 15814 #ifdef HAVE_ASM_TYPES_H 15815 #include <asm/types.h> 15816 #endif 15817 #include <sys/socket.h> 15818 15819 " 15820 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 11923 15821 cat >>confdefs.h <<_ACEOF 11924 15822 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 … … 11926 15824 11927 15825 else 11928 as_fn_error "\"Linux netlink headers not found\"" "$LINENO" 515826 as_fn_error $? "\"Linux netlink headers not found\"" "$LINENO" 5 11929 15827 fi 11930 15828 11931 15829 done 11932 15830 11933 fi 11934 11935 threads="posix" 15831 fi 15832 15833 15834 case $is_backend_android in 15835 yes) 15836 15837 $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h 15838 15839 ;; 15840 *) 11936 15841 THREAD_CFLAGS="-pthread" 11937 PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" 15842 LIBS="${LIBS} -pthread" 15843 esac 15844 11938 15845 for ac_header in poll.h 11939 15846 do : 11940 15847 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 11941 if test "x$ac_cv_header_poll_h" = x ""yes; then :15848 if test "x$ac_cv_header_poll_h" = xyes; then : 11942 15849 cat >>confdefs.h <<_ACEOF 11943 15850 #define HAVE_POLL_H 1 … … 11957 15864 11958 15865 11959 threads="posix" 11960 PC_LIBS_PRIVATE="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" 15866 LIBS="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" 11961 15867 LTLDFLAGS="${LTLDFLAGS} -Wl,-prebind" 11962 15868 for ac_header in poll.h 11963 15869 do : 11964 15870 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 11965 if test "x$ac_cv_header_poll_h" = x ""yes; then :15871 if test "x$ac_cv_header_poll_h" = xyes; then : 11966 15872 cat >>confdefs.h <<_ACEOF 11967 15873 #define HAVE_POLL_H 1 … … 11974 15880 ac_fn_c_check_type "$LINENO" "nfds_t" "ac_cv_type_nfds_t" "#include <poll.h> 11975 15881 " 11976 if test "x$ac_cv_type_nfds_t" = x ""yes; then :15882 if test "x$ac_cv_type_nfds_t" = xyes; then : 11977 15883 11978 15884 $as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h … … 11990 15896 11991 15897 11992 threads="posix"11993 15898 THREAD_CFLAGS="-pthread" 11994 PC_LIBS_PRIVATE="-pthread"15899 LIBS="-pthread" 11995 15900 for ac_header in poll.h 11996 15901 do : 11997 15902 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 11998 if test "x$ac_cv_header_poll_h" = x ""yes; then :15903 if test "x$ac_cv_header_poll_h" = xyes; then : 11999 15904 cat >>confdefs.h <<_ACEOF 12000 15905 #define HAVE_POLL_H 1 … … 12009 15914 12010 15915 ;; 15916 sunos) 15917 15918 $as_echo "#define OS_SUNOS 1" >>confdefs.h 15919 15920 15921 THREAD_CFLAGS="-pthread" 15922 LIBS="-pthread -ldevinfo" 15923 for ac_header in poll.h 15924 do : 15925 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 15926 if test "x$ac_cv_header_poll_h" = xyes; then : 15927 cat >>confdefs.h <<_ACEOF 15928 #define HAVE_POLL_H 1 15929 _ACEOF 15930 15931 fi 15932 15933 done 15934 15935 15936 $as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h 15937 15938 ;; 15939 netbsd) 15940 15941 $as_echo "#define OS_NETBSD 1" >>confdefs.h 15942 15943 15944 THREAD_CFLAGS="-pthread" 15945 LIBS="-pthread" 15946 for ac_header in poll.h 15947 do : 15948 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 15949 if test "x$ac_cv_header_poll_h" = xyes; then : 15950 cat >>confdefs.h <<_ACEOF 15951 #define HAVE_POLL_H 1 15952 _ACEOF 15953 15954 fi 15955 15956 done 15957 15958 15959 $as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h 15960 15961 ;; 12011 15962 windows) 12012 15963 … … 12014 15965 12015 15966 12016 PC_LIBS_PRIVATE=""15967 LIBS="" 12017 15968 LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias" 12018 15969 12019 15970 $as_echo "#define POLL_NFDS_TYPE unsigned int" >>confdefs.h 12020 15971 15972 15973 $as_echo "#define WINVER 0x0501" >>confdefs.h 15974 15975 15976 # Check whether --enable-usbdk was given. 15977 if test "${enable_usbdk+set}" = set; then : 15978 enableval=$enable_usbdk; 15979 else 15980 enable_usbdk="no" 15981 fi 15982 15983 if test "x$enable_usbdk" = "xyes" ; then 15984 15985 $as_echo "#define USE_USBDK 1" >>confdefs.h 15986 15987 fi 15988 12021 15989 ;; 12022 os2) 12023 12024 $as_echo "#define OS_OS2 1" >>confdefs.h 12025 12026 12027 threads="posix" 12028 PC_LIBS_PRIVATE="-lpthread" 12029 12030 $as_echo "#define POLL_NFDS_TYPE unsigned int" >>confdefs.h 15990 haiku) 15991 15992 $as_echo "#define OS_HAIKU 1" >>confdefs.h 15993 15994 15995 LIBS="${LIBS} -lbe" 15996 for ac_header in poll.h 15997 do : 15998 ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" 15999 if test "x$ac_cv_header_poll_h" = xyes; then : 16000 cat >>confdefs.h <<_ACEOF 16001 #define HAVE_POLL_H 1 16002 _ACEOF 16003 16004 fi 16005 16006 done 16007 16008 16009 $as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h 12031 16010 12032 16011 ;; … … 12034 16013 12035 16014 12036 LIBS="${LIBS} ${PC_LIBS_PRIVATE}"12037 16015 12038 16016 if test "x$backend" = xlinux; then … … 12060 16038 fi 12061 16039 16040 if test "x$backend" = xsunos; then 16041 OS_SUNOS_TRUE= 16042 OS_SUNOS_FALSE='#' 16043 else 16044 OS_SUNOS_TRUE='#' 16045 OS_SUNOS_FALSE= 16046 fi 16047 16048 if test "x$backend" = xnetbsd; then 16049 OS_NETBSD_TRUE= 16050 OS_NETBSD_FALSE='#' 16051 else 16052 OS_NETBSD_TRUE='#' 16053 OS_NETBSD_FALSE= 16054 fi 16055 12062 16056 if test "x$backend" = xwindows; then 12063 16057 OS_WINDOWS_TRUE= … … 12068 16062 fi 12069 16063 12070 if test "x$backend" = x os2; then12071 OS_ OS2_TRUE=12072 OS_ OS2_FALSE='#'12073 else 12074 OS_ OS2_TRUE='#'12075 OS_ OS2_FALSE=16064 if test "x$backend" = xhaiku; then 16065 OS_HAIKU_TRUE= 16066 OS_HAIKU_FALSE='#' 16067 else 16068 OS_HAIKU_TRUE='#' 16069 OS_HAIKU_FALSE= 12076 16070 fi 12077 16071 … … 12084 16078 fi 12085 16079 16080 if test "x$create_import_lib" = "xyes"; then 16081 CREATE_IMPORT_LIB_TRUE= 16082 CREATE_IMPORT_LIB_FALSE='#' 16083 else 16084 CREATE_IMPORT_LIB_TRUE='#' 16085 CREATE_IMPORT_LIB_FALSE= 16086 fi 16087 12086 16088 if test "x$enable_udev" = xyes; then 12087 16089 USE_UDEV_TRUE= … … 12092 16094 fi 12093 16095 16096 if test "x$enable_usbdk" = xyes; then 16097 USE_USBDK_TRUE= 16098 USE_USBDK_FALSE='#' 16099 else 16100 USE_USBDK_TRUE='#' 16101 USE_USBDK_FALSE= 16102 fi 16103 12094 16104 if test "$threads" = posix; then 12095 16105 … … 12100 16110 # timerfd 12101 16111 ac_fn_c_check_header_mongrel "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default" 12102 if test "x$ac_cv_header_sys_timerfd_h" = x ""yes; then :16112 if test "x$ac_cv_header_sys_timerfd_h" = xyes; then : 12103 16113 timerfd_h=1 12104 16114 else … … 12116 16126 12117 16127 if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then 12118 as_fn_error "timerfd header not available; glibc 2.9+ required" "$LINENO" 516128 as_fn_error $? "timerfd header not available; glibc 2.9+ required" "$LINENO" 5 12119 16129 fi 12120 16130 12121 16131 ac_fn_c_check_decl "$LINENO" "TFD_NONBLOCK" "ac_cv_have_decl_TFD_NONBLOCK" "#include <sys/timerfd.h> 12122 16132 " 12123 if test "x$ac_cv_have_decl_TFD_NONBLOCK" = x ""yes; then :16133 if test "x$ac_cv_have_decl_TFD_NONBLOCK" = xyes; then : 12124 16134 tfd_hdr_ok=yes 12125 16135 else … … 12128 16138 12129 16139 if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then 12130 as_fn_error "timerfd header not usable; glibc 2.9+ required" "$LINENO" 516140 as_fn_error $? "timerfd header not usable; glibc 2.9+ required" "$LINENO" 5 12131 16141 fi 12132 16142 … … 12150 16160 12151 16161 ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "$ac_includes_default" 12152 if test "x$ac_cv_type_struct_timespec" = x ""yes; then :16162 if test "x$ac_cv_type_struct_timespec" = xyes; then : 12153 16163 12154 16164 cat >>confdefs.h <<_ACEOF … … 12187 16197 fi 12188 16198 16199 # Check whether --enable-system-log was given. 16200 if test "${enable_system_log+set}" = set; then : 16201 enableval=$enable_system_log; system_log_enabled=$enableval 16202 else 16203 system_log_enabled='no' 16204 fi 16205 16206 if test "x$system_log_enabled" != "xno"; then 16207 16208 $as_echo "#define USE_SYSTEM_LOGGING_FACILITY 1" >>confdefs.h 16209 16210 fi 16211 16212 # Check if syslog is available in standard C library 16213 for ac_header in syslog.h 16214 do : 16215 ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" 16216 if test "x$ac_cv_header_syslog_h" = xyes; then : 16217 cat >>confdefs.h <<_ACEOF 16218 #define HAVE_SYSLOG_H 1 16219 _ACEOF 16220 16221 fi 16222 16223 done 16224 16225 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" 16226 if test "x$ac_cv_func_syslog" = xyes; then : 16227 have_syslog=yes 16228 else 16229 have_syslog=no 16230 fi 16231 16232 if test "x$have_syslog" != "xno"; then 16233 16234 $as_echo "#define HAVE_SYSLOG_FUNC 1" >>confdefs.h 16235 16236 fi 16237 12189 16238 # Examples build 12190 16239 # Check whether --enable-examples-build was given. … … 12201 16250 BUILD_EXAMPLES_TRUE='#' 12202 16251 BUILD_EXAMPLES_FALSE= 16252 fi 16253 16254 16255 # Tests build 16256 # Check whether --enable-tests-build was given. 16257 if test "${enable_tests_build+set}" = set; then : 16258 enableval=$enable_tests_build; build_tests=$enableval 16259 else 16260 build_tests='no' 16261 fi 16262 16263 if test "x$build_tests" != "xno"; then 16264 BUILD_TESTS_TRUE= 16265 BUILD_TESTS_FALSE='#' 16266 else 16267 BUILD_TESTS_TRUE='#' 16268 BUILD_TESTS_FALSE= 12203 16269 fi 12204 16270 … … 12257 16323 # sigaction not available on MinGW 12258 16324 ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" 12259 if test "x$ac_cv_func_sigaction" = x ""yes; then :16325 if test "x$ac_cv_func_sigaction" = xyes; then : 12260 16326 have_sigaction=yes 12261 16327 else … … 12276 16342 do : 12277 16343 ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" 12278 if test "x$ac_cv_header_sys_time_h" = x ""yes; then :16344 if test "x$ac_cv_header_sys_time_h" = xyes; then : 12279 16345 cat >>confdefs.h <<_ACEOF 12280 16346 #define HAVE_SYS_TIME_H 1 … … 12288 16354 do : 12289 16355 ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" 12290 if test "x$ac_cv_func_gettimeofday" = x ""yes; then :16356 if test "x$ac_cv_func_gettimeofday" = xyes; then : 12291 16357 cat >>confdefs.h <<_ACEOF 12292 16358 #define HAVE_GETTIMEOFDAY 1 … … 12296 16362 done 12297 16363 12298 12299 AM_CFLAGS="-std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow" 12300 16364 for ac_header in signal.h 16365 do : 16366 ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" 16367 if test "x$ac_cv_header_signal_h" = xyes; then : 16368 cat >>confdefs.h <<_ACEOF 16369 #define HAVE_SIGNAL_H 1 16370 _ACEOF 16371 16372 fi 16373 16374 done 16375 16376 16377 # check for -std=gnu99 compiler support 16378 saved_cflags="$CFLAGS" 16379 CFLAGS="-std=gnu99" 16380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -std=gnu99" >&5 16381 $as_echo_n "checking whether CC supports -std=gnu99... " >&6; } 16382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 16383 /* end confdefs.h. */ 16384 16385 int 16386 main () 16387 { 16388 16389 ; 16390 return 0; 16391 } 16392 _ACEOF 16393 if ac_fn_c_try_compile "$LINENO"; then : 16394 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 16395 $as_echo "yes" >&6; } 16396 AM_CFLAGS="${AM_CFLAGS} -std=gnu99" 16397 else 16398 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 16399 $as_echo "no" >&6; } 16400 16401 fi 16402 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 16403 CFLAGS="$saved_cflags" 16404 16405 AM_CFLAGS="${AM_CFLAGS} -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}" 12301 16406 12302 16407 … … 12310 16415 12311 16416 ac_config_files="$ac_config_files examples/Makefile" 16417 16418 ac_config_files="$ac_config_files tests/Makefile" 12312 16419 12313 16420 ac_config_files="$ac_config_files doc/Makefile" … … 12379 16486 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else 12380 16487 if test -w "$cache_file"; then 12381 test "x$cache_file" != "x/dev/null" &&16488 if test "x$cache_file" != "x/dev/null"; then 12382 16489 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 12383 16490 $as_echo "$as_me: updating cache $cache_file" >&6;} 12384 cat confcache >$cache_file 16491 if test ! -f "$cache_file" || test -h "$cache_file"; then 16492 cat confcache >"$cache_file" 16493 else 16494 case $cache_file in #( 16495 */* | ?:*) 16496 mv -f confcache "$cache_file"$$ && 16497 mv -f "$cache_file"$$ "$cache_file" ;; #( 16498 *) 16499 mv -f confcache "$cache_file" ;; 16500 esac 16501 fi 16502 fi 12385 16503 else 12386 16504 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 … … 12398 16516 ac_libobjs= 12399 16517 ac_ltlibobjs= 16518 U= 12400 16519 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue 12401 16520 # 1. Remove the extension, and $U if already installed. … … 12412 16531 12413 16532 16533 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 16534 $as_echo_n "checking that generated files are newer than configure... " >&6; } 16535 if test -n "$am_sleep_pid"; then 16536 # Hide warnings about reused PIDs. 16537 wait $am_sleep_pid 2>/dev/null 16538 fi 16539 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 16540 $as_echo "done" >&6; } 12414 16541 if test -n "$EXEEXT"; then 12415 16542 am__EXEEXT_TRUE= … … 12420 16547 fi 12421 16548 12422 if test -z "${ MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then12423 as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.16549 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 16550 as_fn_error $? "conditional \"AMDEP\" was never defined. 12424 16551 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12425 16552 fi 12426 if test -z "${ AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then12427 as_fn_error "conditional \"AMDEP\" was never defined.16553 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then 16554 as_fn_error $? "conditional \"am__fastdepCC\" was never defined. 12428 16555 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12429 16556 fi 12430 if test -z "${am__fastdepC C_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then12431 as_fn_error "conditional \"am__fastdepCC\" was never defined.16557 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then 16558 as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. 12432 16559 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12433 16560 fi 12434 16561 if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then 12435 as_fn_error "conditional \"OS_LINUX\" was never defined.16562 as_fn_error $? "conditional \"OS_LINUX\" was never defined. 12436 16563 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12437 16564 fi 12438 16565 if test -z "${OS_DARWIN_TRUE}" && test -z "${OS_DARWIN_FALSE}"; then 12439 as_fn_error "conditional \"OS_DARWIN\" was never defined.16566 as_fn_error $? "conditional \"OS_DARWIN\" was never defined. 12440 16567 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12441 16568 fi 12442 16569 if test -z "${OS_OPENBSD_TRUE}" && test -z "${OS_OPENBSD_FALSE}"; then 12443 as_fn_error "conditional \"OS_OPENBSD\" was never defined.16570 as_fn_error $? "conditional \"OS_OPENBSD\" was never defined. 12444 16571 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12445 16572 fi 16573 if test -z "${OS_SUNOS_TRUE}" && test -z "${OS_SUNOS_FALSE}"; then 16574 as_fn_error $? "conditional \"OS_SUNOS\" was never defined. 16575 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16576 fi 16577 if test -z "${OS_NETBSD_TRUE}" && test -z "${OS_NETBSD_FALSE}"; then 16578 as_fn_error $? "conditional \"OS_NETBSD\" was never defined. 16579 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16580 fi 12446 16581 if test -z "${OS_WINDOWS_TRUE}" && test -z "${OS_WINDOWS_FALSE}"; then 12447 as_fn_error "conditional \"OS_WINDOWS\" was never defined.16582 as_fn_error $? "conditional \"OS_WINDOWS\" was never defined. 12448 16583 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12449 16584 fi 12450 if test -z "${OS_ OS2_TRUE}" && test -z "${OS_OS2_FALSE}"; then12451 as_fn_error "conditional \"OS_OS2\" was never defined.16585 if test -z "${OS_HAIKU_TRUE}" && test -z "${OS_HAIKU_FALSE}"; then 16586 as_fn_error $? "conditional \"OS_HAIKU\" was never defined. 12452 16587 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12453 16588 fi 12454 16589 if test -z "${THREADS_POSIX_TRUE}" && test -z "${THREADS_POSIX_FALSE}"; then 12455 as_fn_error "conditional \"THREADS_POSIX\" was never defined.16590 as_fn_error $? "conditional \"THREADS_POSIX\" was never defined. 12456 16591 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12457 16592 fi 16593 if test -z "${CREATE_IMPORT_LIB_TRUE}" && test -z "${CREATE_IMPORT_LIB_FALSE}"; then 16594 as_fn_error $? "conditional \"CREATE_IMPORT_LIB\" was never defined. 16595 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16596 fi 12458 16597 if test -z "${USE_UDEV_TRUE}" && test -z "${USE_UDEV_FALSE}"; then 12459 as_fn_error "conditional \"USE_UDEV\" was never defined.16598 as_fn_error $? "conditional \"USE_UDEV\" was never defined. 12460 16599 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12461 16600 fi 16601 if test -z "${USE_USBDK_TRUE}" && test -z "${USE_USBDK_FALSE}"; then 16602 as_fn_error $? "conditional \"USE_USBDK\" was never defined. 16603 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16604 fi 12462 16605 if test -z "${BUILD_EXAMPLES_TRUE}" && test -z "${BUILD_EXAMPLES_FALSE}"; then 12463 as_fn_error "conditional \"BUILD_EXAMPLES\" was never defined.16606 as_fn_error $? "conditional \"BUILD_EXAMPLES\" was never defined. 12464 16607 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12465 16608 fi 16609 if test -z "${BUILD_TESTS_TRUE}" && test -z "${BUILD_TESTS_FALSE}"; then 16610 as_fn_error $? "conditional \"BUILD_TESTS\" was never defined. 16611 Usually this means the macro was only invoked conditionally." "$LINENO" 5 16612 fi 12466 16613 if test -z "${HAVE_SIGACTION_TRUE}" && test -z "${HAVE_SIGACTION_FALSE}"; then 12467 as_fn_error "conditional \"HAVE_SIGACTION\" was never defined.16614 as_fn_error $? "conditional \"HAVE_SIGACTION\" was never defined. 12468 16615 Usually this means the macro was only invoked conditionally." "$LINENO" 5 12469 16616 fi 12470 16617 12471 : ${CONFIG_STATUS=./config.status}16618 : "${CONFIG_STATUS=./config.status}" 12472 16619 ac_write_fail=0 12473 16620 ac_clean_files_save=$ac_clean_files … … 12570 16717 12571 16718 # Find who we are. Look in the path if we contain no directory separator. 16719 as_myself= 12572 16720 case $0 in #(( 12573 16721 *[\\/]* ) as_myself=$0 ;; … … 12615 16763 12616 16764 12617 # as_fn_error ERROR [LINENO LOG_FD]12618 # --------------------------------- 16765 # as_fn_error STATUS ERROR [LINENO LOG_FD] 16766 # ---------------------------------------- 12619 16767 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 12620 16768 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the 12621 # script with status $?, using 1 if that was 0.16769 # script with STATUS, using 1 if that was 0. 12622 16770 as_fn_error () 12623 16771 { 12624 as_status=$ ?; test $as_status -eq 0 && as_status=112625 if test "$ 3"; then12626 as_lineno=${as_lineno-"$ 2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack12627 $as_echo "$as_me:${as_lineno-$LINENO}: error: $ 1" >&$316772 as_status=$1; test $as_status -eq 0 && as_status=1 16773 if test "$4"; then 16774 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 16775 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 12628 16776 fi 12629 $as_echo "$as_me: error: $ 1" >&216777 $as_echo "$as_me: error: $2" >&2 12630 16778 as_fn_exit $as_status 12631 16779 } # as_fn_error … … 12765 16913 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. 12766 16914 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. 12767 # In both cases, we have to default to `cp -p '.16915 # In both cases, we have to default to `cp -pR'. 12768 16916 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || 12769 as_ln_s='cp -p '16917 as_ln_s='cp -pR' 12770 16918 elif ln conf$$.file conf$$ 2>/dev/null; then 12771 16919 as_ln_s=ln 12772 16920 else 12773 as_ln_s='cp -p '16921 as_ln_s='cp -pR' 12774 16922 fi 12775 16923 else 12776 as_ln_s='cp -p '16924 as_ln_s='cp -pR' 12777 16925 fi 12778 16926 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file … … 12823 16971 done 12824 16972 test -z "$as_dirs" || eval "mkdir $as_dirs" 12825 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"16973 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 12826 16974 12827 16975 … … 12834 16982 fi 12835 16983 12836 if test -x / >/dev/null 2>&1; then 12837 as_test_x='test -x' 12838 else 12839 if ls -dL / >/dev/null 2>&1; then 12840 as_ls_L_option=L 12841 else 12842 as_ls_L_option= 12843 fi 12844 as_test_x=' 12845 eval sh -c '\'' 12846 if test -d "$1"; then 12847 test -d "$1/."; 12848 else 12849 case $1 in #( 12850 -*)set "./$1";; 12851 esac; 12852 case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( 12853 ???[sx]*):;;*)false;;esac;fi 12854 '\'' sh 12855 ' 12856 fi 12857 as_executable_p=$as_test_x 16984 16985 # as_fn_executable_p FILE 16986 # ----------------------- 16987 # Test if FILE is an executable regular file. 16988 as_fn_executable_p () 16989 { 16990 test -f "$1" && test -x "$1" 16991 } # as_fn_executable_p 16992 as_test_x='test -x' 16993 as_executable_p=as_fn_executable_p 12858 16994 12859 16995 # Sed expression to map a string onto a valid CPP name. … … 12876 17012 # values after options handling. 12877 17013 ac_log=" 12878 This file was extended by libusb $as_me 1.0. 16-rc6, which was12879 generated by GNU Autoconf 2.6 4. Invocation command line was17014 This file was extended by libusb $as_me 1.0.21, which was 17015 generated by GNU Autoconf 2.69. Invocation command line was 12880 17016 12881 17017 CONFIG_FILES = $CONFIG_FILES … … 12917 17053 -h, --help print this help, then exit 12918 17054 -V, --version print version number and configuration settings, then exit 17055 --config print configuration, then exit 12919 17056 -q, --quiet, --silent 12920 17057 do not print progress messages … … 12936 17073 12937 17074 Report bugs to <libusb-devel@lists.sourceforge.net>. 12938 libusb home page: <http:// www.libusb.org/>."17075 libusb home page: <http://libusb.info>." 12939 17076 12940 17077 _ACEOF 12941 17078 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 17079 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 12942 17080 ac_cs_version="\\ 12943 libusb config.status 1.0. 16-rc612944 configured by $0, generated by GNU Autoconf 2.6 4,12945 with options \\" `$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"12946 12947 Copyright (C) 20 09Free Software Foundation, Inc.17081 libusb config.status 1.0.21 17082 configured by $0, generated by GNU Autoconf 2.69, 17083 with options \\"\$ac_cs_config\\" 17084 17085 Copyright (C) 2012 Free Software Foundation, Inc. 12948 17086 This config.status script is free software; the Free Software Foundation 12949 17087 gives unlimited permission to copy, distribute and modify it." … … 12963 17101 do 12964 17102 case $1 in 12965 --*= *)17103 --*=?*) 12966 17104 ac_option=`expr "X$1" : 'X\([^=]*\)='` 12967 17105 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` 17106 ac_shift=: 17107 ;; 17108 --*=) 17109 ac_option=`expr "X$1" : 'X\([^=]*\)='` 17110 ac_optarg= 12968 17111 ac_shift=: 12969 17112 ;; … … 12981 17124 --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) 12982 17125 $as_echo "$ac_cs_version"; exit ;; 17126 --config | --confi | --conf | --con | --co | --c ) 17127 $as_echo "$ac_cs_config"; exit ;; 12983 17128 --debug | --debu | --deb | --de | --d | -d ) 12984 17129 debug=: ;; … … 12987 17132 case $ac_optarg in 12988 17133 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; 17134 '') as_fn_error $? "missing file argument" ;; 12989 17135 esac 12990 17136 as_fn_append CONFIG_FILES " '$ac_optarg'" … … 12999 17145 --he | --h) 13000 17146 # Conflict between --help and --header 13001 as_fn_error "ambiguous option: \`$1'17147 as_fn_error $? "ambiguous option: \`$1' 13002 17148 Try \`$0 --help' for more information.";; 13003 17149 --help | --hel | -h ) … … 13008 17154 13009 17155 # This is an error. 13010 -*) as_fn_error "unrecognized option: \`$1'17156 -*) as_fn_error $? "unrecognized option: \`$1' 13011 17157 Try \`$0 --help' for more information." ;; 13012 17158 … … 13028 17174 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 13029 17175 if \$ac_cs_recheck; then 13030 set X '$SHELL''$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion17176 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion 13031 17177 shift 13032 17178 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 … … 13192 17338 old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' 13193 17339 striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' 17340 compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' 17341 predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' 17342 postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' 17343 predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' 17344 postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' 17345 compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' 17346 LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' 13194 17347 LD_RC='`$ECHO "$LD_RC" | $SED "$delay_single_quote_subst"`' 17348 reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' 13195 17349 reload_flag_RC='`$ECHO "$reload_flag_RC" | $SED "$delay_single_quote_subst"`' 17350 reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13196 17351 reload_cmds_RC='`$ECHO "$reload_cmds_RC" | $SED "$delay_single_quote_subst"`' 17352 old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13197 17353 old_archive_cmds_RC='`$ECHO "$old_archive_cmds_RC" | $SED "$delay_single_quote_subst"`' 17354 compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' 13198 17355 compiler_RC='`$ECHO "$compiler_RC" | $SED "$delay_single_quote_subst"`' 17356 GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' 13199 17357 GCC_RC='`$ECHO "$GCC_RC" | $SED "$delay_single_quote_subst"`' 17358 lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' 13200 17359 lt_prog_compiler_no_builtin_flag_RC='`$ECHO "$lt_prog_compiler_no_builtin_flag_RC" | $SED "$delay_single_quote_subst"`' 17360 lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' 13201 17361 lt_prog_compiler_pic_RC='`$ECHO "$lt_prog_compiler_pic_RC" | $SED "$delay_single_quote_subst"`' 17362 lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' 13202 17363 lt_prog_compiler_wl_RC='`$ECHO "$lt_prog_compiler_wl_RC" | $SED "$delay_single_quote_subst"`' 17364 lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' 13203 17365 lt_prog_compiler_static_RC='`$ECHO "$lt_prog_compiler_static_RC" | $SED "$delay_single_quote_subst"`' 17366 lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' 13204 17367 lt_cv_prog_compiler_c_o_RC='`$ECHO "$lt_cv_prog_compiler_c_o_RC" | $SED "$delay_single_quote_subst"`' 17368 archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' 13205 17369 archive_cmds_need_lc_RC='`$ECHO "$archive_cmds_need_lc_RC" | $SED "$delay_single_quote_subst"`' 17370 enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' 13206 17371 enable_shared_with_static_runtimes_RC='`$ECHO "$enable_shared_with_static_runtimes_RC" | $SED "$delay_single_quote_subst"`' 17372 export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' 13207 17373 export_dynamic_flag_spec_RC='`$ECHO "$export_dynamic_flag_spec_RC" | $SED "$delay_single_quote_subst"`' 17374 whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' 13208 17375 whole_archive_flag_spec_RC='`$ECHO "$whole_archive_flag_spec_RC" | $SED "$delay_single_quote_subst"`' 17376 compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' 13209 17377 compiler_needs_object_RC='`$ECHO "$compiler_needs_object_RC" | $SED "$delay_single_quote_subst"`' 17378 old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13210 17379 old_archive_from_new_cmds_RC='`$ECHO "$old_archive_from_new_cmds_RC" | $SED "$delay_single_quote_subst"`' 17380 old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13211 17381 old_archive_from_expsyms_cmds_RC='`$ECHO "$old_archive_from_expsyms_cmds_RC" | $SED "$delay_single_quote_subst"`' 17382 archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13212 17383 archive_cmds_RC='`$ECHO "$archive_cmds_RC" | $SED "$delay_single_quote_subst"`' 17384 archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13213 17385 archive_expsym_cmds_RC='`$ECHO "$archive_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' 17386 module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13214 17387 module_cmds_RC='`$ECHO "$module_cmds_RC" | $SED "$delay_single_quote_subst"`' 17388 module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13215 17389 module_expsym_cmds_RC='`$ECHO "$module_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' 17390 with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' 13216 17391 with_gnu_ld_RC='`$ECHO "$with_gnu_ld_RC" | $SED "$delay_single_quote_subst"`' 17392 allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' 13217 17393 allow_undefined_flag_RC='`$ECHO "$allow_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' 17394 no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' 13218 17395 no_undefined_flag_RC='`$ECHO "$no_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' 17396 hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' 13219 17397 hardcode_libdir_flag_spec_RC='`$ECHO "$hardcode_libdir_flag_spec_RC" | $SED "$delay_single_quote_subst"`' 17398 hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' 13220 17399 hardcode_libdir_separator_RC='`$ECHO "$hardcode_libdir_separator_RC" | $SED "$delay_single_quote_subst"`' 17400 hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' 13221 17401 hardcode_direct_RC='`$ECHO "$hardcode_direct_RC" | $SED "$delay_single_quote_subst"`' 17402 hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' 13222 17403 hardcode_direct_absolute_RC='`$ECHO "$hardcode_direct_absolute_RC" | $SED "$delay_single_quote_subst"`' 17404 hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' 13223 17405 hardcode_minus_L_RC='`$ECHO "$hardcode_minus_L_RC" | $SED "$delay_single_quote_subst"`' 17406 hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' 13224 17407 hardcode_shlibpath_var_RC='`$ECHO "$hardcode_shlibpath_var_RC" | $SED "$delay_single_quote_subst"`' 17408 hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' 13225 17409 hardcode_automatic_RC='`$ECHO "$hardcode_automatic_RC" | $SED "$delay_single_quote_subst"`' 17410 inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' 13226 17411 inherit_rpath_RC='`$ECHO "$inherit_rpath_RC" | $SED "$delay_single_quote_subst"`' 17412 link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' 13227 17413 link_all_deplibs_RC='`$ECHO "$link_all_deplibs_RC" | $SED "$delay_single_quote_subst"`' 17414 always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' 13228 17415 always_export_symbols_RC='`$ECHO "$always_export_symbols_RC" | $SED "$delay_single_quote_subst"`' 17416 export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13229 17417 export_symbols_cmds_RC='`$ECHO "$export_symbols_cmds_RC" | $SED "$delay_single_quote_subst"`' 17418 exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' 13230 17419 exclude_expsyms_RC='`$ECHO "$exclude_expsyms_RC" | $SED "$delay_single_quote_subst"`' 17420 include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' 13231 17421 include_expsyms_RC='`$ECHO "$include_expsyms_RC" | $SED "$delay_single_quote_subst"`' 17422 prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13232 17423 prelink_cmds_RC='`$ECHO "$prelink_cmds_RC" | $SED "$delay_single_quote_subst"`' 17424 postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' 13233 17425 postlink_cmds_RC='`$ECHO "$postlink_cmds_RC" | $SED "$delay_single_quote_subst"`' 17426 file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' 13234 17427 file_list_spec_RC='`$ECHO "$file_list_spec_RC" | $SED "$delay_single_quote_subst"`' 17428 hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' 13235 17429 hardcode_action_RC='`$ECHO "$hardcode_action_RC" | $SED "$delay_single_quote_subst"`' 17430 compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' 17431 compiler_lib_search_dirs_RC='`$ECHO "$compiler_lib_search_dirs_RC" | $SED "$delay_single_quote_subst"`' 17432 predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' 17433 predep_objects_RC='`$ECHO "$predep_objects_RC" | $SED "$delay_single_quote_subst"`' 17434 postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' 17435 postdep_objects_RC='`$ECHO "$postdep_objects_RC" | $SED "$delay_single_quote_subst"`' 17436 predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' 17437 predeps_RC='`$ECHO "$predeps_RC" | $SED "$delay_single_quote_subst"`' 17438 postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' 17439 postdeps_RC='`$ECHO "$postdeps_RC" | $SED "$delay_single_quote_subst"`' 17440 compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' 17441 compiler_lib_search_path_RC='`$ECHO "$compiler_lib_search_path_RC" | $SED "$delay_single_quote_subst"`' 13236 17442 13237 17443 LTCC='$LTCC' … … 13313 17519 old_striplib \ 13314 17520 striplib \ 17521 compiler_lib_search_dirs \ 17522 predep_objects \ 17523 postdep_objects \ 17524 predeps \ 17525 postdeps \ 17526 compiler_lib_search_path \ 17527 LD_CXX \ 13315 17528 LD_RC \ 17529 reload_flag_CXX \ 13316 17530 reload_flag_RC \ 17531 compiler_CXX \ 13317 17532 compiler_RC \ 17533 lt_prog_compiler_no_builtin_flag_CXX \ 13318 17534 lt_prog_compiler_no_builtin_flag_RC \ 17535 lt_prog_compiler_pic_CXX \ 13319 17536 lt_prog_compiler_pic_RC \ 17537 lt_prog_compiler_wl_CXX \ 13320 17538 lt_prog_compiler_wl_RC \ 17539 lt_prog_compiler_static_CXX \ 13321 17540 lt_prog_compiler_static_RC \ 17541 lt_cv_prog_compiler_c_o_CXX \ 13322 17542 lt_cv_prog_compiler_c_o_RC \ 17543 export_dynamic_flag_spec_CXX \ 13323 17544 export_dynamic_flag_spec_RC \ 17545 whole_archive_flag_spec_CXX \ 13324 17546 whole_archive_flag_spec_RC \ 17547 compiler_needs_object_CXX \ 13325 17548 compiler_needs_object_RC \ 17549 with_gnu_ld_CXX \ 13326 17550 with_gnu_ld_RC \ 17551 allow_undefined_flag_CXX \ 13327 17552 allow_undefined_flag_RC \ 17553 no_undefined_flag_CXX \ 13328 17554 no_undefined_flag_RC \ 17555 hardcode_libdir_flag_spec_CXX \ 13329 17556 hardcode_libdir_flag_spec_RC \ 17557 hardcode_libdir_separator_CXX \ 13330 17558 hardcode_libdir_separator_RC \ 17559 exclude_expsyms_CXX \ 13331 17560 exclude_expsyms_RC \ 17561 include_expsyms_CXX \ 13332 17562 include_expsyms_RC \ 13333 file_list_spec_RC; do 17563 file_list_spec_CXX \ 17564 file_list_spec_RC \ 17565 compiler_lib_search_dirs_CXX \ 17566 compiler_lib_search_dirs_RC \ 17567 predep_objects_CXX \ 17568 predep_objects_RC \ 17569 postdep_objects_CXX \ 17570 postdep_objects_RC \ 17571 predeps_CXX \ 17572 predeps_RC \ 17573 postdeps_CXX \ 17574 postdeps_RC \ 17575 compiler_lib_search_path_CXX \ 17576 compiler_lib_search_path_RC; do 13334 17577 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in 13335 17578 *[\\\\\\\`\\"\\\$]*) … … 13362 17605 sys_lib_search_path_spec \ 13363 17606 sys_lib_dlsearch_path_spec \ 17607 reload_cmds_CXX \ 13364 17608 reload_cmds_RC \ 17609 old_archive_cmds_CXX \ 13365 17610 old_archive_cmds_RC \ 17611 old_archive_from_new_cmds_CXX \ 13366 17612 old_archive_from_new_cmds_RC \ 17613 old_archive_from_expsyms_cmds_CXX \ 13367 17614 old_archive_from_expsyms_cmds_RC \ 17615 archive_cmds_CXX \ 13368 17616 archive_cmds_RC \ 17617 archive_expsym_cmds_CXX \ 13369 17618 archive_expsym_cmds_RC \ 17619 module_cmds_CXX \ 13370 17620 module_cmds_RC \ 17621 module_expsym_cmds_CXX \ 13371 17622 module_expsym_cmds_RC \ 17623 export_symbols_cmds_CXX \ 13372 17624 export_symbols_cmds_RC \ 17625 prelink_cmds_CXX \ 13373 17626 prelink_cmds_RC \ 17627 postlink_cmds_CXX \ 13374 17628 postlink_cmds_RC; do 13375 17629 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in … … 13399 17653 RM='$RM' 13400 17654 ofile='$ofile' 17655 17656 13401 17657 13402 17658 … … 13420 17676 "libusb/Makefile") CONFIG_FILES="$CONFIG_FILES libusb/Makefile" ;; 13421 17677 "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; 17678 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; 13422 17679 "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; 13423 17680 "doc/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen.cfg" ;; 13424 17681 13425 *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;17682 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 13426 17683 esac 13427 17684 done … … 13446 17703 $debug || 13447 17704 { 13448 tmp= 17705 tmp= ac_tmp= 13449 17706 trap 'exit_status=$? 13450 { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status 17707 : "${ac_tmp:=$tmp}" 17708 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status 13451 17709 ' 0 13452 17710 trap 'as_fn_exit 1' 1 2 13 15 … … 13456 17714 { 13457 17715 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && 13458 test - n "$tmp" && test -d "$tmp"17716 test -d "$tmp" 13459 17717 } || 13460 17718 { 13461 17719 tmp=./conf$$-$RANDOM 13462 17720 (umask 077 && mkdir "$tmp") 13463 } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 17721 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 17722 ac_tmp=$tmp 13464 17723 13465 17724 # Set up the scripts for CONFIG_FILES section. … … 13478 17737 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` 13479 17738 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then 13480 ac_cs_awk_cr='\ r'17739 ac_cs_awk_cr='\\r' 13481 17740 else 13482 17741 ac_cs_awk_cr=$ac_cr 13483 17742 fi 13484 17743 13485 echo 'BEGIN {' >"$ tmp/subs1.awk" &&17744 echo 'BEGIN {' >"$ac_tmp/subs1.awk" && 13486 17745 _ACEOF 13487 17746 … … 13492 17751 echo "_ACEOF" 13493 17752 } >conf$$subs.sh || 13494 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 513495 ac_delim_num=`echo "$ac_subst_vars" | grep -c ' $'`17753 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 17754 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` 13496 17755 ac_delim='%!_!# ' 13497 17756 for ac_last_try in false false false false false :; do 13498 17757 . ./conf$$subs.sh || 13499 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 517758 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 13500 17759 13501 17760 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` … … 13503 17762 break 13504 17763 elif $ac_last_try; then 13505 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 517764 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 13506 17765 else 13507 17766 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " … … 13511 17770 13512 17771 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 13513 cat >>"\$ tmp/subs1.awk" <<\\_ACAWK &&17772 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && 13514 17773 _ACEOF 13515 17774 sed -n ' … … 13525 17784 :nl 13526 17785 h 13527 s/\(.\{148\}\). */\1/17786 s/\(.\{148\}\)..*/\1/ 13528 17787 t more1 13529 17788 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ … … 13539 17798 :delim 13540 17799 h 13541 s/\(.\{148\}\). */\1/17800 s/\(.\{148\}\)..*/\1/ 13542 17801 t more2 13543 17802 s/["\\]/\\&/g; s/^/"/; s/$/"/ … … 13559 17818 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 13560 17819 _ACAWK 13561 cat >>"\$ tmp/subs1.awk" <<_ACAWK &&17820 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && 13562 17821 for (key in S) S_is_set[key] = 1 13563 17822 FS = "" … … 13591 17850 else 13592 17851 cat 13593 fi < "$ tmp/subs1.awk" > "$tmp/subs.awk" \13594 || as_fn_error "could not setup config files machinery" "$LINENO" 517852 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ 17853 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 13595 17854 _ACEOF 13596 17855 13597 # VPATH may cause trouble with some makes, so we remove $(srcdir),13598 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and17856 # VPATH may cause trouble with some makes, so we remove sole $(srcdir), 17857 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and 13599 17858 # trailing colons and then remove the whole line if VPATH becomes empty 13600 17859 # (actually we leave an empty line to preserve line numbers). 13601 17860 if test "x$srcdir" = x.; then 13602 ac_vpsub='/^[ ]*VPATH[ ]*=/{ 13603 s/:*\$(srcdir):*/:/ 13604 s/:*\${srcdir}:*/:/ 13605 s/:*@srcdir@:*/:/ 13606 s/^\([^=]*=[ ]*\):*/\1/ 17861 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ 17862 h 17863 s/// 17864 s/^/:/ 17865 s/[ ]*$/:/ 17866 s/:\$(srcdir):/:/g 17867 s/:\${srcdir}:/:/g 17868 s/:@srcdir@:/:/g 17869 s/^:*// 13607 17870 s/:*$// 17871 x 17872 s/\(=[ ]*\).*/\1/ 17873 G 17874 s/\n// 13608 17875 s/^[^=]*=[ ]*$// 13609 17876 }' … … 13617 17884 # This happens for instance with `./config.status Makefile'. 13618 17885 if test -n "$CONFIG_HEADERS"; then 13619 cat >"$ tmp/defines.awk" <<\_ACAWK ||17886 cat >"$ac_tmp/defines.awk" <<\_ACAWK || 13620 17887 BEGIN { 13621 17888 _ACEOF … … 13629 17896 ac_delim='%!_!# ' 13630 17897 for ac_last_try in false false :; do 13631 ac_t =`sed -n "/$ac_delim/p" confdefs.h`13632 if test -z "$ac_t "; then17898 ac_tt=`sed -n "/$ac_delim/p" confdefs.h` 17899 if test -z "$ac_tt"; then 13633 17900 break 13634 17901 elif $ac_last_try; then 13635 as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 517902 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 13636 17903 else 13637 17904 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " … … 13718 17985 _ACEOF 13719 17986 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 13720 as_fn_error "could not setup config headers machinery" "$LINENO" 517987 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 13721 17988 fi # test -n "$CONFIG_HEADERS" 13722 17989 … … 13731 17998 case $ac_mode$ac_tag in 13732 17999 :[FHL]*:*);; 13733 :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;18000 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; 13734 18001 :[FH]-) ac_tag=-:-;; 13735 18002 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; … … 13750 18017 do 13751 18018 case $ac_f in 13752 -) ac_f="$ tmp/stdin";;18019 -) ac_f="$ac_tmp/stdin";; 13753 18020 *) # Look for the file first in the build tree, then in the source tree 13754 18021 # (if the path is not absolute). The absolute path cannot be DOS-style, … … 13759 18026 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 13760 18027 esac || 13761 as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;18028 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 13762 18029 esac 13763 18030 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac … … 13785 18052 13786 18053 case $ac_tag in 13787 *:-:* | *:-) cat >"$ tmp/stdin" \13788 || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;18054 *:-:* | *:-) cat >"$ac_tmp/stdin" \ 18055 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 13789 18056 esac 13790 18057 ;; … … 13922 18189 $ac_datarootdir_hack 13923 18190 " 13924 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ tmp/subs.awk" >$tmp/out\13925 || as_fn_error"could not create $ac_file" "$LINENO" 518191 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ 18192 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 13926 18193 13927 18194 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && 13928 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && 13929 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && 18195 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && 18196 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ 18197 "$ac_tmp/out"`; test -z "$ac_out"; } && 13930 18198 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' 13931 which seems to be undefined. Please make sure it is defined ." >&518199 which seems to be undefined. Please make sure it is defined" >&5 13932 18200 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' 13933 which seems to be undefined. Please make sure it is defined ." >&2;}13934 13935 rm -f "$ tmp/stdin"18201 which seems to be undefined. Please make sure it is defined" >&2;} 18202 18203 rm -f "$ac_tmp/stdin" 13936 18204 case $ac_file in 13937 -) cat "$ tmp/out" && rm -f "$tmp/out";;13938 *) rm -f "$ac_file" && mv "$ tmp/out" "$ac_file";;18205 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; 18206 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; 13939 18207 esac \ 13940 || as_fn_error "could not create $ac_file" "$LINENO" 518208 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 13941 18209 ;; 13942 18210 :H) … … 13947 18215 { 13948 18216 $as_echo "/* $configure_input */" \ 13949 && eval '$AWK -f "$ tmp/defines.awk"' "$ac_file_inputs"13950 } >"$ tmp/config.h" \13951 || as_fn_error "could not create $ac_file" "$LINENO" 513952 if diff "$ac_file" "$ tmp/config.h" >/dev/null 2>&1; then18217 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" 18218 } >"$ac_tmp/config.h" \ 18219 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 18220 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then 13953 18221 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 13954 18222 $as_echo "$as_me: $ac_file is unchanged" >&6;} 13955 18223 else 13956 18224 rm -f "$ac_file" 13957 mv "$ tmp/config.h" "$ac_file" \13958 || as_fn_error "could not create $ac_file" "$LINENO" 518225 mv "$ac_tmp/config.h" "$ac_file" \ 18226 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 13959 18227 fi 13960 18228 else 13961 18229 $as_echo "/* $configure_input */" \ 13962 && eval '$AWK -f "$ tmp/defines.awk"' "$ac_file_inputs" \13963 || as_fn_error "could not create -" "$LINENO" 518230 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ 18231 || as_fn_error $? "could not create -" "$LINENO" 5 13964 18232 fi 13965 18233 # Compute "$ac_file"'s index in $config_headers. … … 14007 18275 case $ac_file$ac_mode in 14008 18276 "depfiles":C) test x"$AMDEP_TRUE" != x"" || { 14009 # Autoconf 2.62quotes --file arguments for eval, but not when files18277 # Older Autoconf quotes --file arguments for eval, but not when files 14010 18278 # are listed without --file. Let's play safe and only enable the eval 14011 18279 # if we detect the quoting. … … 14020 18288 mf=`echo "$mf" | sed -e 's/:.*$//'` 14021 18289 # Check whether this is an Automake generated Makefile or not. 14022 # We used to match only the files named `Makefile.in', but18290 # We used to match only the files named 'Makefile.in', but 14023 18291 # some people rename them; so instead we look at the file content. 14024 18292 # Grep'ing the first line is not enough: some people post-process … … 14054 18322 fi 14055 18323 # Extract the definition of DEPDIR, am__include, and am__quote 14056 # from the Makefile without running `make'.18324 # from the Makefile without running 'make'. 14057 18325 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 14058 18326 test -z "$DEPDIR" && continue 14059 18327 am__include=`sed -n 's/^am__include = //p' < "$mf"` 14060 test -z " am__include" && continue18328 test -z "$am__include" && continue 14061 18329 am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 14062 # When using ansi2knr, U may be empty or an underscore; expand it14063 U=`sed -n 's/^U = //p' < "$mf"`14064 18330 # Find all dependency output files, they are included files with 14065 18331 # $(DEPDIR) in their names. We invoke sed twice because it is the … … 14068 18334 for file in `sed -n " 14069 18335 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 14070 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do18336 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 14071 18337 # Make sure the directory exists. 14072 18338 test -f "$dirpart/$file" && continue … … 14151 18417 14152 18418 # The names of the tagged configurations supported by this script. 14153 available_tags=" RC "18419 available_tags="CXX RC " 14154 18420 14155 18421 # ### BEGIN LIBTOOL CONFIG … … 14537 18803 # How to hardcode a shared library path into an executable. 14538 18804 hardcode_action=$hardcode_action 18805 18806 # The directories searched by this compiler when creating a shared library. 18807 compiler_lib_search_dirs=$lt_compiler_lib_search_dirs 18808 18809 # Dependencies to place before and after the objects being linked to 18810 # create a shared library. 18811 predep_objects=$lt_predep_objects 18812 postdep_objects=$lt_postdep_objects 18813 predeps=$lt_predeps 18814 postdeps=$lt_postdeps 18815 18816 # The library search path used internally by the compiler when linking 18817 # a shared library. 18818 compiler_lib_search_path=$lt_compiler_lib_search_path 14539 18819 14540 18820 # ### END LIBTOOL CONFIG … … 14733 19013 cat <<_LT_EOF >> "$ofile" 14734 19014 19015 # ### BEGIN LIBTOOL TAG CONFIG: CXX 19016 19017 # The linker used to build libraries. 19018 LD=$lt_LD_CXX 19019 19020 # How to create reloadable object files. 19021 reload_flag=$lt_reload_flag_CXX 19022 reload_cmds=$lt_reload_cmds_CXX 19023 19024 # Commands used to build an old-style archive. 19025 old_archive_cmds=$lt_old_archive_cmds_CXX 19026 19027 # A language specific compiler. 19028 CC=$lt_compiler_CXX 19029 19030 # Is the compiler the GNU compiler? 19031 with_gcc=$GCC_CXX 19032 19033 # Compiler flag to turn off builtin functions. 19034 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX 19035 19036 # Additional compiler flags for building library objects. 19037 pic_flag=$lt_lt_prog_compiler_pic_CXX 19038 19039 # How to pass a linker flag through the compiler. 19040 wl=$lt_lt_prog_compiler_wl_CXX 19041 19042 # Compiler flag to prevent dynamic linking. 19043 link_static_flag=$lt_lt_prog_compiler_static_CXX 19044 19045 # Does compiler simultaneously support -c and -o options? 19046 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX 19047 19048 # Whether or not to add -lc for building shared libraries. 19049 build_libtool_need_lc=$archive_cmds_need_lc_CXX 19050 19051 # Whether or not to disallow shared libs when runtime libs are static. 19052 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX 19053 19054 # Compiler flag to allow reflexive dlopens. 19055 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX 19056 19057 # Compiler flag to generate shared objects directly from archives. 19058 whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX 19059 19060 # Whether the compiler copes with passing no objects directly. 19061 compiler_needs_object=$lt_compiler_needs_object_CXX 19062 19063 # Create an old-style archive from a shared archive. 19064 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX 19065 19066 # Create a temporary old-style archive to link instead of a shared archive. 19067 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX 19068 19069 # Commands used to build a shared archive. 19070 archive_cmds=$lt_archive_cmds_CXX 19071 archive_expsym_cmds=$lt_archive_expsym_cmds_CXX 19072 19073 # Commands used to build a loadable module if different from building 19074 # a shared archive. 19075 module_cmds=$lt_module_cmds_CXX 19076 module_expsym_cmds=$lt_module_expsym_cmds_CXX 19077 19078 # Whether we are building with GNU ld or not. 19079 with_gnu_ld=$lt_with_gnu_ld_CXX 19080 19081 # Flag that allows shared libraries with undefined symbols to be built. 19082 allow_undefined_flag=$lt_allow_undefined_flag_CXX 19083 19084 # Flag that enforces no undefined symbols. 19085 no_undefined_flag=$lt_no_undefined_flag_CXX 19086 19087 # Flag to hardcode \$libdir into a binary during linking. 19088 # This must work even if \$libdir does not exist 19089 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX 19090 19091 # Whether we need a single "-rpath" flag with a separated argument. 19092 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX 19093 19094 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes 19095 # DIR into the resulting binary. 19096 hardcode_direct=$hardcode_direct_CXX 19097 19098 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes 19099 # DIR into the resulting binary and the resulting library dependency is 19100 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the 19101 # library is relocated. 19102 hardcode_direct_absolute=$hardcode_direct_absolute_CXX 19103 19104 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR 19105 # into the resulting binary. 19106 hardcode_minus_L=$hardcode_minus_L_CXX 19107 19108 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR 19109 # into the resulting binary. 19110 hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX 19111 19112 # Set to "yes" if building a shared library automatically hardcodes DIR 19113 # into the library and all subsequent libraries and executables linked 19114 # against it. 19115 hardcode_automatic=$hardcode_automatic_CXX 19116 19117 # Set to yes if linker adds runtime paths of dependent libraries 19118 # to runtime path list. 19119 inherit_rpath=$inherit_rpath_CXX 19120 19121 # Whether libtool must link a program against all its dependency libraries. 19122 link_all_deplibs=$link_all_deplibs_CXX 19123 19124 # Set to "yes" if exported symbols are required. 19125 always_export_symbols=$always_export_symbols_CXX 19126 19127 # The commands to list exported symbols. 19128 export_symbols_cmds=$lt_export_symbols_cmds_CXX 19129 19130 # Symbols that should not be listed in the preloaded symbols. 19131 exclude_expsyms=$lt_exclude_expsyms_CXX 19132 19133 # Symbols that must always be exported. 19134 include_expsyms=$lt_include_expsyms_CXX 19135 19136 # Commands necessary for linking programs (against libraries) with templates. 19137 prelink_cmds=$lt_prelink_cmds_CXX 19138 19139 # Commands necessary for finishing linking programs. 19140 postlink_cmds=$lt_postlink_cmds_CXX 19141 19142 # Specify filename containing input files. 19143 file_list_spec=$lt_file_list_spec_CXX 19144 19145 # How to hardcode a shared library path into an executable. 19146 hardcode_action=$hardcode_action_CXX 19147 19148 # The directories searched by this compiler when creating a shared library. 19149 compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX 19150 19151 # Dependencies to place before and after the objects being linked to 19152 # create a shared library. 19153 predep_objects=$lt_predep_objects_CXX 19154 postdep_objects=$lt_postdep_objects_CXX 19155 predeps=$lt_predeps_CXX 19156 postdeps=$lt_postdeps_CXX 19157 19158 # The library search path used internally by the compiler when linking 19159 # a shared library. 19160 compiler_lib_search_path=$lt_compiler_lib_search_path_CXX 19161 19162 # ### END LIBTOOL TAG CONFIG: CXX 19163 _LT_EOF 19164 19165 19166 cat <<_LT_EOF >> "$ofile" 19167 14735 19168 # ### BEGIN LIBTOOL TAG CONFIG: RC 14736 19169 … … 14866 19299 hardcode_action=$hardcode_action_RC 14867 19300 19301 # The directories searched by this compiler when creating a shared library. 19302 compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC 19303 19304 # Dependencies to place before and after the objects being linked to 19305 # create a shared library. 19306 predep_objects=$lt_predep_objects_RC 19307 postdep_objects=$lt_postdep_objects_RC 19308 predeps=$lt_predeps_RC 19309 postdeps=$lt_postdeps_RC 19310 19311 # The library search path used internally by the compiler when linking 19312 # a shared library. 19313 compiler_lib_search_path=$lt_compiler_lib_search_path_RC 19314 14868 19315 # ### END LIBTOOL TAG CONFIG: RC 14869 19316 _LT_EOF … … 14880 19327 14881 19328 test $ac_write_fail = 0 || 14882 as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 519329 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 14883 19330 14884 19331 … … 14901 19348 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 14902 19349 # would make configure fail if this is the last instruction. 14903 $ac_cs_success || as_fn_exit $?19350 $ac_cs_success || as_fn_exit 1 14904 19351 fi 14905 19352 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then -
TabularUnified libusb1/trunk/configure.ac ¶
r1879 r1882 9 9 dnl The m4_bregexp() returns (only) the numbers following the #define named 10 10 dnl in the first macro parameter. m4_define() then defines the name for use 11 dnl in AC_INIT ().11 dnl in AC_INIT. 12 12 13 13 LU_DEFINE_VERSION_ATOM([LIBUSB_MAJOR]) … … 16 16 LU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC]) 17 17 18 AC_INIT([libusb], LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/])18 AC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb-devel@lists.sourceforge.net],[libusb],[http://libusb.info]) 19 19 20 20 # Library versioning … … 22 22 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 23 23 # http://sourceware.org/autobook/autobook/autobook_91.html 24 lt_current=" 2"24 lt_current="1" 25 25 lt_revision="0" 26 lt_age=" 0"26 lt_age="1" 27 27 LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" 28 28 29 29 AM_INIT_AUTOMAKE 30 AM_MAINTAINER_MODE31 30 32 31 AC_CONFIG_SRCDIR([libusb/core.c]) … … 35 34 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 36 35 37 AC_PREREQ([2. 50])36 AC_PREREQ([2.69]) 38 37 AC_PROG_CC 39 AC_PROG_LIBTOOL 38 AC_PROG_CXX 39 LT_INIT 40 40 LT_LANG([Windows Resource]) 41 41 AC_C_INLINE … … 46 46 47 47 AC_MSG_CHECKING([operating system]) 48 49 dnl on linux-android platform, some functions are in different places 48 50 case $host in 49 *-linux*) 51 *-linux-android*) 52 AC_MSG_RESULT([This is a Linux-Android system]) 53 is_backend_android="yes" 54 ;; 55 *) 56 is_backend_android="no" 57 esac 58 59 case $host in 60 *-linux* | *-uclinux*) 50 61 AC_MSG_RESULT([Linux]) 51 62 backend="linux" 63 threads="posix" 52 64 ;; 53 65 *-darwin*) 54 66 AC_MSG_RESULT([Darwin/Mac OS X]) 55 67 backend="darwin" 68 threads="posix" 56 69 ;; 57 70 *-openbsd*) 58 71 AC_MSG_RESULT([OpenBSD]) 59 72 backend="openbsd" 73 threads="posix" 60 74 ;; 61 75 *-netbsd*) 62 AC_MSG_RESULT([NetBSD (using OpenBSD backend)]) 63 backend="openbsd" 64 ;; 65 *-mingw*) 76 AC_MSG_RESULT([NetBSD]) 77 backend="netbsd" 78 threads="posix" 79 ;; 80 *-mingw* | *msys*) 66 81 AC_MSG_RESULT([Windows]) 67 82 backend="windows" 83 threads="windows" 84 create_import_lib="yes" 85 AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer" 68 86 ;; 69 87 *-os2-emx*) 70 88 AC_MSG_RESULT([OS2]) 71 89 backend="os2" 90 threads="posix" 72 91 ;; 73 92 *-cygwin*) … … 76 95 threads="posix" 77 96 ;; 97 *-haiku*) 98 AC_MSG_RESULT([Haiku]) 99 backend="haiku" 100 threads="posix" 101 ;; 102 *-solaris*) 103 AC_MSG_RESULT([SunOS]) 104 backend="sunos" 105 threads="posix" 106 ;; 78 107 *) 79 AC_MSG_ERROR([unsupported operating system ])108 AC_MSG_ERROR([unsupported operating system $host]) 80 109 esac 110 81 111 case $backend in 82 112 linux) 83 113 AC_DEFINE(OS_LINUX, 1, [Linux backend]) 84 114 AC_SUBST(OS_LINUX) 85 AC_ CHECK_LIB(rt, clock_gettime, PC_LIBS_PRIVATE="-lrt")115 AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread) 86 116 AC_ARG_ENABLE([udev], 87 [AC_HELP_STRING([--with-udev], [use udev for device enumeration and hotplug support (recommended, default: yes)])], 88 [], [enable_udev="yes"]) 89 if test "x$enable_udev" = "xyes" ; then 90 # system has udev. use it or fail! 91 AC_CHECK_HEADERS([libudev.h],[],[AC_ERROR(["udev support requested but libudev not installed"])]) 92 AC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR(["udev support requested but libudev not installed"])]) 93 AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug]) 94 else 95 AC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR(["Linux netlink headers not found"])]) 96 fi 97 AC_SUBST(USE_UDEV) 98 threads="posix" 117 [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])], 118 [], [enable_udev="yes"]) 119 if test "x$enable_udev" = "xyes" ; then 120 # system has udev. use it or fail! 121 AC_CHECK_HEADERS([libudev.h],[],[AC_ERROR(["udev support requested but libudev not installed"])]) 122 AC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR(["udev support requested but libudev not installed"])]) 123 AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug]) 124 else 125 AC_CHECK_HEADERS([asm/types.h], [], []) 126 AC_CHECK_HEADERS([sys/socket.h linux/netlink.h], [], [AC_ERROR(["Linux netlink headers not found"])], [ 127 #ifdef HAVE_ASM_TYPES_H 128 #include <asm/types.h> 129 #endif 130 #include <sys/socket.h> 131 ]) 132 fi 133 AC_SUBST(USE_UDEV) 134 135 case $is_backend_android in 136 yes) 137 dnl there are gettimeofday function but configure doesn't seem to be able to find it. 138 AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday]) 139 ;; 140 *) 99 141 THREAD_CFLAGS="-pthread" 100 PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" 142 LIBS="${LIBS} -pthread" 143 esac 144 101 145 AC_CHECK_HEADERS([poll.h]) 102 146 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) … … 105 149 AC_DEFINE(OS_DARWIN, 1, [Darwin backend]) 106 150 AC_SUBST(OS_DARWIN) 107 threads="posix" 108 PC_LIBS_PRIVATE="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" 151 LIBS="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" 109 152 LTLDFLAGS="${LTLDFLAGS} -Wl,-prebind" 110 153 AC_CHECK_HEADERS([poll.h]) … … 117 160 AC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend]) 118 161 AC_SUBST(OS_OPENBSD) 119 threads="posix"120 162 THREAD_CFLAGS="-pthread" 121 PC_LIBS_PRIVATE="-pthread" 163 LIBS="-pthread" 164 AC_CHECK_HEADERS([poll.h]) 165 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) 166 ;; 167 sunos) 168 AC_DEFINE(OS_SUNOS, 1, [SunOS backend]) 169 AC_SUBST(OS_SUNOS) 170 THREAD_CFLAGS="-pthread" 171 LIBS="-pthread -ldevinfo" 172 AC_CHECK_HEADERS([poll.h]) 173 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) 174 ;; 175 netbsd) 176 AC_DEFINE(OS_NETBSD, 1, [NetBSD backend]) 177 AC_SUBST(OS_NETBSD) 178 THREAD_CFLAGS="-pthread" 179 LIBS="-pthread" 122 180 AC_CHECK_HEADERS([poll.h]) 123 181 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) … … 126 184 AC_DEFINE(OS_WINDOWS, 1, [Windows backend]) 127 185 AC_SUBST(OS_WINDOWS) 128 PC_LIBS_PRIVATE=""186 LIBS="" 129 187 LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias" 130 188 AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument]) 189 AC_DEFINE([WINVER], 0x0501, [Oldest Windows version supported]) 190 191 AC_ARG_ENABLE([usbdk], 192 [AC_HELP_STRING([--enable-usbdk], [use UsbDk Windows backend [default=no]])], 193 [], [enable_usbdk="no"]) 194 if test "x$enable_usbdk" = "xyes" ; then 195 AC_DEFINE(USE_USBDK, 1, [Use UsbDk Windows backend]) 196 fi 197 AC_SUBST(USE_USBDK) 131 198 ;; 132 199 os2) 133 200 AC_DEFINE(OS_OS2, 1, [OS/2 backend]) 134 201 AC_SUBST(OS_OS2) 135 threads="posix" 136 PC_LIBS_PRIVATE="-lpthread" 137 AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument]) 202 LIBS="${LIBS} -lpthread" 203 AC_CHECK_HEADERS([poll.h]) 204 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) 205 ;; 206 haiku) 207 AC_DEFINE(OS_HAIKU, 1, [Haiku backend]) 208 AC_SUBST(OS_HAIKU) 209 LIBS="${LIBS} -lbe" 210 AC_CHECK_HEADERS([poll.h]) 211 AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) 138 212 ;; 139 213 esac 140 AC_SUBST(THREAD_CFLAGS) 141 AC_SUBST(PC_LIBS_PRIVATE) 142 LIBS="${LIBS} ${PC_LIBS_PRIVATE}" 214 215 AC_SUBST(LIBS) 143 216 144 217 AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux) 145 218 AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin) 146 219 AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd) 220 AM_CONDITIONAL(OS_SUNOS, test "x$backend" = xsunos) 221 AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd) 147 222 AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows) 148 223 AM_CONDITIONAL(OS_OS2, test "x$backend" = xos2) 224 AM_CONDITIONAL(OS_HAIKU, test "x$backend" = xhaiku) 149 225 AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix) 226 AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes") 150 227 AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes) 228 AM_CONDITIONAL(USE_USBDK, test "x$enable_usbdk" = xyes) 151 229 if test "$threads" = posix; then 152 230 AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads]) … … 157 235 AC_ARG_ENABLE([timerfd], 158 236 [AS_HELP_STRING([--enable-timerfd], 159 [use timerfd for timing (default auto)])],237 [use timerfd for timing [default=auto]])], 160 238 [use_timerfd=$enableval], [use_timerfd='auto']) 161 239 … … 192 270 193 271 AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log], 194 [ enable debug logging (default n)])],272 [start with debug message logging enabled [default=no]])], 195 273 [debug_log_enabled=$enableval], 196 274 [debug_log_enabled='no']) 197 275 if test "x$debug_log_enabled" != "xno"; then 198 AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging]) 276 AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled]) 277 fi 278 279 AC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log], 280 [output logging messages to system wide log, if supported by the OS [default=no]])], 281 [system_log_enabled=$enableval], 282 [system_log_enabled='no']) 283 if test "x$system_log_enabled" != "xno"; then 284 AC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log]) 285 fi 286 287 # Check if syslog is available in standard C library 288 AC_CHECK_HEADERS(syslog.h) 289 AC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no]) 290 if test "x$have_syslog" != "xno"; then 291 AC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available]) 199 292 fi 200 293 201 294 # Examples build 202 295 AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build], 203 [build example applications (default n)])],296 [build example applications [default=no]])], 204 297 [build_examples=$enableval], 205 298 [build_examples='no']) 206 299 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) 300 301 # Tests build 302 AC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build], 303 [build test applications [default=no]])], 304 [build_tests=$enableval], 305 [build_tests='no']) 306 AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != "xno"]) 207 307 208 308 # check for -fvisibility=hidden compiler support (GCC >= 3.4) … … 232 332 AC_CHECK_HEADERS([sys/time.h]) 233 333 AC_CHECK_FUNCS(gettimeofday) 234 235 AM_CFLAGS="-std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow" 236 237 AC_SUBST(VISIBILITY_CFLAGS) 334 AC_CHECK_HEADERS([signal.h]) 335 336 # check for -std=gnu99 compiler support 337 saved_cflags="$CFLAGS" 338 CFLAGS="-std=gnu99" 339 AC_MSG_CHECKING([whether CC supports -std=gnu99]) 340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], 341 [AC_MSG_RESULT([yes])] 342 [AM_CFLAGS="${AM_CFLAGS} -std=gnu99"], 343 [AC_MSG_RESULT([no])] 344 ) 345 CFLAGS="$saved_cflags" 346 347 AM_CFLAGS="${AM_CFLAGS} -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}" 348 238 349 AC_SUBST(AM_CFLAGS) 239 350 AC_SUBST(LTLDFLAGS) … … 243 354 AC_CONFIG_FILES([libusb/Makefile]) 244 355 AC_CONFIG_FILES([examples/Makefile]) 356 AC_CONFIG_FILES([tests/Makefile]) 245 357 AC_CONFIG_FILES([doc/Makefile]) 246 358 AC_CONFIG_FILES([doc/doxygen.cfg]) -
TabularUnified libusb1/trunk/depcomp ¶
r1876 r1882 2 2 # depcomp - compile a program generating dependencies as side-effects 3 3 4 scriptversion=201 2-03-27.16; # UTC5 6 # Copyright (C) 1999-201 2Free Software Foundation, Inc.4 scriptversion=2013-05-30.07; # UTC 5 6 # Copyright (C) 1999-2013 Free Software Foundation, Inc. 7 7 8 8 # This program is free software; you can redistribute it and/or modify … … 28 28 case $1 in 29 29 '') 30 31 32 30 echo "$0: No command. Try '$0 --help' for more information." 1>&2 31 exit 1; 32 ;; 33 33 -h | --h*) 34 34 cat <<\EOF … … 57 57 esac 58 58 59 # Get the directory component of the given path, and save it in the 60 # global variables '$dir'. Note that this directory component will 61 # be either empty or ending with a '/' character. This is deliberate. 62 set_dir_from () 63 { 64 case $1 in 65 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; 66 *) dir=;; 67 esac 68 } 69 70 # Get the suffix-stripped basename of the given path, and save it the 71 # global variable '$base'. 72 set_base_from () 73 { 74 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` 75 } 76 77 # If no dependency file was actually created by the compiler invocation, 78 # we still have to create a dummy depfile, to avoid errors with the 79 # Makefile "include basename.Plo" scheme. 80 make_dummy_depfile () 81 { 82 echo "#dummy" > "$depfile" 83 } 84 85 # Factor out some common post-processing of the generated depfile. 86 # Requires the auxiliary global variable '$tmpdepfile' to be set. 87 aix_post_process_depfile () 88 { 89 # If the compiler actually managed to produce a dependency file, 90 # post-process it. 91 if test -f "$tmpdepfile"; then 92 # Each line is of the form 'foo.o: dependency.h'. 93 # Do two passes, one to just change these to 94 # $object: dependency.h 95 # and one to simply output 96 # dependency.h: 97 # which is needed to avoid the deleted-header problem. 98 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" 99 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" 100 } > "$depfile" 101 rm -f "$tmpdepfile" 102 else 103 make_dummy_depfile 104 fi 105 } 106 59 107 # A tabulation character. 60 108 tab=' ' … … 62 110 nl=' 63 111 ' 112 # Character ranges might be problematic outside the C locale. 113 # These definitions help. 114 upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ 115 lower=abcdefghijklmnopqrstuvwxyz 116 digits=0123456789 117 alpha=${upper}${lower} 64 118 65 119 if test -z "$depmode" || test -z "$source" || test -z "$object"; then … … 74 128 75 129 rm -f "$tmpdepfile" 130 131 # Avoid interferences from the environment. 132 gccflag= dashmflag= 76 133 77 134 # Some modes work just like other modes, but use different flags. We … … 86 143 87 144 if test "$depmode" = dashXmstdout; then 88 89 90 145 # This is just like dashmstdout with a different argument. 146 dashmflag=-xM 147 depmode=dashmstdout 91 148 fi 92 149 93 150 cygpath_u="cygpath -u -f -" 94 151 if test "$depmode" = msvcmsys; then 95 96 97 98 99 152 # This is just like msvisualcpp but w/o cygpath translation. 153 # Just convert the backslash-escaped backslashes to single forward 154 # slashes to satisfy depend.m4 155 cygpath_u='sed s,\\\\,/,g' 156 depmode=msvisualcpp 100 157 fi 101 158 102 159 if test "$depmode" = msvc7msys; then 103 104 105 106 107 160 # This is just like msvc7 but w/o cygpath translation. 161 # Just convert the backslash-escaped backslashes to single forward 162 # slashes to satisfy depend.m4 163 cygpath_u='sed s,\\\\,/,g' 164 depmode=msvc7 108 165 fi 109 166 110 167 if test "$depmode" = xlc; then 111 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.112 113 168 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. 169 gccflag=-qmakedep=gcc,-MF 170 depmode=gcc 114 171 fi 115 172 … … 134 191 "$@" 135 192 stat=$? 136 if test $stat -eq 0; then : 137 else 193 if test $stat -ne 0; then 138 194 rm -f "$tmpdepfile" 139 195 exit $stat … … 143 199 144 200 gcc) 201 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. 202 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. 203 ## (see the conditional assignment to $gccflag above). 145 204 ## There are various ways to get dependency output from gcc. Here's 146 205 ## why we pick this rather obscure method: … … 149 208 ## (We might end up doing this anyway to support other compilers.) 150 209 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 151 ## -MM, not -M (despite what the docs say). 210 ## -MM, not -M (despite what the docs say). Also, it might not be 211 ## supported by the other compilers which use the 'gcc' depmode. 152 212 ## - Using -M directly means running the compiler twice (even worse 153 213 ## than renaming). … … 157 217 "$@" -Wp,"$gccflag$tmpdepfile" 158 218 stat=$? 159 if test $stat -eq 0; then : 160 else 219 if test $stat -ne 0; then 161 220 rm -f "$tmpdepfile" 162 221 exit $stat … … 164 223 rm -f "$depfile" 165 224 echo "$object : \\" > "$depfile" 166 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz167 ## The second -e expression handles DOS-style file names with driveletters.225 # The second -e expression handles DOS-style file names with drive 226 # letters. 168 227 sed -e 's/^[^:]*: / /' \ 169 228 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" … … 174 233 ## dummy dependencies for each header file. Too bad gcc doesn't do 175 234 ## this for us directly. 176 tr ' ' "$nl" < "$tmpdepfile" |177 235 ## Some versions of gcc put a space before the ':'. On the theory 178 236 ## that the space means something, we add a space to the output as … … 181 239 ## Some versions of the HPUX 10.20 sed can't process this invocation 182 240 ## correctly. Breaking it into two sed invocations is a workaround. 183 sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 184 | sed -e 's/$/ :/' >> "$depfile" 241 tr ' ' "$nl" < "$tmpdepfile" \ 242 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 243 | sed -e 's/$/ :/' >> "$depfile" 185 244 rm -f "$tmpdepfile" 186 245 ;; … … 200 259 fi 201 260 stat=$? 202 if test $stat -eq 0; then : 203 else 261 if test $stat -ne 0; then 204 262 rm -f "$tmpdepfile" 205 263 exit $stat … … 209 267 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 210 268 echo "$object : \\" > "$depfile" 211 212 269 # Clip off the initial element (the dependent). Don't try to be 213 270 # clever and replace this with sed code, as IRIX sed won't handle … … 217 274 # dependency line. 218 275 tr ' ' "$nl" < "$tmpdepfile" \ 219 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' |\220 tr "$nl" ' ' >> "$depfile"276 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ 277 | tr "$nl" ' ' >> "$depfile" 221 278 echo >> "$depfile" 222 223 279 # The second pass generates a dummy entry for each header file. 224 280 tr ' ' "$nl" < "$tmpdepfile" \ 225 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \226 >> "$depfile"281 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 282 >> "$depfile" 227 283 else 228 # The sourcefile does not contain any dependencies, so just 229 # store a dummy comment line, to avoid errors with the Makefile 230 # "include basename.Plo" scheme. 231 echo "#dummy" > "$depfile" 284 make_dummy_depfile 232 285 fi 233 286 rm -f "$tmpdepfile" … … 247 300 # start of each line; $object doesn't have directory information. 248 301 # Version 6 uses the directory in both cases. 249 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 250 test "x$dir" = "x$object" && dir= 251 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 302 set_dir_from "$object" 303 set_base_from "$object" 252 304 if test "$libtool" = yes; then 253 305 tmpdepfile1=$dir$base.u … … 262 314 fi 263 315 stat=$? 264 265 if test $stat -eq 0; then : 266 else 316 if test $stat -ne 0; then 267 317 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 268 318 exit $stat … … 273 323 test -f "$tmpdepfile" && break 274 324 done 275 if test -f "$tmpdepfile"; then 276 # Each line is of the form 'foo.o: dependent.h'. 277 # Do two passes, one to just change these to 278 # '$object: dependent.h' and one to simply 'dependent.h:'. 279 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 280 sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 281 else 282 # The sourcefile does not contain any dependencies, so just 283 # store a dummy comment line, to avoid errors with the Makefile 284 # "include basename.Plo" scheme. 285 echo "#dummy" > "$depfile" 286 fi 325 aix_post_process_depfile 326 ;; 327 328 tcc) 329 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 330 # FIXME: That version still under development at the moment of writing. 331 # Make that this statement remains true also for stable, released 332 # versions. 333 # It will wrap lines (doesn't matter whether long or short) with a 334 # trailing '\', as in: 335 # 336 # foo.o : \ 337 # foo.c \ 338 # foo.h \ 339 # 340 # It will put a trailing '\' even on the last line, and will use leading 341 # spaces rather than leading tabs (at least since its commit 0394caf7 342 # "Emit spaces for -MD"). 343 "$@" -MD -MF "$tmpdepfile" 344 stat=$? 345 if test $stat -ne 0; then 346 rm -f "$tmpdepfile" 347 exit $stat 348 fi 349 rm -f "$depfile" 350 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. 351 # We have to change lines of the first kind to '$object: \'. 352 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" 353 # And for each line of the second kind, we have to emit a 'dep.h:' 354 # dummy dependency, to avoid the deleted-header problem. 355 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" 287 356 rm -f "$tmpdepfile" 288 357 ;; 289 358 290 icc) 291 # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. 292 # However on 293 # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c 294 # ICC 7.0 will fill foo.d with something like 295 # foo.o: sub/foo.c 296 # foo.o: sub/foo.h 297 # which is wrong. We want 298 # sub/foo.o: sub/foo.c 299 # sub/foo.o: sub/foo.h 300 # sub/foo.c: 301 # sub/foo.h: 302 # ICC 7.1 will output 359 ## The order of this option in the case statement is important, since the 360 ## shell code in configure will try each of these formats in the order 361 ## listed in this file. A plain '-MD' option would be understood by many 362 ## compilers, so we must ensure this comes after the gcc and icc options. 363 pgcc) 364 # Portland's C compiler understands '-MD'. 365 # Will always output deps to 'file.d' where file is the root name of the 366 # source file under compilation, even if file resides in a subdirectory. 367 # The object file name does not affect the name of the '.d' file. 368 # pgcc 10.2 will output 303 369 # foo.o: sub/foo.c sub/foo.h 304 # and will wrap long lines using '\' :370 # and will wrap long lines using '\' : 305 371 # foo.o: sub/foo.c ... \ 306 372 # sub/foo.h ... \ 307 373 # ... 308 # tcc 0.9.26 (FIXME still under development at the moment of writing) 309 # will emit a similar output, but also prepend the continuation lines 310 # with horizontal tabulation characters. 311 "$@" -MD -MF "$tmpdepfile" 312 stat=$? 313 if test $stat -eq 0; then : 314 else 374 set_dir_from "$object" 375 # Use the source, not the object, to determine the base name, since 376 # that's sadly what pgcc will do too. 377 set_base_from "$source" 378 tmpdepfile=$base.d 379 380 # For projects that build the same source file twice into different object 381 # files, the pgcc approach of using the *source* file root name can cause 382 # problems in parallel builds. Use a locking strategy to avoid stomping on 383 # the same $tmpdepfile. 384 lockdir=$base.d-lock 385 trap " 386 echo '$0: caught signal, cleaning up...' >&2 387 rmdir '$lockdir' 388 exit 1 389 " 1 2 13 15 390 numtries=100 391 i=$numtries 392 while test $i -gt 0; do 393 # mkdir is a portable test-and-set. 394 if mkdir "$lockdir" 2>/dev/null; then 395 # This process acquired the lock. 396 "$@" -MD 397 stat=$? 398 # Release the lock. 399 rmdir "$lockdir" 400 break 401 else 402 # If the lock is being held by a different process, wait 403 # until the winning process is done or we timeout. 404 while test -d "$lockdir" && test $i -gt 0; do 405 sleep 1 406 i=`expr $i - 1` 407 done 408 fi 409 i=`expr $i - 1` 410 done 411 trap - 1 2 13 15 412 if test $i -le 0; then 413 echo "$0: failed to acquire lock after $numtries attempts" >&2 414 echo "$0: check lockdir '$lockdir'" >&2 415 exit 1 416 fi 417 418 if test $stat -ne 0; then 315 419 rm -f "$tmpdepfile" 316 420 exit $stat 317 421 fi 318 422 rm -f "$depfile" 319 # Each line is of the form 'foo.o: dependent.h',320 # or 'foo.o: dep1.h dep2.h \', or 'dep3.h dep4.h \'.423 # Each line is of the form `foo.o: dependent.h', 424 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 321 425 # Do two passes, one to just change these to 322 # '$object: dependent.h' and one to simply 'dependent.h:'. 323 sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ 324 < "$tmpdepfile" > "$depfile" 325 sed ' 326 s/[ '"$tab"'][ '"$tab"']*/ /g 327 s/^ *// 328 s/ *\\*$// 329 s/^[^:]*: *// 330 /^$/d 331 /:$/d 332 s/$/ :/ 333 ' < "$tmpdepfile" >> "$depfile" 426 # `$object: dependent.h' and one to simply `dependent.h:'. 427 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 428 # Some versions of the HPUX 10.20 sed can't process this invocation 429 # correctly. Breaking it into two sed invocations is a workaround. 430 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ 431 | sed -e 's/$/ :/' >> "$depfile" 334 432 rm -f "$tmpdepfile" 335 433 ;; … … 342 440 # happens to be. 343 441 # Much of this is similar to the tru64 case; see comments there. 344 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 345 test "x$dir" = "x$object" && dir= 346 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 442 set_dir_from "$object" 443 set_base_from "$object" 347 444 if test "$libtool" = yes; then 348 445 tmpdepfile1=$dir$base.d … … 355 452 fi 356 453 stat=$? 357 if test $stat -eq 0; then : 358 else 454 if test $stat -ne 0; then 359 455 rm -f "$tmpdepfile1" "$tmpdepfile2" 360 456 exit $stat … … 366 462 done 367 463 if test -f "$tmpdepfile"; then 368 sed -e "s,^.*\.[ a-z]*:,$object:," "$tmpdepfile" > "$depfile"464 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" 369 465 # Add 'dependent.h:' lines. 370 466 sed -ne '2,${ 371 372 373 374 375 467 s/^ *// 468 s/ \\*$// 469 s/$/:/ 470 p 471 }' "$tmpdepfile" >> "$depfile" 376 472 else 377 echo "#dummy" > "$depfile"473 make_dummy_depfile 378 474 fi 379 475 rm -f "$tmpdepfile" "$tmpdepfile2" … … 381 477 382 478 tru64) 383 # The Tru64 compiler uses -MD to generate dependencies as a side 384 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. 385 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 386 # dependencies in 'foo.d' instead, so we check for that too. 387 # Subdirectories are respected. 388 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 389 test "x$dir" = "x$object" && dir= 390 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 391 392 if test "$libtool" = yes; then 393 # With Tru64 cc, shared objects can also be used to make a 394 # static library. This mechanism is used in libtool 1.4 series to 395 # handle both shared and static libraries in a single compilation. 396 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 397 # 398 # With libtool 1.5 this exception was removed, and libtool now 399 # generates 2 separate objects for the 2 libraries. These two 400 # compilations output dependencies in $dir.libs/$base.o.d and 401 # in $dir$base.o.d. We have to check for both files, because 402 # one of the two compilations can be disabled. We should prefer 403 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 404 # automatically cleaned when .libs/ is deleted, while ignoring 405 # the former would cause a distcleancheck panic. 406 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 407 tmpdepfile2=$dir$base.o.d # libtool 1.5 408 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 409 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 410 "$@" -Wc,-MD 411 else 412 tmpdepfile1=$dir$base.o.d 413 tmpdepfile2=$dir$base.d 414 tmpdepfile3=$dir$base.d 415 tmpdepfile4=$dir$base.d 416 "$@" -MD 417 fi 418 419 stat=$? 420 if test $stat -eq 0; then : 421 else 422 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 423 exit $stat 424 fi 425 426 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 427 do 428 test -f "$tmpdepfile" && break 429 done 430 if test -f "$tmpdepfile"; then 431 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 432 sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 433 else 434 echo "#dummy" > "$depfile" 435 fi 436 rm -f "$tmpdepfile" 437 ;; 479 # The Tru64 compiler uses -MD to generate dependencies as a side 480 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. 481 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 482 # dependencies in 'foo.d' instead, so we check for that too. 483 # Subdirectories are respected. 484 set_dir_from "$object" 485 set_base_from "$object" 486 487 if test "$libtool" = yes; then 488 # Libtool generates 2 separate objects for the 2 libraries. These 489 # two compilations output dependencies in $dir.libs/$base.o.d and 490 # in $dir$base.o.d. We have to check for both files, because 491 # one of the two compilations can be disabled. We should prefer 492 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 493 # automatically cleaned when .libs/ is deleted, while ignoring 494 # the former would cause a distcleancheck panic. 495 tmpdepfile1=$dir$base.o.d # libtool 1.5 496 tmpdepfile2=$dir.libs/$base.o.d # Likewise. 497 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 498 "$@" -Wc,-MD 499 else 500 tmpdepfile1=$dir$base.d 501 tmpdepfile2=$dir$base.d 502 tmpdepfile3=$dir$base.d 503 "$@" -MD 504 fi 505 506 stat=$? 507 if test $stat -ne 0; then 508 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 509 exit $stat 510 fi 511 512 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 513 do 514 test -f "$tmpdepfile" && break 515 done 516 # Same post-processing that is required for AIX mode. 517 aix_post_process_depfile 518 ;; 438 519 439 520 msvc7) … … 446 527 stat=$? 447 528 grep -v '^Note: including file: ' "$tmpdepfile" 448 if test "$stat" = 0; then : 449 else 529 if test $stat -ne 0; then 450 530 rm -f "$tmpdepfile" 451 531 exit $stat … … 473 553 p 474 554 }' >> "$depfile" 555 echo >> "$depfile" # make sure the fragment doesn't end with a backslash 475 556 rm -f "$tmpdepfile" 476 557 ;; … … 524 605 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. 525 606 "$@" $dashmflag | 526 sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :'> "$tmpdepfile"607 sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" 527 608 rm -f "$depfile" 528 609 cat < "$tmpdepfile" > "$depfile" 529 tr ' ' "$nl" < "$tmpdepfile" | \ 530 ## Some versions of the HPUX 10.20 sed can't process this invocation 531 ## correctly. Breaking it into two sed invocations is a workaround. 532 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 610 # Some versions of the HPUX 10.20 sed can't process this sed invocation 611 # correctly. Breaking it into two sed invocations is a workaround. 612 tr ' ' "$nl" < "$tmpdepfile" \ 613 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 614 | sed -e 's/$/ :/' >> "$depfile" 533 615 rm -f "$tmpdepfile" 534 616 ;; … … 583 665 # No need to regex-escape $object, excess matching of '.' is harmless. 584 666 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" 585 sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ 586 ## Some versions of the HPUX 10.20 sed can't process this invocation 587 ## correctly. Breaking it into two sed invocations is a workaround. 588 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 667 # Some versions of the HPUX 10.20 sed can't process the last invocation 668 # correctly. Breaking it into two sed invocations is a workaround. 669 sed '1,2d' "$tmpdepfile" \ 670 | tr ' ' "$nl" \ 671 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 672 | sed -e 's/$/ :/' >> "$depfile" 589 673 rm -f "$tmpdepfile" "$tmpdepfile".bak 590 674 ;; … … 622 706 done 623 707 624 "$@" -E |625 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \626 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |627 sed '$ s: \\$::' > "$tmpdepfile"708 "$@" -E \ 709 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 710 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 711 | sed '$ s: \\$::' > "$tmpdepfile" 628 712 rm -f "$depfile" 629 713 echo "$object : \\" > "$depfile" … … 657 741 ;; 658 742 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 659 660 661 662 743 set fnord "$@" 744 shift 745 shift 746 ;; 663 747 *) 664 665 666 667 748 set fnord "$@" "$arg" 749 shift 750 shift 751 ;; 668 752 esac 669 753 done -
TabularUnified libusb1/trunk/doc/Makefile.am ¶
r1876 r1882 6 6 docs-upload: docs 7 7 ln -s html api-1.0 8 rsync -av api-1.0/ web.sourceforge.net:htdocs/api-1.0/8 scp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs 9 9 rm -f api-1.0 10 -
TabularUnified libusb1/trunk/doc/Makefile.in ¶
r1879 r1882 1 # Makefile.in generated by automake 1.1 1.1 from Makefile.am.1 # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 # Inc. 4 # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 7 6 # This Makefile.in is free software; the Free Software Foundation 8 7 # gives unlimited permission to copy and/or distribute it, … … 16 15 @SET_MAKE@ 17 16 VPATH = @srcdir@ 17 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 18 am__make_running_with_option = \ 19 case $${target_option-} in \ 20 ?) ;; \ 21 *) echo "am__make_running_with_option: internal error: invalid" \ 22 "target option '$${target_option-}' specified" >&2; \ 23 exit 1;; \ 24 esac; \ 25 has_opt=no; \ 26 sane_makeflags=$$MAKEFLAGS; \ 27 if $(am__is_gnu_make); then \ 28 sane_makeflags=$$MFLAGS; \ 29 else \ 30 case $$MAKEFLAGS in \ 31 *\\[\ \ ]*) \ 32 bs=\\; \ 33 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 34 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 35 esac; \ 36 fi; \ 37 skip_next=no; \ 38 strip_trailopt () \ 39 { \ 40 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 41 }; \ 42 for flg in $$sane_makeflags; do \ 43 test $$skip_next = yes && { skip_next=no; continue; }; \ 44 case $$flg in \ 45 *=*|--*) continue;; \ 46 -*I) strip_trailopt 'I'; skip_next=yes;; \ 47 -*I?*) strip_trailopt 'I';; \ 48 -*O) strip_trailopt 'O'; skip_next=yes;; \ 49 -*O?*) strip_trailopt 'O';; \ 50 -*l) strip_trailopt 'l'; skip_next=yes;; \ 51 -*l?*) strip_trailopt 'l';; \ 52 -[dEDm]) skip_next=yes;; \ 53 -[JT]) skip_next=yes;; \ 54 esac; \ 55 case $$flg in \ 56 *$$target_option*) has_opt=yes; break;; \ 57 esac; \ 58 done; \ 59 test $$has_opt = yes 60 am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 61 am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 18 62 pkgdatadir = $(datadir)/@PACKAGE@ 19 63 pkgincludedir = $(includedir)/@PACKAGE@ … … 35 79 host_triplet = @host@ 36 80 subdir = doc 37 DIST_COMMON = $(srcdir)/Makefile. am $(srcdir)/Makefile.in\81 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 38 82 $(srcdir)/doxygen.cfg.in 39 83 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 48 92 CONFIG_CLEAN_FILES = doxygen.cfg 49 93 CONFIG_CLEAN_VPATH_FILES = 50 AM_V_GEN = $(am__v_GEN_$(V)) 51 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) 52 am__v_GEN_0 = @echo " GEN " $@; 53 AM_V_at = $(am__v_at_$(V)) 54 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) 94 AM_V_P = $(am__v_P_@AM_V@) 95 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 96 am__v_P_0 = false 97 am__v_P_1 = : 98 AM_V_GEN = $(am__v_GEN_@AM_V@) 99 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 100 am__v_GEN_0 = @echo " GEN " $@; 101 am__v_GEN_1 = 102 AM_V_at = $(am__v_at_@AM_V@) 103 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 55 104 am__v_at_0 = @ 105 am__v_at_1 = 56 106 SOURCES = 57 107 DIST_SOURCES = 108 am__can_run_installinfo = \ 109 case $$AM_UPDATE_INFO_DIR in \ 110 n|no|NO) false;; \ 111 *) (install-info --version) >/dev/null 2>&1;; \ 112 esac 113 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 58 114 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 59 115 ACLOCAL = @ACLOCAL@ … … 71 127 CPP = @CPP@ 72 128 CPPFLAGS = @CPPFLAGS@ 129 CXX = @CXX@ 130 CXXCPP = @CXXCPP@ 131 CXXDEPMODE = @CXXDEPMODE@ 132 CXXFLAGS = @CXXFLAGS@ 73 133 CYGPATH_W = @CYGPATH_W@ 74 134 DEFS = @DEFS@ … … 98 158 LTLDFLAGS = @LTLDFLAGS@ 99 159 LTLIBOBJS = @LTLIBOBJS@ 100 MAINT = @MAINT@101 160 MAKEINFO = @MAKEINFO@ 102 161 MANIFEST_TOOL = @MANIFEST_TOOL@ … … 107 166 OBJEXT = @OBJEXT@ 108 167 OS_DARWIN = @OS_DARWIN@ 168 OS_HAIKU = @OS_HAIKU@ 109 169 OS_LINUX = @OS_LINUX@ 170 OS_NETBSD = @OS_NETBSD@ 110 171 OS_OPENBSD = @OS_OPENBSD@ 111 OS_ OS2 = @OS_OS2@172 OS_SUNOS = @OS_SUNOS@ 112 173 OS_WINDOWS = @OS_WINDOWS@ 113 174 OTOOL = @OTOOL@ … … 121 182 PACKAGE_VERSION = @PACKAGE_VERSION@ 122 183 PATH_SEPARATOR = @PATH_SEPARATOR@ 123 PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@124 184 RANLIB = @RANLIB@ 125 185 RC = @RC@ … … 128 188 SHELL = @SHELL@ 129 189 STRIP = @STRIP@ 130 THREAD_CFLAGS = @THREAD_CFLAGS@131 190 USE_UDEV = @USE_UDEV@ 191 USE_USBDK = @USE_USBDK@ 132 192 VERSION = @VERSION@ 133 VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@134 193 abs_builddir = @abs_builddir@ 135 194 abs_srcdir = @abs_srcdir@ … … 138 197 ac_ct_AR = @ac_ct_AR@ 139 198 ac_ct_CC = @ac_ct_CC@ 199 ac_ct_CXX = @ac_ct_CXX@ 140 200 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 141 201 am__include = @am__include@ … … 188 248 189 249 .SUFFIXES: 190 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)250 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 191 251 @for dep in $?; do \ 192 252 case '$(am__configure_deps)' in \ … … 213 273 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 214 274 215 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)275 $(top_srcdir)/configure: $(am__configure_deps) 216 276 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 217 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)277 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 218 278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 219 279 $(am__aclocal_m4_deps): … … 226 286 clean-libtool: 227 287 -rm -rf .libs _libs 228 tags : TAGS229 TAGS: 230 231 ctags: CTAGS 232 CTAGS:288 tags TAGS: 289 290 ctags CTAGS: 291 292 cscope cscopelist: 233 293 234 294 … … 277 337 installcheck: installcheck-am 278 338 install-strip: 279 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 280 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 281 `test -z '$(STRIP)' || \ 282 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 339 if test -z '$(STRIP)'; then \ 340 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 341 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 342 install; \ 343 else \ 344 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 345 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 346 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 347 fi 283 348 mostlyclean-generic: 284 349 … … 361 426 362 427 .PHONY: all all-am check check-am clean clean-generic clean-libtool \ 363 distclean distclean-generic distclean-libtool distdir dvi \ 364 dvi-am html html-am info info-am install install-am \ 365 install-data install-data-am install-dvi install-dvi-am \ 366 install-exec install-exec-am install-html install-html-am \ 367 install-info install-info-am install-man install-pdf \ 368 install-pdf-am install-ps install-ps-am install-strip \ 369 installcheck installcheck-am installdirs maintainer-clean \ 370 maintainer-clean-generic mostlyclean mostlyclean-generic \ 371 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am 428 cscopelist-am ctags-am distclean distclean-generic \ 429 distclean-libtool distdir dvi dvi-am html html-am info info-am \ 430 install install-am install-data install-data-am install-dvi \ 431 install-dvi-am install-exec install-exec-am install-html \ 432 install-html-am install-info install-info-am install-man \ 433 install-pdf install-pdf-am install-ps install-ps-am \ 434 install-strip installcheck installcheck-am installdirs \ 435 maintainer-clean maintainer-clean-generic mostlyclean \ 436 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 437 tags-am uninstall uninstall-am 372 438 373 439 … … 377 443 docs-upload: docs 378 444 ln -s html api-1.0 379 rsync -av api-1.0/ web.sourceforge.net:htdocs/api-1.0/445 scp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs 380 446 rm -f api-1.0 381 447 -
TabularUnified libusb1/trunk/doc/doxygen.cfg.in ¶
r1876 r1882 1 # Doxyfile 1. 5.31 # Doxyfile 1.8.8 2 2 3 3 # This file describes the settings to be used by the documentation system 4 # doxygen (www.doxygen.org) for a project 5 # 6 # All text after a hash (#) is considered a comment and will be ignored 4 # doxygen (www.doxygen.org) for a project. 5 # 6 # All text after a double hash (##) is considered a comment and is placed in 7 # front of the TAG it is preceding. 8 # 9 # All text after a single hash (#) is considered a comment and will be ignored. 7 10 # The format is: 8 # 9 # For lists items can also be appended using:10 # 11 # Values that contain spaces should be placed between quotes ( " ")11 # TAG = value [value, ...] 12 # For lists, items can also be appended using: 13 # TAG += value [value, ...] 14 # Values that contain spaces should be placed between quotes (\" \"). 12 15 13 16 #--------------------------------------------------------------------------- … … 15 18 #--------------------------------------------------------------------------- 16 19 17 # This tag specifies the encoding used for all characters in the config file that 18 # follow. The default is UTF-8 which is also the encoding used for all text before 19 # the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 20 # libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 21 # possible encodings. 20 # This tag specifies the encoding used for all characters in the config file 21 # that follow. The default is UTF-8 which is also the encoding used for all text 22 # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv 23 # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv 24 # for the list of possible encodings. 25 # The default value is: UTF-8. 22 26 23 27 DOXYFILE_ENCODING = UTF-8 24 28 25 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 26 # by quotes) that should identify the project. 27 28 PROJECT_NAME = libusb 29 30 # The PROJECT_NUMBER tag can be used to enter a project or revision number. 31 # This could be handy for archiving the generated documentation or 32 # if some version control system is used. 33 34 PROJECT_NUMBER = 35 36 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 37 # base path where the generated documentation will be put. 38 # If a relative path is entered, it will be relative to the location 39 # where doxygen was started. If left blank the current directory will be used. 40 41 OUTPUT_DIRECTORY = 42 43 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 44 # 4096 sub-directories (in 2 levels) under the output directory of each output 45 # format and will distribute the generated files over these directories. 46 # Enabling this option can be useful when feeding doxygen a huge amount of 47 # source files, where putting all generated files in the same directory would 48 # otherwise cause performance problems for the file system. 29 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by 30 # double-quotes, unless you are using Doxywizard) that should identify the 31 # project for which the documentation is generated. This name is used in the 32 # title of most generated pages and in a few other places. 33 # The default value is: My Project. 34 35 PROJECT_NAME = 36 37 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This 38 # could be handy for archiving the generated documentation or if some version 39 # control system is used. 40 41 PROJECT_NUMBER = 42 43 # Using the PROJECT_BRIEF tag one can provide an optional one line description 44 # for a project that appears at the top of each page and should give viewer a 45 # quick idea about the purpose of the project. Keep the description short. 46 47 PROJECT_BRIEF = "A cross-platform user library to access USB devices" 48 49 # With the PROJECT_LOGO tag one can specify an logo or icon that is included in 50 # the documentation. The maximum height of the logo should not exceed 55 pixels 51 # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo 52 # to the output directory. 53 54 PROJECT_LOGO = libusb.png 55 56 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path 57 # into which the generated documentation will be written. If a relative path is 58 # entered, it will be relative to the location where doxygen was started. If 59 # left blank the current directory will be used. 60 61 OUTPUT_DIRECTORY = 62 63 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- 64 # directories (in 2 levels) under the output directory of each output format and 65 # will distribute the generated files over these directories. Enabling this 66 # option can be useful when feeding doxygen a huge amount of source files, where 67 # putting all generated files in the same directory would otherwise causes 68 # performance problems for the file system. 69 # The default value is: NO. 49 70 50 71 CREATE_SUBDIRS = NO 51 72 52 # The OUTPUT_LANGUAGE tag is used to specify the language in which all 53 # documentation generated by doxygen is written. Doxygen will use this 54 # information to generate all constant output in the proper language. 55 # The default language is English, other supported languages are: 56 # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 57 # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 58 # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 59 # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 60 # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. 73 # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII 74 # characters to appear in the names of generated files. If set to NO, non-ASCII 75 # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode 76 # U+3044. 77 # The default value is: NO. 78 79 ALLOW_UNICODE_NAMES = NO 80 81 # The OUTPUT_LANGUAGE tag is used to specify the language in which all 82 # documentation generated by doxygen is written. Doxygen will use this 83 # information to generate all constant output in the proper language. 84 # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, 85 # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), 86 # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, 87 # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), 88 # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, 89 # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, 90 # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, 91 # Ukrainian and Vietnamese. 92 # The default value is: English. 61 93 62 94 OUTPUT_LANGUAGE = English 63 95 64 # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will65 # include brief member descriptions after the members that are listed in66 # the file and class documentation (similar to JavaDoc).67 # Set to NO to disable this.96 # If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member 97 # descriptions after the members that are listed in the file and class 98 # documentation (similar to Javadoc). Set to NO to disable this. 99 # The default value is: YES. 68 100 69 101 BRIEF_MEMBER_DESC = YES 70 102 71 # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 72 # the brief description of a member or function before the detailed description. 73 # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 103 # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief 104 # description of a member or function before the detailed description 105 # 106 # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 74 107 # brief descriptions will be completely suppressed. 108 # The default value is: YES. 75 109 76 110 REPEAT_BRIEF = YES 77 111 78 # This tag implements a quasi-intelligent brief description abbreviator 79 # that is used to form the text in various listings. Each string 80 # in this list, if found as the leading text of the brief description, will be 81 # stripped from the text and the result after processing the whole list, is 82 # used as the annotated text. Otherwise, the brief description is used as-is. 83 # If left blank, the following values are used ("$name" is automatically 84 # replaced with the name of the entity): "The $name class" "The $name widget" 85 # "The $name file" "is" "provides" "specifies" "contains" 86 # "represents" "a" "an" "the" 87 88 ABBREVIATE_BRIEF = 89 90 # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 91 # Doxygen will generate a detailed section even if there is only a brief 112 # This tag implements a quasi-intelligent brief description abbreviator that is 113 # used to form the text in various listings. Each string in this list, if found 114 # as the leading text of the brief description, will be stripped from the text 115 # and the result, after processing the whole list, is used as the annotated 116 # text. Otherwise, the brief description is used as-is. If left blank, the 117 # following values are used ($name is automatically replaced with the name of 118 # the entity):The $name class, The $name widget, The $name file, is, provides, 119 # specifies, contains, represents, a, an and the. 120 121 ABBREVIATE_BRIEF = 122 123 # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 124 # doxygen will generate a detailed section even if there is only a brief 92 125 # description. 126 # The default value is: NO. 93 127 94 128 ALWAYS_DETAILED_SEC = NO 95 129 96 # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 97 # inherited members of a class in the documentation of that class as if those 98 # members were ordinary class members. Constructors, destructors and assignment 130 # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 131 # inherited members of a class in the documentation of that class as if those 132 # members were ordinary class members. Constructors, destructors and assignment 99 133 # operators of the base classes will not be shown. 134 # The default value is: NO. 100 135 101 136 INLINE_INHERITED_MEMB = NO 102 137 103 # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 104 # path before files name in the file list and in the header files. If set 105 # to NO the shortest path that makes the file name unique will be used. 138 # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path 139 # before files name in the file list and in the header files. If set to NO the 140 # shortest path that makes the file name unique will be used 141 # The default value is: YES. 106 142 107 143 FULL_PATH_NAMES = NO 108 144 109 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 110 # can be used to strip a user-defined part of the path. Stripping is 111 # only done if one of the specified strings matches the left-hand part of 112 # the path. The tag can be used to show relative paths in the file list. 113 # If left blank the directory from which doxygen is run is used as the 114 # path to strip. 115 116 STRIP_FROM_PATH = 117 118 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 119 # the path mentioned in the documentation of a class, which tells 120 # the reader which header file to include in order to use a class. 121 # If left blank only the name of the header file containing the class 122 # definition is used. Otherwise one should specify the include paths that 123 # are normally passed to the compiler using the -I flag. 124 125 STRIP_FROM_INC_PATH = 126 127 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 128 # (but less readable) file names. This can be useful is your file systems 129 # doesn't support long names like on DOS, Mac, or CD-ROM. 145 # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. 146 # Stripping is only done if one of the specified strings matches the left-hand 147 # part of the path. The tag can be used to show relative paths in the file list. 148 # If left blank the directory from which doxygen is run is used as the path to 149 # strip. 150 # 151 # Note that you can specify absolute paths here, but also relative paths, which 152 # will be relative from the directory where doxygen is started. 153 # This tag requires that the tag FULL_PATH_NAMES is set to YES. 154 155 STRIP_FROM_PATH = 156 157 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the 158 # path mentioned in the documentation of a class, which tells the reader which 159 # header file to include in order to use a class. If left blank only the name of 160 # the header file containing the class definition is used. Otherwise one should 161 # specify the list of include paths that are normally passed to the compiler 162 # using the -I flag. 163 164 STRIP_FROM_INC_PATH = 165 166 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but 167 # less readable) file names. This can be useful is your file systems doesn't 168 # support long names like on DOS, Mac, or CD-ROM. 169 # The default value is: NO. 130 170 131 171 SHORT_NAMES = NO 132 172 133 # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 134 # will interpret the first line (until the first dot) of a JavaDoc-style 135 # comment as the brief description. If set to NO, the JavaDoc 136 # comments will behave just like regular Qt-style comments 137 # (thus requiring an explicit @brief command for a brief description.) 173 # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the 174 # first line (until the first dot) of a Javadoc-style comment as the brief 175 # description. If set to NO, the Javadoc-style will behave just like regular Qt- 176 # style comments (thus requiring an explicit @brief command for a brief 177 # description.) 178 # The default value is: NO. 138 179 139 180 JAVADOC_AUTOBRIEF = YES 140 181 141 # If the QT_AUTOBRIEF tag is set to YES then Doxygen will142 # interpret the first line (until the first dot) of a Qt-style143 # comment as the brief description. If set to NO, the comments144 # will behave just like regular Qt-style comments (thus requiring145 # an explicit \brief command for a brief description.)182 # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first 183 # line (until the first dot) of a Qt-style comment as the brief description. If 184 # set to NO, the Qt-style will behave just like regular Qt-style comments (thus 185 # requiring an explicit \brief command for a brief description.) 186 # The default value is: NO. 146 187 147 188 QT_AUTOBRIEF = NO 148 189 149 # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 150 # treat a multi-line C++ special comment block (i.e. a block of //! or /// 151 # comments) as a brief description. This used to be the default behaviour. 152 # The new default is to treat a multi-line C++ comment block as a detailed 153 # description. Set this tag to YES if you prefer the old behaviour instead. 190 # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a 191 # multi-line C++ special comment block (i.e. a block of //! or /// comments) as 192 # a brief description. This used to be the default behavior. The new default is 193 # to treat a multi-line C++ comment block as a detailed description. Set this 194 # tag to YES if you prefer the old behavior instead. 195 # 196 # Note that setting this tag to YES also means that rational rose comments are 197 # not recognized any more. 198 # The default value is: NO. 154 199 155 200 MULTILINE_CPP_IS_BRIEF = NO 156 201 157 # If the DETAILS_AT_TOP tag is set to YES then Doxygen 158 # will output the detailed description near the top, like JavaDoc. 159 # If set to NO, the detailed description appears after the member 160 # documentation. 161 162 DETAILS_AT_TOP = NO 163 164 # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 165 # member inherits the documentation from any documented member that it 166 # re-implements. 202 # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the 203 # documentation from any documented member that it re-implements. 204 # The default value is: YES. 167 205 168 206 INHERIT_DOCS = YES 169 207 170 # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 171 # a new page for each member. If set to NO, the documentation of a member will 172 # be part of the file/class/namespace that contains it. 208 # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a 209 # new page for each member. If set to NO, the documentation of a member will be 210 # part of the file/class/namespace that contains it. 211 # The default value is: NO. 173 212 174 213 SEPARATE_MEMBER_PAGES = NO 175 214 176 # The TAB_SIZE tag can be used to set the number of spaces in a tab. 177 # Doxygen uses this value to replace tabs by spaces in code fragments. 215 # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen 216 # uses this value to replace tabs by spaces in code fragments. 217 # Minimum value: 1, maximum value: 16, default value: 4. 178 218 179 219 TAB_SIZE = 4 180 220 181 # This tag can be used to specify a number of aliases that acts 182 # as commands in the documentation. An alias has the form "name=value". 183 # For example adding "sideeffect=\par Side Effects:\n" will allow you to 184 # put the command \sideeffect (or @sideeffect) in the documentation, which 185 # will result in a user-defined paragraph with heading "Side Effects:". 186 # You can put \n's in the value part of an alias to insert newlines. 187 188 ALIASES = 189 190 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 191 # sources only. Doxygen will then generate output that is more tailored for C. 192 # For instance, some of the names that are used will be different. The list 193 # of all members will be omitted, etc. 221 # This tag can be used to specify a number of aliases that act as commands in 222 # the documentation. An alias has the form: 223 # name=value 224 # For example adding 225 # "sideeffect=@par Side Effects:\n" 226 # will allow you to put the command \sideeffect (or @sideeffect) in the 227 # documentation, which will result in a user-defined paragraph with heading 228 # "Side Effects:". You can put \n's in the value part of an alias to insert 229 # newlines. 230 231 ALIASES = 232 233 # This tag can be used to specify a number of word-keyword mappings (TCL only). 234 # A mapping has the form "name=value". For example adding "class=itcl::class" 235 # will allow you to use the command class in the itcl::class meaning. 236 237 TCL_SUBST = 238 239 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 240 # only. Doxygen will then generate output that is more tailored for C. For 241 # instance, some of the names that are used will be different. The list of all 242 # members will be omitted, etc. 243 # The default value is: NO. 194 244 195 245 OPTIMIZE_OUTPUT_FOR_C = YES 196 246 197 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 198 # sources only. Doxygen will then generate output that is more tailored for Java. 199 # For instance, namespaces will be presented as packages, qualified scopes 200 # will look different, etc. 247 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or 248 # Python sources only. Doxygen will then generate output that is more tailored 249 # for that language. For instance, namespaces will be presented as packages, 250 # qualified scopes will look different, etc. 251 # The default value is: NO. 201 252 202 253 OPTIMIZE_OUTPUT_JAVA = NO 203 254 204 # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 205 # include (a tag file for) the STL sources as input, then you should 206 # set this tag to YES in order to let doxygen match functions declarations and 207 # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 208 # func(std::string) {}). This also make the inheritance and collaboration 255 # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 256 # sources. Doxygen will then generate output that is tailored for Fortran. 257 # The default value is: NO. 258 259 OPTIMIZE_FOR_FORTRAN = NO 260 261 # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 262 # sources. Doxygen will then generate output that is tailored for VHDL. 263 # The default value is: NO. 264 265 OPTIMIZE_OUTPUT_VHDL = NO 266 267 # Doxygen selects the parser to use depending on the extension of the files it 268 # parses. With this tag you can assign which parser to use for a given 269 # extension. Doxygen has a built-in mapping, but you can override or extend it 270 # using this tag. The format is ext=language, where ext is a file extension, and 271 # language is one of the parsers supported by doxygen: IDL, Java, Javascript, 272 # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: 273 # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: 274 # Fortran. In the later case the parser tries to guess whether the code is fixed 275 # or free formatted code, this is the default for Fortran type files), VHDL. For 276 # instance to make doxygen treat .inc files as Fortran files (default is PHP), 277 # and .f files as C (default is Fortran), use: inc=Fortran f=C. 278 # 279 # Note For files without extension you can use no_extension as a placeholder. 280 # 281 # Note that for custom extensions you also need to set FILE_PATTERNS otherwise 282 # the files are not read by doxygen. 283 284 EXTENSION_MAPPING = 285 286 # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments 287 # according to the Markdown format, which allows for more readable 288 # documentation. See http://daringfireball.net/projects/markdown/ for details. 289 # The output of markdown processing is further processed by doxygen, so you can 290 # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in 291 # case of backward compatibilities issues. 292 # The default value is: YES. 293 294 MARKDOWN_SUPPORT = YES 295 296 # When enabled doxygen tries to link words that correspond to documented 297 # classes, or namespaces to their corresponding documentation. Such a link can 298 # be prevented in individual cases by by putting a % sign in front of the word 299 # or globally by setting AUTOLINK_SUPPORT to NO. 300 # The default value is: YES. 301 302 AUTOLINK_SUPPORT = YES 303 304 # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 305 # to include (a tag file for) the STL sources as input, then you should set this 306 # tag to YES in order to let doxygen match functions declarations and 307 # definitions whose arguments contain STL classes (e.g. func(std::string); 308 # versus func(std::string) {}). This also make the inheritance and collaboration 209 309 # diagrams that involve STL classes more complete and accurate. 310 # The default value is: NO. 210 311 211 312 BUILTIN_STL_SUPPORT = NO … … 213 314 # If you use Microsoft's C++/CLI language, you should set this option to YES to 214 315 # enable parsing support. 316 # The default value is: NO. 215 317 216 318 CPP_CLI_SUPPORT = NO 217 319 218 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 219 # tag is set to YES, then doxygen will reuse the documentation of the first 220 # member in the group (if any) for the other members of the group. By default 320 # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: 321 # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen 322 # will parse them like normal C++ but will assume all classes use public instead 323 # of private inheritance when no explicit protection keyword is present. 324 # The default value is: NO. 325 326 SIP_SUPPORT = NO 327 328 # For Microsoft's IDL there are propget and propput attributes to indicate 329 # getter and setter methods for a property. Setting this option to YES will make 330 # doxygen to replace the get and set methods by a property in the documentation. 331 # This will only work if the methods are indeed getting or setting a simple 332 # type. If this is not the case, or you want to show the methods anyway, you 333 # should set this option to NO. 334 # The default value is: YES. 335 336 IDL_PROPERTY_SUPPORT = YES 337 338 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 339 # tag is set to YES, then doxygen will reuse the documentation of the first 340 # member in the group (if any) for the other members of the group. By default 221 341 # all members of a group must be documented explicitly. 342 # The default value is: NO. 222 343 223 344 DISTRIBUTE_GROUP_DOC = NO 224 345 225 # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 226 # the same type (for instance a group of public functions) to be put as a 227 # subgroup of that type (e.g. under the Public Functions section). Set it to 228 # NO to prevent subgrouping. Alternatively, this can be done per class using 229 # the \nosubgrouping command. 346 # Set the SUBGROUPING tag to YES to allow class member groups of the same type 347 # (for instance a group of public functions) to be put as a subgroup of that 348 # type (e.g. under the Public Functions section). Set it to NO to prevent 349 # subgrouping. Alternatively, this can be done per class using the 350 # \nosubgrouping command. 351 # The default value is: YES. 230 352 231 353 SUBGROUPING = YES 232 354 355 # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions 356 # are shown inside the group in which they are included (e.g. using \ingroup) 357 # instead of on a separate page (for HTML and Man pages) or section (for LaTeX 358 # and RTF). 359 # 360 # Note that this feature does not work in combination with 361 # SEPARATE_MEMBER_PAGES. 362 # The default value is: NO. 363 364 INLINE_GROUPED_CLASSES = NO 365 366 # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions 367 # with only public data fields or simple typedef fields will be shown inline in 368 # the documentation of the scope in which they are defined (i.e. file, 369 # namespace, or group documentation), provided this scope is documented. If set 370 # to NO, structs, classes, and unions are shown on a separate page (for HTML and 371 # Man pages) or section (for LaTeX and RTF). 372 # The default value is: NO. 373 374 INLINE_SIMPLE_STRUCTS = NO 375 376 # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or 377 # enum is documented as struct, union, or enum with the name of the typedef. So 378 # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 379 # with name TypeT. When disabled the typedef will appear as a member of a file, 380 # namespace, or class. And the struct will be named TypeS. This can typically be 381 # useful for C code in case the coding convention dictates that all compound 382 # types are typedef'ed and only the typedef is referenced, never the tag name. 383 # The default value is: NO. 384 385 TYPEDEF_HIDES_STRUCT = NO 386 387 # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This 388 # cache is used to resolve symbols given their name and scope. Since this can be 389 # an expensive process and often the same symbol appears multiple times in the 390 # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small 391 # doxygen will become slower. If the cache is too large, memory is wasted. The 392 # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range 393 # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 394 # symbols. At the end of a run doxygen will report the cache usage and suggest 395 # the optimal cache size from a speed point of view. 396 # Minimum value: 0, maximum value: 9, default value: 0. 397 398 LOOKUP_CACHE_SIZE = 0 399 233 400 #--------------------------------------------------------------------------- 234 401 # Build related configuration options 235 402 #--------------------------------------------------------------------------- 236 403 237 # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 238 # documentation are documented, even if no documentation was available. 239 # Private class members and static file members will be hidden unless 240 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 404 # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 405 # documentation are documented, even if no documentation was available. Private 406 # class members and static file members will be hidden unless the 407 # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. 408 # Note: This will also disable the warnings about undocumented members that are 409 # normally produced when WARNINGS is set to YES. 410 # The default value is: NO. 241 411 242 412 EXTRACT_ALL = NO 243 413 244 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 245 # will be included in the documentation. 414 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will 415 # be included in the documentation. 416 # The default value is: NO. 246 417 247 418 EXTRACT_PRIVATE = NO 248 419 249 # If the EXTRACT_STATIC tag is set to YES all static members of a file 250 # will be included in the documentation. 420 # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal 421 # scope will be included in the documentation. 422 # The default value is: NO. 423 424 EXTRACT_PACKAGE = NO 425 426 # If the EXTRACT_STATIC tag is set to YES all static members of a file will be 427 # included in the documentation. 428 # The default value is: NO. 251 429 252 430 EXTRACT_STATIC = YES 253 431 254 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 255 # defined locally in source files will be included in the documentation. 256 # If set to NO only classes defined in header files are included. 432 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined 433 # locally in source files will be included in the documentation. If set to NO 434 # only classes defined in header files are included. Does not have any effect 435 # for Java sources. 436 # The default value is: YES. 257 437 258 438 EXTRACT_LOCAL_CLASSES = YES 259 439 260 # This flag is only useful for Objective-C code. When set to YES local 261 # methods, which are defined in the implementation section but not in 262 # the interface are included in the documentation. 263 # If set to NO (the default) only methods in the interface are included. 440 # This flag is only useful for Objective-C code. When set to YES local methods, 441 # which are defined in the implementation section but not in the interface are 442 # included in the documentation. If set to NO only methods in the interface are 443 # included. 444 # The default value is: NO. 264 445 265 446 EXTRACT_LOCAL_METHODS = NO 266 447 267 # If this flag is set to YES, the members of anonymous namespaces will be extracted 268 # and appear in the documentation as a namespace called 'anonymous_namespace{file}', 269 # where file will be replaced with the base name of the file that contains the anonymous 270 # namespace. By default anonymous namespace are hidden. 448 # If this flag is set to YES, the members of anonymous namespaces will be 449 # extracted and appear in the documentation as a namespace called 450 # 'anonymous_namespace{file}', where file will be replaced with the base name of 451 # the file that contains the anonymous namespace. By default anonymous namespace 452 # are hidden. 453 # The default value is: NO. 271 454 272 455 EXTRACT_ANON_NSPACES = NO 273 456 274 # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all275 # undocumented members of documented classes, files or namespaces.276 # If set to NO (the default) these members will be included in the277 # various overviews, but no documentation section is generated.278 # Th is option has no effect if EXTRACT_ALL is enabled.457 # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all 458 # undocumented members inside documented classes or files. If set to NO these 459 # members will be included in the various overviews, but no documentation 460 # section is generated. This option has no effect if EXTRACT_ALL is enabled. 461 # The default value is: NO. 279 462 280 463 HIDE_UNDOC_MEMBERS = NO 281 464 282 # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 283 # undocumented classes that are normally visible in the class hierarchy. 284 # If set to NO (the default) these classes will be included in the various 285 # overviews. This option has no effect if EXTRACT_ALL is enabled. 465 # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all 466 # undocumented classes that are normally visible in the class hierarchy. If set 467 # to NO these classes will be included in the various overviews. This option has 468 # no effect if EXTRACT_ALL is enabled. 469 # The default value is: NO. 286 470 287 471 HIDE_UNDOC_CLASSES = NO 288 472 289 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 290 # friend (class|struct|union) declarations. 291 # If set to NO (the default) these declarations will be included in the 473 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend 474 # (class|struct|union) declarations. If set to NO these declarations will be 475 # included in the documentation. 476 # The default value is: NO. 477 478 HIDE_FRIEND_COMPOUNDS = NO 479 480 # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any 481 # documentation blocks found inside the body of a function. If set to NO these 482 # blocks will be appended to the function's detailed documentation block. 483 # The default value is: NO. 484 485 HIDE_IN_BODY_DOCS = NO 486 487 # The INTERNAL_DOCS tag determines if documentation that is typed after a 488 # \internal command is included. If the tag is set to NO then the documentation 489 # will be excluded. Set it to YES to include the internal documentation. 490 # The default value is: NO. 491 492 INTERNAL_DOCS = NO 493 494 # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file 495 # names in lower-case letters. If set to YES upper-case letters are also 496 # allowed. This is useful if you have classes or files whose names only differ 497 # in case and if your file system supports case sensitive file names. Windows 498 # and Mac users are advised to set this option to NO. 499 # The default value is: system dependent. 500 501 CASE_SENSE_NAMES = YES 502 503 # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with 504 # their full class and namespace scopes in the documentation. If set to YES the 505 # scope will be hidden. 506 # The default value is: NO. 507 508 HIDE_SCOPE_NAMES = NO 509 510 # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of 511 # the files that are included by a file in the documentation of that file. 512 # The default value is: YES. 513 514 SHOW_INCLUDE_FILES = YES 515 516 # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each 517 # grouped member an include statement to the documentation, telling the reader 518 # which file to include in order to use the member. 519 # The default value is: NO. 520 521 SHOW_GROUPED_MEMB_INC = NO 522 523 # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include 524 # files with double quotes in the documentation rather than with sharp brackets. 525 # The default value is: NO. 526 527 FORCE_LOCAL_INCLUDES = NO 528 529 # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the 530 # documentation for inline members. 531 # The default value is: YES. 532 533 INLINE_INFO = YES 534 535 # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the 536 # (detailed) documentation of file and class members alphabetically by member 537 # name. If set to NO the members will appear in declaration order. 538 # The default value is: YES. 539 540 SORT_MEMBER_DOCS = NO 541 542 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief 543 # descriptions of file, namespace and class members alphabetically by member 544 # name. If set to NO the members will appear in declaration order. Note that 545 # this will also influence the order of the classes in the class list. 546 # The default value is: NO. 547 548 SORT_BRIEF_DOCS = NO 549 550 # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the 551 # (brief and detailed) documentation of class members so that constructors and 552 # destructors are listed first. If set to NO the constructors will appear in the 553 # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. 554 # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief 555 # member documentation. 556 # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting 557 # detailed member documentation. 558 # The default value is: NO. 559 560 SORT_MEMBERS_CTORS_1ST = NO 561 562 # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy 563 # of group names into alphabetical order. If set to NO the group names will 564 # appear in their defined order. 565 # The default value is: NO. 566 567 SORT_GROUP_NAMES = NO 568 569 # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by 570 # fully-qualified names, including namespaces. If set to NO, the class list will 571 # be sorted only by class name, not including the namespace part. 572 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 573 # Note: This option applies only to the class list, not to the alphabetical 574 # list. 575 # The default value is: NO. 576 577 SORT_BY_SCOPE_NAME = NO 578 579 # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper 580 # type resolution of all parameters of a function it will reject a match between 581 # the prototype and the implementation of a member function even if there is 582 # only one candidate or it is obvious which candidate to choose by doing a 583 # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still 584 # accept a match between prototype and implementation in such cases. 585 # The default value is: NO. 586 587 STRICT_PROTO_MATCHING = NO 588 589 # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the 590 # todo list. This list is created by putting \todo commands in the 292 591 # documentation. 293 294 HIDE_FRIEND_COMPOUNDS = NO 295 296 # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 297 # documentation blocks found inside the body of a function. 298 # If set to NO (the default) these blocks will be appended to the 299 # function's detailed documentation block. 300 301 HIDE_IN_BODY_DOCS = NO 302 303 # The INTERNAL_DOCS tag determines if documentation 304 # that is typed after a \internal command is included. If the tag is set 305 # to NO (the default) then the documentation will be excluded. 306 # Set it to YES to include the internal documentation. 307 308 INTERNAL_DOCS = NO 309 310 # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 311 # file names in lower-case letters. If set to YES upper-case letters are also 312 # allowed. This is useful if you have classes or files whose names only differ 313 # in case and if your file system supports case sensitive file names. Windows 314 # and Mac users are advised to set this option to NO. 315 316 CASE_SENSE_NAMES = YES 317 318 # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 319 # will show members with their full class and namespace scopes in the 320 # documentation. If set to YES the scope will be hidden. 321 322 HIDE_SCOPE_NAMES = NO 323 324 # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 325 # will put a list of the files that are included by a file in the documentation 326 # of that file. 327 328 SHOW_INCLUDE_FILES = YES 329 330 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 331 # is inserted in the documentation for inline members. 332 333 INLINE_INFO = YES 334 335 # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 336 # will sort the (detailed) documentation of file and class members 337 # alphabetically by member name. If set to NO the members will appear in 338 # declaration order. 339 340 SORT_MEMBER_DOCS = NO 341 342 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 343 # brief documentation of file, namespace and class members alphabetically 344 # by member name. If set to NO (the default) the members will appear in 345 # declaration order. 346 347 SORT_BRIEF_DOCS = NO 348 349 # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 350 # sorted by fully-qualified names, including namespaces. If set to 351 # NO (the default), the class list will be sorted only by class name, 352 # not including the namespace part. 353 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 354 # Note: This option applies only to the class list, not to the 355 # alphabetical list. 356 357 SORT_BY_SCOPE_NAME = NO 358 359 # The GENERATE_TODOLIST tag can be used to enable (YES) or 360 # disable (NO) the todo list. This list is created by putting \todo 361 # commands in the documentation. 592 # The default value is: YES. 362 593 363 594 GENERATE_TODOLIST = YES 364 595 365 # The GENERATE_TESTLIST tag can be used to enable (YES) or 366 # disable (NO) the test list. This list is created by putting \test 367 # commands in the documentation. 596 # The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the 597 # test list. This list is created by putting \test commands in the 598 # documentation. 599 # The default value is: YES. 368 600 369 601 GENERATE_TESTLIST = YES 370 602 371 # The GENERATE_BUGLIST tag can be used to enable ( YES) or372 # disable (NO) the bug list. This list is created by putting \bug373 # commands in the documentation.603 # The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug 604 # list. This list is created by putting \bug commands in the documentation. 605 # The default value is: YES. 374 606 375 607 GENERATE_BUGLIST = YES 376 608 377 # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 378 # disable (NO) the deprecated list. This list is created by putting 379 # \deprecated commands in the documentation. 609 # The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) 610 # the deprecated list. This list is created by putting \deprecated commands in 611 # the documentation. 612 # The default value is: YES. 380 613 381 614 GENERATE_DEPRECATEDLIST= YES 382 615 383 # The ENABLED_SECTIONS tag can be used to enable conditional 384 # documentation sections, marked by \if sectionname ... \endif. 385 386 ENABLED_SECTIONS = 387 388 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 389 # the initial value of a variable or define consists of for it to appear in 390 # the documentation. If the initializer consists of more lines than specified 391 # here it will be hidden. Use a value of 0 to hide initializers completely. 392 # The appearance of the initializer of individual variables and defines in the 393 # documentation can be controlled using \showinitializer or \hideinitializer 394 # command in the documentation regardless of this setting. 616 # The ENABLED_SECTIONS tag can be used to enable conditional documentation 617 # sections, marked by \if <section_label> ... \endif and \cond <section_label> 618 # ... \endcond blocks. 619 620 ENABLED_SECTIONS = 621 622 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the 623 # initial value of a variable or macro / define can have for it to appear in the 624 # documentation. If the initializer consists of more lines than specified here 625 # it will be hidden. Use a value of 0 to hide initializers completely. The 626 # appearance of the value of individual variables and macros / defines can be 627 # controlled using \showinitializer or \hideinitializer command in the 628 # documentation regardless of this setting. 629 # Minimum value: 0, maximum value: 10000, default value: 30. 395 630 396 631 MAX_INITIALIZER_LINES = 30 397 632 398 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 399 # at the bottom of the documentation of classes and structs. If set to YES the 400 # list will mention the files that were used to generate the documentation. 633 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at 634 # the bottom of the documentation of classes and structs. If set to YES the list 635 # will mention the files that were used to generate the documentation. 636 # The default value is: YES. 401 637 402 638 SHOW_USED_FILES = YES 403 639 404 # If the sources in your project are distributed over multiple directories 405 # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 406 # in the documentation. The default is NO. 407 408 SHOW_DIRECTORIES = NO 409 410 # The FILE_VERSION_FILTER tag can be used to specify a program or script that 411 # doxygen should invoke to get the current version for each file (typically from the 412 # version control system). Doxygen will invoke the program by executing (via 413 # popen()) the command <command> <input-file>, where <command> is the value of 414 # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 415 # provided by doxygen. Whatever the program writes to standard output 416 # is used as the file version. See the manual for examples. 417 418 FILE_VERSION_FILTER = 419 420 #--------------------------------------------------------------------------- 421 # configuration options related to warning and progress messages 422 #--------------------------------------------------------------------------- 423 424 # The QUIET tag can be used to turn on/off the messages that are generated 425 # by doxygen. Possible values are YES and NO. If left blank NO is used. 426 427 QUIET = NO 428 429 # The WARNINGS tag can be used to turn on/off the warning messages that are 430 # generated by doxygen. Possible values are YES and NO. If left blank 431 # NO is used. 640 # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This 641 # will remove the Files entry from the Quick Index and from the Folder Tree View 642 # (if specified). 643 # The default value is: YES. 644 645 SHOW_FILES = YES 646 647 # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces 648 # page. This will remove the Namespaces entry from the Quick Index and from the 649 # Folder Tree View (if specified). 650 # The default value is: YES. 651 652 SHOW_NAMESPACES = YES 653 654 # The FILE_VERSION_FILTER tag can be used to specify a program or script that 655 # doxygen should invoke to get the current version for each file (typically from 656 # the version control system). Doxygen will invoke the program by executing (via 657 # popen()) the command command input-file, where command is the value of the 658 # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided 659 # by doxygen. Whatever the program writes to standard output is used as the file 660 # version. For an example see the documentation. 661 662 FILE_VERSION_FILTER = 663 664 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 665 # by doxygen. The layout file controls the global structure of the generated 666 # output files in an output format independent way. To create the layout file 667 # that represents doxygen's defaults, run doxygen with the -l option. You can 668 # optionally specify a file name after the option, if omitted DoxygenLayout.xml 669 # will be used as the name of the layout file. 670 # 671 # Note that if you run doxygen from a directory containing a file called 672 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE 673 # tag is left empty. 674 675 LAYOUT_FILE = 676 677 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing 678 # the reference definitions. This must be a list of .bib files. The .bib 679 # extension is automatically appended if omitted. This requires the bibtex tool 680 # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. 681 # For LaTeX the style of the bibliography can be controlled using 682 # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the 683 # search path. See also \cite for info how to create references. 684 685 CITE_BIB_FILES = 686 687 #--------------------------------------------------------------------------- 688 # Configuration options related to warning and progress messages 689 #--------------------------------------------------------------------------- 690 691 # The QUIET tag can be used to turn on/off the messages that are generated to 692 # standard output by doxygen. If QUIET is set to YES this implies that the 693 # messages are off. 694 # The default value is: NO. 695 696 QUIET = YES 697 698 # The WARNINGS tag can be used to turn on/off the warning messages that are 699 # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES 700 # this implies that the warnings are on. 701 # 702 # Tip: Turn warnings on while writing the documentation. 703 # The default value is: YES. 432 704 433 705 WARNINGS = YES 434 706 435 # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 436 # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 437 # automatically be disabled. 707 # If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate 708 # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag 709 # will automatically be disabled. 710 # The default value is: YES. 438 711 439 712 WARN_IF_UNDOCUMENTED = YES 440 713 441 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 442 # potential errors in the documentation, such as not documenting some 443 # parameters in a documented function, or documenting parameters that 444 # don't exist or using markup commands wrongly. 714 # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for 715 # potential errors in the documentation, such as not documenting some parameters 716 # in a documented function, or documenting parameters that don't exist or using 717 # markup commands wrongly. 718 # The default value is: YES. 445 719 446 720 WARN_IF_DOC_ERROR = YES 447 721 448 # This WARN_NO_PARAMDOC option can be abled to get warnings for449 # functions that are documented, but have no documentation for their parameters450 # or return value. If set to NO (the default) doxygen will only warn about451 # wrong or incomplete parameter documentation, but not about the absence of452 # documentation.722 # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that 723 # are documented, but have no documentation for their parameters or return 724 # value. If set to NO doxygen will only warn about wrong or incomplete parameter 725 # documentation, but not about the absence of documentation. 726 # The default value is: NO. 453 727 454 728 WARN_NO_PARAMDOC = NO 455 729 456 # The WARN_FORMAT tag determines the format of the warning messages that 457 # doxygen can produce. The string should contain the $file, $line, and $text 458 # tags, which will be replaced by the file and line number from which the 459 # warning originated and the warning text. Optionally the format may contain 460 # $version, which will be replaced by the version of the file (if it could 461 # be obtained via FILE_VERSION_FILTER) 730 # The WARN_FORMAT tag determines the format of the warning messages that doxygen 731 # can produce. The string should contain the $file, $line, and $text tags, which 732 # will be replaced by the file and line number from which the warning originated 733 # and the warning text. Optionally the format may contain $version, which will 734 # be replaced by the version of the file (if it could be obtained via 735 # FILE_VERSION_FILTER) 736 # The default value is: $file:$line: $text. 462 737 463 738 WARN_FORMAT = "$file:$line: $text" 464 739 465 # The WARN_LOGFILE tag can be used to specify a file to which warning 466 # and error messages should be written. If left blank the output is written 467 # to stderr. 468 469 WARN_LOGFILE = 470 471 #--------------------------------------------------------------------------- 472 # configuration options related to the input files 473 #--------------------------------------------------------------------------- 474 475 # The INPUT tag can be used to specify the files and/or directories that contain 476 # documented source files. You may enter file names like "myfile.cpp" or 477 # directories like "/usr/src/myproject". Separate the files or directories 478 # with spaces. 740 # The WARN_LOGFILE tag can be used to specify a file to which warning and error 741 # messages should be written. If left blank the output is written to standard 742 # error (stderr). 743 744 WARN_LOGFILE = 745 746 #--------------------------------------------------------------------------- 747 # Configuration options related to the input files 748 #--------------------------------------------------------------------------- 749 750 # The INPUT tag is used to specify the files and/or directories that contain 751 # documented source files. You may enter file names like myfile.cpp or 752 # directories like /usr/src/myproject. Separate the files or directories with 753 # spaces. 754 # Note: If this tag is empty the current directory is searched. 479 755 480 756 INPUT = @top_srcdir@/libusb 481 757 482 # This tag can be used to specify the character encoding of the source files that 483 # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 484 # input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 485 # See http://www.gnu.org/software/libiconv for the list of possible encodings. 758 # This tag can be used to specify the character encoding of the source files 759 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses 760 # libiconv (or the iconv built into libc) for the transcoding. See the libiconv 761 # documentation (see: http://www.gnu.org/software/libiconv) for the list of 762 # possible encodings. 763 # The default value is: UTF-8. 486 764 487 765 INPUT_ENCODING = UTF-8 488 766 489 # If the value of the INPUT tag contains directories, you can use the 490 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 491 # and *.h) to filter out the source-files in the directories. If left 492 # blank the following patterns are tested: 493 # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 494 # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py 495 496 FILE_PATTERNS = 497 498 # The RECURSIVE tag can be used to turn specify whether or not subdirectories 499 # should be searched for input files as well. Possible values are YES and NO. 500 # If left blank NO is used. 767 # If the value of the INPUT tag contains directories, you can use the 768 # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and 769 # *.h) to filter out the source-files in the directories. If left blank the 770 # following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, 771 # *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, 772 # *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, 773 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, 774 # *.qsf, *.as and *.js. 775 776 FILE_PATTERNS = 777 778 # The RECURSIVE tag can be used to specify whether or not subdirectories should 779 # be searched for input files as well. 780 # The default value is: NO. 501 781 502 782 RECURSIVE = NO 503 783 504 # The EXCLUDE tag can be used to specify files and/or directories that should 505 # excluded from the INPUT source files. This way you can easily exclude a 784 # The EXCLUDE tag can be used to specify files and/or directories that should be 785 # excluded from the INPUT source files. This way you can easily exclude a 506 786 # subdirectory from a directory tree whose root is specified with the INPUT tag. 507 508 EXCLUDE = @top_srcdir@/libusb/libusbi.h @top_srcdir@/libusb/hotplug.h 509 510 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 511 # directories that are symbolic links (a Unix filesystem feature) are excluded 787 # 788 # Note that relative paths are relative to the directory from which doxygen is 789 # run. 790 791 EXCLUDE = @top_srcdir@/libusb/libusbi.h \ 792 @top_srcdir@/libusb/hotplug.h 793 794 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or 795 # directories that are symbolic links (a Unix file system feature) are excluded 512 796 # from the input. 797 # The default value is: NO. 513 798 514 799 EXCLUDE_SYMLINKS = NO 515 800 516 # If the value of the INPUT tag contains directories, you can use the 517 # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 518 # certain files from those directories. Note that the wildcards are matched 519 # against the file with absolute path, so to exclude all test directories 520 # for example use the pattern */test/* 521 522 EXCLUDE_PATTERNS = 523 524 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 525 # (namespaces, classes, functions, etc.) that should be excluded from the output. 526 # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 527 # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test 528 529 EXCLUDE_SYMBOLS = 530 531 # The EXAMPLE_PATH tag can be used to specify one or more files or 532 # directories that contain example code fragments that are included (see 533 # the \include command). 534 535 EXAMPLE_PATH = 536 537 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 538 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 539 # and *.h) to filter out the source-files in the directories. If left 540 # blank all files are included. 541 542 EXAMPLE_PATTERNS = 543 544 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 545 # searched for input files to be used with the \include or \dontinclude 546 # commands irrespective of the value of the RECURSIVE tag. 547 # Possible values are YES and NO. If left blank NO is used. 801 # If the value of the INPUT tag contains directories, you can use the 802 # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 803 # certain files from those directories. 804 # 805 # Note that the wildcards are matched against the file with absolute path, so to 806 # exclude all test directories for example use the pattern */test/* 807 808 EXCLUDE_PATTERNS = 809 810 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 811 # (namespaces, classes, functions, etc.) that should be excluded from the 812 # output. The symbol name can be a fully qualified name, a word, or if the 813 # wildcard * is used, a substring. Examples: ANamespace, AClass, 814 # AClass::ANamespace, ANamespace::*Test 815 # 816 # Note that the wildcards are matched against the file with absolute path, so to 817 # exclude all test directories use the pattern */test/* 818 819 EXCLUDE_SYMBOLS = 820 821 # The EXAMPLE_PATH tag can be used to specify one or more files or directories 822 # that contain example code fragments that are included (see the \include 823 # command). 824 825 EXAMPLE_PATH = 826 827 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 828 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and 829 # *.h) to filter out the source-files in the directories. If left blank all 830 # files are included. 831 832 EXAMPLE_PATTERNS = 833 834 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 835 # searched for input files to be used with the \include or \dontinclude commands 836 # irrespective of the value of the RECURSIVE tag. 837 # The default value is: NO. 548 838 549 839 EXAMPLE_RECURSIVE = NO 550 840 551 # The IMAGE_PATH tag can be used to specify one or more files or 552 # directories that contain image that are included in the documentation (see 553 # the \image command). 554 555 IMAGE_PATH = 556 557 # The INPUT_FILTER tag can be used to specify a program that doxygen should 558 # invoke to filter for each input file. Doxygen will invoke the filter program 559 # by executing (via popen()) the command <filter> <input-file>, where <filter> 560 # is the value of the INPUT_FILTER tag, and <input-file> is the name of an 561 # input file. Doxygen will then use the output that the filter program writes 562 # to standard output. If FILTER_PATTERNS is specified, this tag will be 563 # ignored. 564 565 INPUT_FILTER = 566 567 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 568 # basis. Doxygen will compare the file name with each pattern and apply the 569 # filter if there is a match. The filters are a list of the form: 570 # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 571 # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 572 # is applied to all files. 573 574 FILTER_PATTERNS = 575 576 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 577 # INPUT_FILTER) will be used to filter the input files when producing source 578 # files to browse (i.e. when SOURCE_BROWSER is set to YES). 841 # The IMAGE_PATH tag can be used to specify one or more files or directories 842 # that contain images that are to be included in the documentation (see the 843 # \image command). 844 845 IMAGE_PATH = 846 847 # The INPUT_FILTER tag can be used to specify a program that doxygen should 848 # invoke to filter for each input file. Doxygen will invoke the filter program 849 # by executing (via popen()) the command: 850 # 851 # <filter> <input-file> 852 # 853 # where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the 854 # name of an input file. Doxygen will then use the output that the filter 855 # program writes to standard output. If FILTER_PATTERNS is specified, this tag 856 # will be ignored. 857 # 858 # Note that the filter must not add or remove lines; it is applied before the 859 # code is scanned, but not when the output code is generated. If lines are added 860 # or removed, the anchors will not be placed correctly. 861 862 INPUT_FILTER = 863 864 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 865 # basis. Doxygen will compare the file name with each pattern and apply the 866 # filter if there is a match. The filters are a list of the form: pattern=filter 867 # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how 868 # filters are used. If the FILTER_PATTERNS tag is empty or if none of the 869 # patterns match the file name, INPUT_FILTER is applied. 870 871 FILTER_PATTERNS = 872 873 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 874 # INPUT_FILTER ) will also be used to filter the input files that are used for 875 # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). 876 # The default value is: NO. 579 877 580 878 FILTER_SOURCE_FILES = NO 581 879 582 #--------------------------------------------------------------------------- 583 # configuration options related to source browsing 584 #--------------------------------------------------------------------------- 585 586 # If the SOURCE_BROWSER tag is set to YES then a list of source files will 587 # be generated. Documented entities will be cross-referenced with these sources. 588 # Note: To get rid of all source code in the generated output, make sure also 589 # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH 590 # then you must also enable this option. If you don't then doxygen will produce 591 # a warning and turn it on anyway 880 # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 881 # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and 882 # it is also possible to disable source filtering for a specific pattern using 883 # *.ext= (so without naming a filter). 884 # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. 885 886 FILTER_SOURCE_PATTERNS = 887 888 # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that 889 # is part of the input, its contents will be placed on the main page 890 # (index.html). This can be useful if you have a project on for instance GitHub 891 # and want to reuse the introduction page also for the doxygen output. 892 893 USE_MDFILE_AS_MAINPAGE = 894 895 #--------------------------------------------------------------------------- 896 # Configuration options related to source browsing 897 #--------------------------------------------------------------------------- 898 899 # If the SOURCE_BROWSER tag is set to YES then a list of source files will be 900 # generated. Documented entities will be cross-referenced with these sources. 901 # 902 # Note: To get rid of all source code in the generated output, make sure that 903 # also VERBATIM_HEADERS is set to NO. 904 # The default value is: NO. 592 905 593 906 SOURCE_BROWSER = NO 594 907 595 # Setting the INLINE_SOURCES tag to YES will include the body 596 # of functions and classes directly in the documentation. 908 # Setting the INLINE_SOURCES tag to YES will include the body of functions, 909 # classes and enums directly into the documentation. 910 # The default value is: NO. 597 911 598 912 INLINE_SOURCES = NO 599 913 600 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 601 # doxygen to hide any special comment blocks from generated source code 602 # fragments. Normal C and C++ comments will always remain visible. 914 # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any 915 # special comment blocks from generated source code fragments. Normal C, C++ and 916 # Fortran comments will always remain visible. 917 # The default value is: YES. 603 918 604 919 STRIP_CODE_COMMENTS = YES 605 920 606 # If the REFERENCED_BY_RELATION tag is set to YES (the default)607 # then for each documented function all documented608 # functions referencing it will be listed.921 # If the REFERENCED_BY_RELATION tag is set to YES then for each documented 922 # function all documented functions referencing it will be listed. 923 # The default value is: NO. 609 924 610 925 REFERENCED_BY_RELATION = NO 611 926 612 # If the REFERENCES_RELATION tag is set to YES (the default)613 # then for each documented function all documented entities614 # called/used by that function will be listed.927 # If the REFERENCES_RELATION tag is set to YES then for each documented function 928 # all documented entities called/used by that function will be listed. 929 # The default value is: NO. 615 930 616 931 REFERENCES_RELATION = NO 617 932 618 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 619 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 620 # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 621 # link to the source code. Otherwise they will link to the documentstion. 933 # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set 934 # to YES, then the hyperlinks from functions in REFERENCES_RELATION and 935 # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will 936 # link to the documentation. 937 # The default value is: YES. 622 938 623 939 REFERENCES_LINK_SOURCE = YES 624 940 625 # If the USE_HTAGS tag is set to YES then the references to source code 626 # will point to the HTML generated by the htags(1) tool instead of doxygen 627 # built-in source browser. The htags tool is part of GNU's global source 628 # tagging system (see http://www.gnu.org/software/global/global.html). You 629 # will need version 4.8.6 or higher. 941 # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the 942 # source code will show a tooltip with additional information such as prototype, 943 # brief description and links to the definition and documentation. Since this 944 # will make the HTML file larger and loading of large files a bit slower, you 945 # can opt to disable this feature. 946 # The default value is: YES. 947 # This tag requires that the tag SOURCE_BROWSER is set to YES. 948 949 SOURCE_TOOLTIPS = YES 950 951 # If the USE_HTAGS tag is set to YES then the references to source code will 952 # point to the HTML generated by the htags(1) tool instead of doxygen built-in 953 # source browser. The htags tool is part of GNU's global source tagging system 954 # (see http://www.gnu.org/software/global/global.html). You will need version 955 # 4.8.6 or higher. 956 # 957 # To use it do the following: 958 # - Install the latest version of global 959 # - Enable SOURCE_BROWSER and USE_HTAGS in the config file 960 # - Make sure the INPUT points to the root of the source tree 961 # - Run doxygen as normal 962 # 963 # Doxygen will invoke htags (and that will in turn invoke gtags), so these 964 # tools must be available from the command line (i.e. in the search path). 965 # 966 # The result: instead of the source browser generated by doxygen, the links to 967 # source code will now point to the output of htags. 968 # The default value is: NO. 969 # This tag requires that the tag SOURCE_BROWSER is set to YES. 630 970 631 971 USE_HTAGS = NO 632 972 633 # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 634 # will generate a verbatim copy of the header file for each class for 635 # which an include is specified. Set to NO to disable this. 973 # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a 974 # verbatim copy of the header file for each class for which an include is 975 # specified. Set to NO to disable this. 976 # See also: Section \class. 977 # The default value is: YES. 636 978 637 979 VERBATIM_HEADERS = YES 638 980 639 981 #--------------------------------------------------------------------------- 640 # configuration options related to the alphabetical class index 641 #--------------------------------------------------------------------------- 642 643 # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 644 # of all compounds will be generated. Enable this if the project 645 # contains a lot of classes, structs, unions or interfaces. 982 # Configuration options related to the alphabetical class index 983 #--------------------------------------------------------------------------- 984 985 # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all 986 # compounds will be generated. Enable this if the project contains a lot of 987 # classes, structs, unions or interfaces. 988 # The default value is: YES. 646 989 647 990 ALPHABETICAL_INDEX = YES 648 991 649 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 650 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 651 # in which this list will be split (can be a number in the range [1..20]) 992 # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in 993 # which the alphabetical index list will be split. 994 # Minimum value: 1, maximum value: 20, default value: 5. 995 # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. 652 996 653 997 COLS_IN_ALPHA_INDEX = 5 654 998 655 # In case all classes in a project start with a common prefix, all 656 # classes will be put under the same header in the alphabetical index. 657 # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 658 # should be ignored while generating the index headers. 659 660 IGNORE_PREFIX = 661 662 #--------------------------------------------------------------------------- 663 # configuration options related to the HTML output 664 #--------------------------------------------------------------------------- 665 666 # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 667 # generate HTML output. 999 # In case all classes in a project start with a common prefix, all classes will 1000 # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag 1001 # can be used to specify a prefix (or a list of prefixes) that should be ignored 1002 # while generating the index headers. 1003 # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. 1004 1005 IGNORE_PREFIX = 1006 1007 #--------------------------------------------------------------------------- 1008 # Configuration options related to the HTML output 1009 #--------------------------------------------------------------------------- 1010 1011 # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output 1012 # The default value is: YES. 668 1013 669 1014 GENERATE_HTML = YES 670 1015 671 # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 672 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 673 # put in front of it. If left blank `html' will be used as the default path. 1016 # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a 1017 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1018 # it. 1019 # The default directory is: html. 1020 # This tag requires that the tag GENERATE_HTML is set to YES. 674 1021 675 1022 HTML_OUTPUT = html 676 1023 677 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 678 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 679 # doxygen will generate files with .html extension. 1024 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each 1025 # generated HTML page (for example: .htm, .php, .asp). 1026 # The default value is: .html. 1027 # This tag requires that the tag GENERATE_HTML is set to YES. 680 1028 681 1029 HTML_FILE_EXTENSION = .html 682 1030 683 # The HTML_HEADER tag can be used to specify a personal HTML header for684 # each generated HTML page. If it is left blank doxygen will generate a1031 # The HTML_HEADER tag can be used to specify a user-defined HTML header file for 1032 # each generated HTML page. If the tag is left blank doxygen will generate a 685 1033 # standard header. 686 687 HTML_HEADER = 688 689 # The HTML_FOOTER tag can be used to specify a personal HTML footer for 690 # each generated HTML page. If it is left blank doxygen will generate a 691 # standard footer. 692 693 HTML_FOOTER = 694 695 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 696 # style sheet that is used by each HTML page. It can be used to 697 # fine-tune the look of the HTML output. If the tag is left blank doxygen 698 # will generate a default style sheet. Note that doxygen will try to copy 699 # the style sheet file to the HTML output directory, so don't put your own 700 # stylesheet in the HTML output directory as well, or it will be erased! 701 702 HTML_STYLESHEET = 703 704 # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 705 # files or namespaces will be aligned in HTML using tables. If set to 706 # NO a bullet list will be used. 707 708 HTML_ALIGN_MEMBERS = YES 709 710 # If the GENERATE_HTMLHELP tag is set to YES, additional index files 711 # will be generated that can be used as input for tools like the 712 # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 713 # of the generated HTML documentation. 1034 # 1035 # To get valid HTML the header file that includes any scripts and style sheets 1036 # that doxygen needs, which is dependent on the configuration options used (e.g. 1037 # the setting GENERATE_TREEVIEW). It is highly recommended to start with a 1038 # default header using 1039 # doxygen -w html new_header.html new_footer.html new_stylesheet.css 1040 # YourConfigFile 1041 # and then modify the file new_header.html. See also section "Doxygen usage" 1042 # for information on how to generate the default header that doxygen normally 1043 # uses. 1044 # Note: The header is subject to change so you typically have to regenerate the 1045 # default header when upgrading to a newer version of doxygen. For a description 1046 # of the possible markers and block names see the documentation. 1047 # This tag requires that the tag GENERATE_HTML is set to YES. 1048 1049 HTML_HEADER = 1050 1051 # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each 1052 # generated HTML page. If the tag is left blank doxygen will generate a standard 1053 # footer. See HTML_HEADER for more information on how to generate a default 1054 # footer and what special commands can be used inside the footer. See also 1055 # section "Doxygen usage" for information on how to generate the default footer 1056 # that doxygen normally uses. 1057 # This tag requires that the tag GENERATE_HTML is set to YES. 1058 1059 HTML_FOOTER = 1060 1061 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style 1062 # sheet that is used by each HTML page. It can be used to fine-tune the look of 1063 # the HTML output. If left blank doxygen will generate a default style sheet. 1064 # See also section "Doxygen usage" for information on how to generate the style 1065 # sheet that doxygen normally uses. 1066 # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as 1067 # it is more robust and this tag (HTML_STYLESHEET) will in the future become 1068 # obsolete. 1069 # This tag requires that the tag GENERATE_HTML is set to YES. 1070 1071 HTML_STYLESHEET = 1072 1073 # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined 1074 # cascading style sheets that are included after the standard style sheets 1075 # created by doxygen. Using this option one can overrule certain style aspects. 1076 # This is preferred over using HTML_STYLESHEET since it does not replace the 1077 # standard style sheet and is therefor more robust against future updates. 1078 # Doxygen will copy the style sheet files to the output directory. 1079 # Note: The order of the extra stylesheet files is of importance (e.g. the last 1080 # stylesheet in the list overrules the setting of the previous ones in the 1081 # list). For an example see the documentation. 1082 # This tag requires that the tag GENERATE_HTML is set to YES. 1083 1084 HTML_EXTRA_STYLESHEET = 1085 1086 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 1087 # other source files which should be copied to the HTML output directory. Note 1088 # that these files will be copied to the base HTML output directory. Use the 1089 # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 1090 # files. In the HTML_STYLESHEET file, use the file name only. Also note that the 1091 # files will be copied as-is; there are no commands or markers available. 1092 # This tag requires that the tag GENERATE_HTML is set to YES. 1093 1094 HTML_EXTRA_FILES = 1095 1096 # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen 1097 # will adjust the colors in the stylesheet and background images according to 1098 # this color. Hue is specified as an angle on a colorwheel, see 1099 # http://en.wikipedia.org/wiki/Hue for more information. For instance the value 1100 # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 1101 # purple, and 360 is red again. 1102 # Minimum value: 0, maximum value: 359, default value: 220. 1103 # This tag requires that the tag GENERATE_HTML is set to YES. 1104 1105 HTML_COLORSTYLE_HUE = 220 1106 1107 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors 1108 # in the HTML output. For a value of 0 the output will use grayscales only. A 1109 # value of 255 will produce the most vivid colors. 1110 # Minimum value: 0, maximum value: 255, default value: 100. 1111 # This tag requires that the tag GENERATE_HTML is set to YES. 1112 1113 HTML_COLORSTYLE_SAT = 100 1114 1115 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the 1116 # luminance component of the colors in the HTML output. Values below 100 1117 # gradually make the output lighter, whereas values above 100 make the output 1118 # darker. The value divided by 100 is the actual gamma applied, so 80 represents 1119 # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not 1120 # change the gamma. 1121 # Minimum value: 40, maximum value: 240, default value: 80. 1122 # This tag requires that the tag GENERATE_HTML is set to YES. 1123 1124 HTML_COLORSTYLE_GAMMA = 80 1125 1126 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 1127 # page will contain the date and time when the page was generated. Setting this 1128 # to NO can help when comparing the output of multiple runs. 1129 # The default value is: YES. 1130 # This tag requires that the tag GENERATE_HTML is set to YES. 1131 1132 HTML_TIMESTAMP = YES 1133 1134 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 1135 # documentation will contain sections that can be hidden and shown after the 1136 # page has loaded. 1137 # The default value is: NO. 1138 # This tag requires that the tag GENERATE_HTML is set to YES. 1139 1140 HTML_DYNAMIC_SECTIONS = YES 1141 1142 # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries 1143 # shown in the various tree structured indices initially; the user can expand 1144 # and collapse entries dynamically later on. Doxygen will expand the tree to 1145 # such a level that at most the specified number of entries are visible (unless 1146 # a fully collapsed tree already exceeds this amount). So setting the number of 1147 # entries 1 will produce a full collapsed tree by default. 0 is a special value 1148 # representing an infinite number of entries and will result in a full expanded 1149 # tree by default. 1150 # Minimum value: 0, maximum value: 9999, default value: 100. 1151 # This tag requires that the tag GENERATE_HTML is set to YES. 1152 1153 HTML_INDEX_NUM_ENTRIES = 100 1154 1155 # If the GENERATE_DOCSET tag is set to YES, additional index files will be 1156 # generated that can be used as input for Apple's Xcode 3 integrated development 1157 # environment (see: http://developer.apple.com/tools/xcode/), introduced with 1158 # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a 1159 # Makefile in the HTML output directory. Running make will produce the docset in 1160 # that directory and running make install will install the docset in 1161 # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at 1162 # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 1163 # for more information. 1164 # The default value is: NO. 1165 # This tag requires that the tag GENERATE_HTML is set to YES. 1166 1167 GENERATE_DOCSET = NO 1168 1169 # This tag determines the name of the docset feed. A documentation feed provides 1170 # an umbrella under which multiple documentation sets from a single provider 1171 # (such as a company or product suite) can be grouped. 1172 # The default value is: Doxygen generated docs. 1173 # This tag requires that the tag GENERATE_DOCSET is set to YES. 1174 1175 DOCSET_FEEDNAME = "Doxygen generated docs" 1176 1177 # This tag specifies a string that should uniquely identify the documentation 1178 # set bundle. This should be a reverse domain-name style string, e.g. 1179 # com.mycompany.MyDocSet. Doxygen will append .docset to the name. 1180 # The default value is: org.doxygen.Project. 1181 # This tag requires that the tag GENERATE_DOCSET is set to YES. 1182 1183 DOCSET_BUNDLE_ID = org.doxygen.Project 1184 1185 # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify 1186 # the documentation publisher. This should be a reverse domain-name style 1187 # string, e.g. com.mycompany.MyDocSet.documentation. 1188 # The default value is: org.doxygen.Publisher. 1189 # This tag requires that the tag GENERATE_DOCSET is set to YES. 1190 1191 DOCSET_PUBLISHER_ID = org.doxygen.Publisher 1192 1193 # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. 1194 # The default value is: Publisher. 1195 # This tag requires that the tag GENERATE_DOCSET is set to YES. 1196 1197 DOCSET_PUBLISHER_NAME = Publisher 1198 1199 # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three 1200 # additional HTML index files: index.hhp, index.hhc, and index.hhk. The 1201 # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop 1202 # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on 1203 # Windows. 1204 # 1205 # The HTML Help Workshop contains a compiler that can convert all HTML output 1206 # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML 1207 # files are now used as the Windows 98 help format, and will replace the old 1208 # Windows help format (.hlp) on all Windows platforms in the future. Compressed 1209 # HTML files also contain an index, a table of contents, and you can search for 1210 # words in the documentation. The HTML workshop also contains a viewer for 1211 # compressed HTML files. 1212 # The default value is: NO. 1213 # This tag requires that the tag GENERATE_HTML is set to YES. 714 1214 715 1215 GENERATE_HTMLHELP = NO 716 1216 717 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 718 # documentation will contain sections that can be hidden and shown after the 719 # page has loaded. For this to work a browser that supports 720 # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 721 # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 722 723 HTML_DYNAMIC_SECTIONS = YES 724 725 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 726 # be used to specify the file name of the resulting .chm file. You 727 # can add a path in front of the file if the result should not be 1217 # The CHM_FILE tag can be used to specify the file name of the resulting .chm 1218 # file. You can add a path in front of the file if the result should not be 728 1219 # written to the html output directory. 729 730 CHM_FILE = 731 732 # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 733 # be used to specify the location (absolute path including file name) of 734 # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 735 # the HTML help compiler on the generated index.hhp. 736 737 HHC_LOCATION = 738 739 # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 740 # controls if a separate .chi index file is generated (YES) or that 741 # it should be included in the master .chm file (NO). 1220 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1221 1222 CHM_FILE = 1223 1224 # The HHC_LOCATION tag can be used to specify the location (absolute path 1225 # including file name) of the HTML help compiler ( hhc.exe). If non-empty 1226 # doxygen will try to run the HTML help compiler on the generated index.hhp. 1227 # The file has to be specified with full path. 1228 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1229 1230 HHC_LOCATION = 1231 1232 # The GENERATE_CHI flag controls if a separate .chi index file is generated ( 1233 # YES) or that it should be included in the master .chm file ( NO). 1234 # The default value is: NO. 1235 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 742 1236 743 1237 GENERATE_CHI = NO 744 1238 745 # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 746 # controls whether a binary table of contents is generated (YES) or a 747 # normal table of contents (NO) in the .chm file. 1239 # The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) 1240 # and project file content. 1241 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1242 1243 CHM_INDEX_ENCODING = 1244 1245 # The BINARY_TOC flag controls whether a binary table of contents is generated ( 1246 # YES) or a normal table of contents ( NO) in the .chm file. Furthermore it 1247 # enables the Previous and Next buttons. 1248 # The default value is: NO. 1249 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 748 1250 749 1251 BINARY_TOC = NO 750 1252 751 # The TOC_EXPAND flag can be set to YES to add extra items for group members 752 # to the contents of the HTML help documentation and to the tree view. 1253 # The TOC_EXPAND flag can be set to YES to add extra items for group members to 1254 # the table of contents of the HTML help documentation and to the tree view. 1255 # The default value is: NO. 1256 # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 753 1257 754 1258 TOC_EXPAND = NO 755 1259 756 # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 757 # top of each HTML page. The value NO (the default) enables the index and 758 # the value YES disables it. 1260 # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 1261 # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that 1262 # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help 1263 # (.qch) of the generated HTML documentation. 1264 # The default value is: NO. 1265 # This tag requires that the tag GENERATE_HTML is set to YES. 1266 1267 GENERATE_QHP = NO 1268 1269 # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify 1270 # the file name of the resulting .qch file. The path specified is relative to 1271 # the HTML output folder. 1272 # This tag requires that the tag GENERATE_QHP is set to YES. 1273 1274 QCH_FILE = 1275 1276 # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help 1277 # Project output. For more information please see Qt Help Project / Namespace 1278 # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). 1279 # The default value is: org.doxygen.Project. 1280 # This tag requires that the tag GENERATE_QHP is set to YES. 1281 1282 QHP_NAMESPACE = org.doxygen.Project 1283 1284 # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt 1285 # Help Project output. For more information please see Qt Help Project / Virtual 1286 # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- 1287 # folders). 1288 # The default value is: doc. 1289 # This tag requires that the tag GENERATE_QHP is set to YES. 1290 1291 QHP_VIRTUAL_FOLDER = doc 1292 1293 # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom 1294 # filter to add. For more information please see Qt Help Project / Custom 1295 # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- 1296 # filters). 1297 # This tag requires that the tag GENERATE_QHP is set to YES. 1298 1299 QHP_CUST_FILTER_NAME = 1300 1301 # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the 1302 # custom filter to add. For more information please see Qt Help Project / Custom 1303 # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- 1304 # filters). 1305 # This tag requires that the tag GENERATE_QHP is set to YES. 1306 1307 QHP_CUST_FILTER_ATTRS = 1308 1309 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 1310 # project's filter section matches. Qt Help Project / Filter Attributes (see: 1311 # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). 1312 # This tag requires that the tag GENERATE_QHP is set to YES. 1313 1314 QHP_SECT_FILTER_ATTRS = 1315 1316 # The QHG_LOCATION tag can be used to specify the location of Qt's 1317 # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the 1318 # generated .qhp file. 1319 # This tag requires that the tag GENERATE_QHP is set to YES. 1320 1321 QHG_LOCATION = 1322 1323 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be 1324 # generated, together with the HTML files, they form an Eclipse help plugin. To 1325 # install this plugin and make it available under the help contents menu in 1326 # Eclipse, the contents of the directory containing the HTML and XML files needs 1327 # to be copied into the plugins directory of eclipse. The name of the directory 1328 # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. 1329 # After copying Eclipse needs to be restarted before the help appears. 1330 # The default value is: NO. 1331 # This tag requires that the tag GENERATE_HTML is set to YES. 1332 1333 GENERATE_ECLIPSEHELP = NO 1334 1335 # A unique identifier for the Eclipse help plugin. When installing the plugin 1336 # the directory name containing the HTML and XML files should also have this 1337 # name. Each documentation set should have its own identifier. 1338 # The default value is: org.doxygen.Project. 1339 # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. 1340 1341 ECLIPSE_DOC_ID = org.doxygen.Project 1342 1343 # If you want full control over the layout of the generated HTML pages it might 1344 # be necessary to disable the index and replace it with your own. The 1345 # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top 1346 # of each HTML page. A value of NO enables the index and the value YES disables 1347 # it. Since the tabs in the index contain the same information as the navigation 1348 # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. 1349 # The default value is: NO. 1350 # This tag requires that the tag GENERATE_HTML is set to YES. 759 1351 760 1352 DISABLE_INDEX = NO 761 1353 762 # This tag can be used to set the number of enum values (range [1..20]) 763 # that doxygen will group on one line in the generated HTML documentation. 1354 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 1355 # structure should be generated to display hierarchical information. If the tag 1356 # value is set to YES, a side panel will be generated containing a tree-like 1357 # index structure (just like the one that is generated for HTML Help). For this 1358 # to work a browser that supports JavaScript, DHTML, CSS and frames is required 1359 # (i.e. any modern browser). Windows users are probably better off using the 1360 # HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can 1361 # further fine-tune the look of the index. As an example, the default style 1362 # sheet generated by doxygen has an example that shows how to put an image at 1363 # the root of the tree instead of the PROJECT_NAME. Since the tree basically has 1364 # the same information as the tab index, you could consider setting 1365 # DISABLE_INDEX to YES when enabling this option. 1366 # The default value is: NO. 1367 # This tag requires that the tag GENERATE_HTML is set to YES. 1368 1369 GENERATE_TREEVIEW = NO 1370 1371 # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that 1372 # doxygen will group on one line in the generated HTML documentation. 1373 # 1374 # Note that a value of 0 will completely suppress the enum values from appearing 1375 # in the overview section. 1376 # Minimum value: 0, maximum value: 20, default value: 4. 1377 # This tag requires that the tag GENERATE_HTML is set to YES. 764 1378 765 1379 ENUM_VALUES_PER_LINE = 4 766 1380 767 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be 768 # generated containing a tree-like index structure (just like the one that 769 # is generated for HTML Help). For this to work a browser that supports 770 # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 771 # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 772 # probably better off using the HTML help feature. 773 774 GENERATE_TREEVIEW = NO 775 776 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 777 # used to set the initial width (in pixels) of the frame in which the tree 778 # is shown. 1381 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used 1382 # to set the initial width (in pixels) of the frame in which the tree is shown. 1383 # Minimum value: 0, maximum value: 1500, default value: 250. 1384 # This tag requires that the tag GENERATE_HTML is set to YES. 779 1385 780 1386 TREEVIEW_WIDTH = 250 781 1387 782 #--------------------------------------------------------------------------- 783 # configuration options related to the LaTeX output 784 #--------------------------------------------------------------------------- 785 786 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 787 # generate Latex output. 1388 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to 1389 # external symbols imported via tag files in a separate window. 1390 # The default value is: NO. 1391 # This tag requires that the tag GENERATE_HTML is set to YES. 1392 1393 EXT_LINKS_IN_WINDOW = NO 1394 1395 # Use this tag to change the font size of LaTeX formulas included as images in 1396 # the HTML documentation. When you change the font size after a successful 1397 # doxygen run you need to manually remove any form_*.png images from the HTML 1398 # output directory to force them to be regenerated. 1399 # Minimum value: 8, maximum value: 50, default value: 10. 1400 # This tag requires that the tag GENERATE_HTML is set to YES. 1401 1402 FORMULA_FONTSIZE = 10 1403 1404 # Use the FORMULA_TRANPARENT tag to determine whether or not the images 1405 # generated for formulas are transparent PNGs. Transparent PNGs are not 1406 # supported properly for IE 6.0, but are supported on all modern browsers. 1407 # 1408 # Note that when changing this option you need to delete any form_*.png files in 1409 # the HTML output directory before the changes have effect. 1410 # The default value is: YES. 1411 # This tag requires that the tag GENERATE_HTML is set to YES. 1412 1413 FORMULA_TRANSPARENT = YES 1414 1415 # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see 1416 # http://www.mathjax.org) which uses client side Javascript for the rendering 1417 # instead of using prerendered bitmaps. Use this if you do not have LaTeX 1418 # installed or if you want to formulas look prettier in the HTML output. When 1419 # enabled you may also need to install MathJax separately and configure the path 1420 # to it using the MATHJAX_RELPATH option. 1421 # The default value is: NO. 1422 # This tag requires that the tag GENERATE_HTML is set to YES. 1423 1424 USE_MATHJAX = NO 1425 1426 # When MathJax is enabled you can set the default output format to be used for 1427 # the MathJax output. See the MathJax site (see: 1428 # http://docs.mathjax.org/en/latest/output.html) for more details. 1429 # Possible values are: HTML-CSS (which is slower, but has the best 1430 # compatibility), NativeMML (i.e. MathML) and SVG. 1431 # The default value is: HTML-CSS. 1432 # This tag requires that the tag USE_MATHJAX is set to YES. 1433 1434 MATHJAX_FORMAT = HTML-CSS 1435 1436 # When MathJax is enabled you need to specify the location relative to the HTML 1437 # output directory using the MATHJAX_RELPATH option. The destination directory 1438 # should contain the MathJax.js script. For instance, if the mathjax directory 1439 # is located at the same level as the HTML output directory, then 1440 # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax 1441 # Content Delivery Network so you can quickly see the result without installing 1442 # MathJax. However, it is strongly recommended to install a local copy of 1443 # MathJax from http://www.mathjax.org before deployment. 1444 # The default value is: http://cdn.mathjax.org/mathjax/latest. 1445 # This tag requires that the tag USE_MATHJAX is set to YES. 1446 1447 MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest 1448 1449 # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax 1450 # extension names that should be enabled during MathJax rendering. For example 1451 # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols 1452 # This tag requires that the tag USE_MATHJAX is set to YES. 1453 1454 MATHJAX_EXTENSIONS = 1455 1456 # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces 1457 # of code that will be used on startup of the MathJax code. See the MathJax site 1458 # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an 1459 # example see the documentation. 1460 # This tag requires that the tag USE_MATHJAX is set to YES. 1461 1462 MATHJAX_CODEFILE = 1463 1464 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for 1465 # the HTML output. The underlying search engine uses javascript and DHTML and 1466 # should work on any modern browser. Note that when using HTML help 1467 # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) 1468 # there is already a search function so this one should typically be disabled. 1469 # For large projects the javascript based search engine can be slow, then 1470 # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to 1471 # search using the keyboard; to jump to the search box use <access key> + S 1472 # (what the <access key> is depends on the OS and browser, but it is typically 1473 # <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down 1474 # key> to jump into the search results window, the results can be navigated 1475 # using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel 1476 # the search. The filter options can be selected when the cursor is inside the 1477 # search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> 1478 # to select a filter and <Enter> or <escape> to activate or cancel the filter 1479 # option. 1480 # The default value is: YES. 1481 # This tag requires that the tag GENERATE_HTML is set to YES. 1482 1483 SEARCHENGINE = NO 1484 1485 # When the SERVER_BASED_SEARCH tag is enabled the search engine will be 1486 # implemented using a web server instead of a web client using Javascript. There 1487 # are two flavors of web server based searching depending on the EXTERNAL_SEARCH 1488 # setting. When disabled, doxygen will generate a PHP script for searching and 1489 # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing 1490 # and searching needs to be provided by external tools. See the section 1491 # "External Indexing and Searching" for details. 1492 # The default value is: NO. 1493 # This tag requires that the tag SEARCHENGINE is set to YES. 1494 1495 SERVER_BASED_SEARCH = NO 1496 1497 # When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP 1498 # script for searching. Instead the search results are written to an XML file 1499 # which needs to be processed by an external indexer. Doxygen will invoke an 1500 # external search engine pointed to by the SEARCHENGINE_URL option to obtain the 1501 # search results. 1502 # 1503 # Doxygen ships with an example indexer ( doxyindexer) and search engine 1504 # (doxysearch.cgi) which are based on the open source search engine library 1505 # Xapian (see: http://xapian.org/). 1506 # 1507 # See the section "External Indexing and Searching" for details. 1508 # The default value is: NO. 1509 # This tag requires that the tag SEARCHENGINE is set to YES. 1510 1511 EXTERNAL_SEARCH = NO 1512 1513 # The SEARCHENGINE_URL should point to a search engine hosted by a web server 1514 # which will return the search results when EXTERNAL_SEARCH is enabled. 1515 # 1516 # Doxygen ships with an example indexer ( doxyindexer) and search engine 1517 # (doxysearch.cgi) which are based on the open source search engine library 1518 # Xapian (see: http://xapian.org/). See the section "External Indexing and 1519 # Searching" for details. 1520 # This tag requires that the tag SEARCHENGINE is set to YES. 1521 1522 SEARCHENGINE_URL = 1523 1524 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed 1525 # search data is written to a file for indexing by an external tool. With the 1526 # SEARCHDATA_FILE tag the name of this file can be specified. 1527 # The default file is: searchdata.xml. 1528 # This tag requires that the tag SEARCHENGINE is set to YES. 1529 1530 SEARCHDATA_FILE = searchdata.xml 1531 1532 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the 1533 # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is 1534 # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple 1535 # projects and redirect the results back to the right project. 1536 # This tag requires that the tag SEARCHENGINE is set to YES. 1537 1538 EXTERNAL_SEARCH_ID = 1539 1540 # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen 1541 # projects other than the one defined by this configuration file, but that are 1542 # all added to the same external search index. Each project needs to have a 1543 # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of 1544 # to a relative location where the documentation can be found. The format is: 1545 # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... 1546 # This tag requires that the tag SEARCHENGINE is set to YES. 1547 1548 EXTRA_SEARCH_MAPPINGS = 1549 1550 #--------------------------------------------------------------------------- 1551 # Configuration options related to the LaTeX output 1552 #--------------------------------------------------------------------------- 1553 1554 # If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. 1555 # The default value is: YES. 788 1556 789 1557 GENERATE_LATEX = NO 790 1558 791 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 792 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 793 # put in front of it. If left blank `latex' will be used as the default path. 1559 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a 1560 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1561 # it. 1562 # The default directory is: latex. 1563 # This tag requires that the tag GENERATE_LATEX is set to YES. 794 1564 795 1565 LATEX_OUTPUT = latex 796 1566 797 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 798 # invoked. If left blank `latex' will be used as the default command name. 1567 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1568 # invoked. 1569 # 1570 # Note that when enabling USE_PDFLATEX this option is only used for generating 1571 # bitmaps for formulas in the HTML output, but not in the Makefile that is 1572 # written to the output directory. 1573 # The default file is: latex. 1574 # This tag requires that the tag GENERATE_LATEX is set to YES. 799 1575 800 1576 LATEX_CMD_NAME = latex 801 1577 802 # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 803 # generate index for LaTeX. If left blank `makeindex' will be used as the 804 # default command name. 1578 # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate 1579 # index for LaTeX. 1580 # The default file is: makeindex. 1581 # This tag requires that the tag GENERATE_LATEX is set to YES. 805 1582 806 1583 MAKEINDEX_CMD_NAME = makeindex 807 1584 808 # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 809 # LaTeX documents. This may be useful for small projects and may help to 810 # save some trees in general. 1585 # If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX 1586 # documents. This may be useful for small projects and may help to save some 1587 # trees in general. 1588 # The default value is: NO. 1589 # This tag requires that the tag GENERATE_LATEX is set to YES. 811 1590 812 1591 COMPACT_LATEX = NO 813 1592 814 # The PAPER_TYPE tag can be used to set the paper type that is used 815 # by the printer. Possible values are: a4, a4wide, letter, legal and 816 # executive. If left blank a4wide will be used. 1593 # The PAPER_TYPE tag can be used to set the paper type that is used by the 1594 # printer. 1595 # Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x 1596 # 14 inches) and executive (7.25 x 10.5 inches). 1597 # The default value is: a4. 1598 # This tag requires that the tag GENERATE_LATEX is set to YES. 817 1599 818 1600 PAPER_TYPE = a4wide 819 1601 820 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 821 # packages that should be included in the LaTeX output. 822 823 EXTRA_PACKAGES = 824 825 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 826 # the generated latex document. The header should contain everything until 827 # the first chapter. If it is left blank doxygen will generate a 828 # standard header. Notice: only use this tag if you know what you are doing! 829 830 LATEX_HEADER = 831 832 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 833 # is prepared for conversion to pdf (using ps2pdf). The pdf file will 834 # contain links (just like the HTML output) instead of page references 835 # This makes the output suitable for online browsing using a pdf viewer. 1602 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names 1603 # that should be included in the LaTeX output. To get the times font for 1604 # instance you can specify 1605 # EXTRA_PACKAGES=times 1606 # If left blank no extra packages will be included. 1607 # This tag requires that the tag GENERATE_LATEX is set to YES. 1608 1609 EXTRA_PACKAGES = 1610 1611 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the 1612 # generated LaTeX document. The header should contain everything until the first 1613 # chapter. If it is left blank doxygen will generate a standard header. See 1614 # section "Doxygen usage" for information on how to let doxygen write the 1615 # default header to a separate file. 1616 # 1617 # Note: Only use a user-defined header if you know what you are doing! The 1618 # following commands have a special meaning inside the header: $title, 1619 # $datetime, $date, $doxygenversion, $projectname, $projectnumber, 1620 # $projectbrief, $projectlogo. Doxygen will replace $title with the empy string, 1621 # for the replacement values of the other commands the user is refered to 1622 # HTML_HEADER. 1623 # This tag requires that the tag GENERATE_LATEX is set to YES. 1624 1625 LATEX_HEADER = 1626 1627 # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the 1628 # generated LaTeX document. The footer should contain everything after the last 1629 # chapter. If it is left blank doxygen will generate a standard footer. See 1630 # LATEX_HEADER for more information on how to generate a default footer and what 1631 # special commands can be used inside the footer. 1632 # 1633 # Note: Only use a user-defined footer if you know what you are doing! 1634 # This tag requires that the tag GENERATE_LATEX is set to YES. 1635 1636 LATEX_FOOTER = 1637 1638 # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or 1639 # other source files which should be copied to the LATEX_OUTPUT output 1640 # directory. Note that the files will be copied as-is; there are no commands or 1641 # markers available. 1642 # This tag requires that the tag GENERATE_LATEX is set to YES. 1643 1644 LATEX_EXTRA_FILES = 1645 1646 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is 1647 # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will 1648 # contain links (just like the HTML output) instead of page references. This 1649 # makes the output suitable for online browsing using a PDF viewer. 1650 # The default value is: YES. 1651 # This tag requires that the tag GENERATE_LATEX is set to YES. 836 1652 837 1653 PDF_HYPERLINKS = NO 838 1654 839 # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of840 # plain latex in the generated Makefile. Set this option to YES to get a1655 # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate 1656 # the PDF file directly from the LaTeX files. Set this option to YES to get a 841 1657 # higher quality PDF documentation. 1658 # The default value is: YES. 1659 # This tag requires that the tag GENERATE_LATEX is set to YES. 842 1660 843 1661 USE_PDFLATEX = NO 844 1662 845 # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 846 # command to the generated LaTeX files. This will instruct LaTeX to keep 847 # running if errors occur, instead of asking the user for help. 848 # This option is also used when generating formulas in HTML. 1663 # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode 1664 # command to the generated LaTeX files. This will instruct LaTeX to keep running 1665 # if errors occur, instead of asking the user for help. This option is also used 1666 # when generating formulas in HTML. 1667 # The default value is: NO. 1668 # This tag requires that the tag GENERATE_LATEX is set to YES. 849 1669 850 1670 LATEX_BATCHMODE = NO 851 1671 852 # If LATEX_HIDE_INDICES is set to YES then doxygen will not 853 # include the index chapters (such as File Index, Compound Index, etc.) 854 # in the output. 1672 # If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the 1673 # index chapters (such as File Index, Compound Index, etc.) in the output. 1674 # The default value is: NO. 1675 # This tag requires that the tag GENERATE_LATEX is set to YES. 855 1676 856 1677 LATEX_HIDE_INDICES = NO 857 1678 858 #--------------------------------------------------------------------------- 859 # configuration options related to the RTF output 860 #--------------------------------------------------------------------------- 861 862 # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 863 # The RTF output is optimized for Word 97 and may not look very pretty with 864 # other RTF readers or editors. 1679 # If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source 1680 # code with syntax highlighting in the LaTeX output. 1681 # 1682 # Note that which sources are shown also depends on other settings such as 1683 # SOURCE_BROWSER. 1684 # The default value is: NO. 1685 # This tag requires that the tag GENERATE_LATEX is set to YES. 1686 1687 LATEX_SOURCE_CODE = NO 1688 1689 # The LATEX_BIB_STYLE tag can be used to specify the style to use for the 1690 # bibliography, e.g. plainnat, or ieeetr. See 1691 # http://en.wikipedia.org/wiki/BibTeX and \cite for more info. 1692 # The default value is: plain. 1693 # This tag requires that the tag GENERATE_LATEX is set to YES. 1694 1695 LATEX_BIB_STYLE = plain 1696 1697 #--------------------------------------------------------------------------- 1698 # Configuration options related to the RTF output 1699 #--------------------------------------------------------------------------- 1700 1701 # If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The 1702 # RTF output is optimized for Word 97 and may not look too pretty with other RTF 1703 # readers/editors. 1704 # The default value is: NO. 865 1705 866 1706 GENERATE_RTF = NO 867 1707 868 # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 869 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 870 # put in front of it. If left blank `rtf' will be used as the default path. 1708 # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a 1709 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1710 # it. 1711 # The default directory is: rtf. 1712 # This tag requires that the tag GENERATE_RTF is set to YES. 871 1713 872 1714 RTF_OUTPUT = rtf 873 1715 874 # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 875 # RTF documents. This may be useful for small projects and may help to 876 # save some trees in general. 1716 # If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF 1717 # documents. This may be useful for small projects and may help to save some 1718 # trees in general. 1719 # The default value is: NO. 1720 # This tag requires that the tag GENERATE_RTF is set to YES. 877 1721 878 1722 COMPACT_RTF = NO 879 1723 880 # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 881 # will contain hyperlink fields. The RTF file will 882 # contain links (just like the HTML output) instead of page references. 883 # This makes the output suitable for online browsing using WORD or other 884 # programs which support those fields. 885 # Note: wordpad (write) and others do not support links. 1724 # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will 1725 # contain hyperlink fields. The RTF file will contain links (just like the HTML 1726 # output) instead of page references. This makes the output suitable for online 1727 # browsing using Word or some other Word compatible readers that support those 1728 # fields. 1729 # 1730 # Note: WordPad (write) and others do not support links. 1731 # The default value is: NO. 1732 # This tag requires that the tag GENERATE_RTF is set to YES. 886 1733 887 1734 RTF_HYPERLINKS = NO 888 1735 889 # Load stylesheet definitions from file. Syntax is similar to doxygen's 890 # config file, i.e. a series of assignments. You only have to provide 891 # replacements, missing definitions are set to their default value. 892 893 RTF_STYLESHEET_FILE = 894 895 # Set optional variables used in the generation of an rtf document. 896 # Syntax is similar to doxygen's config file. 897 898 RTF_EXTENSIONS_FILE = 899 900 #--------------------------------------------------------------------------- 901 # configuration options related to the man page output 902 #--------------------------------------------------------------------------- 903 904 # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 905 # generate man pages 1736 # Load stylesheet definitions from file. Syntax is similar to doxygen's config 1737 # file, i.e. a series of assignments. You only have to provide replacements, 1738 # missing definitions are set to their default value. 1739 # 1740 # See also section "Doxygen usage" for information on how to generate the 1741 # default style sheet that doxygen normally uses. 1742 # This tag requires that the tag GENERATE_RTF is set to YES. 1743 1744 RTF_STYLESHEET_FILE = 1745 1746 # Set optional variables used in the generation of an RTF document. Syntax is 1747 # similar to doxygen's config file. A template extensions file can be generated 1748 # using doxygen -e rtf extensionFile. 1749 # This tag requires that the tag GENERATE_RTF is set to YES. 1750 1751 RTF_EXTENSIONS_FILE = 1752 1753 #--------------------------------------------------------------------------- 1754 # Configuration options related to the man page output 1755 #--------------------------------------------------------------------------- 1756 1757 # If the GENERATE_MAN tag is set to YES doxygen will generate man pages for 1758 # classes and files. 1759 # The default value is: NO. 906 1760 907 1761 GENERATE_MAN = NO 908 1762 909 # The MAN_OUTPUT tag is used to specify where the man pages will be put. 910 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 911 # put in front of it. If left blank `man' will be used as the default path. 1763 # The MAN_OUTPUT tag is used to specify where the man pages will be put. If a 1764 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1765 # it. A directory man3 will be created inside the directory specified by 1766 # MAN_OUTPUT. 1767 # The default directory is: man. 1768 # This tag requires that the tag GENERATE_MAN is set to YES. 912 1769 913 1770 MAN_OUTPUT = man 914 1771 915 # The MAN_EXTENSION tag determines the extension that is added to 916 # the generated man pages (default is the subroutine's section .3) 1772 # The MAN_EXTENSION tag determines the extension that is added to the generated 1773 # man pages. In case the manual section does not start with a number, the number 1774 # 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is 1775 # optional. 1776 # The default value is: .3. 1777 # This tag requires that the tag GENERATE_MAN is set to YES. 917 1778 918 1779 MAN_EXTENSION = .3 919 1780 920 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 921 # then it will generate one additional man file for each entity 922 # documented in the real man page(s). These additional files 923 # only source the real man page, but without them the man command 924 # would be unable to find the correct page. The default is NO. 1781 # The MAN_SUBDIR tag determines the name of the directory created within 1782 # MAN_OUTPUT in which the man pages are placed. If defaults to man followed by 1783 # MAN_EXTENSION with the initial . removed. 1784 # This tag requires that the tag GENERATE_MAN is set to YES. 1785 1786 MAN_SUBDIR = 1787 1788 # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it 1789 # will generate one additional man file for each entity documented in the real 1790 # man page(s). These additional files only source the real man page, but without 1791 # them the man command would be unable to find the correct page. 1792 # The default value is: NO. 1793 # This tag requires that the tag GENERATE_MAN is set to YES. 925 1794 926 1795 MAN_LINKS = NO 927 1796 928 1797 #--------------------------------------------------------------------------- 929 # configuration options related to the XML output930 #--------------------------------------------------------------------------- 931 932 # If the GENERATE_XML tag is set to YES Doxygen will933 # generate an XML file that captures the structure of934 # the code including all documentation.1798 # Configuration options related to the XML output 1799 #--------------------------------------------------------------------------- 1800 1801 # If the GENERATE_XML tag is set to YES doxygen will generate an XML file that 1802 # captures the structure of the code including all documentation. 1803 # The default value is: NO. 935 1804 936 1805 GENERATE_XML = NO 937 1806 938 # The XML_OUTPUT tag is used to specify where the XML pages will be put. 939 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 940 # put in front of it. If left blank `xml' will be used as the default path. 1807 # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a 1808 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1809 # it. 1810 # The default directory is: xml. 1811 # This tag requires that the tag GENERATE_XML is set to YES. 941 1812 942 1813 XML_OUTPUT = xml 943 1814 944 # The XML_SCHEMA tag can be used to specify an XML schema, 945 # which can be used by a validating XML parser to check the 946 # syntax of the XML files. 947 948 XML_SCHEMA = 949 950 # The XML_DTD tag can be used to specify an XML DTD, 951 # which can be used by a validating XML parser to check the 952 # syntax of the XML files. 953 954 XML_DTD = 955 956 # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 957 # dump the program listings (including syntax highlighting 958 # and cross-referencing information) to the XML output. Note that 959 # enabling this will significantly increase the size of the XML output. 1815 # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program 1816 # listings (including syntax highlighting and cross-referencing information) to 1817 # the XML output. Note that enabling this will significantly increase the size 1818 # of the XML output. 1819 # The default value is: YES. 1820 # This tag requires that the tag GENERATE_XML is set to YES. 960 1821 961 1822 XML_PROGRAMLISTING = YES 962 1823 963 1824 #--------------------------------------------------------------------------- 964 # configuration options for the AutoGen Definitions output 965 #--------------------------------------------------------------------------- 966 967 # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 968 # generate an AutoGen Definitions (see autogen.sf.net) file 969 # that captures the structure of the code including all 970 # documentation. Note that this feature is still experimental 971 # and incomplete at the moment. 1825 # Configuration options related to the DOCBOOK output 1826 #--------------------------------------------------------------------------- 1827 1828 # If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files 1829 # that can be used to generate PDF. 1830 # The default value is: NO. 1831 1832 GENERATE_DOCBOOK = NO 1833 1834 # The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. 1835 # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in 1836 # front of it. 1837 # The default directory is: docbook. 1838 # This tag requires that the tag GENERATE_DOCBOOK is set to YES. 1839 1840 DOCBOOK_OUTPUT = docbook 1841 1842 # If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the 1843 # program listings (including syntax highlighting and cross-referencing 1844 # information) to the DOCBOOK output. Note that enabling this will significantly 1845 # increase the size of the DOCBOOK output. 1846 # The default value is: NO. 1847 # This tag requires that the tag GENERATE_DOCBOOK is set to YES. 1848 1849 DOCBOOK_PROGRAMLISTING = NO 1850 1851 #--------------------------------------------------------------------------- 1852 # Configuration options for the AutoGen Definitions output 1853 #--------------------------------------------------------------------------- 1854 1855 # If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen 1856 # Definitions (see http://autogen.sf.net) file that captures the structure of 1857 # the code including all documentation. Note that this feature is still 1858 # experimental and incomplete at the moment. 1859 # The default value is: NO. 972 1860 973 1861 GENERATE_AUTOGEN_DEF = NO 974 1862 975 1863 #--------------------------------------------------------------------------- 976 # configuration options related to the Perl module output977 #--------------------------------------------------------------------------- 978 979 # If the GENERATE_PERLMOD tag is set to YES Doxygen will980 # generate a Perl module file that captures the structure of981 # the code including all documentation. Note that this982 # feature is still experimental and incomplete at the983 # moment.1864 # Configuration options related to the Perl module output 1865 #--------------------------------------------------------------------------- 1866 1867 # If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module 1868 # file that captures the structure of the code including all documentation. 1869 # 1870 # Note that this feature is still experimental and incomplete at the moment. 1871 # The default value is: NO. 984 1872 985 1873 GENERATE_PERLMOD = NO 986 1874 987 # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 988 # the necessary Makefile rules, Perl scripts and LaTeX code to be able 989 # to generate PDF and DVI output from the Perl module output. 1875 # If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary 1876 # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI 1877 # output from the Perl module output. 1878 # The default value is: NO. 1879 # This tag requires that the tag GENERATE_PERLMOD is set to YES. 990 1880 991 1881 PERLMOD_LATEX = NO 992 1882 993 # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 994 # nicely formatted so it can be parsed by a human reader. This is useful 995 # if you want to understand what is going on. On the other hand, if this 996 # tag is set to NO the size of the Perl module output will be much smaller 997 # and Perl will parse it just the same. 1883 # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely 1884 # formatted so it can be parsed by a human reader. This is useful if you want to 1885 # understand what is going on. On the other hand, if this tag is set to NO the 1886 # size of the Perl module output will be much smaller and Perl will parse it 1887 # just the same. 1888 # The default value is: YES. 1889 # This tag requires that the tag GENERATE_PERLMOD is set to YES. 998 1890 999 1891 PERLMOD_PRETTY = YES 1000 1892 1001 # The names of the make variables in the generated doxyrules.make file 1002 # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1003 # This is useful so different doxyrules.make files included by the same 1004 # Makefile don't overwrite each other's variables. 1005 1006 PERLMOD_MAKEVAR_PREFIX = 1007 1008 #--------------------------------------------------------------------------- 1009 # Configuration options related to the preprocessor 1010 #--------------------------------------------------------------------------- 1011 1012 # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1013 # evaluate all C-preprocessor directives found in the sources and include 1893 # The names of the make variables in the generated doxyrules.make file are 1894 # prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful 1895 # so different doxyrules.make files included by the same Makefile don't 1896 # overwrite each other's variables. 1897 # This tag requires that the tag GENERATE_PERLMOD is set to YES. 1898 1899 PERLMOD_MAKEVAR_PREFIX = 1900 1901 #--------------------------------------------------------------------------- 1902 # Configuration options related to the preprocessor 1903 #--------------------------------------------------------------------------- 1904 1905 # If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all 1906 # C-preprocessor directives found in the sources and include files. 1907 # The default value is: YES. 1908 1909 ENABLE_PREPROCESSING = YES 1910 1911 # If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names 1912 # in the source code. If set to NO only conditional compilation will be 1913 # performed. Macro expansion can be done in a controlled way by setting 1914 # EXPAND_ONLY_PREDEF to YES. 1915 # The default value is: NO. 1916 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1917 1918 MACRO_EXPANSION = YES 1919 1920 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then 1921 # the macro expansion is limited to the macros specified with the PREDEFINED and 1922 # EXPAND_AS_DEFINED tags. 1923 # The default value is: NO. 1924 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1925 1926 EXPAND_ONLY_PREDEF = YES 1927 1928 # If the SEARCH_INCLUDES tag is set to YES the includes files in the 1929 # INCLUDE_PATH will be searched if a #include is found. 1930 # The default value is: YES. 1931 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1932 1933 SEARCH_INCLUDES = YES 1934 1935 # The INCLUDE_PATH tag can be used to specify one or more directories that 1936 # contain include files that are not input files but should be processed by the 1937 # preprocessor. 1938 # This tag requires that the tag SEARCH_INCLUDES is set to YES. 1939 1940 INCLUDE_PATH = 1941 1942 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1943 # patterns (like *.h and *.hpp) to filter out the header-files in the 1944 # directories. If left blank, the patterns specified with FILE_PATTERNS will be 1945 # used. 1946 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1947 1948 INCLUDE_FILE_PATTERNS = 1949 1950 # The PREDEFINED tag can be used to specify one or more macro names that are 1951 # defined before the preprocessor is started (similar to the -D option of e.g. 1952 # gcc). The argument of the tag is a list of macros of the form: name or 1953 # name=definition (no spaces). If the definition and the "=" are omitted, "=1" 1954 # is assumed. To prevent a macro definition from being undefined via #undef or 1955 # recursively expanded use the := operator instead of the = operator. 1956 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1957 1958 PREDEFINED = API_EXPORTED= \ 1959 LIBUSB_CALL= \ 1960 DEFAULT_VISIBILITY= 1961 1962 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this 1963 # tag can be used to specify a list of macro names that should be expanded. The 1964 # macro definition that is found in the sources will be used. Use the PREDEFINED 1965 # tag if you want to use a different macro definition that overrules the 1966 # definition found in the source code. 1967 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1968 1969 EXPAND_AS_DEFINED = 1970 1971 # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will 1972 # remove all references to function-like macros that are alone on a line, have 1973 # an all uppercase name, and do not end with a semicolon. Such function macros 1974 # are typically used for boiler-plate code, and will confuse the parser if not 1975 # removed. 1976 # The default value is: YES. 1977 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. 1978 1979 SKIP_FUNCTION_MACROS = YES 1980 1981 #--------------------------------------------------------------------------- 1982 # Configuration options related to external references 1983 #--------------------------------------------------------------------------- 1984 1985 # The TAGFILES tag can be used to specify one or more tag files. For each tag 1986 # file the location of the external documentation should be added. The format of 1987 # a tag file without this location is as follows: 1988 # TAGFILES = file1 file2 ... 1989 # Adding location for the tag files is done as follows: 1990 # TAGFILES = file1=loc1 "file2 = loc2" ... 1991 # where loc1 and loc2 can be relative or absolute paths or URLs. See the 1992 # section "Linking to external documentation" for more information about the use 1993 # of tag files. 1994 # Note: Each tag file must have a unique name (where the name does NOT include 1995 # the path). If a tag file is not located in the directory in which doxygen is 1996 # run, you must also specify the path to the tagfile here. 1997 1998 TAGFILES = 1999 2000 # When a file name is specified after GENERATE_TAGFILE, doxygen will create a 2001 # tag file that is based on the input files it reads. See section "Linking to 2002 # external documentation" for more information about the usage of tag files. 2003 2004 GENERATE_TAGFILE = 2005 2006 # If the ALLEXTERNALS tag is set to YES all external class will be listed in the 2007 # class index. If set to NO only the inherited external classes will be listed. 2008 # The default value is: NO. 2009 2010 ALLEXTERNALS = NO 2011 2012 # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in 2013 # the modules index. If set to NO, only the current project's groups will be 2014 # listed. 2015 # The default value is: YES. 2016 2017 EXTERNAL_GROUPS = YES 2018 2019 # If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in 2020 # the related pages index. If set to NO, only the current project's pages will 2021 # be listed. 2022 # The default value is: YES. 2023 2024 EXTERNAL_PAGES = YES 2025 2026 # The PERL_PATH should be the absolute path and name of the perl script 2027 # interpreter (i.e. the result of 'which perl'). 2028 # The default file (with absolute path) is: /usr/bin/perl. 2029 2030 PERL_PATH = /usr/bin/perl 2031 2032 #--------------------------------------------------------------------------- 2033 # Configuration options related to the dot tool 2034 #--------------------------------------------------------------------------- 2035 2036 # If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram 2037 # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to 2038 # NO turns the diagrams off. Note that this option also works with HAVE_DOT 2039 # disabled, but it is recommended to install and use dot, since it yields more 2040 # powerful graphs. 2041 # The default value is: YES. 2042 2043 CLASS_DIAGRAMS = YES 2044 2045 # You can define message sequence charts within doxygen comments using the \msc 2046 # command. Doxygen will then run the mscgen tool (see: 2047 # http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the 2048 # documentation. The MSCGEN_PATH tag allows you to specify the directory where 2049 # the mscgen tool resides. If left empty the tool is assumed to be found in the 2050 # default search path. 2051 2052 MSCGEN_PATH = 2053 2054 # You can include diagrams made with dia in doxygen documentation. Doxygen will 2055 # then run dia to produce the diagram and insert it in the documentation. The 2056 # DIA_PATH tag allows you to specify the directory where the dia binary resides. 2057 # If left empty dia is assumed to be found in the default search path. 2058 2059 DIA_PATH = 2060 2061 # If set to YES, the inheritance and collaboration graphs will hide inheritance 2062 # and usage relations if the target is undocumented or is not a class. 2063 # The default value is: YES. 2064 2065 HIDE_UNDOC_RELATIONS = YES 2066 2067 # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 2068 # available from the path. This tool is part of Graphviz (see: 2069 # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent 2070 # Bell Labs. The other options in this section have no effect if this option is 2071 # set to NO 2072 # The default value is: NO. 2073 2074 HAVE_DOT = NO 2075 2076 # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed 2077 # to run in parallel. When set to 0 doxygen will base this on the number of 2078 # processors available in the system. You can set it explicitly to a value 2079 # larger than 0 to get control over the balance between CPU load and processing 2080 # speed. 2081 # Minimum value: 0, maximum value: 32, default value: 0. 2082 # This tag requires that the tag HAVE_DOT is set to YES. 2083 2084 DOT_NUM_THREADS = 0 2085 2086 # When you want a differently looking font in the dot files that doxygen 2087 # generates you can specify the font name using DOT_FONTNAME. You need to make 2088 # sure dot is able to find the font, which can be done by putting it in a 2089 # standard location or by setting the DOTFONTPATH environment variable or by 2090 # setting DOT_FONTPATH to the directory containing the font. 2091 # The default value is: Helvetica. 2092 # This tag requires that the tag HAVE_DOT is set to YES. 2093 2094 DOT_FONTNAME = Helvetica 2095 2096 # The DOT_FONTSIZE tag can be used to set the size (in points) of the font of 2097 # dot graphs. 2098 # Minimum value: 4, maximum value: 24, default value: 10. 2099 # This tag requires that the tag HAVE_DOT is set to YES. 2100 2101 DOT_FONTSIZE = 10 2102 2103 # By default doxygen will tell dot to use the default font as specified with 2104 # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set 2105 # the path where dot can find it using this tag. 2106 # This tag requires that the tag HAVE_DOT is set to YES. 2107 2108 DOT_FONTPATH = 2109 2110 # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for 2111 # each documented class showing the direct and indirect inheritance relations. 2112 # Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. 2113 # The default value is: YES. 2114 # This tag requires that the tag HAVE_DOT is set to YES. 2115 2116 CLASS_GRAPH = YES 2117 2118 # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a 2119 # graph for each documented class showing the direct and indirect implementation 2120 # dependencies (inheritance, containment, and class references variables) of the 2121 # class with other documented classes. 2122 # The default value is: YES. 2123 # This tag requires that the tag HAVE_DOT is set to YES. 2124 2125 COLLABORATION_GRAPH = YES 2126 2127 # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for 2128 # groups, showing the direct groups dependencies. 2129 # The default value is: YES. 2130 # This tag requires that the tag HAVE_DOT is set to YES. 2131 2132 GROUP_GRAPHS = YES 2133 2134 # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 2135 # collaboration diagrams in a style similar to the OMG's Unified Modeling 2136 # Language. 2137 # The default value is: NO. 2138 # This tag requires that the tag HAVE_DOT is set to YES. 2139 2140 UML_LOOK = NO 2141 2142 # If the UML_LOOK tag is enabled, the fields and methods are shown inside the 2143 # class node. If there are many fields or methods and many nodes the graph may 2144 # become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the 2145 # number of items for each type to make the size more manageable. Set this to 0 2146 # for no limit. Note that the threshold may be exceeded by 50% before the limit 2147 # is enforced. So when you set the threshold to 10, up to 15 fields may appear, 2148 # but if the number exceeds 15, the total amount of fields shown is limited to 2149 # 10. 2150 # Minimum value: 0, maximum value: 100, default value: 10. 2151 # This tag requires that the tag HAVE_DOT is set to YES. 2152 2153 UML_LIMIT_NUM_FIELDS = 10 2154 2155 # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and 2156 # collaboration graphs will show the relations between templates and their 2157 # instances. 2158 # The default value is: NO. 2159 # This tag requires that the tag HAVE_DOT is set to YES. 2160 2161 TEMPLATE_RELATIONS = NO 2162 2163 # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to 2164 # YES then doxygen will generate a graph for each documented file showing the 2165 # direct and indirect include dependencies of the file with other documented 1014 2166 # files. 1015 1016 ENABLE_PREPROCESSING = YES 1017 1018 # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1019 # names in the source code. If set to NO (the default) only conditional 1020 # compilation will be performed. Macro expansion can be done in a controlled 1021 # way by setting EXPAND_ONLY_PREDEF to YES. 1022 1023 MACRO_EXPANSION = YES 1024 1025 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1026 # then the macro expansion is limited to the macros specified with the 1027 # PREDEFINED and EXPAND_AS_DEFINED tags. 1028 1029 EXPAND_ONLY_PREDEF = YES 1030 1031 # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1032 # in the INCLUDE_PATH (see below) will be search if a #include is found. 1033 1034 SEARCH_INCLUDES = YES 1035 1036 # The INCLUDE_PATH tag can be used to specify one or more directories that 1037 # contain include files that are not input files but should be processed by 1038 # the preprocessor. 1039 1040 INCLUDE_PATH = 1041 1042 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1043 # patterns (like *.h and *.hpp) to filter out the header-files in the 1044 # directories. If left blank, the patterns specified with FILE_PATTERNS will 1045 # be used. 1046 1047 INCLUDE_FILE_PATTERNS = 1048 1049 # The PREDEFINED tag can be used to specify one or more macro names that 1050 # are defined before the preprocessor is started (similar to the -D option of 1051 # gcc). The argument of the tag is a list of macros of the form: name 1052 # or name=definition (no spaces). If the definition and the = are 1053 # omitted =1 is assumed. To prevent a macro definition from being 1054 # undefined via #undef or recursively expanded use the := operator 1055 # instead of the = operator. 1056 1057 PREDEFINED = API_EXPORTED= LIBUSB_CALL= DEFAULT_VISIBILITY= 1058 1059 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1060 # this tag can be used to specify a list of macro names that should be expanded. 1061 # The macro definition that is found in the sources will be used. 1062 # Use the PREDEFINED tag if you want to use a different macro definition. 1063 1064 EXPAND_AS_DEFINED = 1065 1066 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1067 # doxygen's preprocessor will remove all function-like macros that are alone 1068 # on a line, have an all uppercase name, and do not end with a semicolon. Such 1069 # function macros are typically used for boiler-plate code, and will confuse 1070 # the parser if not removed. 1071 1072 SKIP_FUNCTION_MACROS = YES 1073 1074 #--------------------------------------------------------------------------- 1075 # Configuration::additions related to external references 1076 #--------------------------------------------------------------------------- 1077 1078 # The TAGFILES option can be used to specify one or more tagfiles. 1079 # Optionally an initial location of the external documentation 1080 # can be added for each tagfile. The format of a tag file without 1081 # this location is as follows: 1082 # TAGFILES = file1 file2 ... 1083 # Adding location for the tag files is done as follows: 1084 # TAGFILES = file1=loc1 "file2 = loc2" ... 1085 # where "loc1" and "loc2" can be relative or absolute paths or 1086 # URLs. If a location is present for each tag, the installdox tool 1087 # does not have to be run to correct the links. 1088 # Note that each tag file must have a unique name 1089 # (where the name does NOT include the path) 1090 # If a tag file is not located in the directory in which doxygen 1091 # is run, you must also specify the path to the tagfile here. 1092 1093 TAGFILES = 1094 1095 # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1096 # a tag file that is based on the input files it reads. 1097 1098 GENERATE_TAGFILE = 1099 1100 # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1101 # in the class index. If set to NO only the inherited external classes 1102 # will be listed. 1103 1104 ALLEXTERNALS = NO 1105 1106 # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1107 # in the modules index. If set to NO, only the current project's groups will 1108 # be listed. 1109 1110 EXTERNAL_GROUPS = YES 1111 1112 # The PERL_PATH should be the absolute path and name of the perl script 1113 # interpreter (i.e. the result of `which perl'). 1114 1115 PERL_PATH = /usr/bin/perl 1116 1117 #--------------------------------------------------------------------------- 1118 # Configuration options related to the dot tool 1119 #--------------------------------------------------------------------------- 1120 1121 # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1122 # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1123 # or super classes. Setting the tag to NO turns the diagrams off. Note that 1124 # this option is superseded by the HAVE_DOT option below. This is only a 1125 # fallback. It is recommended to install and use dot, since it yields more 1126 # powerful graphs. 1127 1128 CLASS_DIAGRAMS = YES 1129 1130 # You can define message sequence charts within doxygen comments using the \msc 1131 # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 1132 # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 1133 # specify the directory where the mscgen tool resides. If left empty the tool is assumed to 1134 # be found in the default search path. 1135 1136 MSCGEN_PATH = 1137 1138 # If set to YES, the inheritance and collaboration graphs will hide 1139 # inheritance and usage relations if the target is undocumented 1140 # or is not a class. 1141 1142 HIDE_UNDOC_RELATIONS = YES 1143 1144 # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1145 # available from the path. This tool is part of Graphviz, a graph visualization 1146 # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1147 # have no effect if this option is set to NO (the default) 1148 1149 HAVE_DOT = NO 1150 1151 # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1152 # will generate a graph for each documented class showing the direct and 1153 # indirect inheritance relations. Setting this tag to YES will force the 1154 # the CLASS_DIAGRAMS tag to NO. 1155 1156 CLASS_GRAPH = YES 1157 1158 # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1159 # will generate a graph for each documented class showing the direct and 1160 # indirect implementation dependencies (inheritance, containment, and 1161 # class references variables) of the class with other documented classes. 1162 1163 COLLABORATION_GRAPH = YES 1164 1165 # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1166 # will generate a graph for groups, showing the direct groups dependencies 1167 1168 GROUP_GRAPHS = YES 1169 1170 # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1171 # collaboration diagrams in a style similar to the OMG's Unified Modeling 1172 # Language. 1173 1174 UML_LOOK = NO 1175 1176 # If set to YES, the inheritance and collaboration graphs will show the 1177 # relations between templates and their instances. 1178 1179 TEMPLATE_RELATIONS = NO 1180 1181 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1182 # tags are set to YES then doxygen will generate a graph for each documented 1183 # file showing the direct and indirect include dependencies of the file with 1184 # other documented files. 2167 # The default value is: YES. 2168 # This tag requires that the tag HAVE_DOT is set to YES. 1185 2169 1186 2170 INCLUDE_GRAPH = YES 1187 2171 1188 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1189 # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1190 # documented header file showing the documented files that directly or 1191 # indirectly include this file. 2172 # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are 2173 # set to YES then doxygen will generate a graph for each documented file showing 2174 # the direct and indirect include dependencies of the file with other documented 2175 # files. 2176 # The default value is: YES. 2177 # This tag requires that the tag HAVE_DOT is set to YES. 1192 2178 1193 2179 INCLUDED_BY_GRAPH = YES 1194 2180 1195 # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 1196 # generate a call dependency graph for every global function or class method. 1197 # Note that enabling this option will significantly increase the time of a run. 1198 # So in most cases it will be better to enable call graphs for selected 2181 # If the CALL_GRAPH tag is set to YES then doxygen will generate a call 2182 # dependency graph for every global function or class method. 2183 # 2184 # Note that enabling this option will significantly increase the time of a run. 2185 # So in most cases it will be better to enable call graphs for selected 1199 2186 # functions only using the \callgraph command. 2187 # The default value is: NO. 2188 # This tag requires that the tag HAVE_DOT is set to YES. 1200 2189 1201 2190 CALL_GRAPH = NO 1202 2191 1203 # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 1204 # generate a caller dependency graph for every global function or class method. 1205 # Note that enabling this option will significantly increase the time of a run. 1206 # So in most cases it will be better to enable caller graphs for selected 2192 # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller 2193 # dependency graph for every global function or class method. 2194 # 2195 # Note that enabling this option will significantly increase the time of a run. 2196 # So in most cases it will be better to enable caller graphs for selected 1207 2197 # functions only using the \callergraph command. 2198 # The default value is: NO. 2199 # This tag requires that the tag HAVE_DOT is set to YES. 1208 2200 1209 2201 CALLER_GRAPH = NO 1210 2202 1211 # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1212 # will graphical hierarchy of all classes instead of a textual one. 2203 # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical 2204 # hierarchy of all classes instead of a textual one. 2205 # The default value is: YES. 2206 # This tag requires that the tag HAVE_DOT is set to YES. 1213 2207 1214 2208 GRAPHICAL_HIERARCHY = YES 1215 2209 1216 # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1217 # then doxygen will show the dependencies a directory has on other directories 1218 # in a graphical way. The dependency relations are determined by the #include 1219 # relations between the files in the directories. 2210 # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the 2211 # dependencies a directory has on other directories in a graphical way. The 2212 # dependency relations are determined by the #include relations between the 2213 # files in the directories. 2214 # The default value is: YES. 2215 # This tag requires that the tag HAVE_DOT is set to YES. 1220 2216 1221 2217 DIRECTORY_GRAPH = YES 1222 2218 1223 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1224 # generated by dot. Possible values are png, jpg, or gif 1225 # If left blank png will be used. 2219 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 2220 # generated by dot. 2221 # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order 2222 # to make the SVG files visible in IE 9+ (other browsers do not have this 2223 # requirement). 2224 # Possible values are: png, jpg, gif and svg. 2225 # The default value is: png. 2226 # This tag requires that the tag HAVE_DOT is set to YES. 1226 2227 1227 2228 DOT_IMAGE_FORMAT = png 1228 2229 1229 # The tag DOT_PATH can be used to specify the path where the dot tool can be 2230 # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to 2231 # enable generation of interactive SVG images that allow zooming and panning. 2232 # 2233 # Note that this requires a modern browser other than Internet Explorer. Tested 2234 # and working are Firefox, Chrome, Safari, and Opera. 2235 # Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make 2236 # the SVG files visible. Older versions of IE do not have SVG support. 2237 # The default value is: NO. 2238 # This tag requires that the tag HAVE_DOT is set to YES. 2239 2240 INTERACTIVE_SVG = NO 2241 2242 # The DOT_PATH tag can be used to specify the path where the dot tool can be 1230 2243 # found. If left blank, it is assumed the dot tool can be found in the path. 1231 1232 DOT_PATH = 1233 1234 # The DOTFILE_DIRS tag can be used to specify one or more directories that 1235 # contain dot files that are included in the documentation (see the 1236 # \dotfile command). 1237 1238 DOTFILE_DIRS = 1239 1240 # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1241 # nodes that will be shown in the graph. If the number of nodes in a graph 1242 # becomes larger than this value, doxygen will truncate the graph, which is 1243 # visualized by representing a node as a red box. Note that doxygen if the number 1244 # of direct children of the root node in a graph is already larger than 1245 # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note 1246 # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 2244 # This tag requires that the tag HAVE_DOT is set to YES. 2245 2246 DOT_PATH = 2247 2248 # The DOTFILE_DIRS tag can be used to specify one or more directories that 2249 # contain dot files that are included in the documentation (see the \dotfile 2250 # command). 2251 # This tag requires that the tag HAVE_DOT is set to YES. 2252 2253 DOTFILE_DIRS = 2254 2255 # The MSCFILE_DIRS tag can be used to specify one or more directories that 2256 # contain msc files that are included in the documentation (see the \mscfile 2257 # command). 2258 2259 MSCFILE_DIRS = 2260 2261 # The DIAFILE_DIRS tag can be used to specify one or more directories that 2262 # contain dia files that are included in the documentation (see the \diafile 2263 # command). 2264 2265 DIAFILE_DIRS = 2266 2267 # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the 2268 # path where java can find the plantuml.jar file. If left blank, it is assumed 2269 # PlantUML is not used or called during a preprocessing step. Doxygen will 2270 # generate a warning when it encounters a \startuml command in this case and 2271 # will not generate output for the diagram. 2272 # This tag requires that the tag HAVE_DOT is set to YES. 2273 2274 PLANTUML_JAR_PATH = 2275 2276 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes 2277 # that will be shown in the graph. If the number of nodes in a graph becomes 2278 # larger than this value, doxygen will truncate the graph, which is visualized 2279 # by representing a node as a red box. Note that doxygen if the number of direct 2280 # children of the root node in a graph is already larger than 2281 # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that 2282 # the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 2283 # Minimum value: 0, maximum value: 10000, default value: 50. 2284 # This tag requires that the tag HAVE_DOT is set to YES. 1247 2285 1248 2286 DOT_GRAPH_MAX_NODES = 50 1249 2287 1250 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1251 # g raphs generated by dot. A depth value of 3 means that only nodes reachable1252 # from the root by following a path via at most 3 edges will be shown. Nodes1253 # that lay further from the root node will be omitted. Note that setting this1254 # o ption to 1 or 2 may greatly reduce the computation time needed for large1255 # code bases. Also note that the size of a graph can be further restricted by2288 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs 2289 # generated by dot. A depth value of 3 means that only nodes reachable from the 2290 # root by following a path via at most 3 edges will be shown. Nodes that lay 2291 # further from the root node will be omitted. Note that setting this option to 1 2292 # or 2 may greatly reduce the computation time needed for large code bases. Also 2293 # note that the size of a graph can be further restricted by 1256 2294 # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 2295 # Minimum value: 0, maximum value: 1000, default value: 0. 2296 # This tag requires that the tag HAVE_DOT is set to YES. 1257 2297 1258 2298 MAX_DOT_GRAPH_DEPTH = 0 1259 2299 1260 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1261 # background. This is disabled by default, which results in a white background. 1262 # Warning: Depending on the platform used, enabling this option may lead to 1263 # badly anti-aliased labels on the edges of a graph (i.e. they become hard to 2300 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 2301 # background. This is disabled by default, because dot on Windows does not seem 2302 # to support this out of the box. 2303 # 2304 # Warning: Depending on the platform used, enabling this option may lead to 2305 # badly anti-aliased labels on the edges of a graph (i.e. they become hard to 1264 2306 # read). 2307 # The default value is: NO. 2308 # This tag requires that the tag HAVE_DOT is set to YES. 1265 2309 1266 2310 DOT_TRANSPARENT = NO 1267 2311 1268 # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1269 # files in one run (i.e. multiple -o and -T options on the command line). This 1270 # makes dot run faster, but since only newer versions of dot (>1.8.10) 1271 # support this, this feature is disabled by default. 2312 # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 2313 # files in one run (i.e. multiple -o and -T options on the command line). This 2314 # makes dot run faster, but since only newer versions of dot (>1.8.10) support 2315 # this, this feature is disabled by default. 2316 # The default value is: NO. 2317 # This tag requires that the tag HAVE_DOT is set to YES. 1272 2318 1273 2319 DOT_MULTI_TARGETS = NO 1274 2320 1275 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1276 # generate a legend page explaining the meaning of the various boxes and 1277 # arrows in the dot generated graphs. 2321 # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page 2322 # explaining the meaning of the various boxes and arrows in the dot generated 2323 # graphs. 2324 # The default value is: YES. 2325 # This tag requires that the tag HAVE_DOT is set to YES. 1278 2326 1279 2327 GENERATE_LEGEND = YES 1280 2328 1281 # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1282 # remove the intermediate dot files that are used to generate 1283 # the various graphs. 2329 # If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot 2330 # files that are used to generate the various graphs. 2331 # The default value is: YES. 2332 # This tag requires that the tag HAVE_DOT is set to YES. 1284 2333 1285 2334 DOT_CLEANUP = YES 1286 1287 #---------------------------------------------------------------------------1288 # Configuration::additions related to the search engine1289 #---------------------------------------------------------------------------1290 1291 # The SEARCHENGINE tag specifies whether or not a search engine should be1292 # used. If set to NO the values of all tags below this one will be ignored.1293 1294 SEARCHENGINE = NO -
TabularUnified libusb1/trunk/examples/Makefile.am ¶
r1876 r1882 1 1 AM_CPPFLAGS = -I$(top_srcdir)/libusb 2 2 LDADD = ../libusb/libusb-1.0.la 3 noinst_PROGRAMS = listdevs hotplugtest testlibusb1 3 4 noinst_PROGRAMS = listdevs xusb fxload hotplugtest testlibusb 4 5 5 6 if HAVE_SIGACTION … … 7 8 8 9 if THREADS_POSIX 9 dpfp_threaded_CFLAGS = $( THREAD_CFLAGS) $(AM_CFLAGS)10 dpfp_threaded_CFLAGS = $(AM_CFLAGS) 10 11 noinst_PROGRAMS += dpfp_threaded 11 12 endif … … 14 15 noinst_PROGRAMS += sam3u_benchmark 15 16 endif 17 18 fxload_SOURCES = ezusb.c ezusb.h fxload.c 19 fxload_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) -
TabularUnified libusb1/trunk/examples/Makefile.in ¶
r1879 r1882 1 # Makefile.in generated by automake 1.1 1.1 from Makefile.am.1 # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 # Inc. 4 # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 7 6 # This Makefile.in is free software; the Free Software Foundation 8 7 # gives unlimited permission to copy and/or distribute it, … … 17 16 18 17 VPATH = @srcdir@ 18 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 19 am__make_running_with_option = \ 20 case $${target_option-} in \ 21 ?) ;; \ 22 *) echo "am__make_running_with_option: internal error: invalid" \ 23 "target option '$${target_option-}' specified" >&2; \ 24 exit 1;; \ 25 esac; \ 26 has_opt=no; \ 27 sane_makeflags=$$MAKEFLAGS; \ 28 if $(am__is_gnu_make); then \ 29 sane_makeflags=$$MFLAGS; \ 30 else \ 31 case $$MAKEFLAGS in \ 32 *\\[\ \ ]*) \ 33 bs=\\; \ 34 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 35 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 36 esac; \ 37 fi; \ 38 skip_next=no; \ 39 strip_trailopt () \ 40 { \ 41 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 42 }; \ 43 for flg in $$sane_makeflags; do \ 44 test $$skip_next = yes && { skip_next=no; continue; }; \ 45 case $$flg in \ 46 *=*|--*) continue;; \ 47 -*I) strip_trailopt 'I'; skip_next=yes;; \ 48 -*I?*) strip_trailopt 'I';; \ 49 -*O) strip_trailopt 'O'; skip_next=yes;; \ 50 -*O?*) strip_trailopt 'O';; \ 51 -*l) strip_trailopt 'l'; skip_next=yes;; \ 52 -*l?*) strip_trailopt 'l';; \ 53 -[dEDm]) skip_next=yes;; \ 54 -[JT]) skip_next=yes;; \ 55 esac; \ 56 case $$flg in \ 57 *$$target_option*) has_opt=yes; break;; \ 58 esac; \ 59 done; \ 60 test $$has_opt = yes 61 am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 62 am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 19 63 pkgdatadir = $(datadir)/@PACKAGE@ 20 64 pkgincludedir = $(includedir)/@PACKAGE@ … … 35 79 build_triplet = @build@ 36 80 host_triplet = @host@ 37 noinst_PROGRAMS = listdevs$(EXEEXT) hotplugtest$(EXEEXT) \38 testlibusb1$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \39 $(am__EXEEXT_ 3)81 noinst_PROGRAMS = listdevs$(EXEEXT) xusb$(EXEEXT) fxload$(EXEEXT) \ 82 hotplugtest$(EXEEXT) testlibusb$(EXEEXT) $(am__EXEEXT_1) \ 83 $(am__EXEEXT_2) $(am__EXEEXT_3) 40 84 @HAVE_SIGACTION_TRUE@am__append_1 = dpfp 41 85 @HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am__append_2 = dpfp_threaded 42 86 @HAVE_SIGACTION_TRUE@am__append_3 = sam3u_benchmark 43 87 subdir = examples 44 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 88 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 89 $(top_srcdir)/depcomp 45 90 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 46 91 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ … … 62 107 dpfp_LDADD = $(LDADD) 63 108 dpfp_DEPENDENCIES = ../libusb/libusb-1.0.la 64 AM_V_lt = $(am__v_lt_ $(V))65 am__v_lt_ = $(am__v_lt_ $(AM_DEFAULT_VERBOSITY))109 AM_V_lt = $(am__v_lt_@AM_V@) 110 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 66 111 am__v_lt_0 = --silent 112 am__v_lt_1 = 67 113 dpfp_threaded_SOURCES = dpfp_threaded.c 68 114 dpfp_threaded_OBJECTS = dpfp_threaded-dpfp_threaded.$(OBJEXT) … … 72 118 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dpfp_threaded_CFLAGS) \ 73 119 $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 120 am_fxload_OBJECTS = fxload-ezusb.$(OBJEXT) fxload-fxload.$(OBJEXT) 121 fxload_OBJECTS = $(am_fxload_OBJECTS) 122 fxload_LDADD = $(LDADD) 123 fxload_DEPENDENCIES = ../libusb/libusb-1.0.la 124 fxload_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 125 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(fxload_CFLAGS) $(CFLAGS) \ 126 $(AM_LDFLAGS) $(LDFLAGS) -o $@ 74 127 hotplugtest_SOURCES = hotplugtest.c 75 128 hotplugtest_OBJECTS = hotplugtest.$(OBJEXT) … … 86 139 sam3u_benchmark_LDADD = $(LDADD) 87 140 sam3u_benchmark_DEPENDENCIES = ../libusb/libusb-1.0.la 88 testlibusb1_SOURCES = testlibusb1.c 89 testlibusb1_OBJECTS = testlibusb1.$(OBJEXT) 90 testlibusb1_LDADD = $(LDADD) 91 testlibusb1_DEPENDENCIES = ../libusb/libusb-1.0.la 141 testlibusb_SOURCES = testlibusb.c 142 testlibusb_OBJECTS = testlibusb.$(OBJEXT) 143 testlibusb_LDADD = $(LDADD) 144 testlibusb_DEPENDENCIES = ../libusb/libusb-1.0.la 145 xusb_SOURCES = xusb.c 146 xusb_OBJECTS = xusb.$(OBJEXT) 147 xusb_LDADD = $(LDADD) 148 xusb_DEPENDENCIES = ../libusb/libusb-1.0.la 149 AM_V_P = $(am__v_P_@AM_V@) 150 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 151 am__v_P_0 = false 152 am__v_P_1 = : 153 AM_V_GEN = $(am__v_GEN_@AM_V@) 154 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 155 am__v_GEN_0 = @echo " GEN " $@; 156 am__v_GEN_1 = 157 AM_V_at = $(am__v_at_@AM_V@) 158 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 159 am__v_at_0 = @ 160 am__v_at_1 = 92 161 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 93 162 depcomp = $(SHELL) $(top_srcdir)/depcomp … … 100 169 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 101 170 $(AM_CFLAGS) $(CFLAGS) 102 AM_V_CC = $(am__v_CC_$(V)) 103 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) 104 am__v_CC_0 = @echo " CC " $@; 105 AM_V_at = $(am__v_at_$(V)) 106 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) 107 am__v_at_0 = @ 171 AM_V_CC = $(am__v_CC_@AM_V@) 172 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 173 am__v_CC_0 = @echo " CC " $@; 174 am__v_CC_1 = 108 175 CCLD = $(CC) 109 176 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 110 177 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 111 178 $(AM_LDFLAGS) $(LDFLAGS) -o $@ 112 AM_V_CCLD = $(am__v_CCLD_$(V)) 113 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) 114 am__v_CCLD_0 = @echo " CCLD " $@; 115 AM_V_GEN = $(am__v_GEN_$(V)) 116 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) 117 am__v_GEN_0 = @echo " GEN " $@; 118 SOURCES = dpfp.c dpfp_threaded.c hotplugtest.c listdevs.c \ 119 $(sam3u_benchmark_SOURCES) testlibusb1.c 120 DIST_SOURCES = dpfp.c dpfp_threaded.c hotplugtest.c listdevs.c \ 121 $(am__sam3u_benchmark_SOURCES_DIST) testlibusb1.c 179 AM_V_CCLD = $(am__v_CCLD_@AM_V@) 180 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 181 am__v_CCLD_0 = @echo " CCLD " $@; 182 am__v_CCLD_1 = 183 SOURCES = dpfp.c dpfp_threaded.c $(fxload_SOURCES) hotplugtest.c \ 184 listdevs.c $(sam3u_benchmark_SOURCES) testlibusb.c xusb.c 185 DIST_SOURCES = dpfp.c dpfp_threaded.c $(fxload_SOURCES) hotplugtest.c \ 186 listdevs.c $(am__sam3u_benchmark_SOURCES_DIST) testlibusb.c \ 187 xusb.c 188 am__can_run_installinfo = \ 189 case $$AM_UPDATE_INFO_DIR in \ 190 n|no|NO) false;; \ 191 *) (install-info --version) >/dev/null 2>&1;; \ 192 esac 193 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 194 # Read a list of newline-separated strings from the standard input, 195 # and print each of them once, without duplicates. Input order is 196 # *not* preserved. 197 am__uniquify_input = $(AWK) '\ 198 BEGIN { nonempty = 0; } \ 199 { items[$$0] = 1; nonempty = 1; } \ 200 END { if (nonempty) { for (i in items) print i; }; } \ 201 ' 202 # Make sure the list of sources is unique. This is necessary because, 203 # e.g., the same source file might be shared among _SOURCES variables 204 # for different programs/libraries. 205 am__define_uniq_tagged_files = \ 206 list='$(am__tagged_files)'; \ 207 unique=`for i in $$list; do \ 208 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 209 done | $(am__uniquify_input)` 122 210 ETAGS = etags 123 211 CTAGS = ctags … … 137 225 CPP = @CPP@ 138 226 CPPFLAGS = @CPPFLAGS@ 227 CXX = @CXX@ 228 CXXCPP = @CXXCPP@ 229 CXXDEPMODE = @CXXDEPMODE@ 230 CXXFLAGS = @CXXFLAGS@ 139 231 CYGPATH_W = @CYGPATH_W@ 140 232 DEFS = @DEFS@ … … 164 256 LTLDFLAGS = @LTLDFLAGS@ 165 257 LTLIBOBJS = @LTLIBOBJS@ 166 MAINT = @MAINT@167 258 MAKEINFO = @MAKEINFO@ 168 259 MANIFEST_TOOL = @MANIFEST_TOOL@ … … 173 264 OBJEXT = @OBJEXT@ 174 265 OS_DARWIN = @OS_DARWIN@ 266 OS_HAIKU = @OS_HAIKU@ 175 267 OS_LINUX = @OS_LINUX@ 268 OS_NETBSD = @OS_NETBSD@ 176 269 OS_OPENBSD = @OS_OPENBSD@ 177 OS_ OS2 = @OS_OS2@270 OS_SUNOS = @OS_SUNOS@ 178 271 OS_WINDOWS = @OS_WINDOWS@ 179 272 OTOOL = @OTOOL@ … … 187 280 PACKAGE_VERSION = @PACKAGE_VERSION@ 188 281 PATH_SEPARATOR = @PATH_SEPARATOR@ 189 PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@190 282 RANLIB = @RANLIB@ 191 283 RC = @RC@ … … 194 286 SHELL = @SHELL@ 195 287 STRIP = @STRIP@ 196 THREAD_CFLAGS = @THREAD_CFLAGS@197 288 USE_UDEV = @USE_UDEV@ 289 USE_USBDK = @USE_USBDK@ 198 290 VERSION = @VERSION@ 199 VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@200 291 abs_builddir = @abs_builddir@ 201 292 abs_srcdir = @abs_srcdir@ … … 204 295 ac_ct_AR = @ac_ct_AR@ 205 296 ac_ct_CC = @ac_ct_CC@ 297 ac_ct_CXX = @ac_ct_CXX@ 206 298 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 207 299 am__include = @am__include@ … … 252 344 AM_CPPFLAGS = -I$(top_srcdir)/libusb 253 345 LDADD = ../libusb/libusb-1.0.la 254 @HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_CFLAGS = $( THREAD_CFLAGS) $(AM_CFLAGS)346 @HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_CFLAGS = $(AM_CFLAGS) 255 347 @HAVE_SIGACTION_TRUE@sam3u_benchmark_SOURCES = sam3u_benchmark.c 348 fxload_SOURCES = ezusb.c ezusb.h fxload.c 349 fxload_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) 256 350 all: all-am 257 351 258 352 .SUFFIXES: 259 353 .SUFFIXES: .c .lo .o .obj 260 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)354 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 261 355 @for dep in $?; do \ 262 356 case '$(am__configure_deps)' in \ … … 283 377 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 284 378 285 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)379 $(top_srcdir)/configure: $(am__configure_deps) 286 380 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 287 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)381 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 288 382 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 289 383 $(am__aclocal_m4_deps): … … 297 391 echo " rm -f" $$list; \ 298 392 rm -f $$list 299 dpfp$(EXEEXT): $(dpfp_OBJECTS) $(dpfp_DEPENDENCIES) 393 394 dpfp$(EXEEXT): $(dpfp_OBJECTS) $(dpfp_DEPENDENCIES) $(EXTRA_dpfp_DEPENDENCIES) 300 395 @rm -f dpfp$(EXEEXT) 301 396 $(AM_V_CCLD)$(LINK) $(dpfp_OBJECTS) $(dpfp_LDADD) $(LIBS) 302 dpfp_threaded$(EXEEXT): $(dpfp_threaded_OBJECTS) $(dpfp_threaded_DEPENDENCIES) 397 398 dpfp_threaded$(EXEEXT): $(dpfp_threaded_OBJECTS) $(dpfp_threaded_DEPENDENCIES) $(EXTRA_dpfp_threaded_DEPENDENCIES) 303 399 @rm -f dpfp_threaded$(EXEEXT) 304 400 $(AM_V_CCLD)$(dpfp_threaded_LINK) $(dpfp_threaded_OBJECTS) $(dpfp_threaded_LDADD) $(LIBS) 305 hotplugtest$(EXEEXT): $(hotplugtest_OBJECTS) $(hotplugtest_DEPENDENCIES) 401 402 fxload$(EXEEXT): $(fxload_OBJECTS) $(fxload_DEPENDENCIES) $(EXTRA_fxload_DEPENDENCIES) 403 @rm -f fxload$(EXEEXT) 404 $(AM_V_CCLD)$(fxload_LINK) $(fxload_OBJECTS) $(fxload_LDADD) $(LIBS) 405 406 hotplugtest$(EXEEXT): $(hotplugtest_OBJECTS) $(hotplugtest_DEPENDENCIES) $(EXTRA_hotplugtest_DEPENDENCIES) 306 407 @rm -f hotplugtest$(EXEEXT) 307 408 $(AM_V_CCLD)$(LINK) $(hotplugtest_OBJECTS) $(hotplugtest_LDADD) $(LIBS) 308 listdevs$(EXEEXT): $(listdevs_OBJECTS) $(listdevs_DEPENDENCIES) 409 410 listdevs$(EXEEXT): $(listdevs_OBJECTS) $(listdevs_DEPENDENCIES) $(EXTRA_listdevs_DEPENDENCIES) 309 411 @rm -f listdevs$(EXEEXT) 310 412 $(AM_V_CCLD)$(LINK) $(listdevs_OBJECTS) $(listdevs_LDADD) $(LIBS) 311 sam3u_benchmark$(EXEEXT): $(sam3u_benchmark_OBJECTS) $(sam3u_benchmark_DEPENDENCIES) 413 414 sam3u_benchmark$(EXEEXT): $(sam3u_benchmark_OBJECTS) $(sam3u_benchmark_DEPENDENCIES) $(EXTRA_sam3u_benchmark_DEPENDENCIES) 312 415 @rm -f sam3u_benchmark$(EXEEXT) 313 416 $(AM_V_CCLD)$(LINK) $(sam3u_benchmark_OBJECTS) $(sam3u_benchmark_LDADD) $(LIBS) 314 testlibusb1$(EXEEXT): $(testlibusb1_OBJECTS) $(testlibusb1_DEPENDENCIES) 315 @rm -f testlibusb1$(EXEEXT) 316 $(AM_V_CCLD)$(LINK) $(testlibusb1_OBJECTS) $(testlibusb1_LDADD) $(LIBS) 417 418 testlibusb$(EXEEXT): $(testlibusb_OBJECTS) $(testlibusb_DEPENDENCIES) $(EXTRA_testlibusb_DEPENDENCIES) 419 @rm -f testlibusb$(EXEEXT) 420 $(AM_V_CCLD)$(LINK) $(testlibusb_OBJECTS) $(testlibusb_LDADD) $(LIBS) 421 422 xusb$(EXEEXT): $(xusb_OBJECTS) $(xusb_DEPENDENCIES) $(EXTRA_xusb_DEPENDENCIES) 423 @rm -f xusb$(EXEEXT) 424 $(AM_V_CCLD)$(LINK) $(xusb_OBJECTS) $(xusb_LDADD) $(LIBS) 317 425 318 426 mostlyclean-compile: … … 324 432 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp.Po@am__quote@ 325 433 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp_threaded-dpfp_threaded.Po@am__quote@ 434 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fxload-ezusb.Po@am__quote@ 435 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fxload-fxload.Po@am__quote@ 326 436 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hotplugtest.Po@am__quote@ 327 437 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listdevs.Po@am__quote@ 328 438 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sam3u_benchmark.Po@am__quote@ 329 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlibusb1.Po@am__quote@ 439 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlibusb.Po@am__quote@ 440 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xusb.Po@am__quote@ 330 441 331 442 .c.o: 332 443 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 333 444 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 334 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 335 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 336 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 337 @am__fastdepCC_FALSE@ $(COMPILE) -c $< 445 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 446 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 447 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< 338 448 339 449 .c.obj: 340 450 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 341 451 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 342 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 343 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 344 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 345 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 452 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 453 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 454 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 346 455 347 456 .c.lo: 348 457 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 349 458 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo 350 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 351 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 352 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 353 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< 459 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 460 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 461 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< 354 462 355 463 dpfp_threaded-dpfp_threaded.o: dpfp_threaded.c 356 464 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.o -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c 357 465 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po 358 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 359 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.o' libtool=no @AMDEPBACKSLASH@ 360 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 361 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c 466 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.o' libtool=no @AMDEPBACKSLASH@ 467 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 468 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c 362 469 363 470 dpfp_threaded-dpfp_threaded.obj: dpfp_threaded.c 364 471 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.obj -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` 365 472 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po 366 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 367 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.obj' libtool=no @AMDEPBACKSLASH@ 368 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 369 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` 473 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.obj' libtool=no @AMDEPBACKSLASH@ 474 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 475 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` 476 477 fxload-ezusb.o: ezusb.c 478 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-ezusb.o -MD -MP -MF $(DEPDIR)/fxload-ezusb.Tpo -c -o fxload-ezusb.o `test -f 'ezusb.c' || echo '$(srcdir)/'`ezusb.c 479 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-ezusb.Tpo $(DEPDIR)/fxload-ezusb.Po 480 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ezusb.c' object='fxload-ezusb.o' libtool=no @AMDEPBACKSLASH@ 481 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 482 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-ezusb.o `test -f 'ezusb.c' || echo '$(srcdir)/'`ezusb.c 483 484 fxload-ezusb.obj: ezusb.c 485 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-ezusb.obj -MD -MP -MF $(DEPDIR)/fxload-ezusb.Tpo -c -o fxload-ezusb.obj `if test -f 'ezusb.c'; then $(CYGPATH_W) 'ezusb.c'; else $(CYGPATH_W) '$(srcdir)/ezusb.c'; fi` 486 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-ezusb.Tpo $(DEPDIR)/fxload-ezusb.Po 487 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ezusb.c' object='fxload-ezusb.obj' libtool=no @AMDEPBACKSLASH@ 488 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 489 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-ezusb.obj `if test -f 'ezusb.c'; then $(CYGPATH_W) 'ezusb.c'; else $(CYGPATH_W) '$(srcdir)/ezusb.c'; fi` 490 491 fxload-fxload.o: fxload.c 492 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-fxload.o -MD -MP -MF $(DEPDIR)/fxload-fxload.Tpo -c -o fxload-fxload.o `test -f 'fxload.c' || echo '$(srcdir)/'`fxload.c 493 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-fxload.Tpo $(DEPDIR)/fxload-fxload.Po 494 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fxload.c' object='fxload-fxload.o' libtool=no @AMDEPBACKSLASH@ 495 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 496 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-fxload.o `test -f 'fxload.c' || echo '$(srcdir)/'`fxload.c 497 498 fxload-fxload.obj: fxload.c 499 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -MT fxload-fxload.obj -MD -MP -MF $(DEPDIR)/fxload-fxload.Tpo -c -o fxload-fxload.obj `if test -f 'fxload.c'; then $(CYGPATH_W) 'fxload.c'; else $(CYGPATH_W) '$(srcdir)/fxload.c'; fi` 500 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fxload-fxload.Tpo $(DEPDIR)/fxload-fxload.Po 501 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fxload.c' object='fxload-fxload.obj' libtool=no @AMDEPBACKSLASH@ 502 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 503 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fxload_CFLAGS) $(CFLAGS) -c -o fxload-fxload.obj `if test -f 'fxload.c'; then $(CYGPATH_W) 'fxload.c'; else $(CYGPATH_W) '$(srcdir)/fxload.c'; fi` 370 504 371 505 mostlyclean-libtool: … … 375 509 -rm -rf .libs _libs 376 510 377 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 378 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 379 unique=`for i in $$list; do \ 380 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 381 done | \ 382 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 383 END { if (nonempty) { for (i in files) print i; }; }'`; \ 384 mkid -fID $$unique 385 tags: TAGS 386 387 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 388 $(TAGS_FILES) $(LISP) 511 ID: $(am__tagged_files) 512 $(am__define_uniq_tagged_files); mkid -fID $$unique 513 tags: tags-am 514 TAGS: tags 515 516 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 389 517 set x; \ 390 518 here=`pwd`; \ 391 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 392 unique=`for i in $$list; do \ 393 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 394 done | \ 395 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 396 END { if (nonempty) { for (i in files) print i; }; }'`; \ 519 $(am__define_uniq_tagged_files); \ 397 520 shift; \ 398 521 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ … … 406 529 fi; \ 407 530 fi 408 ctags: CTAGS 409 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 410 $(TAGS_FILES) $(LISP) 411 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 412 unique=`for i in $$list; do \ 413 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 414 done | \ 415 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 416 END { if (nonempty) { for (i in files) print i; }; }'`; \ 531 ctags: ctags-am 532 533 CTAGS: ctags 534 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 535 $(am__define_uniq_tagged_files); \ 417 536 test -z "$(CTAGS_ARGS)$$unique" \ 418 537 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ … … 423 542 && $(am__cd) $(top_srcdir) \ 424 543 && gtags -i $(GTAGS_ARGS) "$$here" 544 cscopelist: cscopelist-am 545 546 cscopelist-am: $(am__tagged_files) 547 list='$(am__tagged_files)'; \ 548 case "$(srcdir)" in \ 549 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 550 *) sdir=$(subdir)/$(srcdir) ;; \ 551 esac; \ 552 for i in $$list; do \ 553 if test -f "$$i"; then \ 554 echo "$(subdir)/$$i"; \ 555 else \ 556 echo "$$sdir/$$i"; \ 557 fi; \ 558 done >> $(top_builddir)/cscope.files 425 559 426 560 distclean-tags: … … 471 605 installcheck: installcheck-am 472 606 install-strip: 473 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 474 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 475 `test -z '$(STRIP)' || \ 476 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 607 if test -z '$(STRIP)'; then \ 608 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 609 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 610 install; \ 611 else \ 612 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 613 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 614 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 615 fi 477 616 mostlyclean-generic: 478 617 … … 559 698 .MAKE: install-am install-strip 560 699 561 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 562 clean-libtool clean-noinstPROGRAMS ctags distclean \ 563 distclean-compile distclean-generic distclean-libtool \ 564 distclean-tags distdir dvi dvi-am html html-am info info-am \ 565 install install-am install-data install-data-am install-dvi \ 566 install-dvi-am install-exec install-exec-am install-html \ 567 install-html-am install-info install-info-am install-man \ 568 install-pdf install-pdf-am install-ps install-ps-am \ 569 install-strip installcheck installcheck-am installdirs \ 570 maintainer-clean maintainer-clean-generic mostlyclean \ 571 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ 572 pdf pdf-am ps ps-am tags uninstall uninstall-am 700 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ 701 clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ 702 ctags-am distclean distclean-compile distclean-generic \ 703 distclean-libtool distclean-tags distdir dvi dvi-am html \ 704 html-am info info-am install install-am install-data \ 705 install-data-am install-dvi install-dvi-am install-exec \ 706 install-exec-am install-html install-html-am install-info \ 707 install-info-am install-man install-pdf install-pdf-am \ 708 install-ps install-ps-am install-strip installcheck \ 709 installcheck-am installdirs maintainer-clean \ 710 maintainer-clean-generic mostlyclean mostlyclean-compile \ 711 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 712 tags tags-am uninstall uninstall-am 573 713 574 714 -
TabularUnified libusb1/trunk/examples/dpfp.c ¶
r1876 r1882 1 1 /* 2 2 * libusb example program to manipulate U.are.U 4000B fingerprint scanner. 3 * Copyright (C)2007 Daniel Drake <dsd@gentoo.org>3 * Copyright © 2007 Daniel Drake <dsd@gentoo.org> 4 4 * 5 5 * Basic image capture program only, does not consider the powerup quirks or … … 28 28 #include <stdlib.h> 29 29 30 #include <libusb.h>30 #include "libusb.h" 31 31 32 32 #define EP_INTR (1 | LIBUSB_ENDPOINT_IN) … … 165 165 static int set_mode_async(unsigned char data) 166 166 { 167 unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);167 unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); 168 168 struct libusb_transfer *transfer; 169 169 … … 505 505 return r >= 0 ? r : -r; 506 506 } 507 -
TabularUnified libusb1/trunk/examples/dpfp_threaded.c ¶
r1876 r1882 1 1 /* 2 2 * libusb example program to manipulate U.are.U 4000B fingerprint scanner. 3 * Copyright (C) 2007 Daniel Drake <dsd@gentoo.org> 3 * Copyright © 2007 Daniel Drake <dsd@gentoo.org> 4 * Copyright © 2016 Nathan Hjelm <hjelmn@mac.com> 4 5 * 5 6 * Basic image capture program only, does not consider the powerup quirks or … … 24 25 #include <errno.h> 25 26 #include <pthread.h> 27 #include <semaphore.h> 26 28 #include <signal.h> 27 29 #include <string.h> 28 30 #include <stdio.h> 29 31 #include <stdlib.h> 30 31 #include <libusb.h> 32 #include <fcntl.h> 33 34 #include "libusb.h" 32 35 33 36 #define EP_INTR (1 | LIBUSB_ENDPOINT_IN) … … 37 40 #define USB_RQ 0x04 38 41 #define INTR_LENGTH 64 42 #define SEM_NAME "/org.libusb.example.dpfp_threaded" 39 43 40 44 enum { … … 65 69 static struct libusb_transfer *irq_transfer = NULL; 66 70 static int img_idx = 0; 67 static int do_exit = 0;71 static volatile sig_atomic_t do_exit = 0; 68 72 69 73 static pthread_t poll_thread; 70 static pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER; 71 static pthread_mutex_t exit_cond_lock = PTHREAD_MUTEX_INITIALIZER; 72 73 static void request_exit(int code) 74 static sem_t *exit_sem; 75 76 static void request_exit(sig_atomic_t code) 74 77 { 75 78 do_exit = code; 76 pthread_cond_signal(&exit_cond);79 sem_post(exit_sem); 77 80 } 78 81 … … 194 197 static int set_mode_async(unsigned char data) 195 198 { 196 unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);199 unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); 197 200 struct libusb_transfer *transfer; 198 201 … … 447 450 int r = 1; 448 451 452 exit_sem = sem_open (SEM_NAME, O_CREAT, 0); 453 if (!exit_sem) { 454 fprintf(stderr, "failed to initialise semaphore error %d", errno); 455 exit(1); 456 } 457 458 /* only using this semaphore in this process so go ahead and unlink it now */ 459 sem_unlink (SEM_NAME); 460 449 461 r = libusb_init(NULL); 450 462 if (r < 0) { … … 501 513 } 502 514 503 while (!do_exit) { 504 pthread_mutex_lock(&exit_cond_lock); 505 pthread_cond_wait(&exit_cond, &exit_cond_lock); 506 pthread_mutex_unlock(&exit_cond_lock); 507 } 515 while (!do_exit) 516 sem_wait(exit_sem); 508 517 509 518 printf("shutting down...\n"); … … 543 552 return r >= 0 ? r : -r; 544 553 } 545 -
TabularUnified libusb1/trunk/examples/hotplugtest.c ¶
r1876 r1882 1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 1 2 /* 2 3 * libusb example program for hotplug API 3 * Copyright (C) 2012-2013 Nathan Hjelm <hjelmn@mac.ccom>4 * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com> 4 5 * 5 6 * This library is free software; you can redistribute it and/or … … 20 21 #include <stdlib.h> 21 22 #include <stdio.h> 22 #include <sched.h>23 #include <unistd.h>24 23 25 #include <libusb.h>24 #include "libusb.h" 26 25 27 26 int done = 0; 28 libusb_device_handle *handle ;27 libusb_device_handle *handle = NULL; 29 28 30 int hotplug_callback (libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) { 31 struct libusb_device_descriptor desc; 32 int rc; 29 static int LIBUSB_CALL hotplug_callback(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) 30 { 31 struct libusb_device_descriptor desc; 32 int rc; 33 33 34 35 36 37 34 rc = libusb_get_device_descriptor(dev, &desc); 35 if (LIBUSB_SUCCESS != rc) { 36 fprintf (stderr, "Error getting device descriptor\n"); 37 } 38 38 39 printf ("Device attach: %04x:%04x\n", desc.idVendor, desc.idProduct);39 printf ("Device attached: %04x:%04x\n", desc.idVendor, desc.idProduct); 40 40 41 libusb_open (dev, &handle); 41 if (handle) { 42 libusb_close (handle); 43 handle = NULL; 44 } 42 45 43 done++; 46 rc = libusb_open (dev, &handle); 47 if (LIBUSB_SUCCESS != rc) { 48 fprintf (stderr, "Error opening device\n"); 49 } 44 50 45 return 0; 51 done++; 52 53 return 0; 46 54 } 47 55 48 int hotplug_callback_detach (libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) { 49 printf ("Device detached\n"); 56 static int LIBUSB_CALL hotplug_callback_detach(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data) 57 { 58 printf ("Device detached\n"); 50 59 51 libusb_close (handle); 60 if (handle) { 61 libusb_close (handle); 62 handle = NULL; 63 } 52 64 53 done++; 54 return 0; 65 done++; 66 67 return 0; 55 68 } 56 69 57 int main (int argc, char *argv[]) { 58 libusb_hotplug_callback_handle hp[2]; 59 int product_id, vendor_id, class_id; 60 int rc; 70 int main(int argc, char *argv[]) 71 { 72 libusb_hotplug_callback_handle hp[2]; 73 int product_id, vendor_id, class_id; 74 int rc; 61 75 62 vendor_id = (argc > 1) ?strtol (argv[1], NULL, 0) : 0x045a;63 product_id = (argc > 2) ?strtol (argv[2], NULL, 0) : 0x5005;64 class_id = (argc > 3) ?strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;76 vendor_id = (argc > 1) ? (int)strtol (argv[1], NULL, 0) : 0x045a; 77 product_id = (argc > 2) ? (int)strtol (argv[2], NULL, 0) : 0x5005; 78 class_id = (argc > 3) ? (int)strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY; 65 79 66 libusb_init (NULL); 80 rc = libusb_init (NULL); 81 if (rc < 0) 82 { 83 printf("failed to initialise libusb: %s\n", libusb_error_name(rc)); 84 return EXIT_FAILURE; 85 } 67 86 68 69 printf ("Hotplug not supported by this build of libusb\n");70 71 72 87 if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) { 88 printf ("Hotplug capabilites are not supported on this platform\n"); 89 libusb_exit (NULL); 90 return EXIT_FAILURE; 91 } 73 92 74 75 76 77 78 79 80 93 rc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, vendor_id, 94 product_id, class_id, hotplug_callback, NULL, &hp[0]); 95 if (LIBUSB_SUCCESS != rc) { 96 fprintf (stderr, "Error registering callback 0\n"); 97 libusb_exit (NULL); 98 return EXIT_FAILURE; 99 } 81 100 82 83 84 85 86 87 88 101 rc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, vendor_id, 102 product_id,class_id, hotplug_callback_detach, NULL, &hp[1]); 103 if (LIBUSB_SUCCESS != rc) { 104 fprintf (stderr, "Error registering callback 1\n"); 105 libusb_exit (NULL); 106 return EXIT_FAILURE; 107 } 89 108 90 while (done < 2) { 91 libusb_handle_events (NULL); 92 } 109 while (done < 2) { 110 rc = libusb_handle_events (NULL); 111 if (rc < 0) 112 printf("libusb_handle_events() failed: %s\n", libusb_error_name(rc)); 113 } 93 114 94 libusb_exit (NULL); 115 if (handle) { 116 libusb_close (handle); 117 } 118 119 libusb_exit (NULL); 120 121 return EXIT_SUCCESS; 95 122 } -
TabularUnified libusb1/trunk/examples/listdevs.c ¶
r1876 r1882 1 1 /* 2 2 * libusb example program to list devices on the bus 3 * Copyright (C)2007 Daniel Drake <dsd@gentoo.org>3 * Copyright © 2007 Daniel Drake <dsd@gentoo.org> 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 19 19 20 20 #include <stdio.h> 21 #include <sys/types.h>22 21 23 #include <libusb.h>22 #include "libusb.h" 24 23 25 24 static void print_devs(libusb_device **devs) 26 25 { 27 26 libusb_device *dev; 28 int i = 0; 27 int i = 0, j = 0; 28 uint8_t path[8]; 29 29 30 30 while ((dev = devs[i++]) != NULL) { … … 36 36 } 37 37 38 printf("%04x:%04x (bus %d, device %d) \n",38 printf("%04x:%04x (bus %d, device %d)", 39 39 desc.idVendor, desc.idProduct, 40 40 libusb_get_bus_number(dev), libusb_get_device_address(dev)); 41 42 r = libusb_get_port_numbers(dev, path, sizeof(path)); 43 if (r > 0) { 44 printf(" path: %d", path[0]); 45 for (j = 1; j < r; j++) 46 printf(".%d", path[j]); 47 } 48 printf("\n"); 41 49 } 42 50 } … … 62 70 return 0; 63 71 } 64 -
TabularUnified libusb1/trunk/examples/sam3u_benchmark.c ¶
r1876 r1882 41 41 static struct timeval tv_start; 42 42 43 static void cb_xfr(struct libusb_transfer *xfr)43 static void LIBUSB_CALL cb_xfr(struct libusb_transfer *xfr) 44 44 { 45 unsignedint i;45 int i; 46 46 47 47 if (xfr->status != LIBUSB_TRANSFER_COMPLETED) { -
TabularUnified libusb1/trunk/libusb-1.0.pc.in ¶
r1876 r1882 5 5 6 6 Name: libusb-1.0 7 Description: C API for USB device access from Linux, Mac OS X, OpenBSD, NetBSD and Windows userspace7 Description: C API for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Solaris userspace 8 8 Version: @VERSION@ 9 9 Libs: -L${libdir} -lusb-1.0 10 Libs.private: @ PC_LIBS_PRIVATE@10 Libs.private: @LIBS@ 11 11 Cflags: -I${includedir}/libusb-1.0 12 -
TabularUnified libusb1/trunk/libusb/Makefile.am ¶
r1879 r1882 1 all: libusb-1.0.la libusb-1.0.dll 2 3 AUTOMAKE_OPTIONS = subdir-objects 4 1 5 lib_LTLIBRARIES = libusb-1.0.la 2 6 3 LINUX_USBFS_SRC = os/linux_usbfs.c 4 DARWIN_USB_SRC = os/darwin_usb.c 7 POSIX_POLL_SRC = os/poll_posix.h os/poll_posix.c 8 POSIX_THREADS_SRC = os/threads_posix.h os/threads_posix.c 9 WINDOWS_POLL_SRC = os/poll_windows.h os/poll_windows.c 10 WINDOWS_THREADS_SRC = os/threads_windows.h os/threads_windows.c 11 LINUX_USBFS_SRC = os/linux_usbfs.h os/linux_usbfs.c 12 DARWIN_USB_SRC = os/darwin_usb.h os/darwin_usb.c 5 13 OPENBSD_USB_SRC = os/openbsd_usb.c 6 14 OS2_USB_SRC = os/poll_os2.c os/os2_usb.c 7 WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ 8 libusb-1.0.def 15 NETBSD_USB_SRC = os/netbsd_usb.c 16 SUNOS_USB_SRC = os/sunos_usb.c os/sunos_usb.h 17 WINDOWS_COMMON_SRC = os/windows_nt_common.h os/windows_nt_common.c \ 18 os/windows_common.h libusb-1.0.rc libusb-1.0.def 19 WINDOWS_USB_SRC = os/windows_winusb.h os/windows_winusb.c 20 WINDOWS_USBDK_SRC = os/windows_usbdk.h os/windows_usbdk.c 21 WINCE_USB_SRC = os/wince_usb.h os/wince_usb.c 22 HAIKU_USB_SRC = os/haiku_usb.h os/haiku_usb_backend.cpp \ 23 os/haiku_usb_raw.h os/haiku_usb_raw.cpp os/haiku_pollfs.cpp 9 24 10 EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ 11 $(WINDOWS_USB_SRC) os/threads_posix.c os/threads_windows.c \ 25 EXTRA_DIST = $(POSIX_POLL_SRC) $(POSIX_THREADS_SRC) \ 26 $(WINDOWS_POLL_SRC) $(WINDOWS_THREADS_SRC) \ 27 $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) \ 28 $(OPENBSD_USB_SRC) $(NETBSD_USB_SRC) \ 29 $(WINDOWS_COMMON_SRC) $(WINDOWS_USB_SRC) $(WINDOWS_USBDK_SRC) \ 30 $(WINCE_USB_SRC) $(HAIKU_USB_SRC) \ 12 31 os/linux_udev.c os/linux_netlink.c 13 32 … … 35 54 endif 36 55 56 if OS_NETBSD 57 OS_SRC = $(NETBSD_USB_SRC) 58 endif 59 60 if OS_SUNOS 61 OS_SRC = $(SUNOS_USB_SRC) 62 endif 63 64 if OS_HAIKU 65 noinst_LTLIBRARIES = libusb_haiku.la 66 libusb_haiku_la_SOURCES = $(HAIKU_USB_SRC) 67 libusb_1_0_la_LIBADD = libusb_haiku.la 68 endif 69 37 70 if OS_WINDOWS 38 OS_SRC = $(WINDOWS_USB_SRC) 71 72 if USE_USBDK 73 OS_SRC = $(WINDOWS_USBDK_SRC) $(WINDOWS_COMMON_SRC) 74 else 75 OS_SRC = $(WINDOWS_USB_SRC) $(WINDOWS_COMMON_SRC) 76 endif 39 77 40 78 .rc.lo: 41 79 $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@ 42 80 43 libusb-1.0.rc: version.h 81 libusb-1.0.rc: version.h version_nano.h 82 endif 83 84 libusb-1.0.dll: libusb-1.0.def libusb-1.0.la 85 if CREATE_IMPORT_LIB 86 # Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged 87 $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a 88 endif 89 90 if OS_WINDOWS 91 POLL_SRC = $(WINDOWS_POLL_SRC) 92 else 93 POLL_SRC = $(POSIX_POLL_SRC) 44 94 endif 45 95 46 96 if THREADS_POSIX 47 THREADS_SRC = os/threads_posix.h os/threads_posix.c97 THREADS_SRC = $(POSIX_THREADS_SRC) 48 98 else 49 THREADS_SRC = os/threads_windows.h os/threads_windows.c99 THREADS_SRC = $(WINDOWS_THREADS_SRC) 50 100 endif 51 101 52 libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) $(THREAD_CFLAGS) \ 53 -DLIBUSB_DESCRIBE=\"`git --git-dir "$(top_srcdir)/.git" describe --tags 2>/dev/null`\" 102 libusb_1_0_la_CFLAGS = $(AM_CFLAGS) 54 103 libusb_1_0_la_LDFLAGS = $(LTLDFLAGS) 55 libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)\56 hotplug.h hotplug.c os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h\57 $( THREADS_SRC) os/poll_posix.h os/poll_windows.h104 libusb_1_0_la_SOURCES = libusbi.h libusb.h version.h version_nano.h \ 105 core.c descriptor.c hotplug.h hotplug.c io.c strerror.c sync.c \ 106 $(POLL_SRC) $(THREADS_SRC) $(OS_SRC) 58 107 59 108 hdrdir = $(includedir)/libusb-1.0 -
TabularUnified libusb1/trunk/libusb/Makefile.in ¶
r1879 r1882 1 # Makefile.in generated by automake 1.1 1.1 from Makefile.am.1 # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 2 # @configure_input@ 3 3 4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 # Inc. 4 # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 7 6 # This Makefile.in is free software; the Free Software Foundation 8 7 # gives unlimited permission to copy and/or distribute it, … … 16 15 @SET_MAKE@ 17 16 18 OS2_LA_NAME=usb-1.019 OS2_DLL_NAME=libusb1020 OS2_DLL_OBJ=$(libusb_1_0_la_OBJECTS:%.lo=%.o)21 OS2_DLL_LIBS=-lpthread -lusbcalls22 17 23 18 VPATH = @srcdir@ 19 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 20 am__make_running_with_option = \ 21 case $${target_option-} in \ 22 ?) ;; \ 23 *) echo "am__make_running_with_option: internal error: invalid" \ 24 "target option '$${target_option-}' specified" >&2; \ 25 exit 1;; \ 26 esac; \ 27 has_opt=no; \ 28 sane_makeflags=$$MAKEFLAGS; \ 29 if $(am__is_gnu_make); then \ 30 sane_makeflags=$$MFLAGS; \ 31 else \ 32 case $$MAKEFLAGS in \ 33 *\\[\ \ ]*) \ 34 bs=\\; \ 35 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 36 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 37 esac; \ 38 fi; \ 39 skip_next=no; \ 40 strip_trailopt () \ 41 { \ 42 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 43 }; \ 44 for flg in $$sane_makeflags; do \ 45 test $$skip_next = yes && { skip_next=no; continue; }; \ 46 case $$flg in \ 47 *=*|--*) continue;; \ 48 -*I) strip_trailopt 'I'; skip_next=yes;; \ 49 -*I?*) strip_trailopt 'I';; \ 50 -*O) strip_trailopt 'O'; skip_next=yes;; \ 51 -*O?*) strip_trailopt 'O';; \ 52 -*l) strip_trailopt 'l'; skip_next=yes;; \ 53 -*l?*) strip_trailopt 'l';; \ 54 -[dEDm]) skip_next=yes;; \ 55 -[JT]) skip_next=yes;; \ 56 esac; \ 57 case $$flg in \ 58 *$$target_option*) has_opt=yes; break;; \ 59 esac; \ 60 done; \ 61 test $$has_opt = yes 62 am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 63 am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 24 64 pkgdatadir = $(datadir)/@PACKAGE@ 25 65 pkgincludedir = $(includedir)/@PACKAGE@ … … 41 81 host_triplet = @host@ 42 82 subdir = libusb 43 DIST_COMMON = $( hdr_HEADERS)$(srcdir)/Makefile.am \44 $( srcdir)/Makefile.in83 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 84 $(top_srcdir)/depcomp $(hdr_HEADERS) 45 85 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 46 86 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ … … 75 115 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 76 116 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 117 am__uninstall_files_from_dir = { \ 118 test -z "$$files" \ 119 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 120 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 121 $(am__cd) "$$dir" && rm -f $$files; }; \ 122 } 77 123 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)" 78 LTLIBRARIES = $(lib_LTLIBRARIES) 79 libusb_1_0_la_LIBADD = 80 am__libusb_1_0_la_SOURCES_DIST = libusbi.h core.c descriptor.c io.c \ 81 sync.c os/darwin_usb.c os/linux_usbfs.c os/linux_netlink.c \ 82 os/linux_udev.c os/openbsd_usb.c os/poll_os2.c os/os2_usb.c \ 83 os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ 84 libusb-1.0.def hotplug.h hotplug.c os/linux_usbfs.h \ 85 os/darwin_usb.h os/windows_usb.h os/threads_windows.h \ 124 LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) 125 @OS_HAIKU_TRUE@libusb_1_0_la_DEPENDENCIES = libusb_haiku.la 126 am__libusb_1_0_la_SOURCES_DIST = libusbi.h libusb.h version.h \ 127 version_nano.h core.c descriptor.c hotplug.h hotplug.c io.c \ 128 strerror.c sync.c os/poll_posix.h os/poll_posix.c \ 129 os/poll_windows.h os/poll_windows.c os/threads_windows.h \ 86 130 os/threads_windows.c os/threads_posix.h os/threads_posix.c \ 87 os/poll_posix.h os/poll_windows.h 88 am__objects_1 = libusb_1_0_la-darwin_usb.lo 89 am__objects_2 = libusb_1_0_la-linux_usbfs.lo 90 am__objects_3 = libusb_1_0_la-openbsd_usb.lo 91 am__objects_4 = libusb_1_0_la-poll_os2.lo libusb_1_0_la-os2_usb.lo 92 am__objects_5 = libusb_1_0_la-poll_windows.lo \ 93 libusb_1_0_la-windows_usb.lo libusb-1.0.lo 94 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_FALSE@@OS_OS2_FALSE@@OS_WINDOWS_TRUE@am__objects_6 = $(am__objects_5) 95 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_FALSE@@OS_OS2_TRUE@am__objects_6 = $(am__objects_4) 96 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@am__objects_6 = $(am__objects_3) 97 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@am__objects_6 = $(am__objects_2) \ 98 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ libusb_1_0_la-linux_netlink.lo 99 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@am__objects_6 = $(am__objects_2) \ 100 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ libusb_1_0_la-linux_udev.lo 101 @OS_DARWIN_TRUE@am__objects_6 = $(am__objects_1) 102 @THREADS_POSIX_FALSE@am__objects_7 = libusb_1_0_la-threads_windows.lo 103 @THREADS_POSIX_TRUE@am__objects_7 = libusb_1_0_la-threads_posix.lo 131 os/darwin_usb.h os/darwin_usb.c os/linux_usbfs.h \ 132 os/linux_usbfs.c os/linux_netlink.c os/linux_udev.c \ 133 os/netbsd_usb.c os/openbsd_usb.c os/sunos_usb.c os/sunos_usb.h \ 134 os/windows_winusb.h os/windows_winusb.c os/windows_nt_common.h \ 135 os/windows_nt_common.c os/windows_common.h libusb-1.0.rc \ 136 libusb-1.0.def os/windows_usbdk.h os/windows_usbdk.c 137 am__dirstamp = $(am__leading_dot)dirstamp 138 am__objects_1 = os/libusb_1_0_la-poll_posix.lo 139 am__objects_2 = os/libusb_1_0_la-poll_windows.lo 140 @OS_WINDOWS_FALSE@am__objects_3 = $(am__objects_1) 141 @OS_WINDOWS_TRUE@am__objects_3 = $(am__objects_2) 142 am__objects_4 = os/libusb_1_0_la-threads_windows.lo 143 am__objects_5 = os/libusb_1_0_la-threads_posix.lo 144 @THREADS_POSIX_FALSE@am__objects_6 = $(am__objects_4) 145 @THREADS_POSIX_TRUE@am__objects_6 = $(am__objects_5) 146 am__objects_7 = os/libusb_1_0_la-darwin_usb.lo 147 am__objects_8 = os/libusb_1_0_la-linux_usbfs.lo 148 am__objects_9 = os/libusb_1_0_la-netbsd_usb.lo 149 am__objects_10 = os/libusb_1_0_la-openbsd_usb.lo 150 am__objects_11 = os/libusb_1_0_la-sunos_usb.lo 151 am__objects_12 = os/libusb_1_0_la-windows_winusb.lo 152 am__objects_13 = os/libusb_1_0_la-windows_nt_common.lo libusb-1.0.lo 153 am__objects_14 = os/libusb_1_0_la-windows_usbdk.lo 154 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_SUNOS_FALSE@@OS_WINDOWS_TRUE@@USE_USBDK_FALSE@am__objects_15 = $(am__objects_12) \ 155 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_SUNOS_FALSE@@OS_WINDOWS_TRUE@@USE_USBDK_FALSE@ $(am__objects_13) 156 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_SUNOS_FALSE@@OS_WINDOWS_TRUE@@USE_USBDK_TRUE@am__objects_15 = $(am__objects_14) \ 157 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_SUNOS_FALSE@@OS_WINDOWS_TRUE@@USE_USBDK_TRUE@ $(am__objects_13) 158 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_FALSE@@OS_SUNOS_TRUE@am__objects_15 = $(am__objects_11) 159 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_FALSE@@OS_OPENBSD_TRUE@am__objects_15 = $(am__objects_10) 160 @OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_NETBSD_TRUE@am__objects_15 = $(am__objects_9) 161 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@am__objects_15 = $(am__objects_8) \ 162 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_FALSE@ os/libusb_1_0_la-linux_netlink.lo 163 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@am__objects_15 = $(am__objects_8) \ 164 @OS_DARWIN_FALSE@@OS_LINUX_TRUE@@USE_UDEV_TRUE@ os/libusb_1_0_la-linux_udev.lo 165 @OS_DARWIN_TRUE@am__objects_15 = $(am__objects_7) 104 166 am_libusb_1_0_la_OBJECTS = libusb_1_0_la-core.lo \ 105 libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo \ 106 libusb_1_0_la-sync.lo $(am__objects_6) \ 107 libusb_1_0_la-hotplug.lo $(am__objects_7) 167 libusb_1_0_la-descriptor.lo libusb_1_0_la-hotplug.lo \ 168 libusb_1_0_la-io.lo libusb_1_0_la-strerror.lo \ 169 libusb_1_0_la-sync.lo $(am__objects_3) $(am__objects_6) \ 170 $(am__objects_15) 108 171 libusb_1_0_la_OBJECTS = $(am_libusb_1_0_la_OBJECTS) 109 AM_V_lt = $(am__v_lt_ $(V))110 am__v_lt_ = $(am__v_lt_ $(AM_DEFAULT_VERBOSITY))172 AM_V_lt = $(am__v_lt_@AM_V@) 173 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 111 174 am__v_lt_0 = --silent 175 am__v_lt_1 = 112 176 libusb_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 113 177 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libusb_1_0_la_CFLAGS) \ 114 178 $(CFLAGS) $(libusb_1_0_la_LDFLAGS) $(LDFLAGS) -o $@ 179 libusb_haiku_la_LIBADD = 180 am__libusb_haiku_la_SOURCES_DIST = os/haiku_usb.h \ 181 os/haiku_usb_backend.cpp os/haiku_usb_raw.h \ 182 os/haiku_usb_raw.cpp os/haiku_pollfs.cpp 183 am__objects_16 = os/haiku_usb_backend.lo os/haiku_usb_raw.lo \ 184 os/haiku_pollfs.lo 185 @OS_HAIKU_TRUE@am_libusb_haiku_la_OBJECTS = $(am__objects_16) 186 libusb_haiku_la_OBJECTS = $(am_libusb_haiku_la_OBJECTS) 187 @OS_HAIKU_TRUE@am_libusb_haiku_la_rpath = 188 AM_V_P = $(am__v_P_@AM_V@) 189 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 190 am__v_P_0 = false 191 am__v_P_1 = : 192 AM_V_GEN = $(am__v_GEN_@AM_V@) 193 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 194 am__v_GEN_0 = @echo " GEN " $@; 195 am__v_GEN_1 = 196 AM_V_at = $(am__v_at_@AM_V@) 197 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 198 am__v_at_0 = @ 199 am__v_at_1 = 115 200 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 116 201 depcomp = $(SHELL) $(top_srcdir)/depcomp … … 123 208 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 124 209 $(AM_CFLAGS) $(CFLAGS) 125 AM_V_CC = $(am__v_CC_$(V)) 126 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) 127 am__v_CC_0 = @echo " CC " $@; 128 AM_V_at = $(am__v_at_$(V)) 129 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) 130 am__v_at_0 = @ 210 AM_V_CC = $(am__v_CC_@AM_V@) 211 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 212 am__v_CC_0 = @echo " CC " $@; 213 am__v_CC_1 = 131 214 CCLD = $(CC) 132 215 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 133 216 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 134 217 $(AM_LDFLAGS) $(LDFLAGS) -o $@ 135 AM_V_CCLD = $(am__v_CCLD_$(V)) 136 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) 137 am__v_CCLD_0 = @echo " CCLD " $@; 138 AM_V_GEN = $(am__v_GEN_$(V)) 139 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) 140 am__v_GEN_0 = @echo " GEN " $@; 141 SOURCES = $(libusb_1_0_la_SOURCES) 142 DIST_SOURCES = $(am__libusb_1_0_la_SOURCES_DIST) 218 AM_V_CCLD = $(am__v_CCLD_@AM_V@) 219 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 220 am__v_CCLD_0 = @echo " CCLD " $@; 221 am__v_CCLD_1 = 222 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 223 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 224 LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ 225 $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ 226 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 227 $(AM_CXXFLAGS) $(CXXFLAGS) 228 AM_V_CXX = $(am__v_CXX_@AM_V@) 229 am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) 230 am__v_CXX_0 = @echo " CXX " $@; 231 am__v_CXX_1 = 232 CXXLD = $(CXX) 233 CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ 234 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ 235 $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 236 AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) 237 am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) 238 am__v_CXXLD_0 = @echo " CXXLD " $@; 239 am__v_CXXLD_1 = 240 SOURCES = $(libusb_1_0_la_SOURCES) $(libusb_haiku_la_SOURCES) 241 DIST_SOURCES = $(am__libusb_1_0_la_SOURCES_DIST) \ 242 $(am__libusb_haiku_la_SOURCES_DIST) 243 am__can_run_installinfo = \ 244 case $$AM_UPDATE_INFO_DIR in \ 245 n|no|NO) false;; \ 246 *) (install-info --version) >/dev/null 2>&1;; \ 247 esac 143 248 HEADERS = $(hdr_HEADERS) 249 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 250 # Read a list of newline-separated strings from the standard input, 251 # and print each of them once, without duplicates. Input order is 252 # *not* preserved. 253 am__uniquify_input = $(AWK) '\ 254 BEGIN { nonempty = 0; } \ 255 { items[$$0] = 1; nonempty = 1; } \ 256 END { if (nonempty) { for (i in items) print i; }; } \ 257 ' 258 # Make sure the list of sources is unique. This is necessary because, 259 # e.g., the same source file might be shared among _SOURCES variables 260 # for different programs/libraries. 261 am__define_uniq_tagged_files = \ 262 list='$(am__tagged_files)'; \ 263 unique=`for i in $$list; do \ 264 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 265 done | $(am__uniquify_input)` 144 266 ETAGS = etags 145 267 CTAGS = ctags … … 159 281 CPP = @CPP@ 160 282 CPPFLAGS = @CPPFLAGS@ 283 CXX = @CXX@ 284 CXXCPP = @CXXCPP@ 285 CXXDEPMODE = @CXXDEPMODE@ 286 CXXFLAGS = @CXXFLAGS@ 161 287 CYGPATH_W = @CYGPATH_W@ 162 288 DEFS = @DEFS@ … … 186 312 LTLDFLAGS = @LTLDFLAGS@ 187 313 LTLIBOBJS = @LTLIBOBJS@ 188 MAINT = @MAINT@189 314 MAKEINFO = @MAKEINFO@ 190 315 MANIFEST_TOOL = @MANIFEST_TOOL@ … … 195 320 OBJEXT = @OBJEXT@ 196 321 OS_DARWIN = @OS_DARWIN@ 322 OS_HAIKU = @OS_HAIKU@ 197 323 OS_LINUX = @OS_LINUX@ 324 OS_NETBSD = @OS_NETBSD@ 198 325 OS_OPENBSD = @OS_OPENBSD@ 199 OS_ OS2 = @OS_OS2@326 OS_SUNOS = @OS_SUNOS@ 200 327 OS_WINDOWS = @OS_WINDOWS@ 201 328 OTOOL = @OTOOL@ … … 209 336 PACKAGE_VERSION = @PACKAGE_VERSION@ 210 337 PATH_SEPARATOR = @PATH_SEPARATOR@ 211 PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@212 338 RANLIB = @RANLIB@ 213 339 RC = @RC@ … … 216 342 SHELL = @SHELL@ 217 343 STRIP = @STRIP@ 218 THREAD_CFLAGS = @THREAD_CFLAGS@219 344 USE_UDEV = @USE_UDEV@ 345 USE_USBDK = @USE_USBDK@ 220 346 VERSION = @VERSION@ 221 VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@222 347 abs_builddir = @abs_builddir@ 223 348 abs_srcdir = @abs_srcdir@ … … 226 351 ac_ct_AR = @ac_ct_AR@ 227 352 ac_ct_CC = @ac_ct_CC@ 353 ac_ct_CXX = @ac_ct_CXX@ 228 354 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 229 355 am__include = @am__include@ … … 272 398 top_builddir = @top_builddir@ 273 399 top_srcdir = @top_srcdir@ 400 AUTOMAKE_OPTIONS = subdir-objects 274 401 lib_LTLIBRARIES = libusb-1.0.la 275 LINUX_USBFS_SRC = os/linux_usbfs.c 276 DARWIN_USB_SRC = os/darwin_usb.c 402 POSIX_POLL_SRC = os/poll_posix.h os/poll_posix.c 403 POSIX_THREADS_SRC = os/threads_posix.h os/threads_posix.c 404 WINDOWS_POLL_SRC = os/poll_windows.h os/poll_windows.c 405 WINDOWS_THREADS_SRC = os/threads_windows.h os/threads_windows.c 406 LINUX_USBFS_SRC = os/linux_usbfs.h os/linux_usbfs.c 407 DARWIN_USB_SRC = os/darwin_usb.h os/darwin_usb.c 277 408 OPENBSD_USB_SRC = os/openbsd_usb.c 278 OS2_USB_SRC = os/poll_os2.c os/os2_usb.c 279 WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ 280 libusb-1.0.def 281 282 EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ 283 $(WINDOWS_USB_SRC) os/threads_posix.c os/threads_windows.c \ 409 NETBSD_USB_SRC = os/netbsd_usb.c 410 SUNOS_USB_SRC = os/sunos_usb.c os/sunos_usb.h 411 WINDOWS_COMMON_SRC = os/windows_nt_common.h os/windows_nt_common.c \ 412 os/windows_common.h libusb-1.0.rc libusb-1.0.def 413 414 WINDOWS_USB_SRC = os/windows_winusb.h os/windows_winusb.c 415 WINDOWS_USBDK_SRC = os/windows_usbdk.h os/windows_usbdk.c 416 WINCE_USB_SRC = os/wince_usb.h os/wince_usb.c 417 HAIKU_USB_SRC = os/haiku_usb.h os/haiku_usb_backend.cpp \ 418 os/haiku_usb_raw.h os/haiku_usb_raw.cpp os/haiku_pollfs.cpp 419 420 EXTRA_DIST = $(POSIX_POLL_SRC) $(POSIX_THREADS_SRC) \ 421 $(WINDOWS_POLL_SRC) $(WINDOWS_THREADS_SRC) \ 422 $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) \ 423 $(OPENBSD_USB_SRC) $(NETBSD_USB_SRC) \ 424 $(WINDOWS_COMMON_SRC) $(WINDOWS_USB_SRC) $(WINDOWS_USBDK_SRC) \ 425 $(WINCE_USB_SRC) $(HAIKU_USB_SRC) \ 284 426 os/linux_udev.c os/linux_netlink.c 285 427 … … 287 429 @OS_LINUX_TRUE@@USE_UDEV_FALSE@OS_SRC = $(LINUX_USBFS_SRC) os/linux_netlink.c 288 430 @OS_LINUX_TRUE@@USE_UDEV_TRUE@OS_SRC = $(LINUX_USBFS_SRC) os/linux_udev.c 431 @OS_NETBSD_TRUE@OS_SRC = $(NETBSD_USB_SRC) 289 432 @OS_OPENBSD_TRUE@OS_SRC = $(OPENBSD_USB_SRC) 290 @OS_OS2_TRUE@OS_SRC = $(OS2_USB_SRC) 291 @OS_WINDOWS_TRUE@OS_SRC = $(WINDOWS_USB_SRC) 433 @OS_SUNOS_TRUE@OS_SRC = $(SUNOS_USB_SRC) 434 @OS_WINDOWS_TRUE@@USE_USBDK_FALSE@OS_SRC = $(WINDOWS_USB_SRC) $(WINDOWS_COMMON_SRC) 435 @OS_WINDOWS_TRUE@@USE_USBDK_TRUE@OS_SRC = $(WINDOWS_USBDK_SRC) $(WINDOWS_COMMON_SRC) 292 436 @OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp 293 @THREADS_POSIX_FALSE@THREADS_SRC = os/threads_windows.h os/threads_windows.c 294 @THREADS_POSIX_TRUE@THREADS_SRC = os/threads_posix.h os/threads_posix.c 295 libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) $(THREAD_CFLAGS) \ 296 -DLIBUSB_DESCRIBE=\"`git --git-dir "$(top_srcdir)/.git" describe --tags 2>/dev/null`\" 297 437 @OS_HAIKU_TRUE@noinst_LTLIBRARIES = libusb_haiku.la 438 @OS_HAIKU_TRUE@libusb_haiku_la_SOURCES = $(HAIKU_USB_SRC) 439 @OS_HAIKU_TRUE@libusb_1_0_la_LIBADD = libusb_haiku.la 440 @OS_WINDOWS_FALSE@POLL_SRC = $(POSIX_POLL_SRC) 441 @OS_WINDOWS_TRUE@POLL_SRC = $(WINDOWS_POLL_SRC) 442 @THREADS_POSIX_FALSE@THREADS_SRC = $(WINDOWS_THREADS_SRC) 443 @THREADS_POSIX_TRUE@THREADS_SRC = $(POSIX_THREADS_SRC) 444 libusb_1_0_la_CFLAGS = $(AM_CFLAGS) 298 445 libusb_1_0_la_LDFLAGS = $(LTLDFLAGS) 299 libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)\300 hotplug.h hotplug.c os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h\301 $( THREADS_SRC) os/poll_posix.h os/poll_windows.h446 libusb_1_0_la_SOURCES = libusbi.h libusb.h version.h version_nano.h \ 447 core.c descriptor.c hotplug.h hotplug.c io.c strerror.c sync.c \ 448 $(POLL_SRC) $(THREADS_SRC) $(OS_SRC) 302 449 303 450 hdrdir = $(includedir)/libusb-1.0 … … 306 453 307 454 .SUFFIXES: 308 .SUFFIXES: .c . lo .o .obj .rc309 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@$(srcdir)/Makefile.am $(am__configure_deps)455 .SUFFIXES: .c .cpp .lo .o .obj .rc 456 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 310 457 @for dep in $?; do \ 311 458 case '$(am__configure_deps)' in \ … … 332 479 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 333 480 334 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)481 $(top_srcdir)/configure: $(am__configure_deps) 335 482 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 336 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)483 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 337 484 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 338 485 $(am__aclocal_m4_deps): 486 339 487 install-libLTLIBRARIES: $(lib_LTLIBRARIES) 340 488 @$(NORMAL_INSTALL) 341 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"342 489 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ 343 490 list2=; for p in $$list; do \ … … 347 494 done; \ 348 495 test -z "$$list2" || { \ 496 echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ 497 $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ 349 498 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ 350 499 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ … … 362 511 clean-libLTLIBRARIES: 363 512 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) 364 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ 365 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ 366 test "$$dir" != "$$p" || dir=.; \ 367 echo "rm -f \"$${dir}/so_locations\""; \ 368 rm -f "$${dir}/so_locations"; \ 369 done 370 libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) 513 @list='$(lib_LTLIBRARIES)'; \ 514 locs=`for p in $$list; do echo $$p; done | \ 515 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ 516 sort -u`; \ 517 test -z "$$locs" || { \ 518 echo rm -f $${locs}; \ 519 rm -f $${locs}; \ 520 } 521 522 clean-noinstLTLIBRARIES: 523 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) 524 @list='$(noinst_LTLIBRARIES)'; \ 525 locs=`for p in $$list; do echo $$p; done | \ 526 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ 527 sort -u`; \ 528 test -z "$$locs" || { \ 529 echo rm -f $${locs}; \ 530 rm -f $${locs}; \ 531 } 532 os/$(am__dirstamp): 533 @$(MKDIR_P) os 534 @: > os/$(am__dirstamp) 535 os/$(DEPDIR)/$(am__dirstamp): 536 @$(MKDIR_P) os/$(DEPDIR) 537 @: > os/$(DEPDIR)/$(am__dirstamp) 538 os/libusb_1_0_la-poll_posix.lo: os/$(am__dirstamp) \ 539 os/$(DEPDIR)/$(am__dirstamp) 540 os/libusb_1_0_la-poll_windows.lo: os/$(am__dirstamp) \ 541 os/$(DEPDIR)/$(am__dirstamp) 542 os/libusb_1_0_la-threads_windows.lo: os/$(am__dirstamp) \ 543 os/$(DEPDIR)/$(am__dirstamp) 544 os/libusb_1_0_la-threads_posix.lo: os/$(am__dirstamp) \ 545 os/$(DEPDIR)/$(am__dirstamp) 546 os/libusb_1_0_la-darwin_usb.lo: os/$(am__dirstamp) \ 547 os/$(DEPDIR)/$(am__dirstamp) 548 os/libusb_1_0_la-linux_usbfs.lo: os/$(am__dirstamp) \ 549 os/$(DEPDIR)/$(am__dirstamp) 550 os/libusb_1_0_la-linux_netlink.lo: os/$(am__dirstamp) \ 551 os/$(DEPDIR)/$(am__dirstamp) 552 os/libusb_1_0_la-linux_udev.lo: os/$(am__dirstamp) \ 553 os/$(DEPDIR)/$(am__dirstamp) 554 os/libusb_1_0_la-netbsd_usb.lo: os/$(am__dirstamp) \ 555 os/$(DEPDIR)/$(am__dirstamp) 556 os/libusb_1_0_la-openbsd_usb.lo: os/$(am__dirstamp) \ 557 os/$(DEPDIR)/$(am__dirstamp) 558 os/libusb_1_0_la-sunos_usb.lo: os/$(am__dirstamp) \ 559 os/$(DEPDIR)/$(am__dirstamp) 560 os/libusb_1_0_la-windows_winusb.lo: os/$(am__dirstamp) \ 561 os/$(DEPDIR)/$(am__dirstamp) 562 os/libusb_1_0_la-windows_nt_common.lo: os/$(am__dirstamp) \ 563 os/$(DEPDIR)/$(am__dirstamp) 564 os/libusb_1_0_la-windows_usbdk.lo: os/$(am__dirstamp) \ 565 os/$(DEPDIR)/$(am__dirstamp) 566 567 libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) $(EXTRA_libusb_1_0_la_DEPENDENCIES) 371 568 $(AM_V_CCLD)$(libusb_1_0_la_LINK) -rpath $(libdir) $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_LIBADD) $(LIBS) 569 os/haiku_usb_backend.lo: os/$(am__dirstamp) \ 570 os/$(DEPDIR)/$(am__dirstamp) 571 os/haiku_usb_raw.lo: os/$(am__dirstamp) os/$(DEPDIR)/$(am__dirstamp) 572 os/haiku_pollfs.lo: os/$(am__dirstamp) os/$(DEPDIR)/$(am__dirstamp) 573 574 libusb_haiku.la: $(libusb_haiku_la_OBJECTS) $(libusb_haiku_la_DEPENDENCIES) $(EXTRA_libusb_haiku_la_DEPENDENCIES) 575 $(AM_V_CXXLD)$(CXXLINK) $(am_libusb_haiku_la_rpath) $(libusb_haiku_la_OBJECTS) $(libusb_haiku_la_LIBADD) $(LIBS) 372 576 373 577 mostlyclean-compile: 374 578 -rm -f *.$(OBJEXT) 579 -rm -f os/*.$(OBJEXT) 580 -rm -f os/*.lo 375 581 376 582 distclean-compile: … … 378 584 379 585 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-core.Plo@am__quote@ 380 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@381 586 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-descriptor.Plo@am__quote@ 382 587 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-hotplug.Plo@am__quote@ 383 588 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-io.Plo@am__quote@ 384 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo@am__quote@ 385 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_udev.Plo@am__quote@ 386 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@ 387 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@ 388 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-os2_usb.Plo@am__quote@ 389 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_os2.Plo@am__quote@ 390 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@ 589 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-strerror.Plo@am__quote@ 391 590 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-sync.Plo@am__quote@ 392 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@ 393 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@ 394 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-windows_usb.Plo@am__quote@ 591 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/haiku_pollfs.Plo@am__quote@ 592 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/haiku_usb_backend.Plo@am__quote@ 593 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/haiku_usb_raw.Plo@am__quote@ 594 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@ 595 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo@am__quote@ 596 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_udev.Plo@am__quote@ 597 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@ 598 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Plo@am__quote@ 599 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@ 600 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-poll_posix.Plo@am__quote@ 601 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@ 602 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-sunos_usb.Plo@am__quote@ 603 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@ 604 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@ 605 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-windows_nt_common.Plo@am__quote@ 606 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-windows_usbdk.Plo@am__quote@ 607 @AMDEP_TRUE@@am__include@ @am__quote@os/$(DEPDIR)/libusb_1_0_la-windows_winusb.Plo@am__quote@ 395 608 396 609 .c.o: 397 @am__fastdepCC_TRUE@ $(AM_V_CC) $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<398 @am__fastdepCC_TRUE@ $( AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po399 @am__fastdepCC_ FALSE@ $(AM_V_CC) @AM_BACKSLASH@400 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@401 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 402 @am__fastdepCC_FALSE@ $( COMPILE) -c$<610 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 611 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 612 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 613 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 614 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 615 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< 403 616 404 617 .c.obj: 405 @am__fastdepCC_TRUE@ $(AM_V_CC) $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`406 @am__fastdepCC_TRUE@ $( AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po407 @am__fastdepCC_ FALSE@ $(AM_V_CC) @AM_BACKSLASH@408 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@409 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 410 @am__fastdepCC_FALSE@ $( COMPILE) -c`$(CYGPATH_W) '$<'`618 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ 619 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ 620 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 621 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 622 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 623 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 411 624 412 625 .c.lo: 413 @am__fastdepCC_TRUE@ $(AM_V_CC) $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<414 @am__fastdepCC_TRUE@ $( AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo415 @am__fastdepCC_ FALSE@ $(AM_V_CC) @AM_BACKSLASH@416 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@417 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 418 @am__fastdepCC_FALSE@ $( LTCOMPILE) -c -o $@ $<626 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ 627 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 628 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo 629 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 630 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 631 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< 419 632 420 633 libusb_1_0_la-core.lo: core.c 421 634 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-core.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-core.Tpo -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c 422 635 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-core.Tpo $(DEPDIR)/libusb_1_0_la-core.Plo 423 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 424 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='core.c' object='libusb_1_0_la-core.lo' libtool=yes @AMDEPBACKSLASH@ 425 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 426 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c 636 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core.c' object='libusb_1_0_la-core.lo' libtool=yes @AMDEPBACKSLASH@ 637 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 638 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c 427 639 428 640 libusb_1_0_la-descriptor.lo: descriptor.c 429 641 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-descriptor.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-descriptor.Tpo -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c 430 642 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-descriptor.Tpo $(DEPDIR)/libusb_1_0_la-descriptor.Plo 431 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 432 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='descriptor.c' object='libusb_1_0_la-descriptor.lo' libtool=yes @AMDEPBACKSLASH@ 433 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 434 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c 643 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='descriptor.c' object='libusb_1_0_la-descriptor.lo' libtool=yes @AMDEPBACKSLASH@ 644 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 645 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c 646 647 libusb_1_0_la-hotplug.lo: hotplug.c 648 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-hotplug.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-hotplug.Tpo -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c 649 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-hotplug.Tpo $(DEPDIR)/libusb_1_0_la-hotplug.Plo 650 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hotplug.c' object='libusb_1_0_la-hotplug.lo' libtool=yes @AMDEPBACKSLASH@ 651 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 652 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c 435 653 436 654 libusb_1_0_la-io.lo: io.c 437 655 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-io.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-io.Tpo -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c 438 656 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-io.Tpo $(DEPDIR)/libusb_1_0_la-io.Plo 439 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 440 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='io.c' object='libusb_1_0_la-io.lo' libtool=yes @AMDEPBACKSLASH@ 441 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 442 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c 657 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io.c' object='libusb_1_0_la-io.lo' libtool=yes @AMDEPBACKSLASH@ 658 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 659 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c 660 661 libusb_1_0_la-strerror.lo: strerror.c 662 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-strerror.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-strerror.Tpo -c -o libusb_1_0_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c 663 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-strerror.Tpo $(DEPDIR)/libusb_1_0_la-strerror.Plo 664 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libusb_1_0_la-strerror.lo' libtool=yes @AMDEPBACKSLASH@ 665 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 666 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c 443 667 444 668 libusb_1_0_la-sync.lo: sync.c 445 669 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-sync.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-sync.Tpo -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c 446 670 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-sync.Tpo $(DEPDIR)/libusb_1_0_la-sync.Plo 447 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 448 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sync.c' object='libusb_1_0_la-sync.lo' libtool=yes @AMDEPBACKSLASH@ 449 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 450 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c 451 452 libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c 453 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c 454 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo $(DEPDIR)/libusb_1_0_la-darwin_usb.Plo 455 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 456 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/darwin_usb.c' object='libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@ 457 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 458 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c 459 460 libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c 461 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_usbfs.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c 462 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo $(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo 463 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 464 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/linux_usbfs.c' object='libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@ 465 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 466 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c 467 468 libusb_1_0_la-linux_netlink.lo: os/linux_netlink.c 469 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_netlink.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c 470 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo $(DEPDIR)/libusb_1_0_la-linux_netlink.Plo 471 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 472 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/linux_netlink.c' object='libusb_1_0_la-linux_netlink.lo' libtool=yes @AMDEPBACKSLASH@ 473 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 474 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c 475 476 libusb_1_0_la-linux_udev.lo: os/linux_udev.c 477 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_udev.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c 478 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_udev.Tpo $(DEPDIR)/libusb_1_0_la-linux_udev.Plo 479 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 480 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/linux_udev.c' object='libusb_1_0_la-linux_udev.lo' libtool=yes @AMDEPBACKSLASH@ 481 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 482 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c 483 484 libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c 485 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-openbsd_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c 486 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo $(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo 487 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 488 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/openbsd_usb.c' object='libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ 489 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 490 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c 491 492 libusb_1_0_la-poll_os2.lo: os/poll_os2.c 493 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_os2.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_os2.Tpo -c -o libusb_1_0_la-poll_os2.lo `test -f 'os/poll_os2.c' || echo '$(srcdir)/'`os/poll_os2.c 494 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_os2.Tpo $(DEPDIR)/libusb_1_0_la-poll_os2.Plo 495 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 496 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/poll_os2.c' object='libusb_1_0_la-poll_os2.lo' libtool=yes @AMDEPBACKSLASH@ 497 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 498 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_os2.lo `test -f 'os/poll_os2.c' || echo '$(srcdir)/'`os/poll_os2.c 499 500 libusb_1_0_la-os2_usb.lo: os/os2_usb.c 501 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-os2_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-os2_usb.Tpo -c -o libusb_1_0_la-os2_usb.lo `test -f 'os/os2_usb.c' || echo '$(srcdir)/'`os/os2_usb.c 502 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-os2_usb.Tpo $(DEPDIR)/libusb_1_0_la-os2_usb.Plo 503 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 504 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/os2_usb.c' object='libusb_1_0_la-os2_usb.lo' libtool=yes @AMDEPBACKSLASH@ 505 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 506 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-os2_usb.lo `test -f 'os/os2_usb.c' || echo '$(srcdir)/'`os/os2_usb.c 507 508 libusb_1_0_la-poll_windows.lo: os/poll_windows.c 509 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c 510 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo $(DEPDIR)/libusb_1_0_la-poll_windows.Plo 511 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 512 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/poll_windows.c' object='libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@ 513 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 514 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c 515 516 libusb_1_0_la-windows_usb.lo: os/windows_usb.c 517 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-windows_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c 518 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo $(DEPDIR)/libusb_1_0_la-windows_usb.Plo 519 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 520 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/windows_usb.c' object='libusb_1_0_la-windows_usb.lo' libtool=yes @AMDEPBACKSLASH@ 521 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 522 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c 523 524 libusb_1_0_la-hotplug.lo: hotplug.c 525 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-hotplug.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-hotplug.Tpo -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c 526 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-hotplug.Tpo $(DEPDIR)/libusb_1_0_la-hotplug.Plo 527 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 528 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hotplug.c' object='libusb_1_0_la-hotplug.lo' libtool=yes @AMDEPBACKSLASH@ 529 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 530 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-hotplug.lo `test -f 'hotplug.c' || echo '$(srcdir)/'`hotplug.c 531 532 libusb_1_0_la-threads_windows.lo: os/threads_windows.c 533 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c 534 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo $(DEPDIR)/libusb_1_0_la-threads_windows.Plo 535 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 536 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/threads_windows.c' object='libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@ 537 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 538 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c 539 540 libusb_1_0_la-threads_posix.lo: os/threads_posix.c 541 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c 542 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo $(DEPDIR)/libusb_1_0_la-threads_posix.Plo 543 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ 544 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/threads_posix.c' object='libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@ 545 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 546 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c 671 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync.c' object='libusb_1_0_la-sync.lo' libtool=yes @AMDEPBACKSLASH@ 672 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 673 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c 674 675 os/libusb_1_0_la-poll_posix.lo: os/poll_posix.c 676 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-poll_posix.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-poll_posix.Tpo -c -o os/libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c 677 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-poll_posix.Tpo os/$(DEPDIR)/libusb_1_0_la-poll_posix.Plo 678 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_posix.c' object='os/libusb_1_0_la-poll_posix.lo' libtool=yes @AMDEPBACKSLASH@ 679 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 680 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-poll_posix.lo `test -f 'os/poll_posix.c' || echo '$(srcdir)/'`os/poll_posix.c 681 682 os/libusb_1_0_la-poll_windows.lo: os/poll_windows.c 683 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-poll_windows.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o os/libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c 684 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-poll_windows.Tpo os/$(DEPDIR)/libusb_1_0_la-poll_windows.Plo 685 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/poll_windows.c' object='os/libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@ 686 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 687 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c 688 689 os/libusb_1_0_la-threads_windows.lo: os/threads_windows.c 690 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-threads_windows.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o os/libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c 691 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-threads_windows.Tpo os/$(DEPDIR)/libusb_1_0_la-threads_windows.Plo 692 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_windows.c' object='os/libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@ 693 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 694 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c 695 696 os/libusb_1_0_la-threads_posix.lo: os/threads_posix.c 697 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-threads_posix.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o os/libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c 698 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-threads_posix.Tpo os/$(DEPDIR)/libusb_1_0_la-threads_posix.Plo 699 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/threads_posix.c' object='os/libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@ 700 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 701 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c 702 703 os/libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c 704 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-darwin_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o os/libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c 705 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo 706 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/darwin_usb.c' object='os/libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@ 707 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 708 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c 709 710 os/libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c 711 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_usbfs.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o os/libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c 712 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo 713 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_usbfs.c' object='os/libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@ 714 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 715 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c 716 717 os/libusb_1_0_la-linux_netlink.lo: os/linux_netlink.c 718 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_netlink.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo -c -o os/libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c 719 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_netlink.Plo 720 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_netlink.c' object='os/libusb_1_0_la-linux_netlink.lo' libtool=yes @AMDEPBACKSLASH@ 721 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 722 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_netlink.lo `test -f 'os/linux_netlink.c' || echo '$(srcdir)/'`os/linux_netlink.c 723 724 os/libusb_1_0_la-linux_udev.lo: os/linux_udev.c 725 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-linux_udev.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-linux_udev.Tpo -c -o os/libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c 726 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-linux_udev.Tpo os/$(DEPDIR)/libusb_1_0_la-linux_udev.Plo 727 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/linux_udev.c' object='os/libusb_1_0_la-linux_udev.lo' libtool=yes @AMDEPBACKSLASH@ 728 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 729 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-linux_udev.lo `test -f 'os/linux_udev.c' || echo '$(srcdir)/'`os/linux_udev.c 730 731 os/libusb_1_0_la-netbsd_usb.lo: os/netbsd_usb.c 732 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-netbsd_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Tpo -c -o os/libusb_1_0_la-netbsd_usb.lo `test -f 'os/netbsd_usb.c' || echo '$(srcdir)/'`os/netbsd_usb.c 733 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-netbsd_usb.Plo 734 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/netbsd_usb.c' object='os/libusb_1_0_la-netbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ 735 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 736 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-netbsd_usb.lo `test -f 'os/netbsd_usb.c' || echo '$(srcdir)/'`os/netbsd_usb.c 737 738 os/libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c 739 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-openbsd_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o os/libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c 740 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo 741 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/openbsd_usb.c' object='os/libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ 742 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 743 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c 744 745 os/libusb_1_0_la-sunos_usb.lo: os/sunos_usb.c 746 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-sunos_usb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-sunos_usb.Tpo -c -o os/libusb_1_0_la-sunos_usb.lo `test -f 'os/sunos_usb.c' || echo '$(srcdir)/'`os/sunos_usb.c 747 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-sunos_usb.Tpo os/$(DEPDIR)/libusb_1_0_la-sunos_usb.Plo 748 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/sunos_usb.c' object='os/libusb_1_0_la-sunos_usb.lo' libtool=yes @AMDEPBACKSLASH@ 749 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 750 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-sunos_usb.lo `test -f 'os/sunos_usb.c' || echo '$(srcdir)/'`os/sunos_usb.c 751 752 os/libusb_1_0_la-windows_winusb.lo: os/windows_winusb.c 753 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-windows_winusb.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-windows_winusb.Tpo -c -o os/libusb_1_0_la-windows_winusb.lo `test -f 'os/windows_winusb.c' || echo '$(srcdir)/'`os/windows_winusb.c 754 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-windows_winusb.Tpo os/$(DEPDIR)/libusb_1_0_la-windows_winusb.Plo 755 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_winusb.c' object='os/libusb_1_0_la-windows_winusb.lo' libtool=yes @AMDEPBACKSLASH@ 756 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 757 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-windows_winusb.lo `test -f 'os/windows_winusb.c' || echo '$(srcdir)/'`os/windows_winusb.c 758 759 os/libusb_1_0_la-windows_nt_common.lo: os/windows_nt_common.c 760 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-windows_nt_common.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-windows_nt_common.Tpo -c -o os/libusb_1_0_la-windows_nt_common.lo `test -f 'os/windows_nt_common.c' || echo '$(srcdir)/'`os/windows_nt_common.c 761 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-windows_nt_common.Tpo os/$(DEPDIR)/libusb_1_0_la-windows_nt_common.Plo 762 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_nt_common.c' object='os/libusb_1_0_la-windows_nt_common.lo' libtool=yes @AMDEPBACKSLASH@ 763 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 764 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-windows_nt_common.lo `test -f 'os/windows_nt_common.c' || echo '$(srcdir)/'`os/windows_nt_common.c 765 766 os/libusb_1_0_la-windows_usbdk.lo: os/windows_usbdk.c 767 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT os/libusb_1_0_la-windows_usbdk.lo -MD -MP -MF os/$(DEPDIR)/libusb_1_0_la-windows_usbdk.Tpo -c -o os/libusb_1_0_la-windows_usbdk.lo `test -f 'os/windows_usbdk.c' || echo '$(srcdir)/'`os/windows_usbdk.c 768 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) os/$(DEPDIR)/libusb_1_0_la-windows_usbdk.Tpo os/$(DEPDIR)/libusb_1_0_la-windows_usbdk.Plo 769 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='os/windows_usbdk.c' object='os/libusb_1_0_la-windows_usbdk.lo' libtool=yes @AMDEPBACKSLASH@ 770 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 771 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o os/libusb_1_0_la-windows_usbdk.lo `test -f 'os/windows_usbdk.c' || echo '$(srcdir)/'`os/windows_usbdk.c 772 773 .cpp.o: 774 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 775 @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 776 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 777 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 778 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 779 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< 780 781 .cpp.obj: 782 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ 783 @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ 784 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 785 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 786 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 787 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 788 789 .cpp.lo: 790 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ 791 @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 792 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo 793 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 794 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 795 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< 547 796 548 797 mostlyclean-libtool: … … 551 800 clean-libtool: 552 801 -rm -rf .libs _libs 802 -rm -rf os/.libs os/_libs 553 803 install-hdrHEADERS: $(hdr_HEADERS) 554 804 @$(NORMAL_INSTALL) 555 test -z "$(hdrdir)" || $(MKDIR_P) "$(DESTDIR)$(hdrdir)"556 805 @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \ 806 if test -n "$$list"; then \ 807 echo " $(MKDIR_P) '$(DESTDIR)$(hdrdir)'"; \ 808 $(MKDIR_P) "$(DESTDIR)$(hdrdir)" || exit 1; \ 809 fi; \ 557 810 for p in $$list; do \ 558 811 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ … … 568 821 @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \ 569 822 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 570 test -n "$$files" || exit 0; \ 571 echo " ( cd '$(DESTDIR)$(hdrdir)' && rm -f" $$files ")"; \ 572 cd "$(DESTDIR)$(hdrdir)" && rm -f $$files 573 574 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 575 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 576 unique=`for i in $$list; do \ 577 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 578 done | \ 579 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 580 END { if (nonempty) { for (i in files) print i; }; }'`; \ 581 mkid -fID $$unique 582 tags: TAGS 583 584 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 585 $(TAGS_FILES) $(LISP) 823 dir='$(DESTDIR)$(hdrdir)'; $(am__uninstall_files_from_dir) 824 825 ID: $(am__tagged_files) 826 $(am__define_uniq_tagged_files); mkid -fID $$unique 827 tags: tags-am 828 TAGS: tags 829 830 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 586 831 set x; \ 587 832 here=`pwd`; \ 588 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 589 unique=`for i in $$list; do \ 590 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 591 done | \ 592 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 593 END { if (nonempty) { for (i in files) print i; }; }'`; \ 833 $(am__define_uniq_tagged_files); \ 594 834 shift; \ 595 835 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ … … 603 843 fi; \ 604 844 fi 605 ctags: CTAGS 606 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 607 $(TAGS_FILES) $(LISP) 608 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 609 unique=`for i in $$list; do \ 610 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 611 done | \ 612 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 613 END { if (nonempty) { for (i in files) print i; }; }'`; \ 845 ctags: ctags-am 846 847 CTAGS: ctags 848 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 849 $(am__define_uniq_tagged_files); \ 614 850 test -z "$(CTAGS_ARGS)$$unique" \ 615 851 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ … … 620 856 && $(am__cd) $(top_srcdir) \ 621 857 && gtags -i $(GTAGS_ARGS) "$$here" 858 cscopelist: cscopelist-am 859 860 cscopelist-am: $(am__tagged_files) 861 list='$(am__tagged_files)'; \ 862 case "$(srcdir)" in \ 863 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 864 *) sdir=$(subdir)/$(srcdir) ;; \ 865 esac; \ 866 for i in $$list; do \ 867 if test -f "$$i"; then \ 868 echo "$(subdir)/$$i"; \ 869 else \ 870 echo "$$sdir/$$i"; \ 871 fi; \ 872 done >> $(top_builddir)/cscope.files 622 873 623 874 distclean-tags: … … 656 907 check-am: all-am 657 908 check: check-am 658 all-am: Makefile $(LTLIBRARIES) $( OS2_DLL_NAME).dll $(HEADERS)909 all-am: Makefile $(LTLIBRARIES) $(HEADERS) 659 910 installdirs: 660 911 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"; do \ … … 671 922 installcheck: installcheck-am 672 923 install-strip: 673 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 674 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 675 `test -z '$(STRIP)' || \ 676 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 924 if test -z '$(STRIP)'; then \ 925 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 926 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 927 install; \ 928 else \ 929 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 930 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 931 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 932 fi 677 933 mostlyclean-generic: 678 934 … … 682 938 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 683 939 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 940 -rm -f os/$(DEPDIR)/$(am__dirstamp) 941 -rm -f os/$(am__dirstamp) 684 942 685 943 maintainer-clean-generic: … … 689 947 690 948 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ 691 mostlyclean-am949 clean-noinstLTLIBRARIES mostlyclean-am 692 950 693 951 distclean: distclean-am 694 -rm -rf ./$(DEPDIR) 952 -rm -rf ./$(DEPDIR) os/$(DEPDIR) 695 953 -rm -f Makefile 696 954 distclean-am: clean-am distclean-compile distclean-generic \ … … 738 996 739 997 maintainer-clean: maintainer-clean-am 740 -rm -rf ./$(DEPDIR) 998 -rm -rf ./$(DEPDIR) os/$(DEPDIR) 741 999 -rm -f Makefile 742 1000 maintainer-clean-am: distclean-am maintainer-clean-generic … … 759 1017 .MAKE: install-am install-strip 760 1018 761 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 762 clean-libLTLIBRARIES clean-libtool ctags distclean \ 763 distclean-compile distclean-generic distclean-libtool \ 764 distclean-tags distdir dvi dvi-am html html-am info info-am \ 765 install install-am install-data install-data-am install-dvi \ 766 install-dvi-am install-exec install-exec-am install-hdrHEADERS \ 767 install-html install-html-am install-info install-info-am \ 1019 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ 1020 clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ 1021 cscopelist-am ctags ctags-am distclean distclean-compile \ 1022 distclean-generic distclean-libtool distclean-tags distdir dvi \ 1023 dvi-am html html-am info info-am install install-am \ 1024 install-data install-data-am install-dvi install-dvi-am \ 1025 install-exec install-exec-am install-hdrHEADERS install-html \ 1026 install-html-am install-info install-info-am \ 768 1027 install-libLTLIBRARIES install-man install-pdf install-pdf-am \ 769 1028 install-ps install-ps-am install-strip installcheck \ … … 771 1030 maintainer-clean-generic mostlyclean mostlyclean-compile \ 772 1031 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 773 tags uninstall uninstall-am uninstall-hdrHEADERS \1032 tags tags-am uninstall uninstall-am uninstall-hdrHEADERS \ 774 1033 uninstall-libLTLIBRARIES 775 1034 1035 all: libusb-1.0.la libusb-1.0.dll 776 1036 777 1037 @OS_WINDOWS_TRUE@.rc.lo: 778 1038 @OS_WINDOWS_TRUE@ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@ 779 1039 780 @OS_WINDOWS_TRUE@libusb-1.0.rc: version.h 1040 @OS_WINDOWS_TRUE@libusb-1.0.rc: version.h version_nano.h 1041 1042 libusb-1.0.dll: libusb-1.0.def libusb-1.0.la 1043 # Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged 1044 @CREATE_IMPORT_LIB_TRUE@ $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a 781 1045 782 1046 # Tell versions [3.59,3.63) of GNU make to not export all variables. 783 1047 # Otherwise a system limit (for SysV at least) may be exceeded. 784 1048 .NOEXPORT: 785 786 $(OS2_DLL_NAME).dll: lib$(OS2_LA_NAME).la787 rm -f .libs/$(OS2_DLL_NAME)*.a788 ar cru .libs/$(OS2_LA_NAME)_s.a $(OS2_DLL_OBJ)789 echo "LIBRARY $(OS2_DLL_NAME) INITINSTANCE TERMINSTANCE" > $(OS2_DLL_NAME).def790 echo "DATA MULTIPLE" >> $(OS2_DLL_NAME).def791 echo "EXPORTS" >> $(OS2_DLL_NAME).def792 emxexp $(OS2_DLL_OBJ) >> $(OS2_DLL_NAME).def793 gcc -g -Zbin-files -Zhigh-mem -Zomf -Zdll $(OS2_DLL_NAME).def -o $@ $(OS2_DLL_OBJ) $(OS2_DLL_LIBS)794 emximp -o .libs/$(OS2_LA_NAME).a $(OS2_DLL_NAME).def795 emximp -o .libs/$(OS2_LA_NAME).lib $(OS2_DLL_NAME).def796 cp $@ .libs -
TabularUnified libusb1/trunk/libusb/core.c ¶
r1879 r1882 1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 1 2 /* 2 3 * Core functions for libusb 3 * Copyright (c)2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu>4 * Copyright (C)2007-2008 Daniel Drake <dsd@gentoo.org>5 * Copyright (c)2001 Johannes Erdfelt <johannes@erdfelt.com>4 * Copyright © 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu> 5 * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org> 6 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 20 21 */ 21 22 22 #include <config.h>23 #include "config.h" 23 24 24 25 #include <errno.h> … … 27 28 #include <stdlib.h> 28 29 #include <string.h> 30 #ifdef HAVE_SYS_TYPES_H 29 31 #include <sys/types.h> 30 32 #endif 31 33 #ifdef HAVE_SYS_TIME_H 32 34 #include <sys/time.h> 35 #endif 36 #ifdef HAVE_SYSLOG_H 37 #include <syslog.h> 38 #endif 39 40 #ifdef __ANDROID__ 41 #include <android/log.h> 33 42 #endif 34 43 … … 42 51 #elif defined(OS_OPENBSD) 43 52 const struct usbi_os_backend * const usbi_backend = &openbsd_backend; 53 #elif defined(OS_NETBSD) 54 const struct usbi_os_backend * const usbi_backend = &netbsd_backend; 44 55 #elif defined(OS_WINDOWS) 56 57 #if defined(USE_USBDK) 58 const struct usbi_os_backend * const usbi_backend = &usbdk_backend; 59 #else 45 60 const struct usbi_os_backend * const usbi_backend = &windows_backend; 61 #endif 62 63 #elif defined(OS_WINCE) 64 const struct usbi_os_backend * const usbi_backend = &wince_backend; 65 #elif defined(OS_HAIKU) 66 const struct usbi_os_backend * const usbi_backend = &haiku_usb_raw_backend; 67 #elif defined (OS_SUNOS) 68 const struct usbi_os_backend * const usbi_backend = &sunos_backend; 46 69 #elif defined(OS_OS2) 47 70 const struct usbi_os_backend * const usbi_backend = &os2_backend; … … 50 73 #endif 51 74 52 const struct libusb_version libusb_version_internal = {53 LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO, LIBUSB_RC,54 LIBUSB_DESCRIBE55 };56 57 75 struct libusb_context *usbi_default_context = NULL; 76 static const struct libusb_version libusb_version_internal = 77 { LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO, 78 LIBUSB_RC, "http://libusb.info" }; 58 79 static int default_context_refcnt = 0; 59 80 static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER; 81 static struct timeval timestamp_origin = { 0, 0 }; 60 82 61 83 usbi_mutex_static_t active_contexts_lock = USBI_MUTEX_INITIALIZER; … … 69 91 * libusb is an open source library that allows you to communicate with USB 70 92 * devices from userspace. For more info, see the 71 * <a href="http://libusb. sourceforge.net">libusb homepage</a>.93 * <a href="http://libusb.info">libusb homepage</a>. 72 94 * 73 95 * This documentation is aimed at application developers wishing to 74 96 * communicate with USB peripherals from their own software. After reviewing 75 97 * this documentation, feedback and questions can be sent to the 76 * <a href="http://sourceforge.net/mail/?group_id=1674">libusb-devel mailing 77 * list</a>. 98 * <a href="http://mailing-list.libusb.info">libusb-devel mailing list</a>. 78 99 * 79 100 * This documentation assumes knowledge of how to operate USB devices from 80 101 * a software standpoint (descriptors, configurations, interfaces, endpoints, 81 102 * control/bulk/interrupt/isochronous transfers, etc). Full information 82 * can be found in the <a href="http://www.usb.org/developers/docs/">USB 2.0103 * can be found in the <a href="http://www.usb.org/developers/docs/">USB 3.0 83 104 * Specification</a> which is available for free download. You can probably 84 105 * find less verbose introductions by searching the web. 106 * 107 * \section API Application Programming Interface (API) 108 * 109 * See the \ref libusb_api page for a complete list of the libusb functions. 85 110 * 86 111 * \section features Library features … … 94 119 * - Lightweight with lean API 95 120 * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer 96 * - Hotplug support ( see \ref hotplug)121 * - Hotplug support (on some platforms). See \ref libusb_hotplug. 97 122 * 98 123 * \section gettingstarted Getting Started … … 102 127 * 103 128 * One decision you will have to make is whether to use the synchronous 104 * or the asynchronous data transfer interface. The \ref io documentation129 * or the asynchronous data transfer interface. The \ref libusb_io documentation 105 130 * provides some insight into this topic. 106 131 * … … 113 138 * libusb functions typically return 0 on success or a negative error code 114 139 * on failure. These negative error codes relate to LIBUSB_ERROR constants 115 * which are listed on the \ref misc "miscellaneous" documentation page.140 * which are listed on the \ref libusb_misc "miscellaneous" documentation page. 116 141 * 117 142 * \section msglog Debug message logging 118 143 * 119 * libusb does not log any messages by default. Your application is therefore 120 * free to close stdout/stderr and those descriptors may be reused without 121 * worry. 122 * 123 * The libusb_set_debug() function can be used to enable stdout/stderr logging 124 * of certain messages. Under standard configuration, libusb doesn't really 125 * log much at all, so you are advised to use this function to enable all 126 * error/warning/informational messages. It will help you debug problems with 127 * your software. 144 * libusb uses stderr for all logging. By default, logging is set to NONE, 145 * which means that no output will be produced. However, unless the library 146 * has been compiled with logging disabled, then any application calls to 147 * libusb_set_debug(), or the setting of the environmental variable 148 * LIBUSB_DEBUG outside of the application, can result in logging being 149 * produced. Your application should therefore not close stderr, but instead 150 * direct it to the null device if its output is undesirable. 151 * 152 * The libusb_set_debug() function can be used to enable logging of certain 153 * messages. Under standard configuration, libusb doesn't really log much 154 * so you are advised to use this function to enable all error/warning/ 155 * informational messages. It will help debug problems with your software. 128 156 * 129 157 * The logged messages are unstructured. There is no one-to-one correspondence … … 131 159 * libusb functions. There is no format to the messages, so you should not 132 160 * try to capture or parse them. They are not and will not be localized. 133 * These messages are not suitable forbeing passed to your application user;161 * These messages are not intended to being passed to your application user; 134 162 * instead, you should interpret the error codes returned from libusb functions 135 163 * and provide appropriate notification to the user. The messages are simply … … 139 167 * 140 168 * The LIBUSB_DEBUG environment variable can be used to enable message logging 141 * at run-time. This environment variable should be set to a number, which is142 * interpreted the same as the libusb_set_debug() parameter. When this169 * at run-time. This environment variable should be set to a log level number, 170 * which is interpreted the same as the libusb_set_debug() parameter. When this 143 171 * environment variable is set, the message logging verbosity level is fixed 144 172 * and libusb_set_debug() effectively does nothing. … … 148 176 * variable have no effects. 149 177 * 150 * libusb can also be compiled with verbose debugging messages . When the151 * library is compiled in this way, all messages of all verbosities are always152 * logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable have153 * no effects.178 * libusb can also be compiled with verbose debugging messages always. When 179 * the library is compiled in this way, all messages of all verbosities are 180 * always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable 181 * have no effects. 154 182 * 155 183 * \section remarks Other remarks 156 184 * 157 * libusb does have imperfections. The \ref caveats "caveats" page attempts185 * libusb does have imperfections. The \ref libusb_caveats "caveats" page attempts 158 186 * to document these. 159 187 */ 160 188 161 189 /** 162 * \page caveats Caveats190 * \page libusb_caveats Caveats 163 191 * 164 192 * \section devresets Device resets … … 206 234 * libusb_set_configuration() using the same configuration value will cause 207 235 * a lightweight device reset. This may not be desirable behaviour. 208 * -# libusb will be unable to change configuration if the device is in209 * another configuration and other programs or drivers have claimed210 * interfaces under that configuration.211 236 * -# In the case where the desired configuration is already active, libusb 212 237 * may not even be able to perform a lightweight device reset. For example, … … 217 242 * perform the lightweight device reset, so libusb_set_configuration() will 218 243 * fail. (Luckily the device in question only has a single configuration.) 244 * -# libusb will be unable to set a configuration if other programs or 245 * drivers have claimed interfaces. In particular, this means that kernel 246 * drivers must be detached from all the interfaces before 247 * libusb_set_configuration() may succeed. 219 248 * 220 249 * One solution to some of the above problems is to consider the currently … … 222 251 * we don't have to select any configuration: 223 252 \code 224 cfg = libusb_get_configuration(dev); 253 cfg = -1; 254 libusb_get_configuration(dev, &cfg); 225 255 if (cfg != desired) 226 256 libusb_set_configuration(dev, desired); … … 257 287 * 258 288 * On legacy platforms, libusb is unable to do this in all situations. After 259 * the incomplete packet occurs, "surplus" data may be transferred. Prior to 260 * libusb v1.0.2, this information was lost (and for device-to-host transfers, 261 * the corresponding data was discarded). As of libusb v1.0.3, this information 262 * is kept (the data length of the transfer is updated) and, for device-to-host 263 * transfers, any surplus data was added to the buffer. Still, this is not 264 * a nice solution because it loses the information about the end of the short 265 * packet, and the user probably wanted that surplus data to arrive in the next 266 * logical transfer. 267 * 268 * A previous workaround was to only ever submit transfers of size 16kb or 269 * less. 270 * 271 * As of libusb v1.0.4 and Linux v2.6.32, this is fixed. A technical 272 * explanation of this issue follows. 273 * 274 * When you ask libusb to submit a bulk transfer larger than 16kb in size, 275 * libusb breaks it up into a number of smaller subtransfers. This is because 276 * the usbfs kernel interface only accepts transfers of up to 16kb in size. 277 * The subtransfers are submitted all at once so that the kernel can queue 278 * them at the hardware level, therefore maximizing bus throughput. 279 * 280 * On legacy platforms, this caused problems when transfers completed early. 281 * Upon this event, the kernel would terminate all further packets in that 282 * subtransfer (but not any following ones). libusb would note this event and 283 * immediately cancel any following subtransfers that had been queued, 284 * but often libusb was not fast enough, and the following subtransfers had 285 * started before libusb got around to cancelling them. 286 * 287 * Thanks to an API extension to usbfs, this is fixed with recent kernel and 288 * libusb releases. The solution was to allow libusb to communicate to the 289 * kernel where boundaries occur between logical libusb-level transfers. When 290 * a short transfer (or other error) occurs, the kernel will cancel all the 291 * subtransfers until the boundary without allowing those transfers to start. 289 * the incomplete packet occurs, "surplus" data may be transferred. For recent 290 * versions of libusb, this information is kept (the data length of the 291 * transfer is updated) and, for device-to-host transfers, any surplus data was 292 * added to the buffer. Still, this is not a nice solution because it loses the 293 * information about the end of the short packet, and the user probably wanted 294 * that surplus data to arrive in the next logical transfer. 295 * 292 296 * 293 297 * \section zlp Zero length packets 294 298 * 295 299 * - libusb is able to send a packet of zero length to an endpoint simply by 296 * submitting a transfer of zero length. On Linux, this did not work with 297 * libusb versions prior to 1.0.3 and kernel versions prior to 2.6.31. 300 * submitting a transfer of zero length. 298 301 * - The \ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET 299 302 * "LIBUSB_TRANSFER_ADD_ZERO_PACKET" flag is currently only supported on Linux. … … 301 304 302 305 /** 303 * \page contexts Contexts306 * \page libusb_contexts Contexts 304 307 * 305 308 * It is possible that libusb may be used simultaneously from two independent … … 339 342 */ 340 343 344 /** 345 * \page libusb_api Application Programming Interface 346 * 347 * This is the complete list of libusb functions, structures and 348 * enumerations in alphabetical order. 349 * 350 * \section Functions 351 * - libusb_alloc_streams() 352 * - libusb_alloc_transfer() 353 * - libusb_attach_kernel_driver() 354 * - libusb_bulk_transfer() 355 * - libusb_cancel_transfer() 356 * - libusb_claim_interface() 357 * - libusb_clear_halt() 358 * - libusb_close() 359 * - libusb_control_transfer() 360 * - libusb_control_transfer_get_data() 361 * - libusb_control_transfer_get_setup() 362 * - libusb_cpu_to_le16() 363 * - libusb_detach_kernel_driver() 364 * - libusb_dev_mem_alloc() 365 * - libusb_dev_mem_free() 366 * - libusb_error_name() 367 * - libusb_event_handler_active() 368 * - libusb_event_handling_ok() 369 * - libusb_exit() 370 * - libusb_fill_bulk_stream_transfer() 371 * - libusb_fill_bulk_transfer() 372 * - libusb_fill_control_setup() 373 * - libusb_fill_control_transfer() 374 * - libusb_fill_interrupt_transfer() 375 * - libusb_fill_iso_transfer() 376 * - libusb_free_bos_descriptor() 377 * - libusb_free_config_descriptor() 378 * - libusb_free_container_id_descriptor() 379 * - libusb_free_device_list() 380 * - libusb_free_pollfds() 381 * - libusb_free_ss_endpoint_companion_descriptor() 382 * - libusb_free_ss_usb_device_capability_descriptor() 383 * - libusb_free_streams() 384 * - libusb_free_transfer() 385 * - libusb_free_usb_2_0_extension_descriptor() 386 * - libusb_get_active_config_descriptor() 387 * - libusb_get_bos_descriptor() 388 * - libusb_get_bus_number() 389 * - libusb_get_config_descriptor() 390 * - libusb_get_config_descriptor_by_value() 391 * - libusb_get_configuration() 392 * - libusb_get_container_id_descriptor() 393 * - libusb_get_descriptor() 394 * - libusb_get_device() 395 * - libusb_get_device_address() 396 * - libusb_get_device_descriptor() 397 * - libusb_get_device_list() 398 * - libusb_get_device_speed() 399 * - libusb_get_iso_packet_buffer() 400 * - libusb_get_iso_packet_buffer_simple() 401 * - libusb_get_max_iso_packet_size() 402 * - libusb_get_max_packet_size() 403 * - libusb_get_next_timeout() 404 * - libusb_get_parent() 405 * - libusb_get_pollfds() 406 * - libusb_get_port_number() 407 * - libusb_get_port_numbers() 408 * - libusb_get_port_path() 409 * - libusb_get_ss_endpoint_companion_descriptor() 410 * - libusb_get_ss_usb_device_capability_descriptor() 411 * - libusb_get_string_descriptor() 412 * - libusb_get_string_descriptor_ascii() 413 * - libusb_get_usb_2_0_extension_descriptor() 414 * - libusb_get_version() 415 * - libusb_handle_events() 416 * - libusb_handle_events_completed() 417 * - libusb_handle_events_locked() 418 * - libusb_handle_events_timeout() 419 * - libusb_handle_events_timeout_completed() 420 * - libusb_has_capability() 421 * - libusb_hotplug_deregister_callback() 422 * - libusb_hotplug_register_callback() 423 * - libusb_init() 424 * - libusb_interrupt_event_handler() 425 * - libusb_interrupt_transfer() 426 * - libusb_kernel_driver_active() 427 * - libusb_lock_events() 428 * - libusb_lock_event_waiters() 429 * - libusb_open() 430 * - libusb_open_device_with_vid_pid() 431 * - libusb_pollfds_handle_timeouts() 432 * - libusb_ref_device() 433 * - libusb_release_interface() 434 * - libusb_reset_device() 435 * - libusb_set_auto_detach_kernel_driver() 436 * - libusb_set_configuration() 437 * - libusb_set_debug() 438 * - libusb_set_interface_alt_setting() 439 * - libusb_set_iso_packet_lengths() 440 * - libusb_setlocale() 441 * - libusb_set_pollfd_notifiers() 442 * - libusb_strerror() 443 * - libusb_submit_transfer() 444 * - libusb_transfer_get_stream_id() 445 * - libusb_transfer_set_stream_id() 446 * - libusb_try_lock_events() 447 * - libusb_unlock_events() 448 * - libusb_unlock_event_waiters() 449 * - libusb_unref_device() 450 * - libusb_wait_for_event() 451 * 452 * \section Structures 453 * - libusb_bos_descriptor 454 * - libusb_bos_dev_capability_descriptor 455 * - libusb_config_descriptor 456 * - libusb_container_id_descriptor 457 * - \ref libusb_context 458 * - libusb_control_setup 459 * - \ref libusb_device 460 * - libusb_device_descriptor 461 * - \ref libusb_device_handle 462 * - libusb_endpoint_descriptor 463 * - libusb_interface 464 * - libusb_interface_descriptor 465 * - libusb_iso_packet_descriptor 466 * - libusb_pollfd 467 * - libusb_ss_endpoint_companion_descriptor 468 * - libusb_ss_usb_device_capability_descriptor 469 * - libusb_transfer 470 * - libusb_usb_2_0_extension_descriptor 471 * - libusb_version 472 * 473 * \section Enums 474 * - \ref libusb_bos_type 475 * - \ref libusb_capability 476 * - \ref libusb_class_code 477 * - \ref libusb_descriptor_type 478 * - \ref libusb_endpoint_direction 479 * - \ref libusb_error 480 * - \ref libusb_iso_sync_type 481 * - \ref libusb_iso_usage_type 482 * - \ref libusb_log_level 483 * - \ref libusb_request_recipient 484 * - \ref libusb_request_type 485 * - \ref libusb_speed 486 * - \ref libusb_ss_usb_device_capability_attributes 487 * - \ref libusb_standard_request 488 * - \ref libusb_supported_speed 489 * - \ref libusb_transfer_flags 490 * - \ref libusb_transfer_status 491 * - \ref libusb_transfer_type 492 * - \ref libusb_usb_2_0_extension_attributes 493 */ 494 341 495 /** 342 * @defgroup lib Library initialization/deinitialization496 * @defgroup libusb_lib Library initialization/deinitialization 343 497 * This page details how to initialize and deinitialize libusb. Initialization 344 498 * must be performed before using any libusb functionality, and similarly you … … 347 501 348 502 /** 349 * @defgroup dev Device handling and enumeration503 * @defgroup libusb_dev Device handling and enumeration 350 504 * The functionality documented below is designed to help with the following 351 505 * operations: … … 457 611 */ 458 612 459 /** @defgroup misc Miscellaneous */613 /** @defgroup libusb_misc Miscellaneous */ 460 614 461 615 /* we traverse usbfs without knowing how many devices we are going to find. … … 478 632 } 479 633 634 static void discovered_devs_free(struct discovered_devs *discdevs) 635 { 636 size_t i; 637 638 for (i = 0; i < discdevs->len; i++) 639 libusb_unref_device(discdevs->devices[i]); 640 641 free(discdevs); 642 } 643 480 644 /* append a device to the discovered devices collection. may realloc itself, 481 645 * returning new discdevs. returns NULL on realloc failure. */ … … 485 649 size_t len = discdevs->len; 486 650 size_t capacity; 651 struct discovered_devs *new_discdevs; 487 652 488 653 /* if there is space, just append the device */ … … 496 661 usbi_dbg("need to increase capacity"); 497 662 capacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP; 498 discdevs = realloc(discdevs, 663 /* can't use usbi_reallocf here because in failure cases it would 664 * free the existing discdevs without unreferencing its devices. */ 665 new_discdevs = realloc(discdevs, 499 666 sizeof(*discdevs) + (sizeof(void *) * capacity)); 500 if (discdevs) { 501 discdevs->capacity = capacity; 502 discdevs->devices[len] = libusb_ref_device(dev); 503 discdevs->len++; 504 } 667 if (!new_discdevs) { 668 discovered_devs_free(discdevs); 669 return NULL; 670 } 671 672 discdevs = new_discdevs; 673 discdevs->capacity = capacity; 674 discdevs->devices[len] = libusb_ref_device(dev); 675 discdevs->len++; 505 676 506 677 return discdevs; 507 }508 509 static void discovered_devs_free(struct discovered_devs *discdevs)510 {511 size_t i;512 513 for (i = 0; i < discdevs->len; i++)514 libusb_unref_device(discdevs->devices[i]);515 516 free(discdevs);517 678 } 518 679 … … 529 690 return NULL; 530 691 531 r = usbi_mutex_init(&dev->lock , NULL);692 r = usbi_mutex_init(&dev->lock); 532 693 if (r) { 533 694 free(dev); … … 539 700 dev->session_data = session_id; 540 701 dev->speed = LIBUSB_SPEED_UNKNOWN; 541 memset(&dev->os_priv, 0, priv_size);542 702 543 703 if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { … … 550 710 void usbi_connect_device(struct libusb_device *dev) 551 711 { 552 libusb_hotplug_message message = {LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, dev}; 553 int ret; 712 struct libusb_context *ctx = DEVICE_CTX(dev); 554 713 555 714 dev->attached = 1; … … 559 718 usbi_mutex_unlock(&dev->ctx->usb_devs_lock); 560 719 561 /* Signal that an event has occurred for this device if we support hotplug AND 562 the hotplug pipe is ready. This prevents an event from getting raised during 563 initial enumeration. */ 564 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) { 565 ret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof (message)); 566 if (sizeof (message) != ret) { 567 usbi_err(DEVICE_CTX(dev), "error writing hotplug message"); 568 } 569 } 720 /* Signal that an event has occurred for this device if we support hotplug AND 721 * the hotplug message list is ready. This prevents an event from getting raised 722 * during initial enumeration. */ 723 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_msgs.next) { 724 usbi_hotplug_notification(ctx, dev, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED); 725 } 570 726 } 571 727 572 728 void usbi_disconnect_device(struct libusb_device *dev) 573 729 { 574 libusb_hotplug_message message = {LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, dev}; 575 struct libusb_context *ctx = dev->ctx; 576 int ret; 730 struct libusb_context *ctx = DEVICE_CTX(dev); 577 731 578 732 usbi_mutex_lock(&dev->lock); … … 580 734 usbi_mutex_unlock(&dev->lock); 581 735 582 /* Signal that an event has occurred for this device if we support hotplug AND583 the hotplug pipe is ready. This prevents an event from getting raised during584 initial enumeration. libusb_handle_events will take care of dereferencing the585 device. */586 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) {587 ret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof (message));588 if (sizeof(message) != ret) {589 usbi_err(DEVICE_CTX(dev), "error writing hotplug message");590 }591 }592 593 736 usbi_mutex_lock(&ctx->usb_devs_lock); 594 737 list_del(&dev->list); 595 738 usbi_mutex_unlock(&ctx->usb_devs_lock); 739 740 /* Signal that an event has occurred for this device if we support hotplug AND 741 * the hotplug message list is ready. This prevents an event from getting raised 742 * during initial enumeration. libusb_handle_events will take care of dereferencing 743 * the device. */ 744 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_msgs.next) { 745 usbi_hotplug_notification(ctx, dev, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT); 746 } 596 747 } 597 748 … … 631 782 list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) 632 783 if (dev->session_data == session_id) { 633 ret = dev;784 ret = libusb_ref_device(dev); 634 785 break; 635 786 } … … 639 790 } 640 791 641 /** @ingroup dev792 /** @ingroup libusb_dev 642 793 * Returns a list of USB devices currently attached to the system. This is 643 794 * your entry point into finding a USB device to operate. … … 656 807 * \param list output location for a list of devices. Must be later freed with 657 808 * libusb_free_device_list(). 658 * \returns The number of devices in the outputted list, or any809 * \returns the number of devices in the outputted list, or any 659 810 * \ref libusb_error according to errors encountered by the backend. 660 811 */ … … 675 826 /* backend provides hotplug support */ 676 827 struct libusb_device *dev; 828 829 if (usbi_backend->hotplug_poll) 830 usbi_backend->hotplug_poll(); 677 831 678 832 usbi_mutex_lock(&ctx->usb_devs_lock); … … 698 852 /* convert discovered_devs into a list */ 699 853 len = discdevs->len; 700 ret = malloc(sizeof(void *) * (len + 1));854 ret = calloc(len + 1, sizeof(struct libusb_device *)); 701 855 if (!ret) { 702 856 len = LIBUSB_ERROR_NO_MEM; … … 712 866 713 867 out: 714 discovered_devs_free(discdevs); 868 if (discdevs) 869 discovered_devs_free(discdevs); 715 870 return len; 716 871 } 717 872 718 /** \ingroup dev873 /** \ingroup libusb_dev 719 874 * Frees a list of devices previously discovered using 720 875 * libusb_get_device_list(). If the unref_devices parameter is set, the … … 739 894 } 740 895 741 /** \ingroup dev896 /** \ingroup libusb_dev 742 897 * Get the number of the bus that a device is connected to. 743 898 * \param dev a device … … 749 904 } 750 905 751 /** \ingroup dev 906 /** \ingroup libusb_dev 907 * Get the number of the port that a device is connected to. 908 * Unless the OS does something funky, or you are hot-plugging USB extension cards, 909 * the port number returned by this call is usually guaranteed to be uniquely tied 910 * to a physical port, meaning that different devices plugged on the same physical 911 * port should return the same port number. 912 * 913 * But outside of this, there is no guarantee that the port number returned by this 914 * call will remain the same, or even match the order in which ports have been 915 * numbered by the HUB/HCD manufacturer. 916 * 917 * \param dev a device 918 * \returns the port number (0 if not available) 919 */ 920 uint8_t API_EXPORTED libusb_get_port_number(libusb_device *dev) 921 { 922 return dev->port_number; 923 } 924 925 /** \ingroup libusb_dev 926 * Get the list of all port numbers from root for the specified device 927 * 928 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 929 * \param dev a device 930 * \param port_numbers the array that should contain the port numbers 931 * \param port_numbers_len the maximum length of the array. As per the USB 3.0 932 * specs, the current maximum limit for the depth is 7. 933 * \returns the number of elements filled 934 * \returns LIBUSB_ERROR_OVERFLOW if the array is too small 935 */ 936 int API_EXPORTED libusb_get_port_numbers(libusb_device *dev, 937 uint8_t* port_numbers, int port_numbers_len) 938 { 939 int i = port_numbers_len; 940 struct libusb_context *ctx = DEVICE_CTX(dev); 941 942 if (port_numbers_len <= 0) 943 return LIBUSB_ERROR_INVALID_PARAM; 944 945 // HCDs can be listed as devices with port #0 946 while((dev) && (dev->port_number != 0)) { 947 if (--i < 0) { 948 usbi_warn(ctx, "port numbers array is too small"); 949 return LIBUSB_ERROR_OVERFLOW; 950 } 951 port_numbers[i] = dev->port_number; 952 dev = dev->parent_dev; 953 } 954 if (i < port_numbers_len) 955 memmove(port_numbers, &port_numbers[i], port_numbers_len - i); 956 return port_numbers_len - i; 957 } 958 959 /** \ingroup libusb_dev 960 * Deprecated please use libusb_get_port_numbers instead. 961 */ 962 int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev, 963 uint8_t* port_numbers, uint8_t port_numbers_len) 964 { 965 UNUSED(ctx); 966 967 return libusb_get_port_numbers(dev, port_numbers, port_numbers_len); 968 } 969 970 /** \ingroup libusb_dev 971 * Get the the parent from the specified device. 972 * \param dev a device 973 * \returns the device parent or NULL if not available 974 * You should issue a \ref libusb_get_device_list() before calling this 975 * function and make sure that you only access the parent before issuing 976 * \ref libusb_free_device_list(). The reason is that libusb currently does 977 * not maintain a permanent list of device instances, and therefore can 978 * only guarantee that parents are fully instantiated within a 979 * libusb_get_device_list() - libusb_free_device_list() block. 980 */ 981 DEFAULT_VISIBILITY 982 libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev) 983 { 984 return dev->parent_dev; 985 } 986 987 /** \ingroup libusb_dev 752 988 * Get the address of the device on the bus it is connected to. 753 989 * \param dev a device … … 759 995 } 760 996 761 /** \ingroup dev997 /** \ingroup libusb_dev 762 998 * Get the negotiated connection speed for a device. 763 999 * \param dev a device … … 795 1031 } 796 1032 797 /** \ingroup dev1033 /** \ingroup libusb_dev 798 1034 * Convenience function to retrieve the wMaxPacketSize value for a particular 799 1035 * endpoint in the active device configuration. … … 826 1062 827 1063 ep = find_endpoint(config, endpoint); 828 if (!ep) 829 return LIBUSB_ERROR_NOT_FOUND; 1064 if (!ep) { 1065 r = LIBUSB_ERROR_NOT_FOUND; 1066 goto out; 1067 } 830 1068 831 1069 r = ep->wMaxPacketSize; 1070 1071 out: 832 1072 libusb_free_config_descriptor(config); 833 1073 return r; 834 1074 } 835 1075 836 /** \ingroup dev1076 /** \ingroup libusb_dev 837 1077 * Calculate the maximum packet size which a specific endpoint is capable is 838 1078 * sending or receiving in the duration of 1 microframe 839 1079 * 840 * Only the active configu tion is examined. The calculation is based on the1080 * Only the active configuration is examined. The calculation is based on the 841 1081 * wMaxPacketSize field in the endpoint descriptor as described in section 842 1082 * 9.6.6 in the USB 2.0 specifications. … … 877 1117 878 1118 ep = find_endpoint(config, endpoint); 879 if (!ep) 880 return LIBUSB_ERROR_NOT_FOUND; 1119 if (!ep) { 1120 r = LIBUSB_ERROR_NOT_FOUND; 1121 goto out; 1122 } 881 1123 882 1124 val = ep->wMaxPacketSize; 883 ep_type = ep->bmAttributes & 0x3; 884 libusb_free_config_descriptor(config); 1125 ep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3); 885 1126 886 1127 r = val & 0x07ff; … … 888 1129 || ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT) 889 1130 r *= (1 + ((val >> 11) & 3)); 1131 1132 out: 1133 libusb_free_config_descriptor(config); 890 1134 return r; 891 1135 } 892 1136 893 /** \ingroup dev1137 /** \ingroup libusb_dev 894 1138 * Increment the reference count of a device. 895 1139 * \param dev the device to reference … … 905 1149 } 906 1150 907 /** \ingroup dev1151 /** \ingroup libusb_dev 908 1152 * Decrement the reference count of a device. If the decrement operation 909 1153 * causes the reference count to reach zero, the device shall be destroyed. … … 923 1167 if (refcnt == 0) { 924 1168 usbi_dbg("destroy device %d.%d", dev->bus_number, dev->device_address); 1169 1170 libusb_unref_device(dev->parent_dev); 925 1171 926 1172 if (usbi_backend->destroy_device) … … 938 1184 939 1185 /* 940 * Interrupt the iteration of the event handling thread, so that it picks941 * up the new fd.942 */ 943 void usbi_fd_notification(struct libusb_context *ctx)1186 * Signal the event pipe so that the event handling thread will be 1187 * interrupted to process an internal event. 1188 */ 1189 int usbi_signal_event(struct libusb_context *ctx) 944 1190 { 945 1191 unsigned char dummy = 1; 946 1192 ssize_t r; 947 1193 948 if (ctx == NULL) 949 return; 950 951 /* record that we are messing with poll fds */ 952 usbi_mutex_lock(&ctx->pollfd_modify_lock); 953 ctx->pollfd_modify++; 954 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 955 956 /* write some data on control pipe to interrupt event handlers */ 957 r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); 958 if (r <= 0) { 1194 /* write some data on event pipe to interrupt event handlers */ 1195 r = usbi_write(ctx->event_pipe[1], &dummy, sizeof(dummy)); 1196 if (r != sizeof(dummy)) { 959 1197 usbi_warn(ctx, "internal signalling write failed"); 960 usbi_mutex_lock(&ctx->pollfd_modify_lock); 961 ctx->pollfd_modify--; 962 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 963 return; 964 } 965 966 /* take event handling lock */ 967 libusb_lock_events(ctx); 968 969 /* read the dummy data */ 970 r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); 971 if (r <= 0) 1198 return LIBUSB_ERROR_IO; 1199 } 1200 1201 return 0; 1202 } 1203 1204 /* 1205 * Clear the event pipe so that the event handling will no longer be 1206 * interrupted. 1207 */ 1208 int usbi_clear_event(struct libusb_context *ctx) 1209 { 1210 unsigned char dummy; 1211 ssize_t r; 1212 1213 /* read some data on event pipe to clear it */ 1214 r = usbi_read(ctx->event_pipe[0], &dummy, sizeof(dummy)); 1215 if (r != sizeof(dummy)) { 972 1216 usbi_warn(ctx, "internal signalling read failed"); 973 974 /* we're done with modifying poll fds */ 975 usbi_mutex_lock(&ctx->pollfd_modify_lock); 976 ctx->pollfd_modify--; 977 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 978 979 /* Release event handling lock and wake up event waiters */ 980 libusb_unlock_events(ctx); 981 } 982 983 /** \ingroup dev 1217 return LIBUSB_ERROR_IO; 1218 } 1219 1220 return 0; 1221 } 1222 1223 /** \ingroup libusb_dev 984 1224 * Open a device and obtain a device handle. A handle allows you to perform 985 1225 * I/O on the device in question. … … 992 1232 * 993 1233 * \param dev the device to open 994 * \param handle output location for the returned device handle pointer. Only1234 * \param dev_handle output location for the returned device handle pointer. Only 995 1235 * populated when the return code is 0. 996 1236 * \returns 0 on success … … 1001 1241 */ 1002 1242 int API_EXPORTED libusb_open(libusb_device *dev, 1003 libusb_device_handle ** handle)1243 libusb_device_handle **dev_handle) 1004 1244 { 1005 1245 struct libusb_context *ctx = DEVICE_CTX(dev); 1006 struct libusb_device_handle *_ handle;1246 struct libusb_device_handle *_dev_handle; 1007 1247 size_t priv_size = usbi_backend->device_handle_priv_size; 1008 1248 int r; … … 1013 1253 } 1014 1254 1015 _ handle = malloc(sizeof(*_handle) + priv_size);1016 if (!_ handle)1255 _dev_handle = malloc(sizeof(*_dev_handle) + priv_size); 1256 if (!_dev_handle) 1017 1257 return LIBUSB_ERROR_NO_MEM; 1018 1258 1019 r = usbi_mutex_init(&_ handle->lock, NULL);1259 r = usbi_mutex_init(&_dev_handle->lock); 1020 1260 if (r) { 1021 free(_ handle);1261 free(_dev_handle); 1022 1262 return LIBUSB_ERROR_OTHER; 1023 1263 } 1024 1264 1025 _handle->dev = libusb_ref_device(dev); 1026 _handle->claimed_interfaces = 0; 1027 memset(&_handle->os_priv, 0, priv_size); 1028 1029 r = usbi_backend->open(_handle); 1265 _dev_handle->dev = libusb_ref_device(dev); 1266 _dev_handle->auto_detach_kernel_driver = 0; 1267 _dev_handle->claimed_interfaces = 0; 1268 memset(&_dev_handle->os_priv, 0, priv_size); 1269 1270 r = usbi_backend->open(_dev_handle); 1030 1271 if (r < 0) { 1031 1272 usbi_dbg("open %d.%d returns %d", dev->bus_number, dev->device_address, r); 1032 1273 libusb_unref_device(dev); 1033 usbi_mutex_destroy(&_ handle->lock);1034 free(_ handle);1274 usbi_mutex_destroy(&_dev_handle->lock); 1275 free(_dev_handle); 1035 1276 return r; 1036 1277 } 1037 1278 1038 1279 usbi_mutex_lock(&ctx->open_devs_lock); 1039 list_add(&_ handle->list, &ctx->open_devs);1280 list_add(&_dev_handle->list, &ctx->open_devs); 1040 1281 usbi_mutex_unlock(&ctx->open_devs_lock); 1041 *handle = _handle; 1042 1043 /* At this point, we want to interrupt any existing event handlers so 1044 * that they realise the addition of the new device's poll fd. One 1045 * example when this is desirable is if the user is running a separate 1046 * dedicated libusb events handling thread, which is running with a long 1047 * or infinite timeout. We want to interrupt that iteration of the loop, 1048 * so that it picks up the new fd, and then continues. */ 1049 usbi_fd_notification(ctx); 1282 *dev_handle = _dev_handle; 1050 1283 1051 1284 return 0; 1052 1285 } 1053 1286 1054 /** \ingroup dev1287 /** \ingroup libusb_dev 1055 1288 * Convenience function for finding a device with a particular 1056 1289 * <tt>idVendor</tt>/<tt>idProduct</tt> combination. This function is intended … … 1066 1299 * \param vendor_id the idVendor value to search for 1067 1300 * \param product_id the idProduct value to search for 1068 * \returns a handle for the first found device, or NULL on error or if the1069 * device could not be found. */1301 * \returns a device handle for the first found device, or NULL on error 1302 * or if the device could not be found. */ 1070 1303 DEFAULT_VISIBILITY 1071 1304 libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( … … 1075 1308 struct libusb_device *found = NULL; 1076 1309 struct libusb_device *dev; 1077 struct libusb_device_handle * handle = NULL;1310 struct libusb_device_handle *dev_handle = NULL; 1078 1311 size_t i = 0; 1079 1312 int r; … … 1094 1327 1095 1328 if (found) { 1096 r = libusb_open(found, & handle);1329 r = libusb_open(found, &dev_handle); 1097 1330 if (r < 0) 1098 handle = NULL;1331 dev_handle = NULL; 1099 1332 } 1100 1333 1101 1334 out: 1102 1335 libusb_free_device_list(devs, 1); 1103 return handle;1336 return dev_handle; 1104 1337 } 1105 1338 … … 1109 1342 struct usbi_transfer *itransfer; 1110 1343 struct usbi_transfer *tmp; 1111 1112 libusb_lock_events(ctx);1113 1344 1114 1345 /* remove any transfers in flight that are for this device */ … … 1118 1349 list_for_each_entry_safe(itransfer, tmp, &ctx->flying_transfers, list, struct usbi_transfer) { 1119 1350 struct libusb_transfer *transfer = 1120 1351 USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1121 1352 1122 1353 if (transfer->dev_handle != dev_handle) 1123 1354 continue; 1124 1355 1125 if (!(itransfer->flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) { 1356 usbi_mutex_lock(&itransfer->lock); 1357 if (!(itransfer->state_flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) { 1126 1358 usbi_err(ctx, "Device handle closed while transfer was still being processed, but the device is still connected as far as we know"); 1127 1359 1128 if (itransfer-> flags & USBI_TRANSFER_CANCELLING)1360 if (itransfer->state_flags & USBI_TRANSFER_CANCELLING) 1129 1361 usbi_warn(ctx, "A cancellation for an in-flight transfer hasn't completed but closing the device handle"); 1130 1362 else 1131 1363 usbi_err(ctx, "A cancellation hasn't even been scheduled on the transfer for which the device is closing"); 1132 1364 } 1365 usbi_mutex_unlock(&itransfer->lock); 1133 1366 1134 1367 /* remove from the list of in-flight transfers and make sure … … 1136 1369 * (or that such accesses will be easily caught and identified as a crash) 1137 1370 */ 1138 usbi_mutex_lock(&itransfer->lock);1139 1371 list_del(&itransfer->list); 1140 1372 transfer->dev_handle = NULL; 1141 usbi_mutex_unlock(&itransfer->lock);1142 1373 1143 1374 /* it is up to the user to free up the actual transfer struct. this is … … 1150 1381 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1151 1382 1152 libusb_unlock_events(ctx);1153 1154 1383 usbi_mutex_lock(&ctx->open_devs_lock); 1155 1384 list_del(&dev_handle->list); … … 1162 1391 } 1163 1392 1164 /** \ingroup dev1393 /** \ingroup libusb_dev 1165 1394 * Close a device handle. Should be called on all open handles before your 1166 1395 * application exits. … … 1171 1400 * This is a non-blocking function; no requests are sent over the bus. 1172 1401 * 1173 * \param dev_handle the handle to close1402 * \param dev_handle the device handle to close 1174 1403 */ 1175 1404 void API_EXPORTED libusb_close(libusb_device_handle *dev_handle) 1176 1405 { 1177 1406 struct libusb_context *ctx; 1178 unsigned char dummy = 1;1179 ssize_t r;1407 int handling_events; 1408 int pending_events; 1180 1409 1181 1410 if (!dev_handle) … … 1184 1413 1185 1414 ctx = HANDLE_CTX(dev_handle); 1415 handling_events = usbi_handling_events(ctx); 1186 1416 1187 1417 /* Similarly to libusb_open(), we want to interrupt all event handlers … … 1189 1419 * the device while holding the event handling lock (preventing any other 1190 1420 * thread from doing event handling) because we will be removing a file 1191 * descriptor from the polling loop. */ 1192 1193 /* record that we are messing with poll fds */ 1194 usbi_mutex_lock(&ctx->pollfd_modify_lock); 1195 ctx->pollfd_modify++; 1196 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 1197 1198 /* write some data on control pipe to interrupt event handlers */ 1199 r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); 1200 if (r <= 0) { 1201 usbi_warn(ctx, "internal signalling write failed, closing anyway"); 1202 do_close(ctx, dev_handle); 1203 usbi_mutex_lock(&ctx->pollfd_modify_lock); 1204 ctx->pollfd_modify--; 1205 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 1206 return; 1207 } 1208 1209 /* take event handling lock */ 1210 libusb_lock_events(ctx); 1211 1212 /* read the dummy data */ 1213 r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); 1214 if (r <= 0) 1215 usbi_warn(ctx, "internal signalling read failed, closing anyway"); 1421 * descriptor from the polling loop. If this is being called by the current 1422 * event handler, we can bypass the interruption code because we already 1423 * hold the event handling lock. */ 1424 1425 if (!handling_events) { 1426 /* Record that we are closing a device. 1427 * Only signal an event if there are no prior pending events. */ 1428 usbi_mutex_lock(&ctx->event_data_lock); 1429 pending_events = usbi_pending_events(ctx); 1430 ctx->device_close++; 1431 if (!pending_events) 1432 usbi_signal_event(ctx); 1433 usbi_mutex_unlock(&ctx->event_data_lock); 1434 1435 /* take event handling lock */ 1436 libusb_lock_events(ctx); 1437 } 1216 1438 1217 1439 /* Close the device */ 1218 1440 do_close(ctx, dev_handle); 1219 1441 1220 /* we're done with modifying poll fds */ 1221 usbi_mutex_lock(&ctx->pollfd_modify_lock); 1222 ctx->pollfd_modify--; 1223 usbi_mutex_unlock(&ctx->pollfd_modify_lock); 1224 1225 /* Release event handling lock and wake up event waiters */ 1226 libusb_unlock_events(ctx); 1227 } 1228 1229 /** \ingroup dev 1230 * Get the underlying device for a handle. This function does not modify 1442 if (!handling_events) { 1443 /* We're done with closing this device. 1444 * Clear the event pipe if there are no further pending events. */ 1445 usbi_mutex_lock(&ctx->event_data_lock); 1446 ctx->device_close--; 1447 pending_events = usbi_pending_events(ctx); 1448 if (!pending_events) 1449 usbi_clear_event(ctx); 1450 usbi_mutex_unlock(&ctx->event_data_lock); 1451 1452 /* Release event handling lock and wake up event waiters */ 1453 libusb_unlock_events(ctx); 1454 } 1455 } 1456 1457 /** \ingroup libusb_dev 1458 * Get the underlying device for a device handle. This function does not modify 1231 1459 * the reference count of the returned device, so do not feel compelled to 1232 1460 * unreference it when you are done. … … 1240 1468 } 1241 1469 1242 /** \ingroup dev1470 /** \ingroup libusb_dev 1243 1471 * Determine the bConfigurationValue of the currently active configuration. 1244 1472 * … … 1253 1481 * parameter if the device is in unconfigured state. 1254 1482 * 1255 * \param dev a device handle1483 * \param dev_handle a device handle 1256 1484 * \param config output location for the bConfigurationValue of the active 1257 1485 * configuration (only valid for return code 0) … … 1260 1488 * \returns another LIBUSB_ERROR code on other failure 1261 1489 */ 1262 int API_EXPORTED libusb_get_configuration(libusb_device_handle *dev ,1490 int API_EXPORTED libusb_get_configuration(libusb_device_handle *dev_handle, 1263 1491 int *config) 1264 1492 { … … 1267 1495 usbi_dbg(""); 1268 1496 if (usbi_backend->get_configuration) 1269 r = usbi_backend->get_configuration(dev , config);1497 r = usbi_backend->get_configuration(dev_handle, config); 1270 1498 1271 1499 if (r == LIBUSB_ERROR_NOT_SUPPORTED) { 1272 1500 uint8_t tmp = 0; 1273 1501 usbi_dbg("falling back to control message"); 1274 r = libusb_control_transfer(dev , LIBUSB_ENDPOINT_IN,1502 r = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN, 1275 1503 LIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000); 1276 1504 if (r == 0) { 1277 usbi_err(HANDLE_CTX(dev ), "zero bytes returned in ctrl transfer?");1505 usbi_err(HANDLE_CTX(dev_handle), "zero bytes returned in ctrl transfer?"); 1278 1506 r = LIBUSB_ERROR_IO; 1279 1507 } else if (r == 1) { … … 1291 1519 } 1292 1520 1293 /** \ingroup dev1521 /** \ingroup libusb_dev 1294 1522 * Set the active configuration for a device. 1295 1523 * … … 1306 1534 * 1307 1535 * You cannot change/reset configuration if your application has claimed 1308 * interfaces - you should free them with libusb_release_interface() first. 1536 * interfaces. It is advised to set the desired configuration before claiming 1537 * interfaces. 1538 * 1539 * Alternatively you can call libusb_release_interface() first. Note if you 1540 * do things this way you must ensure that auto_detach_kernel_driver for 1541 * <tt>dev</tt> is 0, otherwise the kernel driver will be re-attached when you 1542 * release the interface(s). 1543 * 1309 1544 * You cannot change/reset configuration if other applications or drivers have 1310 1545 * claimed interfaces. … … 1320 1555 * This is a blocking function. 1321 1556 * 1322 * \param dev a device handle1557 * \param dev_handle a device handle 1323 1558 * \param configuration the bConfigurationValue of the configuration you 1324 * wish to activate, or -1 if you wish to put the device in unconfigured state 1559 * wish to activate, or -1 if you wish to put the device in an unconfigured 1560 * state 1325 1561 * \returns 0 on success 1326 1562 * \returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist … … 1328 1564 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 1329 1565 * \returns another LIBUSB_ERROR code on other failure 1330 */ 1331 int API_EXPORTED libusb_set_configuration(libusb_device_handle *dev, 1566 * \see libusb_set_auto_detach_kernel_driver() 1567 */ 1568 int API_EXPORTED libusb_set_configuration(libusb_device_handle *dev_handle, 1332 1569 int configuration) 1333 1570 { 1334 1571 usbi_dbg("configuration %d", configuration); 1335 return usbi_backend->set_configuration(dev , configuration);1336 } 1337 1338 /** \ingroup dev1572 return usbi_backend->set_configuration(dev_handle, configuration); 1573 } 1574 1575 /** \ingroup libusb_dev 1339 1576 * Claim an interface on a given device handle. You must claim the interface 1340 1577 * you wish to use before you can perform I/O on any of its endpoints. … … 1342 1579 * It is legal to attempt to claim an already-claimed interface, in which 1343 1580 * case libusb just returns 0 without doing anything. 1581 * 1582 * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel driver 1583 * will be detached if necessary, on failure the detach error is returned. 1344 1584 * 1345 1585 * Claiming of interfaces is a purely logical operation; it does not cause … … 1350 1590 * This is a non-blocking function. 1351 1591 * 1352 * \param dev a device handle1592 * \param dev_handle a device handle 1353 1593 * \param interface_number the <tt>bInterfaceNumber</tt> of the interface you 1354 1594 * wish to claim … … 1359 1599 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 1360 1600 * \returns a LIBUSB_ERROR code on other failure 1361 */ 1362 int API_EXPORTED libusb_claim_interface(libusb_device_handle *dev, 1601 * \see libusb_set_auto_detach_kernel_driver() 1602 */ 1603 int API_EXPORTED libusb_claim_interface(libusb_device_handle *dev_handle, 1363 1604 int interface_number) 1364 1605 { … … 1369 1610 return LIBUSB_ERROR_INVALID_PARAM; 1370 1611 1371 if (!dev ->dev->attached)1612 if (!dev_handle->dev->attached) 1372 1613 return LIBUSB_ERROR_NO_DEVICE; 1373 1614 1374 usbi_mutex_lock(&dev ->lock);1375 if (dev ->claimed_interfaces & (1 << interface_number))1615 usbi_mutex_lock(&dev_handle->lock); 1616 if (dev_handle->claimed_interfaces & (1 << interface_number)) 1376 1617 goto out; 1377 1618 1378 r = usbi_backend->claim_interface(dev , interface_number);1619 r = usbi_backend->claim_interface(dev_handle, interface_number); 1379 1620 if (r == 0) 1380 dev ->claimed_interfaces |= 1 << interface_number;1621 dev_handle->claimed_interfaces |= 1 << interface_number; 1381 1622 1382 1623 out: 1383 usbi_mutex_unlock(&dev ->lock);1624 usbi_mutex_unlock(&dev_handle->lock); 1384 1625 return r; 1385 1626 } 1386 1627 1387 /** \ingroup dev1628 /** \ingroup libusb_dev 1388 1629 * Release an interface previously claimed with libusb_claim_interface(). You 1389 1630 * should release all claimed interfaces before closing a device handle. … … 1392 1633 * to the device, resetting interface state to the first alternate setting. 1393 1634 * 1394 * \param dev a device handle 1635 * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel 1636 * driver will be re-attached after releasing the interface. 1637 * 1638 * \param dev_handle a device handle 1395 1639 * \param interface_number the <tt>bInterfaceNumber</tt> of the 1396 1640 * previously-claimed interface … … 1399 1643 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 1400 1644 * \returns another LIBUSB_ERROR code on other failure 1401 */ 1402 int API_EXPORTED libusb_release_interface(libusb_device_handle *dev, 1645 * \see libusb_set_auto_detach_kernel_driver() 1646 */ 1647 int API_EXPORTED libusb_release_interface(libusb_device_handle *dev_handle, 1403 1648 int interface_number) 1404 1649 { … … 1409 1654 return LIBUSB_ERROR_INVALID_PARAM; 1410 1655 1411 usbi_mutex_lock(&dev ->lock);1412 if (!(dev ->claimed_interfaces & (1 << interface_number))) {1656 usbi_mutex_lock(&dev_handle->lock); 1657 if (!(dev_handle->claimed_interfaces & (1 << interface_number))) { 1413 1658 r = LIBUSB_ERROR_NOT_FOUND; 1414 1659 goto out; 1415 1660 } 1416 1661 1417 r = usbi_backend->release_interface(dev , interface_number);1662 r = usbi_backend->release_interface(dev_handle, interface_number); 1418 1663 if (r == 0) 1419 dev ->claimed_interfaces &= ~(1 << interface_number);1664 dev_handle->claimed_interfaces &= ~(1 << interface_number); 1420 1665 1421 1666 out: 1422 usbi_mutex_unlock(&dev ->lock);1667 usbi_mutex_unlock(&dev_handle->lock); 1423 1668 return r; 1424 1669 } 1425 1670 1426 /** \ingroup dev1671 /** \ingroup libusb_dev 1427 1672 * Activate an alternate setting for an interface. The interface must have 1428 1673 * been previously claimed with libusb_claim_interface(). … … 1434 1679 * This is a blocking function. 1435 1680 * 1436 * \param dev a device handle1681 * \param dev_handle a device handle 1437 1682 * \param interface_number the <tt>bInterfaceNumber</tt> of the 1438 1683 * previously-claimed interface … … 1445 1690 * \returns another LIBUSB_ERROR code on other failure 1446 1691 */ 1447 int API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev ,1692 int API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev_handle, 1448 1693 int interface_number, int alternate_setting) 1449 1694 { … … 1453 1698 return LIBUSB_ERROR_INVALID_PARAM; 1454 1699 1455 usbi_mutex_lock(&dev ->lock);1456 if (!dev ->dev->attached) {1457 usbi_mutex_unlock(&dev ->lock);1700 usbi_mutex_lock(&dev_handle->lock); 1701 if (!dev_handle->dev->attached) { 1702 usbi_mutex_unlock(&dev_handle->lock); 1458 1703 return LIBUSB_ERROR_NO_DEVICE; 1459 1704 } 1460 1705 1461 if (!(dev ->claimed_interfaces & (1 << interface_number))) {1462 usbi_mutex_unlock(&dev ->lock);1706 if (!(dev_handle->claimed_interfaces & (1 << interface_number))) { 1707 usbi_mutex_unlock(&dev_handle->lock); 1463 1708 return LIBUSB_ERROR_NOT_FOUND; 1464 1709 } 1465 usbi_mutex_unlock(&dev ->lock);1466 1467 return usbi_backend->set_interface_altsetting(dev , interface_number,1710 usbi_mutex_unlock(&dev_handle->lock); 1711 1712 return usbi_backend->set_interface_altsetting(dev_handle, interface_number, 1468 1713 alternate_setting); 1469 1714 } 1470 1715 1471 /** \ingroup dev1716 /** \ingroup libusb_dev 1472 1717 * Clear the halt/stall condition for an endpoint. Endpoints with halt status 1473 1718 * are unable to receive or transmit data until the halt condition is stalled. … … 1478 1723 * This is a blocking function. 1479 1724 * 1480 * \param dev a device handle1725 * \param dev_handle a device handle 1481 1726 * \param endpoint the endpoint to clear halt status 1482 1727 * \returns 0 on success … … 1485 1730 * \returns another LIBUSB_ERROR code on other failure 1486 1731 */ 1487 int API_EXPORTED libusb_clear_halt(libusb_device_handle *dev ,1732 int API_EXPORTED libusb_clear_halt(libusb_device_handle *dev_handle, 1488 1733 unsigned char endpoint) 1489 1734 { 1490 1735 usbi_dbg("endpoint %x", endpoint); 1491 if (!dev ->dev->attached)1736 if (!dev_handle->dev->attached) 1492 1737 return LIBUSB_ERROR_NO_DEVICE; 1493 1738 1494 return usbi_backend->clear_halt(dev , endpoint);1495 } 1496 1497 /** \ingroup dev1739 return usbi_backend->clear_halt(dev_handle, endpoint); 1740 } 1741 1742 /** \ingroup libusb_dev 1498 1743 * Perform a USB port reset to reinitialize a device. The system will attempt 1499 1744 * to restore the previous configuration and alternate settings after the … … 1508 1753 * This is a blocking function which usually incurs a noticeable delay. 1509 1754 * 1510 * \param dev a handle of the device to reset1755 * \param dev_handle a handle of the device to reset 1511 1756 * \returns 0 on success 1512 1757 * \returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the … … 1514 1759 * \returns another LIBUSB_ERROR code on other failure 1515 1760 */ 1516 int API_EXPORTED libusb_reset_device(libusb_device_handle *dev )1761 int API_EXPORTED libusb_reset_device(libusb_device_handle *dev_handle) 1517 1762 { 1518 1763 usbi_dbg(""); 1519 if (!dev ->dev->attached)1764 if (!dev_handle->dev->attached) 1520 1765 return LIBUSB_ERROR_NO_DEVICE; 1521 1766 1522 return usbi_backend->reset_device(dev); 1523 } 1524 1525 /** \ingroup dev 1767 return usbi_backend->reset_device(dev_handle); 1768 } 1769 1770 /** \ingroup libusb_asyncio 1771 * Allocate up to num_streams usb bulk streams on the specified endpoints. This 1772 * function takes an array of endpoints rather then a single endpoint because 1773 * some protocols require that endpoints are setup with similar stream ids. 1774 * All endpoints passed in must belong to the same interface. 1775 * 1776 * Note this function may return less streams then requested. Also note that the 1777 * same number of streams are allocated for each endpoint in the endpoint array. 1778 * 1779 * Stream id 0 is reserved, and should not be used to communicate with devices. 1780 * If libusb_alloc_streams() returns with a value of N, you may use stream ids 1781 * 1 to N. 1782 * 1783 * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 1784 * 1785 * \param dev_handle a device handle 1786 * \param num_streams number of streams to try to allocate 1787 * \param endpoints array of endpoints to allocate streams on 1788 * \param num_endpoints length of the endpoints array 1789 * \returns number of streams allocated, or a LIBUSB_ERROR code on failure 1790 */ 1791 int API_EXPORTED libusb_alloc_streams(libusb_device_handle *dev_handle, 1792 uint32_t num_streams, unsigned char *endpoints, int num_endpoints) 1793 { 1794 usbi_dbg("streams %u eps %d", (unsigned) num_streams, num_endpoints); 1795 1796 if (!dev_handle->dev->attached) 1797 return LIBUSB_ERROR_NO_DEVICE; 1798 1799 if (usbi_backend->alloc_streams) 1800 return usbi_backend->alloc_streams(dev_handle, num_streams, endpoints, 1801 num_endpoints); 1802 else 1803 return LIBUSB_ERROR_NOT_SUPPORTED; 1804 } 1805 1806 /** \ingroup libusb_asyncio 1807 * Free usb bulk streams allocated with libusb_alloc_streams(). 1808 * 1809 * Note streams are automatically free-ed when releasing an interface. 1810 * 1811 * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 1812 * 1813 * \param dev_handle a device handle 1814 * \param endpoints array of endpoints to free streams on 1815 * \param num_endpoints length of the endpoints array 1816 * \returns LIBUSB_SUCCESS, or a LIBUSB_ERROR code on failure 1817 */ 1818 int API_EXPORTED libusb_free_streams(libusb_device_handle *dev_handle, 1819 unsigned char *endpoints, int num_endpoints) 1820 { 1821 usbi_dbg("eps %d", num_endpoints); 1822 1823 if (!dev_handle->dev->attached) 1824 return LIBUSB_ERROR_NO_DEVICE; 1825 1826 if (usbi_backend->free_streams) 1827 return usbi_backend->free_streams(dev_handle, endpoints, 1828 num_endpoints); 1829 else 1830 return LIBUSB_ERROR_NOT_SUPPORTED; 1831 } 1832 1833 /** \ingroup libusb_asyncio 1834 * Attempts to allocate a block of persistent DMA memory suitable for transfers 1835 * against the given device. If successful, will return a block of memory 1836 * that is suitable for use as "buffer" in \ref libusb_transfer against this 1837 * device. Using this memory instead of regular memory means that the host 1838 * controller can use DMA directly into the buffer to increase performance, and 1839 * also that transfers can no longer fail due to kernel memory fragmentation. 1840 * 1841 * Note that this means you should not modify this memory (or even data on 1842 * the same cache lines) when a transfer is in progress, although it is legal 1843 * to have several transfers going on within the same memory block. 1844 * 1845 * Will return NULL on failure. Many systems do not support such zerocopy 1846 * and will always return NULL. Memory allocated with this function must be 1847 * freed with \ref libusb_dev_mem_free. Specifically, this means that the 1848 * flag \ref LIBUSB_TRANSFER_FREE_BUFFER cannot be used to free memory allocated 1849 * with this function. 1850 * 1851 * Since version 1.0.21, \ref LIBUSB_API_VERSION >= 0x01000105 1852 * 1853 * \param dev_handle a device handle 1854 * \param length size of desired data buffer 1855 * \returns a pointer to the newly allocated memory, or NULL on failure 1856 */ 1857 DEFAULT_VISIBILITY 1858 unsigned char * LIBUSB_CALL libusb_dev_mem_alloc(libusb_device_handle *dev_handle, 1859 size_t length) 1860 { 1861 if (!dev_handle->dev->attached) 1862 return NULL; 1863 1864 if (usbi_backend->dev_mem_alloc) 1865 return usbi_backend->dev_mem_alloc(dev_handle, length); 1866 else 1867 return NULL; 1868 } 1869 1870 /** \ingroup libusb_asyncio 1871 * Free device memory allocated with libusb_dev_mem_alloc(). 1872 * 1873 * \param dev_handle a device handle 1874 * \param buffer pointer to the previously allocated memory 1875 * \param length size of previously allocated memory 1876 * \returns LIBUSB_SUCCESS, or a LIBUSB_ERROR code on failure 1877 */ 1878 int API_EXPORTED libusb_dev_mem_free(libusb_device_handle *dev_handle, 1879 unsigned char *buffer, size_t length) 1880 { 1881 if (usbi_backend->dev_mem_free) 1882 return usbi_backend->dev_mem_free(dev_handle, buffer, length); 1883 else 1884 return LIBUSB_ERROR_NOT_SUPPORTED; 1885 } 1886 1887 /** \ingroup libusb_dev 1526 1888 * Determine if a kernel driver is active on an interface. If a kernel driver 1527 1889 * is active, you cannot claim the interface, and libusb will be unable to … … 1530 1892 * This functionality is not available on Windows. 1531 1893 * 1532 * \param dev a device handle1894 * \param dev_handle a device handle 1533 1895 * \param interface_number the interface to check 1534 1896 * \returns 0 if no kernel driver is active … … 1540 1902 * \see libusb_detach_kernel_driver() 1541 1903 */ 1542 int API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev ,1904 int API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev_handle, 1543 1905 int interface_number) 1544 1906 { 1545 1907 usbi_dbg("interface %d", interface_number); 1546 1908 1547 if (!dev ->dev->attached)1909 if (!dev_handle->dev->attached) 1548 1910 return LIBUSB_ERROR_NO_DEVICE; 1549 1911 1550 1912 if (usbi_backend->kernel_driver_active) 1551 return usbi_backend->kernel_driver_active(dev , interface_number);1913 return usbi_backend->kernel_driver_active(dev_handle, interface_number); 1552 1914 else 1553 1915 return LIBUSB_ERROR_NOT_SUPPORTED; 1554 1916 } 1555 1917 1556 /** \ingroup dev1918 /** \ingroup libusb_dev 1557 1919 * Detach a kernel driver from an interface. If successful, you will then be 1558 1920 * able to claim the interface and perform I/O. … … 1560 1922 * This functionality is not available on Darwin or Windows. 1561 1923 * 1562 * \param dev a device handle 1924 * Note that libusb itself also talks to the device through a special kernel 1925 * driver, if this driver is already attached to the device, this call will 1926 * not detach it and return LIBUSB_ERROR_NOT_FOUND. 1927 * 1928 * \param dev_handle a device handle 1563 1929 * \param interface_number the interface to detach the driver from 1564 1930 * \returns 0 on success … … 1571 1937 * \see libusb_kernel_driver_active() 1572 1938 */ 1573 int API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev ,1939 int API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev_handle, 1574 1940 int interface_number) 1575 1941 { 1576 1942 usbi_dbg("interface %d", interface_number); 1577 1943 1578 if (!dev ->dev->attached)1944 if (!dev_handle->dev->attached) 1579 1945 return LIBUSB_ERROR_NO_DEVICE; 1580 1946 1581 1947 if (usbi_backend->detach_kernel_driver) 1582 return usbi_backend->detach_kernel_driver(dev , interface_number);1948 return usbi_backend->detach_kernel_driver(dev_handle, interface_number); 1583 1949 else 1584 1950 return LIBUSB_ERROR_NOT_SUPPORTED; 1585 1951 } 1586 1952 1587 /** \ingroup dev1953 /** \ingroup libusb_dev 1588 1954 * Re-attach an interface's kernel driver, which was previously detached 1589 1955 * using libusb_detach_kernel_driver(). This call is only effective on … … 1592 1958 * This functionality is not available on Darwin or Windows. 1593 1959 * 1594 * \param dev a device handle1960 * \param dev_handle a device handle 1595 1961 * \param interface_number the interface to attach the driver from 1596 1962 * \returns 0 on success … … 1605 1971 * \see libusb_kernel_driver_active() 1606 1972 */ 1607 int API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev ,1973 int API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev_handle, 1608 1974 int interface_number) 1609 1975 { 1610 1976 usbi_dbg("interface %d", interface_number); 1611 1977 1612 if (!dev ->dev->attached)1978 if (!dev_handle->dev->attached) 1613 1979 return LIBUSB_ERROR_NO_DEVICE; 1614 1980 1615 1981 if (usbi_backend->attach_kernel_driver) 1616 return usbi_backend->attach_kernel_driver(dev , interface_number);1982 return usbi_backend->attach_kernel_driver(dev_handle, interface_number); 1617 1983 else 1618 1984 return LIBUSB_ERROR_NOT_SUPPORTED; 1619 1985 } 1620 1986 1621 /** \ingroup lib 1622 * Set message verbosity. 1623 * - Level 0: no messages ever printed by the library (default) 1624 * - Level 1: error messages are printed to stderr 1625 * - Level 2: warning and error messages are printed to stderr 1626 * - Level 3: informational messages are printed to stdout, warning and error 1627 * messages are printed to stderr 1628 * 1629 * The default level is 0, which means no messages are ever printed. If you 1630 * choose to increase the message verbosity level, ensure that your 1631 * application does not close the stdout/stderr file descriptors. 1632 * 1633 * You are advised to set level 3. libusb is conservative with its message 1634 * logging and most of the time, will only log messages that explain error 1635 * conditions and other oddities. This will help you debug your software. 1987 /** \ingroup libusb_dev 1988 * Enable/disable libusb's automatic kernel driver detachment. When this is 1989 * enabled libusb will automatically detach the kernel driver on an interface 1990 * when claiming the interface, and attach it when releasing the interface. 1991 * 1992 * Automatic kernel driver detachment is disabled on newly opened device 1993 * handles by default. 1994 * 1995 * On platforms which do not have LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER 1996 * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusb will 1997 * continue as if this function was never called. 1998 * 1999 * \param dev_handle a device handle 2000 * \param enable whether to enable or disable auto kernel driver detachment 2001 * 2002 * \returns LIBUSB_SUCCESS on success 2003 * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality 2004 * is not available 2005 * \see libusb_claim_interface() 2006 * \see libusb_release_interface() 2007 * \see libusb_set_configuration() 2008 */ 2009 int API_EXPORTED libusb_set_auto_detach_kernel_driver( 2010 libusb_device_handle *dev_handle, int enable) 2011 { 2012 if (!(usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER)) 2013 return LIBUSB_ERROR_NOT_SUPPORTED; 2014 2015 dev_handle->auto_detach_kernel_driver = enable; 2016 return LIBUSB_SUCCESS; 2017 } 2018 2019 /** \ingroup libusb_lib 2020 * Set log message verbosity. 2021 * 2022 * The default level is LIBUSB_LOG_LEVEL_NONE, which means no messages are ever 2023 * printed. If you choose to increase the message verbosity level, ensure 2024 * that your application does not close the stdout/stderr file descriptors. 2025 * 2026 * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusb is conservative 2027 * with its message logging and most of the time, will only log messages that 2028 * explain error conditions and other oddities. This will help you debug 2029 * your software. 1636 2030 * 1637 2031 * If the LIBUSB_DEBUG environment variable was set when libusb was … … 1655 2049 } 1656 2050 1657 /** \ingroup lib 2051 /** \ingroup libusb_lib 1658 2052 * Initialize libusb. This function must be called before calling any other 1659 2053 * libusb function. … … 1666 2060 * Only valid on return code 0. 1667 2061 * \returns 0 on success, or a LIBUSB_ERROR code on failure 1668 * \see contexts2062 * \see libusb_contexts 1669 2063 */ 1670 2064 int API_EXPORTED libusb_init(libusb_context **context) 1671 2065 { 2066 struct libusb_device *dev, *next; 1672 2067 char *dbg = getenv("LIBUSB_DEBUG"); 1673 2068 struct libusb_context *ctx; … … 1676 2071 1677 2072 usbi_mutex_static_lock(&default_context_lock); 2073 2074 if (!timestamp_origin.tv_sec) { 2075 usbi_gettimeofday(×tamp_origin, NULL); 2076 } 2077 1678 2078 if (!context && usbi_default_context) { 1679 2079 usbi_dbg("reusing default context"); … … 1683 2083 } 1684 2084 1685 ctx = malloc(sizeof(*ctx));2085 ctx = calloc(1, sizeof(*ctx)); 1686 2086 if (!ctx) { 1687 2087 r = LIBUSB_ERROR_NO_MEM; 1688 2088 goto err_unlock; 1689 2089 } 1690 memset(ctx, 0, sizeof(*ctx)); 2090 2091 #ifdef ENABLE_DEBUG_LOGGING 2092 ctx->debug = LIBUSB_LOG_LEVEL_DEBUG; 2093 #endif 1691 2094 1692 2095 if (dbg) { … … 1696 2099 } 1697 2100 1698 usbi_dbg("libusb-%d.%d.%d%s%s%s", 1699 libusb_version_internal.major, 1700 libusb_version_internal.minor, 1701 libusb_version_internal.micro, 1702 libusb_version_internal.rc, 1703 libusb_version_internal.describe[0] ? " git:" : "", 1704 libusb_version_internal.describe); 1705 1706 usbi_mutex_init(&ctx->usb_devs_lock, NULL); 1707 usbi_mutex_init(&ctx->open_devs_lock, NULL); 1708 usbi_mutex_init(&ctx->hotplug_cbs_lock, NULL); 2101 /* default context should be initialized before calling usbi_dbg */ 2102 if (!usbi_default_context) { 2103 usbi_default_context = ctx; 2104 default_context_refcnt++; 2105 usbi_dbg("created default context"); 2106 } 2107 2108 usbi_dbg("libusb v%u.%u.%u.%u%s", libusb_version_internal.major, libusb_version_internal.minor, 2109 libusb_version_internal.micro, libusb_version_internal.nano, libusb_version_internal.rc); 2110 2111 usbi_mutex_init(&ctx->usb_devs_lock); 2112 usbi_mutex_init(&ctx->open_devs_lock); 2113 usbi_mutex_init(&ctx->hotplug_cbs_lock); 1709 2114 list_init(&ctx->usb_devs); 1710 2115 list_init(&ctx->open_devs); 1711 2116 list_init(&ctx->hotplug_cbs); 2117 2118 usbi_mutex_static_lock(&active_contexts_lock); 2119 if (first_init) { 2120 first_init = 0; 2121 list_init (&active_contexts_list); 2122 } 2123 list_add (&ctx->list, &active_contexts_list); 2124 usbi_mutex_static_unlock(&active_contexts_lock); 1712 2125 1713 2126 if (usbi_backend->init) { … … 1718 2131 1719 2132 r = usbi_io_init(ctx); 1720 if (r < 0) { 1721 if (usbi_backend->exit) 1722 usbi_backend->exit(); 1723 goto err_destroy_mutex; 1724 } 1725 1726 if (context) { 2133 if (r < 0) 2134 goto err_backend_exit; 2135 2136 usbi_mutex_static_unlock(&default_context_lock); 2137 2138 if (context) 1727 2139 *context = ctx; 1728 } else if (!usbi_default_context) {1729 usbi_dbg("created default context");1730 usbi_default_context = ctx;1731 default_context_refcnt++;1732 }1733 usbi_mutex_static_unlock(&default_context_lock);1734 1735 usbi_mutex_static_lock(&active_contexts_lock);1736 if (first_init) {1737 first_init = 0;1738 list_init (&active_contexts_list);1739 }1740 1741 list_add (&ctx->list, &active_contexts_list);1742 usbi_mutex_static_unlock(&active_contexts_lock);1743 2140 1744 2141 return 0; 1745 2142 1746 err_destroy_mutex: 2143 err_backend_exit: 2144 if (usbi_backend->exit) 2145 usbi_backend->exit(); 2146 err_free_ctx: 2147 if (ctx == usbi_default_context) { 2148 usbi_default_context = NULL; 2149 default_context_refcnt--; 2150 } 2151 2152 usbi_mutex_static_lock(&active_contexts_lock); 2153 list_del (&ctx->list); 2154 usbi_mutex_static_unlock(&active_contexts_lock); 2155 2156 usbi_mutex_lock(&ctx->usb_devs_lock); 2157 list_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) { 2158 list_del(&dev->list); 2159 libusb_unref_device(dev); 2160 } 2161 usbi_mutex_unlock(&ctx->usb_devs_lock); 2162 1747 2163 usbi_mutex_destroy(&ctx->open_devs_lock); 1748 2164 usbi_mutex_destroy(&ctx->usb_devs_lock); 1749 err_free_ctx: 2165 usbi_mutex_destroy(&ctx->hotplug_cbs_lock); 2166 1750 2167 free(ctx); 1751 2168 err_unlock: … … 1754 2171 } 1755 2172 1756 /** \ingroup lib 2173 /** \ingroup libusb_lib 1757 2174 * Deinitialize libusb. Should be called after closing all open devices and 1758 2175 * before your application terminates. … … 1761 2178 void API_EXPORTED libusb_exit(struct libusb_context *ctx) 1762 2179 { 2180 struct libusb_device *dev, *next; 2181 struct timeval tv = { 0, 0 }; 2182 1763 2183 usbi_dbg(""); 1764 2184 USBI_GET_CONTEXT(ctx); … … 1766 2186 /* if working with default context, only actually do the deinitialization 1767 2187 * if we're the last user */ 2188 usbi_mutex_static_lock(&default_context_lock); 1768 2189 if (ctx == usbi_default_context) { 1769 usbi_mutex_static_lock(&default_context_lock);1770 2190 if (--default_context_refcnt > 0) { 1771 2191 usbi_dbg("not destroying default context"); … … 1775 2195 usbi_dbg("destroying default context"); 1776 2196 usbi_default_context = NULL; 1777 usbi_mutex_static_unlock(&default_context_lock); 1778 } 1779 1780 usbi_mutex_static_lock(&active_contexts_lock); 1781 list_del (&ctx->list); 1782 usbi_mutex_static_unlock(&active_contexts_lock); 1783 1784 usbi_hotplug_deregister_all(ctx); 1785 1786 /* a little sanity check. doesn't bother with open_devs locking because 1787 * unless there is an application bug, nobody will be accessing this. */ 2197 } 2198 usbi_mutex_static_unlock(&default_context_lock); 2199 2200 usbi_mutex_static_lock(&active_contexts_lock); 2201 list_del (&ctx->list); 2202 usbi_mutex_static_unlock(&active_contexts_lock); 2203 2204 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { 2205 usbi_hotplug_deregister_all(ctx); 2206 2207 /* 2208 * Ensure any pending unplug events are read from the hotplug 2209 * pipe. The usb_device-s hold in the events are no longer part 2210 * of usb_devs, but the events still hold a reference! 2211 * 2212 * Note we don't do this if the application has left devices 2213 * open (which implies a buggy app) to avoid packet completion 2214 * handlers running when the app does not expect them to run. 2215 */ 2216 if (list_empty(&ctx->open_devs)) 2217 libusb_handle_events_timeout(ctx, &tv); 2218 2219 usbi_mutex_lock(&ctx->usb_devs_lock); 2220 list_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) { 2221 list_del(&dev->list); 2222 libusb_unref_device(dev); 2223 } 2224 usbi_mutex_unlock(&ctx->usb_devs_lock); 2225 } 2226 2227 /* a few sanity checks. don't bother with locking because unless 2228 * there is an application bug, nobody will be accessing these. */ 2229 if (!list_empty(&ctx->usb_devs)) 2230 usbi_warn(ctx, "some libusb_devices were leaked"); 1788 2231 if (!list_empty(&ctx->open_devs)) 1789 2232 usbi_warn(ctx, "application left some devices open"); … … 1799 2242 } 1800 2243 1801 /** \ingroup misc2244 /** \ingroup libusb_misc 1802 2245 * Check at runtime if the loaded library has a given capability. 2246 * This call should be performed after \ref libusb_init(), to ensure the 2247 * backend has updated its capability set. 1803 2248 * 1804 2249 * \param capability the \ref libusb_capability to check for 1805 * \returns 1if the running library has the capability, 0 otherwise2250 * \returns nonzero if the running library has the capability, 0 otherwise 1806 2251 */ 1807 2252 int API_EXPORTED libusb_has_capability(uint32_t capability) 1808 2253 { 1809 enum libusb_capability cap = capability; 1810 switch (cap) { 2254 switch (capability) { 1811 2255 case LIBUSB_CAP_HAS_CAPABILITY: 1812 2256 return 1; 1813 2257 case LIBUSB_CAP_HAS_HOTPLUG: 1814 2258 return !(usbi_backend->get_device_list); 2259 case LIBUSB_CAP_HAS_HID_ACCESS: 2260 return (usbi_backend->caps & USBI_CAP_HAS_HID_ACCESS); 2261 case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: 2262 return (usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER); 1815 2263 } 1816 2264 return 0; … … 1845 2293 1846 2294 int usbi_gettimeofday(struct timeval *tp, void *tzp) 1847 { 1848 union { 1849 unsigned __int64 ns100; /*time since 1 Jan 1601 in 100ns units */ 1850 FILETIME ft; 1851 } _now; 1852 1853 if(tp) 1854 { 1855 GetSystemTimeAsFileTime (&_now.ft); 1856 tp->tv_usec=(long)((_now.ns100 / 10) % 1000000 ); 1857 tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000); 1858 } 1859 /* Always return 0 as per Open Group Base Specifications Issue 6. 1860 Do not set errno on error. */ 1861 return 0; 1862 } 2295 { 2296 union { 2297 unsigned __int64 ns100; /* Time since 1 Jan 1601, in 100ns units */ 2298 FILETIME ft; 2299 } _now; 2300 UNUSED(tzp); 2301 2302 if(tp) { 2303 #if defined(OS_WINCE) 2304 SYSTEMTIME st; 2305 GetSystemTime(&st); 2306 SystemTimeToFileTime(&st, &_now.ft); 2307 #else 2308 GetSystemTimeAsFileTime (&_now.ft); 1863 2309 #endif 1864 1865 void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, 2310 tp->tv_usec=(long)((_now.ns100 / 10) % 1000000 ); 2311 tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000); 2312 } 2313 /* Always return 0 as per Open Group Base Specifications Issue 6. 2314 Do not set errno on error. */ 2315 return 0; 2316 } 2317 #endif 2318 2319 static void usbi_log_str(struct libusb_context *ctx, 2320 enum libusb_log_level level, const char * str) 2321 { 2322 #if defined(USE_SYSTEM_LOGGING_FACILITY) 2323 #if defined(OS_WINDOWS) || defined(OS_WINCE) 2324 /* Windows CE only supports the Unicode version of OutputDebugString. */ 2325 WCHAR wbuf[USBI_MAX_LOG_LEN]; 2326 MultiByteToWideChar(CP_UTF8, 0, str, -1, wbuf, sizeof(wbuf)); 2327 OutputDebugStringW(wbuf); 2328 #elif defined(__ANDROID__) 2329 int priority = ANDROID_LOG_UNKNOWN; 2330 switch (level) { 2331 case LIBUSB_LOG_LEVEL_INFO: priority = ANDROID_LOG_INFO; break; 2332 case LIBUSB_LOG_LEVEL_WARNING: priority = ANDROID_LOG_WARN; break; 2333 case LIBUSB_LOG_LEVEL_ERROR: priority = ANDROID_LOG_ERROR; break; 2334 case LIBUSB_LOG_LEVEL_DEBUG: priority = ANDROID_LOG_DEBUG; break; 2335 } 2336 __android_log_write(priority, "libusb", str); 2337 #elif defined(HAVE_SYSLOG_FUNC) 2338 int syslog_level = LOG_INFO; 2339 switch (level) { 2340 case LIBUSB_LOG_LEVEL_INFO: syslog_level = LOG_INFO; break; 2341 case LIBUSB_LOG_LEVEL_WARNING: syslog_level = LOG_WARNING; break; 2342 case LIBUSB_LOG_LEVEL_ERROR: syslog_level = LOG_ERR; break; 2343 case LIBUSB_LOG_LEVEL_DEBUG: syslog_level = LOG_DEBUG; break; 2344 } 2345 syslog(syslog_level, "%s", str); 2346 #else /* All of gcc, Clang, XCode seem to use #warning */ 2347 #warning System logging is not supported on this platform. Logging to stderr will be used instead. 2348 fputs(str, stderr); 2349 #endif 2350 #else 2351 fputs(str, stderr); 2352 #endif /* USE_SYSTEM_LOGGING_FACILITY */ 2353 UNUSED(ctx); 2354 UNUSED(level); 2355 } 2356 2357 void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, 1866 2358 const char *function, const char *format, va_list args) 1867 2359 { 1868 FILE *stream = stdout;1869 c onst char *prefix;2360 const char *prefix = ""; 2361 char buf[USBI_MAX_LOG_LEN]; 1870 2362 struct timeval now; 1871 static struct timeval first = { 0, 0 }; 1872 1873 #ifndef ENABLE_DEBUG_LOGGING 2363 int global_debug, header_len, text_len; 2364 static int has_debug_header_been_displayed = 0; 2365 2366 #ifdef ENABLE_DEBUG_LOGGING 2367 global_debug = 1; 2368 UNUSED(ctx); 2369 #else 2370 int ctx_level = 0; 2371 1874 2372 USBI_GET_CONTEXT(ctx); 1875 if (!ctx) 2373 if (ctx) { 2374 ctx_level = ctx->debug; 2375 } else { 2376 char *dbg = getenv("LIBUSB_DEBUG"); 2377 if (dbg) 2378 ctx_level = atoi(dbg); 2379 } 2380 global_debug = (ctx_level == LIBUSB_LOG_LEVEL_DEBUG); 2381 if (!ctx_level) 1876 2382 return; 1877 if ( !ctx->debug)2383 if (level == LIBUSB_LOG_LEVEL_WARNING && ctx_level < LIBUSB_LOG_LEVEL_WARNING) 1878 2384 return; 1879 if (level == L OG_LEVEL_WARNING && ctx->debug < 2)2385 if (level == LIBUSB_LOG_LEVEL_INFO && ctx_level < LIBUSB_LOG_LEVEL_INFO) 1880 2386 return; 1881 if (level == L OG_LEVEL_INFO && ctx->debug < 3)2387 if (level == LIBUSB_LOG_LEVEL_DEBUG && ctx_level < LIBUSB_LOG_LEVEL_DEBUG) 1882 2388 return; 1883 2389 #endif 1884 2390 1885 2391 usbi_gettimeofday(&now, NULL); 1886 if (!first.tv_sec) { 1887 first.tv_sec = now.tv_sec; 1888 first.tv_usec = now.tv_usec; 1889 } 1890 if (now.tv_usec < first.tv_usec) { 2392 if ((global_debug) && (!has_debug_header_been_displayed)) { 2393 has_debug_header_been_displayed = 1; 2394 usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "[timestamp] [threadID] facility level [function call] <message>" USBI_LOG_LINE_END); 2395 usbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, "--------------------------------------------------------------------------------" USBI_LOG_LINE_END); 2396 } 2397 if (now.tv_usec < timestamp_origin.tv_usec) { 1891 2398 now.tv_sec--; 1892 2399 now.tv_usec += 1000000; 1893 2400 } 1894 now.tv_sec -= first.tv_sec;1895 now.tv_usec -= first.tv_usec;2401 now.tv_sec -= timestamp_origin.tv_sec; 2402 now.tv_usec -= timestamp_origin.tv_usec; 1896 2403 1897 2404 switch (level) { 1898 case L OG_LEVEL_INFO:2405 case LIBUSB_LOG_LEVEL_INFO: 1899 2406 prefix = "info"; 1900 2407 break; 1901 case LOG_LEVEL_WARNING: 1902 stream = stderr; 2408 case LIBUSB_LOG_LEVEL_WARNING: 1903 2409 prefix = "warning"; 1904 2410 break; 1905 case LOG_LEVEL_ERROR: 1906 stream = stderr; 2411 case LIBUSB_LOG_LEVEL_ERROR: 1907 2412 prefix = "error"; 1908 2413 break; 1909 case LOG_LEVEL_DEBUG: 1910 stream = stderr; 2414 case LIBUSB_LOG_LEVEL_DEBUG: 1911 2415 prefix = "debug"; 1912 2416 break; 2417 case LIBUSB_LOG_LEVEL_NONE: 2418 return; 1913 2419 default: 1914 stream = stderr;1915 2420 prefix = "unknown"; 1916 2421 break; 1917 2422 } 1918 2423 1919 fprintf(stream, "libusb: %d.%06d %s [%s] ", 1920 (int)now.tv_sec, (int)now.tv_usec, prefix, function); 1921 1922 vfprintf(stream, format, args); 1923 1924 fprintf(stream, "\n"); 1925 } 1926 1927 void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, 2424 if (global_debug) { 2425 header_len = snprintf(buf, sizeof(buf), 2426 "[%2d.%06d] [%08x] libusb: %s [%s] ", 2427 (int)now.tv_sec, (int)now.tv_usec, usbi_get_tid(), prefix, function); 2428 } else { 2429 header_len = snprintf(buf, sizeof(buf), 2430 "libusb: %s [%s] ", prefix, function); 2431 } 2432 2433 if (header_len < 0 || header_len >= (int)sizeof(buf)) { 2434 /* Somehow snprintf failed to write to the buffer, 2435 * remove the header so something useful is output. */ 2436 header_len = 0; 2437 } 2438 /* Make sure buffer is NUL terminated */ 2439 buf[header_len] = '\0'; 2440 text_len = vsnprintf(buf + header_len, sizeof(buf) - header_len, 2441 format, args); 2442 if (text_len < 0 || text_len + header_len >= (int)sizeof(buf)) { 2443 /* Truncated log output. On some platforms a -1 return value means 2444 * that the output was truncated. */ 2445 text_len = sizeof(buf) - header_len; 2446 } 2447 if (header_len + text_len + sizeof(USBI_LOG_LINE_END) >= sizeof(buf)) { 2448 /* Need to truncate the text slightly to fit on the terminator. */ 2449 text_len -= (header_len + text_len + sizeof(USBI_LOG_LINE_END)) - sizeof(buf); 2450 } 2451 strcpy(buf + header_len + text_len, USBI_LOG_LINE_END); 2452 2453 usbi_log_str(ctx, level, buf); 2454 } 2455 2456 void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, 1928 2457 const char *function, const char *format, ...) 1929 2458 { … … 1935 2464 } 1936 2465 1937 /** \ingroup misc2466 /** \ingroup libusb_misc 1938 2467 * Returns a constant NULL-terminated string with the ASCII name of a libusb 1939 * error code. The caller must not free() the returned string. 1940 * 1941 * \param error_code The \ref libusb_error code to return the name of. 2468 * error or transfer status code. The caller must not free() the returned 2469 * string. 2470 * 2471 * \param error_code The \ref libusb_error or libusb_transfer_status code to 2472 * return the name of. 1942 2473 * \returns The error name, or the string **UNKNOWN** if the value of 1943 * error_code is not a known error code.2474 * error_code is not a known error / status code. 1944 2475 */ 1945 2476 DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code) 1946 2477 { 1947 enum libusb_error error = error_code; 1948 switch (error) { 1949 case LIBUSB_SUCCESS: 1950 return "LIBUSB_SUCCESS"; 2478 switch (error_code) { 1951 2479 case LIBUSB_ERROR_IO: 1952 2480 return "LIBUSB_ERROR_IO"; … … 1975 2503 case LIBUSB_ERROR_OTHER: 1976 2504 return "LIBUSB_ERROR_OTHER"; 1977 } 1978 return "**UNKNOWN**"; 1979 } 1980 1981 /** \ingroup misc 2505 2506 case LIBUSB_TRANSFER_ERROR: 2507 return "LIBUSB_TRANSFER_ERROR"; 2508 case LIBUSB_TRANSFER_TIMED_OUT: 2509 return "LIBUSB_TRANSFER_TIMED_OUT"; 2510 case LIBUSB_TRANSFER_CANCELLED: 2511 return "LIBUSB_TRANSFER_CANCELLED"; 2512 case LIBUSB_TRANSFER_STALL: 2513 return "LIBUSB_TRANSFER_STALL"; 2514 case LIBUSB_TRANSFER_NO_DEVICE: 2515 return "LIBUSB_TRANSFER_NO_DEVICE"; 2516 case LIBUSB_TRANSFER_OVERFLOW: 2517 return "LIBUSB_TRANSFER_OVERFLOW"; 2518 2519 case 0: 2520 return "LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED"; 2521 default: 2522 return "**UNKNOWN**"; 2523 } 2524 } 2525 2526 /** \ingroup libusb_misc 1982 2527 * Returns a pointer to const struct libusb_version with the version 1983 * (major, minor, micro, rc, and nano) of the running library.2528 * (major, minor, micro, nano and rc) of the running library. 1984 2529 */ 1985 2530 DEFAULT_VISIBILITY -
TabularUnified libusb1/trunk/libusb/descriptor.c ¶
r1876 r1882 1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 1 2 /* 2 3 * USB descriptor handling functions for libusb 3 * Copyright (C) 2007 Daniel Drake <dsd@gentoo.org> 4 * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> 5 * Copyright (c) 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu> 4 * Copyright © 2007 Daniel Drake <dsd@gentoo.org> 5 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 20 20 */ 21 21 22 #include <config.h> 23 22 24 #include <errno.h> 23 25 #include <stdint.h> 24 26 #include <stdlib.h> 25 27 #include <string.h> 26 #include <stdio.h>27 #include <assert.h>28 28 29 29 #include "libusbi.h" … … 36 36 #define ENDPOINT_AUDIO_DESC_LENGTH 9 37 37 38 /** @defgroup desc USB descriptors38 /** @defgroup libusb_desc USB descriptors 39 39 * This page details how to examine the various standard USB descriptors 40 40 * for detected devices … … 69 69 dp += 2; 70 70 break; 71 /* 32-bit word, convert from little endian to CPU */ 72 case 'd': 73 /* Align to word boundary */ 74 dp += ((unsigned long)dp & 1); 71 case 'd': /* 32-bit word, convert from little endian to CPU */ 72 dp += ((uintptr_t)dp & 1); /* Align to word boundary */ 75 73 76 74 if (host_endian) { … … 84 82 dp += 4; 85 83 break; 84 case 'u': /* 16 byte UUID */ 85 memcpy(dp, sp, 16); 86 sp += 16; 87 dp += 16; 88 break; 86 89 } 87 90 } … … 92 95 static void clear_endpoint(struct libusb_endpoint_descriptor *endpoint) 93 96 { 94 if (endpoint->extra) 95 free((unsigned char *) endpoint->extra); 97 free((void *) endpoint->extra); 96 98 } 97 99 … … 106 108 int len; 107 109 110 if (size < DESC_HEADER_LENGTH) { 111 usbi_err(ctx, "short endpoint descriptor read %d/%d", 112 size, DESC_HEADER_LENGTH); 113 return LIBUSB_ERROR_IO; 114 } 115 108 116 usbi_parse_descriptor(buffer, "bb", &header, 0); 109 110 /* Everything should be fine being passed into here, but we sanity */111 /* check JIC */112 if (header.bLength > size) {113 usbi_err(ctx, "ran out of descriptors parsing");114 return -1;115 }116 117 117 if (header.bDescriptorType != LIBUSB_DT_ENDPOINT) { 118 118 usbi_err(ctx, "unexpected descriptor %x (expected %x)", … … 120 120 return parsed; 121 121 } 122 122 if (header.bLength > size) { 123 usbi_warn(ctx, "short endpoint descriptor read %d/%d", 124 size, header.bLength); 125 return parsed; 126 } 123 127 if (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH) 124 128 usbi_parse_descriptor(buffer, "bbbbwbbb", endpoint, host_endian); 125 129 else if (header.bLength >= ENDPOINT_DESC_LENGTH) 126 130 usbi_parse_descriptor(buffer, "bbbbwb", endpoint, host_endian); 131 else { 132 usbi_err(ctx, "invalid endpoint bLength (%d)", header.bLength); 133 return LIBUSB_ERROR_IO; 134 } 127 135 128 136 buffer += header.bLength; … … 135 143 while (size >= DESC_HEADER_LENGTH) { 136 144 usbi_parse_descriptor(buffer, "bb", &header, 0); 137 138 if (header.bLength < 2) { 139 usbi_err(ctx, "invalid descriptor length %d", header.bLength); 140 return -1; 145 if (header.bLength < DESC_HEADER_LENGTH) { 146 usbi_err(ctx, "invalid extra ep desc len (%d)", 147 header.bLength); 148 return LIBUSB_ERROR_IO; 149 } else if (header.bLength > size) { 150 usbi_warn(ctx, "short extra ep desc read %d/%d", 151 size, header.bLength); 152 return parsed; 141 153 } 142 154 143 155 /* If we find another "proper" descriptor then we're done */ 144 156 if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) || 145 146 147 157 (header.bDescriptorType == LIBUSB_DT_INTERFACE) || 158 (header.bDescriptorType == LIBUSB_DT_CONFIG) || 159 (header.bDescriptorType == LIBUSB_DT_DEVICE)) 148 160 break; 149 161 … … 186 198 (struct libusb_interface_descriptor *) 187 199 usb_interface->altsetting + i; 188 if (ifp->extra) 189 free((void *) ifp->extra); 200 free((void *) ifp->extra); 190 201 if (ifp->endpoint) { 191 202 for (j = 0; j < ifp->bNumEndpoints; j++) 192 203 clear_endpoint((struct libusb_endpoint_descriptor *) 193 ifp->endpoint + j); 194 free((void *) ifp->endpoint); 204 ifp->endpoint + j); 195 205 } 196 }197 free((void *) usb_interface->altsetting);198 usb_interface->altsetting = NULL;199 }200 206 free((void *) ifp->endpoint); 207 } 208 } 209 free((void *) usb_interface->altsetting); 210 usb_interface->altsetting = NULL; 201 211 } 202 212 … … 209 219 int r; 210 220 int parsed = 0; 211 size_t tmp;221 int interface_number = -1; 212 222 struct usb_descriptor_header header; 213 223 struct libusb_interface_descriptor *ifp; … … 219 229 struct libusb_interface_descriptor *altsetting = 220 230 (struct libusb_interface_descriptor *) usb_interface->altsetting; 221 altsetting = realloc(altsetting,231 altsetting = usbi_reallocf(altsetting, 222 232 sizeof(struct libusb_interface_descriptor) * 223 233 (usb_interface->num_altsetting + 1)); … … 229 239 230 240 ifp = altsetting + usb_interface->num_altsetting; 241 usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp, 0); 242 if (ifp->bDescriptorType != LIBUSB_DT_INTERFACE) { 243 usbi_err(ctx, "unexpected descriptor %x (expected %x)", 244 ifp->bDescriptorType, LIBUSB_DT_INTERFACE); 245 return parsed; 246 } 247 if (ifp->bLength < INTERFACE_DESC_LENGTH) { 248 usbi_err(ctx, "invalid interface bLength (%d)", 249 ifp->bLength); 250 r = LIBUSB_ERROR_IO; 251 goto err; 252 } 253 if (ifp->bLength > size) { 254 usbi_warn(ctx, "short intf descriptor read %d/%d", 255 size, ifp->bLength); 256 return parsed; 257 } 258 if (ifp->bNumEndpoints > USB_MAXENDPOINTS) { 259 usbi_err(ctx, "too many endpoints (%d)", ifp->bNumEndpoints); 260 r = LIBUSB_ERROR_IO; 261 goto err; 262 } 263 231 264 usb_interface->num_altsetting++; 232 usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp, 0);233 265 ifp->extra = NULL; 234 266 ifp->extra_length = 0; 235 267 ifp->endpoint = NULL; 268 269 if (interface_number == -1) 270 interface_number = ifp->bInterfaceNumber; 236 271 237 272 /* Skip over the interface */ … … 245 280 while (size >= DESC_HEADER_LENGTH) { 246 281 usbi_parse_descriptor(buffer, "bb", &header, 0); 247 if (header.bLength < 2) { 248 usbi_err(ctx, "invalid descriptor of length %d", 249 header.bLength); 282 if (header.bLength < DESC_HEADER_LENGTH) { 283 usbi_err(ctx, 284 "invalid extra intf desc len (%d)", 285 header.bLength); 250 286 r = LIBUSB_ERROR_IO; 251 287 goto err; 288 } else if (header.bLength > size) { 289 usbi_warn(ctx, 290 "short extra intf desc read %d/%d", 291 size, header.bLength); 292 return parsed; 252 293 } 253 294 254 295 /* If we find another "proper" descriptor then we're done */ 255 296 if ((header.bDescriptorType == LIBUSB_DT_INTERFACE) || 256 (header.bDescriptorType == LIBUSB_DT_ENDPOINT) || 257 (header.bDescriptorType == LIBUSB_DT_CONFIG) || 258 (header.bDescriptorType == LIBUSB_DT_DEVICE) || 259 (header.bDescriptorType == 260 LIBUSB_DT_SS_ENDPOINT_COMPANION)) 297 (header.bDescriptorType == LIBUSB_DT_ENDPOINT) || 298 (header.bDescriptorType == LIBUSB_DT_CONFIG) || 299 (header.bDescriptorType == LIBUSB_DT_DEVICE)) 261 300 break; 262 301 … … 279 318 } 280 319 281 /* Did we hit an unexpected descriptor? */282 if (size >= DESC_HEADER_LENGTH) {283 usbi_parse_descriptor(buffer, "bb", &header, 0);284 if ((header.bDescriptorType == LIBUSB_DT_CONFIG) ||285 (header.bDescriptorType == LIBUSB_DT_DEVICE)) {286 return parsed;287 }288 }289 290 if (ifp->bNumEndpoints > USB_MAXENDPOINTS) {291 usbi_err(ctx, "too many endpoints (%d)", ifp->bNumEndpoints);292 r = LIBUSB_ERROR_IO;293 goto err;294 }295 296 320 if (ifp->bNumEndpoints > 0) { 297 321 struct libusb_endpoint_descriptor *endpoint; 298 tmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor); 299 endpoint = malloc(tmp); 322 endpoint = calloc(ifp->bNumEndpoints, sizeof(struct libusb_endpoint_descriptor)); 300 323 ifp->endpoint = endpoint; 301 324 if (!endpoint) { … … 304 327 } 305 328 306 memset(endpoint, 0, tmp);307 329 for (i = 0; i < ifp->bNumEndpoints; i++) { 308 usbi_parse_descriptor(buffer, "bb", &header, 0);309 310 if (header.bLength > size) {311 usbi_err(ctx, "ran out of descriptors parsing");312 r = LIBUSB_ERROR_IO;313 goto err;314 }315 316 330 r = parse_endpoint(ctx, endpoint + i, buffer, size, 317 331 host_endian); 318 332 if (r < 0) 319 333 goto err; 334 if (r == 0) { 335 ifp->bNumEndpoints = (uint8_t)i; 336 break;; 337 } 320 338 321 339 buffer += r; … … 329 347 if (size < LIBUSB_DT_INTERFACE_SIZE || 330 348 ifp->bDescriptorType != LIBUSB_DT_INTERFACE || 331 !ifp->bAlternateSetting)349 ifp->bInterfaceNumber != interface_number) 332 350 return parsed; 333 351 } … … 341 359 static void clear_configuration(struct libusb_config_descriptor *config) 342 360 { 361 int i; 343 362 if (config->interface) { 344 int i;345 363 for (i = 0; i < config->bNumInterfaces; i++) 346 364 clear_interface((struct libusb_interface *) 347 config->interface + i); 348 free((void *) config->interface); 349 } 350 if (config->extra) 351 free((void *) config->extra); 365 config->interface + i); 366 } 367 free((void *) config->interface); 368 free((void *) config->extra); 352 369 } 353 370 354 371 static int parse_configuration(struct libusb_context *ctx, 355 372 struct libusb_config_descriptor *config, unsigned char *buffer, 356 int host_endian)373 int size, int host_endian) 357 374 { 358 375 int i; 359 376 int r; 360 int size;361 size_t tmp;362 377 struct usb_descriptor_header header; 363 378 struct libusb_interface *usb_interface; 364 379 380 if (size < LIBUSB_DT_CONFIG_SIZE) { 381 usbi_err(ctx, "short config descriptor read %d/%d", 382 size, LIBUSB_DT_CONFIG_SIZE); 383 return LIBUSB_ERROR_IO; 384 } 385 365 386 usbi_parse_descriptor(buffer, "bbwbbbbb", config, host_endian); 366 size = config->wTotalLength; 367 387 if (config->bDescriptorType != LIBUSB_DT_CONFIG) { 388 usbi_err(ctx, "unexpected descriptor %x (expected %x)", 389 config->bDescriptorType, LIBUSB_DT_CONFIG); 390 return LIBUSB_ERROR_IO; 391 } 392 if (config->bLength < LIBUSB_DT_CONFIG_SIZE) { 393 usbi_err(ctx, "invalid config bLength (%d)", config->bLength); 394 return LIBUSB_ERROR_IO; 395 } 396 if (config->bLength > size) { 397 usbi_err(ctx, "short config descriptor read %d/%d", 398 size, config->bLength); 399 return LIBUSB_ERROR_IO; 400 } 368 401 if (config->bNumInterfaces > USB_MAXINTERFACES) { 369 402 usbi_err(ctx, "too many interfaces (%d)", config->bNumInterfaces); … … 371 404 } 372 405 373 tmp = config->bNumInterfaces * sizeof(struct libusb_interface); 374 usb_interface = malloc(tmp); 406 usb_interface = calloc(config->bNumInterfaces, sizeof(struct libusb_interface)); 375 407 config->interface = usb_interface; 376 if (! config->interface)408 if (!usb_interface) 377 409 return LIBUSB_ERROR_NO_MEM; 378 410 379 memset(usb_interface, 0, tmp);380 411 buffer += config->bLength; 381 412 size -= config->bLength; … … 394 425 usbi_parse_descriptor(buffer, "bb", &header, 0); 395 426 396 if ( (header.bLength > size) ||397 (header.bLength < DESC_HEADER_LENGTH)) {398 usbi_err(ctx, "invalid descriptor length of %d",399 header.bLength);427 if (header.bLength < DESC_HEADER_LENGTH) { 428 usbi_err(ctx, 429 "invalid extra config desc len (%d)", 430 header.bLength); 400 431 r = LIBUSB_ERROR_IO; 401 432 goto err; 433 } else if (header.bLength > size) { 434 usbi_warn(ctx, 435 "short extra config desc read %d/%d", 436 size, header.bLength); 437 config->bNumInterfaces = (uint8_t)i; 438 return size; 402 439 } 403 440 404 441 /* If we find another "proper" descriptor then we're done */ 405 442 if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) || 406 (header.bDescriptorType == LIBUSB_DT_INTERFACE) || 407 (header.bDescriptorType == LIBUSB_DT_CONFIG) || 408 (header.bDescriptorType == LIBUSB_DT_DEVICE) || 409 (header.bDescriptorType == 410 LIBUSB_DT_SS_ENDPOINT_COMPANION)) 443 (header.bDescriptorType == LIBUSB_DT_INTERFACE) || 444 (header.bDescriptorType == LIBUSB_DT_CONFIG) || 445 (header.bDescriptorType == LIBUSB_DT_DEVICE)) 411 446 break; 412 447 413 usbi_dbg("skipping descriptor 0x%x \n", header.bDescriptorType);448 usbi_dbg("skipping descriptor 0x%x", header.bDescriptorType); 414 449 buffer += header.bLength; 415 450 size -= header.bLength; … … 436 471 if (r < 0) 437 472 goto err; 473 if (r == 0) { 474 config->bNumInterfaces = (uint8_t)i; 475 break; 476 } 438 477 439 478 buffer += r; … … 448 487 } 449 488 489 static int raw_desc_to_config(struct libusb_context *ctx, 490 unsigned char *buf, int size, int host_endian, 491 struct libusb_config_descriptor **config) 492 { 493 struct libusb_config_descriptor *_config = malloc(sizeof(*_config)); 494 int r; 495 496 if (!_config) 497 return LIBUSB_ERROR_NO_MEM; 498 499 r = parse_configuration(ctx, _config, buf, size, host_endian); 500 if (r < 0) { 501 usbi_err(ctx, "parse_configuration failed with error %d", r); 502 free(_config); 503 return r; 504 } else if (r > 0) { 505 usbi_warn(ctx, "still %d bytes of descriptor data left", r); 506 } 507 508 *config = _config; 509 return LIBUSB_SUCCESS; 510 } 511 450 512 int usbi_device_cache_descriptor(libusb_device *dev) 451 513 { 452 int r, host_endian ;514 int r, host_endian = 0; 453 515 454 516 r = usbi_backend->get_device_descriptor(dev, (unsigned char *) &dev->device_descriptor, … … 467 529 } 468 530 469 /** \ingroup desc531 /** \ingroup libusb_desc 470 532 * Get the USB device descriptor for a given device. 471 533 * 472 534 * This is a non-blocking function; the device descriptor is cached in memory. 535 * 536 * Note since libusb-1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102, this 537 * function always succeeds. 473 538 * 474 539 * \param dev the device … … 485 550 } 486 551 487 /** \ingroup desc552 /** \ingroup libusb_desc 488 553 * Get the USB configuration descriptor for the currently active configuration. 489 554 * This is a non-blocking function which does not involve any requests being … … 502 567 struct libusb_config_descriptor **config) 503 568 { 504 struct libusb_config_descriptor *_config = malloc(sizeof(*_config));505 unsigned char tmp[ 8];569 struct libusb_config_descriptor _config; 570 unsigned char tmp[LIBUSB_DT_CONFIG_SIZE]; 506 571 unsigned char *buf = NULL; 507 572 int host_endian = 0; 508 573 int r; 509 574 510 usbi_dbg(""); 511 if (!_config) 575 r = usbi_backend->get_active_config_descriptor(dev, tmp, 576 LIBUSB_DT_CONFIG_SIZE, &host_endian); 577 if (r < 0) 578 return r; 579 if (r < LIBUSB_DT_CONFIG_SIZE) { 580 usbi_err(dev->ctx, "short config descriptor read %d/%d", 581 r, LIBUSB_DT_CONFIG_SIZE); 582 return LIBUSB_ERROR_IO; 583 } 584 585 usbi_parse_descriptor(tmp, "bbw", &_config, host_endian); 586 buf = malloc(_config.wTotalLength); 587 if (!buf) 512 588 return LIBUSB_ERROR_NO_MEM; 513 589 514 r = usbi_backend->get_active_config_descriptor(dev, tmp, sizeof(tmp),515 &host_endian);516 if (r < 0)517 goto err;518 519 usbi_parse_descriptor(tmp, "bbw", _config, host_endian);520 buf = malloc(_config->wTotalLength);521 if (!buf) {522 r = LIBUSB_ERROR_NO_MEM;523 goto err;524 }525 526 590 r = usbi_backend->get_active_config_descriptor(dev, buf, 527 _config->wTotalLength, &host_endian); 528 if (r < 0) 529 goto err; 530 531 r = parse_configuration(dev->ctx, _config, buf, host_endian); 532 if (r < 0) { 533 usbi_err(dev->ctx, "parse_configuration failed with error %d", r); 534 goto err; 535 } else if (r > 0) { 536 usbi_warn(dev->ctx, "descriptor data still left"); 537 } 591 _config.wTotalLength, &host_endian); 592 if (r >= 0) 593 r = raw_desc_to_config(dev->ctx, buf, r, host_endian, config); 538 594 539 595 free(buf); 540 *config = _config;541 return 0;542 543 err:544 free(_config);545 if (buf)546 free(buf);547 596 return r; 548 597 } 549 598 550 /** \ingroup desc599 /** \ingroup libusb_desc 551 600 * Get a USB configuration descriptor based on its index. 552 601 * This is a non-blocking function which does not involve any requests being … … 567 616 uint8_t config_index, struct libusb_config_descriptor **config) 568 617 { 569 struct libusb_config_descriptor *_config;570 unsigned char tmp[ 8];618 struct libusb_config_descriptor _config; 619 unsigned char tmp[LIBUSB_DT_CONFIG_SIZE]; 571 620 unsigned char *buf = NULL; 572 621 int host_endian = 0; … … 577 626 return LIBUSB_ERROR_NOT_FOUND; 578 627 579 _config = malloc(sizeof(*_config)); 580 if (!_config) 628 r = usbi_backend->get_config_descriptor(dev, config_index, tmp, 629 LIBUSB_DT_CONFIG_SIZE, &host_endian); 630 if (r < 0) 631 return r; 632 if (r < LIBUSB_DT_CONFIG_SIZE) { 633 usbi_err(dev->ctx, "short config descriptor read %d/%d", 634 r, LIBUSB_DT_CONFIG_SIZE); 635 return LIBUSB_ERROR_IO; 636 } 637 638 usbi_parse_descriptor(tmp, "bbw", &_config, host_endian); 639 buf = malloc(_config.wTotalLength); 640 if (!buf) 581 641 return LIBUSB_ERROR_NO_MEM; 582 642 583 r = usbi_backend->get_config_descriptor(dev, config_index, tmp,584 sizeof(tmp), &host_endian);585 if (r < 0)586 goto err;587 588 usbi_parse_descriptor(tmp, "bbw", _config, host_endian);589 buf = malloc(_config->wTotalLength);590 if (!buf) {591 r = LIBUSB_ERROR_NO_MEM;592 goto err;593 }594 595 host_endian = 0;596 643 r = usbi_backend->get_config_descriptor(dev, config_index, buf, 597 _config->wTotalLength, &host_endian); 598 if (r < 0) 599 goto err; 600 601 r = parse_configuration(dev->ctx, _config, buf, host_endian); 602 if (r < 0) { 603 usbi_err(dev->ctx, "parse_configuration failed with error %d", r); 604 goto err; 605 } else if (r > 0) { 606 usbi_warn(dev->ctx, "descriptor data still left"); 607 } 644 _config.wTotalLength, &host_endian); 645 if (r >= 0) 646 r = raw_desc_to_config(dev->ctx, buf, r, host_endian, config); 608 647 609 648 free(buf); 610 *config = _config;611 return 0;612 613 err:614 free(_config);615 if (buf)616 free(buf);617 649 return r; 618 650 } … … 621 653 * matching a specific bConfigurationValue in the idx output parameter, or -1 622 654 * if the config was not found. 623 * returns 0 o r a LIBUSB_ERROR code655 * returns 0 on success or a LIBUSB_ERROR code 624 656 */ 625 657 int usbi_get_config_index_by_value(struct libusb_device *dev, … … 634 666 int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp), 635 667 &host_endian); 636 if (r < 0) 668 if (r < 0) { 669 *idx = -1; 637 670 return r; 671 } 638 672 if (tmp[5] == bConfigurationValue) { 639 673 *idx = i; … … 646 680 } 647 681 648 /** \ingroup desc682 /** \ingroup libusb_desc 649 683 * Get a USB configuration descriptor with a specific bConfigurationValue. 650 684 * This is a non-blocking function which does not involve any requests being … … 666 700 uint8_t bConfigurationValue, struct libusb_config_descriptor **config) 667 701 { 668 int idx; 669 int r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx); 702 int r, idx, host_endian; 703 unsigned char *buf = NULL; 704 705 if (usbi_backend->get_config_descriptor_by_value) { 706 r = usbi_backend->get_config_descriptor_by_value(dev, 707 bConfigurationValue, &buf, &host_endian); 708 if (r < 0) 709 return r; 710 return raw_desc_to_config(dev->ctx, buf, r, host_endian, config); 711 } 712 713 r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx); 670 714 if (r < 0) 671 715 return r; … … 676 720 } 677 721 678 /** \ingroup desc722 /** \ingroup libusb_desc 679 723 * Free a configuration descriptor obtained from 680 724 * libusb_get_active_config_descriptor() or libusb_get_config_descriptor(). … … 694 738 } 695 739 696 /** \ingroup desc 740 /** \ingroup libusb_desc 741 * Get an endpoints superspeed endpoint companion descriptor (if any) 742 * 743 * \param ctx the context to operate on, or NULL for the default context 744 * \param endpoint endpoint descriptor from which to get the superspeed 745 * endpoint companion descriptor 746 * \param ep_comp output location for the superspeed endpoint companion 747 * descriptor. Only valid if 0 was returned. Must be freed with 748 * libusb_free_ss_endpoint_companion_descriptor() after use. 749 * \returns 0 on success 750 * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist 751 * \returns another LIBUSB_ERROR code on error 752 */ 753 int API_EXPORTED libusb_get_ss_endpoint_companion_descriptor( 754 struct libusb_context *ctx, 755 const struct libusb_endpoint_descriptor *endpoint, 756 struct libusb_ss_endpoint_companion_descriptor **ep_comp) 757 { 758 struct usb_descriptor_header header; 759 int size = endpoint->extra_length; 760 const unsigned char *buffer = endpoint->extra; 761 762 *ep_comp = NULL; 763 764 while (size >= DESC_HEADER_LENGTH) { 765 usbi_parse_descriptor(buffer, "bb", &header, 0); 766 if (header.bLength < 2 || header.bLength > size) { 767 usbi_err(ctx, "invalid descriptor length %d", 768 header.bLength); 769 return LIBUSB_ERROR_IO; 770 } 771 if (header.bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) { 772 buffer += header.bLength; 773 size -= header.bLength; 774 continue; 775 } 776 if (header.bLength < LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE) { 777 usbi_err(ctx, "invalid ss-ep-comp-desc length %d", 778 header.bLength); 779 return LIBUSB_ERROR_IO; 780 } 781 *ep_comp = malloc(sizeof(**ep_comp)); 782 if (*ep_comp == NULL) 783 return LIBUSB_ERROR_NO_MEM; 784 usbi_parse_descriptor(buffer, "bbbbw", *ep_comp, 0); 785 return LIBUSB_SUCCESS; 786 } 787 return LIBUSB_ERROR_NOT_FOUND; 788 } 789 790 /** \ingroup libusb_desc 791 * Free a superspeed endpoint companion descriptor obtained from 792 * libusb_get_ss_endpoint_companion_descriptor(). 793 * It is safe to call this function with a NULL ep_comp parameter, in which 794 * case the function simply returns. 795 * 796 * \param ep_comp the superspeed endpoint companion descriptor to free 797 */ 798 void API_EXPORTED libusb_free_ss_endpoint_companion_descriptor( 799 struct libusb_ss_endpoint_companion_descriptor *ep_comp) 800 { 801 free(ep_comp); 802 } 803 804 static int parse_bos(struct libusb_context *ctx, 805 struct libusb_bos_descriptor **bos, 806 unsigned char *buffer, int size, int host_endian) 807 { 808 struct libusb_bos_descriptor bos_header, *_bos; 809 struct libusb_bos_dev_capability_descriptor dev_cap; 810 int i; 811 812 if (size < LIBUSB_DT_BOS_SIZE) { 813 usbi_err(ctx, "short bos descriptor read %d/%d", 814 size, LIBUSB_DT_BOS_SIZE); 815 return LIBUSB_ERROR_IO; 816 } 817 818 usbi_parse_descriptor(buffer, "bbwb", &bos_header, host_endian); 819 if (bos_header.bDescriptorType != LIBUSB_DT_BOS) { 820 usbi_err(ctx, "unexpected descriptor %x (expected %x)", 821 bos_header.bDescriptorType, LIBUSB_DT_BOS); 822 return LIBUSB_ERROR_IO; 823 } 824 if (bos_header.bLength < LIBUSB_DT_BOS_SIZE) { 825 usbi_err(ctx, "invalid bos bLength (%d)", bos_header.bLength); 826 return LIBUSB_ERROR_IO; 827 } 828 if (bos_header.bLength > size) { 829 usbi_err(ctx, "short bos descriptor read %d/%d", 830 size, bos_header.bLength); 831 return LIBUSB_ERROR_IO; 832 } 833 834 _bos = calloc (1, 835 sizeof(*_bos) + bos_header.bNumDeviceCaps * sizeof(void *)); 836 if (!_bos) 837 return LIBUSB_ERROR_NO_MEM; 838 839 usbi_parse_descriptor(buffer, "bbwb", _bos, host_endian); 840 buffer += bos_header.bLength; 841 size -= bos_header.bLength; 842 843 /* Get the device capability descriptors */ 844 for (i = 0; i < bos_header.bNumDeviceCaps; i++) { 845 if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) { 846 usbi_warn(ctx, "short dev-cap descriptor read %d/%d", 847 size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE); 848 break; 849 } 850 usbi_parse_descriptor(buffer, "bbb", &dev_cap, host_endian); 851 if (dev_cap.bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) { 852 usbi_warn(ctx, "unexpected descriptor %x (expected %x)", 853 dev_cap.bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY); 854 break; 855 } 856 if (dev_cap.bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) { 857 usbi_err(ctx, "invalid dev-cap bLength (%d)", 858 dev_cap.bLength); 859 libusb_free_bos_descriptor(_bos); 860 return LIBUSB_ERROR_IO; 861 } 862 if (dev_cap.bLength > size) { 863 usbi_warn(ctx, "short dev-cap descriptor read %d/%d", 864 size, dev_cap.bLength); 865 break; 866 } 867 868 _bos->dev_capability[i] = malloc(dev_cap.bLength); 869 if (!_bos->dev_capability[i]) { 870 libusb_free_bos_descriptor(_bos); 871 return LIBUSB_ERROR_NO_MEM; 872 } 873 memcpy(_bos->dev_capability[i], buffer, dev_cap.bLength); 874 buffer += dev_cap.bLength; 875 size -= dev_cap.bLength; 876 } 877 _bos->bNumDeviceCaps = (uint8_t)i; 878 *bos = _bos; 879 880 return LIBUSB_SUCCESS; 881 } 882 883 /** \ingroup libusb_desc 884 * Get a Binary Object Store (BOS) descriptor 885 * This is a BLOCKING function, which will send requests to the device. 886 * 887 * \param dev_handle the handle of an open libusb device 888 * \param bos output location for the BOS descriptor. Only valid if 0 was returned. 889 * Must be freed with \ref libusb_free_bos_descriptor() after use. 890 * \returns 0 on success 891 * \returns LIBUSB_ERROR_NOT_FOUND if the device doesn't have a BOS descriptor 892 * \returns another LIBUSB_ERROR code on error 893 */ 894 int API_EXPORTED libusb_get_bos_descriptor(libusb_device_handle *dev_handle, 895 struct libusb_bos_descriptor **bos) 896 { 897 struct libusb_bos_descriptor _bos; 898 uint8_t bos_header[LIBUSB_DT_BOS_SIZE] = {0}; 899 unsigned char *bos_data = NULL; 900 const int host_endian = 0; 901 int r; 902 903 /* Read the BOS. This generates 2 requests on the bus, 904 * one for the header, and one for the full BOS */ 905 r = libusb_get_descriptor(dev_handle, LIBUSB_DT_BOS, 0, bos_header, 906 LIBUSB_DT_BOS_SIZE); 907 if (r < 0) { 908 if (r != LIBUSB_ERROR_PIPE) 909 usbi_err(HANDLE_CTX(dev_handle), "failed to read BOS (%d)", r); 910 return r; 911 } 912 if (r < LIBUSB_DT_BOS_SIZE) { 913 usbi_err(HANDLE_CTX(dev_handle), "short BOS read %d/%d", 914 r, LIBUSB_DT_BOS_SIZE); 915 return LIBUSB_ERROR_IO; 916 } 917 918 usbi_parse_descriptor(bos_header, "bbwb", &_bos, host_endian); 919 usbi_dbg("found BOS descriptor: size %d bytes, %d capabilities", 920 _bos.wTotalLength, _bos.bNumDeviceCaps); 921 bos_data = calloc(_bos.wTotalLength, 1); 922 if (bos_data == NULL) 923 return LIBUSB_ERROR_NO_MEM; 924 925 r = libusb_get_descriptor(dev_handle, LIBUSB_DT_BOS, 0, bos_data, 926 _bos.wTotalLength); 927 if (r >= 0) 928 r = parse_bos(HANDLE_CTX(dev_handle), bos, bos_data, r, host_endian); 929 else 930 usbi_err(HANDLE_CTX(dev_handle), "failed to read BOS (%d)", r); 931 932 free(bos_data); 933 return r; 934 } 935 936 /** \ingroup libusb_desc 937 * Free a BOS descriptor obtained from libusb_get_bos_descriptor(). 938 * It is safe to call this function with a NULL bos parameter, in which 939 * case the function simply returns. 940 * 941 * \param bos the BOS descriptor to free 942 */ 943 void API_EXPORTED libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) 944 { 945 int i; 946 947 if (!bos) 948 return; 949 950 for (i = 0; i < bos->bNumDeviceCaps; i++) 951 free(bos->dev_capability[i]); 952 free(bos); 953 } 954 955 /** \ingroup libusb_desc 956 * Get an USB 2.0 Extension descriptor 957 * 958 * \param ctx the context to operate on, or NULL for the default context 959 * \param dev_cap Device Capability descriptor with a bDevCapabilityType of 960 * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION 961 * LIBUSB_BT_USB_2_0_EXTENSION 962 * \param usb_2_0_extension output location for the USB 2.0 Extension 963 * descriptor. Only valid if 0 was returned. Must be freed with 964 * libusb_free_usb_2_0_extension_descriptor() after use. 965 * \returns 0 on success 966 * \returns a LIBUSB_ERROR code on error 967 */ 968 int API_EXPORTED libusb_get_usb_2_0_extension_descriptor( 969 struct libusb_context *ctx, 970 struct libusb_bos_dev_capability_descriptor *dev_cap, 971 struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension) 972 { 973 struct libusb_usb_2_0_extension_descriptor *_usb_2_0_extension; 974 const int host_endian = 0; 975 976 if (dev_cap->bDevCapabilityType != LIBUSB_BT_USB_2_0_EXTENSION) { 977 usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)", 978 dev_cap->bDevCapabilityType, 979 LIBUSB_BT_USB_2_0_EXTENSION); 980 return LIBUSB_ERROR_INVALID_PARAM; 981 } 982 if (dev_cap->bLength < LIBUSB_BT_USB_2_0_EXTENSION_SIZE) { 983 usbi_err(ctx, "short dev-cap descriptor read %d/%d", 984 dev_cap->bLength, LIBUSB_BT_USB_2_0_EXTENSION_SIZE); 985 return LIBUSB_ERROR_IO; 986 } 987 988 _usb_2_0_extension = malloc(sizeof(*_usb_2_0_extension)); 989 if (!_usb_2_0_extension) 990 return LIBUSB_ERROR_NO_MEM; 991 992 usbi_parse_descriptor((unsigned char *)dev_cap, "bbbd", 993 _usb_2_0_extension, host_endian); 994 995 *usb_2_0_extension = _usb_2_0_extension; 996 return LIBUSB_SUCCESS; 997 } 998 999 /** \ingroup libusb_desc 1000 * Free a USB 2.0 Extension descriptor obtained from 1001 * libusb_get_usb_2_0_extension_descriptor(). 1002 * It is safe to call this function with a NULL usb_2_0_extension parameter, 1003 * in which case the function simply returns. 1004 * 1005 * \param usb_2_0_extension the USB 2.0 Extension descriptor to free 1006 */ 1007 void API_EXPORTED libusb_free_usb_2_0_extension_descriptor( 1008 struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension) 1009 { 1010 free(usb_2_0_extension); 1011 } 1012 1013 /** \ingroup libusb_desc 1014 * Get a SuperSpeed USB Device Capability descriptor 1015 * 1016 * \param ctx the context to operate on, or NULL for the default context 1017 * \param dev_cap Device Capability descriptor with a bDevCapabilityType of 1018 * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 1019 * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 1020 * \param ss_usb_device_cap output location for the SuperSpeed USB Device 1021 * Capability descriptor. Only valid if 0 was returned. Must be freed with 1022 * libusb_free_ss_usb_device_capability_descriptor() after use. 1023 * \returns 0 on success 1024 * \returns a LIBUSB_ERROR code on error 1025 */ 1026 int API_EXPORTED libusb_get_ss_usb_device_capability_descriptor( 1027 struct libusb_context *ctx, 1028 struct libusb_bos_dev_capability_descriptor *dev_cap, 1029 struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap) 1030 { 1031 struct libusb_ss_usb_device_capability_descriptor *_ss_usb_device_cap; 1032 const int host_endian = 0; 1033 1034 if (dev_cap->bDevCapabilityType != LIBUSB_BT_SS_USB_DEVICE_CAPABILITY) { 1035 usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)", 1036 dev_cap->bDevCapabilityType, 1037 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY); 1038 return LIBUSB_ERROR_INVALID_PARAM; 1039 } 1040 if (dev_cap->bLength < LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) { 1041 usbi_err(ctx, "short dev-cap descriptor read %d/%d", 1042 dev_cap->bLength, LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE); 1043 return LIBUSB_ERROR_IO; 1044 } 1045 1046 _ss_usb_device_cap = malloc(sizeof(*_ss_usb_device_cap)); 1047 if (!_ss_usb_device_cap) 1048 return LIBUSB_ERROR_NO_MEM; 1049 1050 usbi_parse_descriptor((unsigned char *)dev_cap, "bbbbwbbw", 1051 _ss_usb_device_cap, host_endian); 1052 1053 *ss_usb_device_cap = _ss_usb_device_cap; 1054 return LIBUSB_SUCCESS; 1055 } 1056 1057 /** \ingroup libusb_desc 1058 * Free a SuperSpeed USB Device Capability descriptor obtained from 1059 * libusb_get_ss_usb_device_capability_descriptor(). 1060 * It is safe to call this function with a NULL ss_usb_device_cap 1061 * parameter, in which case the function simply returns. 1062 * 1063 * \param ss_usb_device_cap the USB 2.0 Extension descriptor to free 1064 */ 1065 void API_EXPORTED libusb_free_ss_usb_device_capability_descriptor( 1066 struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap) 1067 { 1068 free(ss_usb_device_cap); 1069 } 1070 1071 /** \ingroup libusb_desc 1072 * Get a Container ID descriptor 1073 * 1074 * \param ctx the context to operate on, or NULL for the default context 1075 * \param dev_cap Device Capability descriptor with a bDevCapabilityType of 1076 * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID 1077 * LIBUSB_BT_CONTAINER_ID 1078 * \param container_id output location for the Container ID descriptor. 1079 * Only valid if 0 was returned. Must be freed with 1080 * libusb_free_container_id_descriptor() after use. 1081 * \returns 0 on success 1082 * \returns a LIBUSB_ERROR code on error 1083 */ 1084 int API_EXPORTED libusb_get_container_id_descriptor(struct libusb_context *ctx, 1085 struct libusb_bos_dev_capability_descriptor *dev_cap, 1086 struct libusb_container_id_descriptor **container_id) 1087 { 1088 struct libusb_container_id_descriptor *_container_id; 1089 const int host_endian = 0; 1090 1091 if (dev_cap->bDevCapabilityType != LIBUSB_BT_CONTAINER_ID) { 1092 usbi_err(ctx, "unexpected bDevCapabilityType %x (expected %x)", 1093 dev_cap->bDevCapabilityType, 1094 LIBUSB_BT_CONTAINER_ID); 1095 return LIBUSB_ERROR_INVALID_PARAM; 1096 } 1097 if (dev_cap->bLength < LIBUSB_BT_CONTAINER_ID_SIZE) { 1098 usbi_err(ctx, "short dev-cap descriptor read %d/%d", 1099 dev_cap->bLength, LIBUSB_BT_CONTAINER_ID_SIZE); 1100 return LIBUSB_ERROR_IO; 1101 } 1102 1103 _container_id = malloc(sizeof(*_container_id)); 1104 if (!_container_id) 1105 return LIBUSB_ERROR_NO_MEM; 1106 1107 usbi_parse_descriptor((unsigned char *)dev_cap, "bbbbu", 1108 _container_id, host_endian); 1109 1110 *container_id = _container_id; 1111 return LIBUSB_SUCCESS; 1112 } 1113 1114 /** \ingroup libusb_desc 1115 * Free a Container ID descriptor obtained from 1116 * libusb_get_container_id_descriptor(). 1117 * It is safe to call this function with a NULL container_id parameter, 1118 * in which case the function simply returns. 1119 * 1120 * \param container_id the USB 2.0 Extension descriptor to free 1121 */ 1122 void API_EXPORTED libusb_free_container_id_descriptor( 1123 struct libusb_container_id_descriptor *container_id) 1124 { 1125 free(container_id); 1126 } 1127 1128 /** \ingroup libusb_desc 697 1129 * Retrieve a string descriptor in C style ASCII. 698 1130 * … … 700 1132 * supported by the device. 701 1133 * 702 * \param dev a device handle1134 * \param dev_handle a device handle 703 1135 * \param desc_index the index of the descriptor to retrieve 704 1136 * \param data output buffer for ASCII string descriptor … … 706 1138 * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure 707 1139 */ 708 int API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev ,1140 int API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev_handle, 709 1141 uint8_t desc_index, unsigned char *data, int length) 710 1142 { … … 725 1157 return LIBUSB_ERROR_INVALID_PARAM; 726 1158 727 r = libusb_get_string_descriptor(dev , 0, 0, tbuf, sizeof(tbuf));1159 r = libusb_get_string_descriptor(dev_handle, 0, 0, tbuf, sizeof(tbuf)); 728 1160 if (r < 0) 729 1161 return r; … … 734 1166 langid = tbuf[2] | (tbuf[3] << 8); 735 1167 736 r = libusb_get_string_descriptor(dev , desc_index, langid, tbuf,1168 r = libusb_get_string_descriptor(dev_handle, desc_index, langid, tbuf, 737 1169 sizeof(tbuf)); 738 1170 if (r < 0) … … 749 1181 break; 750 1182 751 if ( tbuf[si + 1]) /* high byte*/1183 if ((tbuf[si] & 0x80) || (tbuf[si + 1])) /* non-ASCII */ 752 1184 data[di++] = '?'; 753 1185 else … … 758 1190 return di; 759 1191 } 760 761 int API_EXPORTED libusb_parse_ss_endpoint_comp(const void *buf, int len,762 struct libusb_ss_endpoint_companion_descriptor **ep_comp)763 {764 struct libusb_ss_endpoint_companion_descriptor *ep_comp_desc;765 struct usb_descriptor_header header;766 767 usbi_parse_descriptor(buf, "bb", &header, 0);768 769 /* Everything should be fine being passed into here, but we sanity */770 /* check JIC */771 if (header.bLength > len) {772 usbi_err(NULL, "ran out of descriptors parsing");773 return LIBUSB_ERROR_NO_MEM;774 }775 776 if (header.bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) {777 usbi_err(NULL, "unexpected descriptor %x (expected %x)",778 header.bDescriptorType, LIBUSB_DT_SS_ENDPOINT_COMPANION);779 return LIBUSB_ERROR_INVALID_PARAM;780 }781 782 ep_comp_desc = calloc(1, sizeof (*ep_comp_desc));783 if (!ep_comp_desc) {784 return LIBUSB_ERROR_NO_MEM;785 }786 787 if (header.bLength >= LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE)788 usbi_parse_descriptor(buf, "bbbbw", ep_comp_desc, 0);789 790 *ep_comp = ep_comp_desc;791 792 return LIBUSB_SUCCESS;793 }794 795 void API_EXPORTED libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp)796 {797 assert(ep_comp);798 free(ep_comp);799 }800 801 int API_EXPORTED libusb_parse_bos_descriptor(const void *buf, int len,802 struct libusb_bos_descriptor **bos)803 {804 const unsigned char *buffer = (const unsigned char *) buf;805 struct libusb_bos_descriptor *bos_desc;806 int i;807 808 bos_desc = calloc (1, sizeof (*bos_desc));809 if (!bos_desc) {810 return LIBUSB_ERROR_NO_MEM;811 }812 813 usbi_parse_descriptor(buffer, "bbwb", bos_desc, 0);814 buffer += LIBUSB_DT_BOS_SIZE;815 816 /* Get the device capability descriptors */817 for (i = 0; i < bos_desc->bNumDeviceCaps; ++i) {818 if (buffer[2] == LIBUSB_USB_CAP_TYPE_EXT) {819 if (!bos_desc->usb_2_0_ext_cap) {820 bos_desc->usb_2_0_ext_cap =821 (struct libusb_usb_2_0_device_capability_descriptor *)822 malloc(sizeof(*bos_desc->usb_2_0_ext_cap));823 usbi_parse_descriptor(buffer, "bbbd",824 bos_desc->usb_2_0_ext_cap, 0);825 } else826 usbi_warn(NULL,827 "usb_2_0_ext_cap was already allocated");828 829 /* move to the next device capability descriptor */830 buffer += LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE;831 } else if (buffer[2] == LIBUSB_SS_USB_CAP_TYPE) {832 if (!bos_desc->ss_usb_cap) {833 bos_desc->ss_usb_cap =834 (struct libusb_ss_usb_device_capability_descriptor *)835 malloc(sizeof(*bos_desc->ss_usb_cap));836 usbi_parse_descriptor(buffer, "bbbbwbbw",837 bos_desc->ss_usb_cap, 0);838 } else839 usbi_warn(NULL,840 "ss_usb_cap was already allocated");841 842 /* move to the next device capability descriptor */843 buffer += LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE;844 } else {845 usbi_info(NULL, "wireless/container_id capability "846 "descriptor");847 848 /* move to the next device capability descriptor */849 buffer += buffer[0];850 }851 }852 853 *bos = bos_desc;854 855 return LIBUSB_SUCCESS;856 }857 858 void API_EXPORTED libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)859 {860 assert(bos);861 862 if (bos->usb_2_0_ext_cap) {863 free(bos->usb_2_0_ext_cap);864 }865 866 if (bos->ss_usb_cap) {867 free(bos->ss_usb_cap);868 }869 870 free(bos);871 } -
TabularUnified libusb1/trunk/libusb/hotplug.c ¶
r1876 r1882 1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset:8 -*- */1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 2 2 /* 3 3 * Hotplug functions for libusb 4 * Copyright (C)2012-2013 Nathan Hjelm <hjelmn@mac.com>5 * Copyright (C)2012-2013 Peter Stuge <peter@stuge.se>4 * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com> 5 * Copyright © 2012-2013 Peter Stuge <peter@stuge.se> 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 26 26 #include <stdlib.h> 27 27 #include <string.h> 28 #ifdef HAVE_SYS_TYPES_H 28 29 #include <sys/types.h> 30 #endif 29 31 #include <assert.h> 30 32 … … 33 35 34 36 /** 35 * @defgroup hotplug Device hotplug event notification 36 * This page details how to use the libusb hotplug interface. 37 * 38 * \page hotplug Device hotplug event notification 39 * 40 * \section intro Introduction 41 * 42 * Releases of libusb 1.0 newer than 1.X have added support for hotplug 43 * events. This interface allows you to request notification for the 44 * arrival and departure of matching USB devices. 37 * @defgroup libusb_hotplug Device hotplug event notification 38 * This page details how to use the libusb hotplug interface, where available. 39 * 40 * Be mindful that not all platforms currently implement hotplug notification and 41 * that you should first call on \ref libusb_has_capability() with parameter 42 * \ref LIBUSB_CAP_HAS_HOTPLUG to confirm that hotplug support is available. 43 * 44 * \page libusb_hotplug Device hotplug event notification 45 * 46 * \section hotplug_intro Introduction 47 * 48 * Version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102, has added support 49 * for hotplug events on <b>some</b> platforms (you should test if your platform 50 * supports hotplug notification by calling \ref libusb_has_capability() with 51 * parameter \ref LIBUSB_CAP_HAS_HOTPLUG). 52 * 53 * This interface allows you to request notification for the arrival and departure 54 * of matching USB devices. 45 55 * 46 56 * To receive hotplug notification you register a callback by calling 47 * libusb_hotplug_register_callback(). This function will optionally return48 * a handle that can be passed tolibusb_hotplug_deregister_callback().57 * \ref libusb_hotplug_register_callback(). This function will optionally return 58 * a callback handle that can be passed to \ref libusb_hotplug_deregister_callback(). 49 59 * 50 60 * A callback function must return an int (0 or 1) indicating whether the callback is 51 61 * expecting additional events. Returning 0 will rearm the callback and 1 will cause 52 * the callback to be deregistered. 53 * 54 * Callbacks for a particulat context are automatically deregistered by libusb_exit(). 55 * 56 * As of 1.X there are two supported hotplug events: 62 * the callback to be deregistered. Note that when callbacks are called from 63 * libusb_hotplug_register_callback() because of the \ref LIBUSB_HOTPLUG_ENUMERATE 64 * flag, the callback return value is ignored, iow you cannot cause a callback 65 * to be deregistered by returning 1 when it is called from 66 * libusb_hotplug_register_callback(). 67 * 68 * Callbacks for a particular context are automatically deregistered by libusb_exit(). 69 * 70 * As of 1.0.16 there are two supported hotplug events: 57 71 * - LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: A device has arrived and is ready to use 58 72 * - LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: A device has left and is no longer available … … 62 76 * Note: If you receive notification that a device has left and you have any 63 77 * a libusb_device_handles for the device it is up to you to call libusb_close() 64 * on each handle to free up any remaining resources associated with the device.78 * on each device handle to free up any remaining resources associated with the device. 65 79 * Once a device has left any libusb_device_handle associated with the device 66 80 * are invalid and will remain so even if the device comes back. 67 81 * 68 82 * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED event it is considered 69 * safe to call any libusb function that takes a libusb_device. On the other hand, 70 * when handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function 83 * safe to call any libusb function that takes a libusb_device. It also safe to 84 * open a device and submit asynchronous transfers. However, most other functions 85 * that take a libusb_device_handle are <b>not</b> safe to call. Examples of such 86 * functions are any of the \ref libusb_syncio "synchronous API" functions or the blocking 87 * functions that retrieve various \ref libusb_desc "USB descriptors". These functions must 88 * be used outside of the context of the hotplug callback. 89 * 90 * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function 71 91 * is libusb_get_device_descriptor(). 72 92 * 73 93 * The following code provides an example of the usage of the hotplug interface: 74 94 \code 95 #include <stdio.h> 96 #include <stdlib.h> 97 #include <time.h> 98 #include <libusb.h> 99 75 100 static int count = 0; 76 101 77 102 int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev, 78 103 libusb_hotplug_event event, void *user_data) { 79 static libusb_device_handle * handle = NULL;104 static libusb_device_handle *dev_handle = NULL; 80 105 struct libusb_device_descriptor desc; 81 106 int rc; … … 84 109 85 110 if (LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED == event) { 86 rc = libusb_open(dev, & handle);111 rc = libusb_open(dev, &dev_handle); 87 112 if (LIBUSB_SUCCESS != rc) { 88 113 printf("Could not open USB device\n"); 89 114 } 90 115 } else if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) { 91 if ( handle) {92 libusb_close( handle);93 handle = NULL;116 if (dev_handle) { 117 libusb_close(dev_handle); 118 dev_handle = NULL; 94 119 } 95 120 } else { … … 102 127 103 128 int main (void) { 104 libusb_hotplug_callback_handle handle;129 libusb_hotplug_callback_handle callback_handle; 105 130 int rc; 106 131 … … 110 135 LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, 0x045a, 0x5005, 111 136 LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL, 112 & handle);137 &callback_handle); 113 138 if (LIBUSB_SUCCESS != rc) { 114 139 printf("Error creating a hotplug callback\n"); … … 118 143 119 144 while (count < 2) { 120 usleep(10000); 145 libusb_handle_events_completed(NULL, NULL); 146 nanosleep(&(struct timespec){0, 10000000UL}, NULL); 121 147 } 122 148 123 libusb_hotplug_deregister_callback( handle);149 libusb_hotplug_deregister_callback(NULL, callback_handle); 124 150 libusb_exit(NULL); 125 151 … … 129 155 */ 130 156 131 static int usbi_hotplug_match_cb (struct libusb_device *dev, libusb_hotplug_event event, 132 struct libusb_hotplug_callback *hotplug_cb) { 133 struct libusb_context *ctx = dev->ctx; 134 135 /* Handle lazy deregistration of callback */ 136 if (hotplug_cb->needs_free) { 137 /* Free callback */ 138 return 1; 139 } 140 141 if (!(hotplug_cb->events & event)) { 142 return 0; 143 } 144 145 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->vendor_id && 146 hotplug_cb->vendor_id != dev->device_descriptor.idVendor) { 147 return 0; 148 } 149 150 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->product_id && 151 hotplug_cb->product_id != dev->device_descriptor.idProduct) { 152 return 0; 153 } 154 155 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->dev_class && 156 hotplug_cb->dev_class != dev->device_descriptor.bDeviceClass) { 157 return 0; 158 } 159 160 return hotplug_cb->cb (ctx == usbi_default_context ? NULL : ctx, 161 dev, event, hotplug_cb->user_data); 162 } 163 164 void usbi_hotplug_match(struct libusb_device *dev, libusb_hotplug_event event) { 157 static int usbi_hotplug_match_cb (struct libusb_context *ctx, 158 struct libusb_device *dev, libusb_hotplug_event event, 159 struct libusb_hotplug_callback *hotplug_cb) 160 { 161 /* Handle lazy deregistration of callback */ 162 if (hotplug_cb->needs_free) { 163 /* Free callback */ 164 return 1; 165 } 166 167 if (!(hotplug_cb->events & event)) { 168 return 0; 169 } 170 171 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->vendor_id && 172 hotplug_cb->vendor_id != dev->device_descriptor.idVendor) { 173 return 0; 174 } 175 176 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->product_id && 177 hotplug_cb->product_id != dev->device_descriptor.idProduct) { 178 return 0; 179 } 180 181 if (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->dev_class && 182 hotplug_cb->dev_class != dev->device_descriptor.bDeviceClass) { 183 return 0; 184 } 185 186 return hotplug_cb->cb (ctx, dev, event, hotplug_cb->user_data); 187 } 188 189 void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev, 190 libusb_hotplug_event event) 191 { 165 192 struct libusb_hotplug_callback *hotplug_cb, *next; 166 struct libusb_context *ctx = dev->ctx;193 int ret; 167 194 168 195 usbi_mutex_lock(&ctx->hotplug_cbs_lock); 169 196 170 197 list_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list, struct libusb_hotplug_callback) { 171 172 int ret = usbi_hotplug_match_cb (dev, event, hotplug_cb);173 174 175 176 177 178 198 usbi_mutex_unlock(&ctx->hotplug_cbs_lock); 199 ret = usbi_hotplug_match_cb (ctx, dev, event, hotplug_cb); 200 usbi_mutex_lock(&ctx->hotplug_cbs_lock); 201 202 if (ret) { 203 list_del(&hotplug_cb->list); 204 free(hotplug_cb); 205 } 179 206 } 180 207 181 208 usbi_mutex_unlock(&ctx->hotplug_cbs_lock); 182 209 183 /* loop through and disconnect all open handles for this device */ 184 if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) { 185 struct libusb_device_handle *handle; 186 187 usbi_mutex_lock(&ctx->open_devs_lock); 188 list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { 189 if (dev == handle->dev) { 190 usbi_handle_disconnect (handle); 191 } 192 } 193 usbi_mutex_unlock(&ctx->open_devs_lock); 194 } 210 /* the backend is expected to call the callback for each active transfer */ 211 } 212 213 void usbi_hotplug_notification(struct libusb_context *ctx, struct libusb_device *dev, 214 libusb_hotplug_event event) 215 { 216 int pending_events; 217 libusb_hotplug_message *message = calloc(1, sizeof(*message)); 218 219 if (!message) { 220 usbi_err(ctx, "error allocating hotplug message"); 221 return; 222 } 223 224 message->event = event; 225 message->device = dev; 226 227 /* Take the event data lock and add this message to the list. 228 * Only signal an event if there are no prior pending events. */ 229 usbi_mutex_lock(&ctx->event_data_lock); 230 pending_events = usbi_pending_events(ctx); 231 list_add_tail(&message->list, &ctx->hotplug_msgs); 232 if (!pending_events) 233 usbi_signal_event(ctx); 234 usbi_mutex_unlock(&ctx->event_data_lock); 195 235 } 196 236 197 237 int API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx, 198 libusb_hotplug_event events, 199 libusb_hotplug_flag flags, 200 int vendor_id, int product_id, 201 int dev_class, 202 libusb_hotplug_callback_fn cb_fn, 203 void *user_data, libusb_hotplug_callback_handle *handle) { 204 libusb_hotplug_callback *new_callback; 205 static int handle_id = 1; 206 207 /* check for hotplug support */ 208 if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { 209 return LIBUSB_ERROR_NOT_SUPPORTED; 210 } 211 212 /* check for sane values */ 213 if ((LIBUSB_HOTPLUG_MATCH_ANY != vendor_id && (~0xffff & vendor_id)) || 214 (LIBUSB_HOTPLUG_MATCH_ANY != product_id && (~0xffff & product_id)) || 215 (LIBUSB_HOTPLUG_MATCH_ANY != dev_class && (~0xff & dev_class)) || 216 !cb_fn) { 217 return LIBUSB_ERROR_INVALID_PARAM; 218 } 219 220 USBI_GET_CONTEXT(ctx); 221 222 new_callback = (libusb_hotplug_callback *)calloc(1, sizeof (*new_callback)); 223 if (!new_callback) { 224 return LIBUSB_ERROR_NO_MEM; 225 } 226 227 new_callback->ctx = ctx; 228 new_callback->vendor_id = vendor_id; 229 new_callback->product_id = product_id; 230 new_callback->dev_class = dev_class; 231 new_callback->flags = flags; 232 new_callback->events = events; 233 new_callback->cb = cb_fn; 234 new_callback->user_data = user_data; 235 new_callback->needs_free = 0; 238 libusb_hotplug_event events, libusb_hotplug_flag flags, 239 int vendor_id, int product_id, int dev_class, 240 libusb_hotplug_callback_fn cb_fn, void *user_data, 241 libusb_hotplug_callback_handle *callback_handle) 242 { 243 libusb_hotplug_callback *new_callback; 244 static int handle_id = 1; 245 246 /* check for hotplug support */ 247 if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { 248 return LIBUSB_ERROR_NOT_SUPPORTED; 249 } 250 251 /* check for sane values */ 252 if ((LIBUSB_HOTPLUG_MATCH_ANY != vendor_id && (~0xffff & vendor_id)) || 253 (LIBUSB_HOTPLUG_MATCH_ANY != product_id && (~0xffff & product_id)) || 254 (LIBUSB_HOTPLUG_MATCH_ANY != dev_class && (~0xff & dev_class)) || 255 !cb_fn) { 256 return LIBUSB_ERROR_INVALID_PARAM; 257 } 258 259 USBI_GET_CONTEXT(ctx); 260 261 new_callback = (libusb_hotplug_callback *)calloc(1, sizeof (*new_callback)); 262 if (!new_callback) { 263 return LIBUSB_ERROR_NO_MEM; 264 } 265 266 new_callback->ctx = ctx; 267 new_callback->vendor_id = vendor_id; 268 new_callback->product_id = product_id; 269 new_callback->dev_class = dev_class; 270 new_callback->flags = flags; 271 new_callback->events = events; 272 new_callback->cb = cb_fn; 273 new_callback->user_data = user_data; 274 new_callback->needs_free = 0; 236 275 237 276 usbi_mutex_lock(&ctx->hotplug_cbs_lock); 238 277 239 /* protect the handle by the context hotplug lock. it doesn't matter if the same handle is used for different 240 241 278 /* protect the handle by the context hotplug lock. it doesn't matter if the same handle 279 * is used for different contexts only that the handle is unique for this context */ 280 new_callback->handle = handle_id++; 242 281 243 282 list_add(&new_callback->list, &ctx->hotplug_cbs); 244 283 245 if (flags & LIBUSB_HOTPLUG_ENUMERATE) {246 struct libusb_device *dev;247 248 usbi_mutex_lock(&ctx->usb_devs_lock);249 250 list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) {251 (void) usbi_hotplug_match_cb (dev, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, new_callback);252 }253 254 usbi_mutex_unlock(&ctx->usb_devs_lock);255 }256 257 284 usbi_mutex_unlock(&ctx->hotplug_cbs_lock); 258 285 259 if (handle) { 260 *handle = new_callback->handle; 261 } 262 263 return LIBUSB_SUCCESS; 264 } 265 266 void API_EXPORTED libusb_hotplug_deregister_callback (struct libusb_context *ctx, libusb_hotplug_callback_handle handle) { 267 struct libusb_hotplug_callback *hotplug_cb; 268 269 /* check for hotplug support */ 270 if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { 271 return; 272 } 273 274 USBI_GET_CONTEXT(ctx); 275 276 usbi_mutex_lock(&ctx->hotplug_cbs_lock); 277 list_for_each_entry(hotplug_cb, &ctx->hotplug_cbs, list, 278 struct libusb_hotplug_callback) { 279 if (handle == hotplug_cb->handle) { 280 /* Mark this callback for deregistration */ 281 hotplug_cb->needs_free = 1; 282 } 283 } 284 usbi_mutex_unlock(&ctx->hotplug_cbs_lock); 286 287 if (flags & LIBUSB_HOTPLUG_ENUMERATE) { 288 int i, len; 289 struct libusb_device **devs; 290 291 len = (int) libusb_get_device_list(ctx, &devs); 292 if (len < 0) { 293 libusb_hotplug_deregister_callback(ctx, 294 new_callback->handle); 295 return len; 296 } 297 298 for (i = 0; i < len; i++) { 299 usbi_hotplug_match_cb(ctx, devs[i], 300 LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 301 new_callback); 302 } 303 304 libusb_free_device_list(devs, 1); 305 } 306 307 308 if (callback_handle) 309 *callback_handle = new_callback->handle; 310 311 return LIBUSB_SUCCESS; 312 } 313 314 void API_EXPORTED libusb_hotplug_deregister_callback (struct libusb_context *ctx, 315 libusb_hotplug_callback_handle callback_handle) 316 { 317 struct libusb_hotplug_callback *hotplug_cb; 318 319 /* check for hotplug support */ 320 if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { 321 return; 322 } 323 324 USBI_GET_CONTEXT(ctx); 325 326 usbi_mutex_lock(&ctx->hotplug_cbs_lock); 327 list_for_each_entry(hotplug_cb, &ctx->hotplug_cbs, list, 328 struct libusb_hotplug_callback) { 329 if (callback_handle == hotplug_cb->handle) { 330 /* Mark this callback for deregistration */ 331 hotplug_cb->needs_free = 1; 332 } 333 } 334 usbi_mutex_unlock(&ctx->hotplug_cbs_lock); 335 336 usbi_hotplug_notification(ctx, NULL, 0); 285 337 } 286 338 … … 292 344 struct libusb_hotplug_callback) { 293 345 list_del(&hotplug_cb->list); 294 346 free(hotplug_cb); 295 347 } 296 348 -
TabularUnified libusb1/trunk/libusb/hotplug.h ¶
r1876 r1882 1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset:8 -*- */1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 2 2 /* 3 * Hotplug support for libusb 1.04 * Copyright (C) 2012 Nathan Hjelm <hjelmn@users.sourceforge.net>5 * Copyright (C) 2012Peter Stuge <peter@stuge.se>3 * Hotplug support for libusb 4 * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com> 5 * Copyright © 2012-2013 Peter Stuge <peter@stuge.se> 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 22 22 #if !defined(USBI_HOTPLUG_H) 23 23 #define USBI_HOTPLUG_H 24 25 #ifndef LIBUSBI_H 26 #include "libusbi.h" 27 #endif 24 28 25 29 /** \ingroup hotplug … … 42 46 43 47 /** Hotplug callback flags */ 44 48 libusb_hotplug_flag flags; 45 49 46 50 /** Event(s) that will trigger this callback */ … … 50 54 libusb_hotplug_callback_fn cb; 51 55 52 53 56 /** Handle for this callback (used to match on deregister) */ 57 libusb_hotplug_callback_handle handle; 54 58 55 59 /** User data that will be passed to the callback function */ 56 60 void *user_data; 57 61 58 59 62 /** Callback is marked for deletion */ 63 int needs_free; 60 64 61 65 /** List this callback is registered in (ctx->hotplug_cbs) */ 62 66 struct list_head list; 63 67 }; 64 68 … … 66 70 67 71 struct libusb_hotplug_message { 68 libusb_hotplug_event event; 69 struct libusb_device *device; 72 /** The hotplug event that occurred */ 73 libusb_hotplug_event event; 74 75 /** The device for which this hotplug event occurred */ 76 struct libusb_device *device; 77 78 /** List this message is contained in (ctx->hotplug_msgs) */ 79 struct list_head list; 70 80 }; 71 81 … … 73 83 74 84 void usbi_hotplug_deregister_all(struct libusb_context *ctx); 75 void usbi_hotplug_match(struct libusb_device *dev, libusb_hotplug_event event); 85 void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev, 86 libusb_hotplug_event event); 87 void usbi_hotplug_notification(struct libusb_context *ctx, struct libusb_device *dev, 88 libusb_hotplug_event event); 76 89 77 90 #endif -
TabularUnified libusb1/trunk/libusb/io.c ¶
r1879 r1882 1 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 1 2 /* 2 3 * I/O functions for libusb 3 * Copyright (C)2007-2009 Daniel Drake <dsd@gentoo.org>4 * Copyright (c)2001 Johannes Erdfelt <johannes@erdfelt.com>4 * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org> 5 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 20 21 21 22 #include <config.h> 23 24 #include <assert.h> 22 25 #include <errno.h> 23 #include <signal.h>24 26 #include <stdint.h> 25 27 #include <stdlib.h> 26 28 #include <string.h> 27 29 #include <time.h> 28 #include <fcntl.h> 29 30 #ifdef HAVE_SIGNAL_H 31 #include <signal.h> 32 #endif 30 33 #ifdef HAVE_SYS_TIME_H 31 34 #include <sys/time.h> 32 35 #endif 33 34 36 #ifdef USBI_TIMERFD_AVAILABLE 35 37 #include <sys/timerfd.h> … … 40 42 41 43 /** 42 * \page io Synchronous and asynchronous device I/O43 * 44 * \section i ntro Introduction44 * \page libusb_io Synchronous and asynchronous device I/O 45 * 46 * \section io_intro Introduction 45 47 * 46 48 * If you're using libusb in your application, you're probably wanting to … … 54 56 * Once you have read through the following discussion, you should consult the 55 57 * detailed API documentation pages for the details: 56 * - \ref syncio57 * - \ref asyncio58 * - \ref libusb_syncio 59 * - \ref libusb_asyncio 58 60 * 59 61 * \section theory Transfers at a logical level … … 96 98 unsigned char data[4]; 97 99 int actual_length; 98 int r = libusb_bulk_transfer( handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0);100 int r = libusb_bulk_transfer(dev_handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0); 99 101 if (r == 0 && actual_length == sizeof(data)) { 100 102 // results of the transaction can now be found in the data buffer … … 123 125 * 124 126 * For details on how to use the synchronous API, see the 125 * \ref syncio "synchronous I/O API documentation" pages.127 * \ref libusb_syncio "synchronous I/O API documentation" pages. 126 128 * 127 129 * \section async The asynchronous interface … … 164 166 * 165 167 * For details on how to use the asynchronous API, see the 166 * \ref asyncio "asynchronous I/O API" documentation pages.168 * \ref libusb_asyncio "asynchronous I/O API" documentation pages. 167 169 */ 168 170 169 171 170 172 /** 171 * \page packetoverflow Packets and overflows173 * \page libusb_packetoverflow Packets and overflows 172 174 * 173 175 * \section packets Packet abstraction … … 211 213 212 214 /** 213 * @defgroup asyncio Asynchronous device I/O215 * @defgroup libusb_asyncio Asynchronous device I/O 214 216 * 215 217 * This page details libusb's asynchronous (non-blocking) API for USB device … … 217 219 * need to read this page carefully to understand the necessary considerations 218 220 * and issues surrounding use of this interface. Simplistic applications 219 * may wish to consider the \ref syncio "synchronous I/O API" instead.221 * may wish to consider the \ref libusb_syncio "synchronous I/O API" instead. 220 222 * 221 223 * The asynchronous interface is built around the idea of separating transfer … … 292 294 * the libusb_transfer structure documentation for more information. 293 295 * 296 * <b>Important Note</b>: The user-specified callback is called from an event 297 * handling context. It is therefore important that no calls are made into 298 * libusb that will attempt to perform any event handling. Examples of such 299 * functions are any listed in the \ref libusb_syncio "synchronous API" and any of 300 * the blocking functions that retrieve \ref libusb_desc "USB descriptors". 301 * 294 302 * \subsection Deallocation 295 303 * … … 336 344 * smaller than the data that the device wishes to send. In some circumstances 337 345 * this will cause an overflow, which is a nasty condition to deal with. See 338 * the \ref packetoverflow page for discussion.346 * the \ref libusb_packetoverflow page for discussion. 339 347 * 340 348 * \section asyncctrl Considerations for control transfers … … 465 473 * functions may help you here. 466 474 * 475 * <b>Note</b>: Some operating systems (e.g. Linux) may impose limits on the 476 * length of individual isochronous packets and/or the total length of the 477 * isochronous transfer. Such limits can be difficult for libusb to detect, 478 * so the library will simply try and submit the transfer as set up by you. 479 * If the transfer fails to submit because it is too large, 480 * libusb_submit_transfer() will return 481 * \ref libusb_error::LIBUSB_ERROR_INVALID_PARAM "LIBUSB_ERROR_INVALID_PARAM". 482 * 467 483 * \section asyncmem Memory caveats 468 484 * … … 497 513 * \section asyncevent Event handling 498 514 * 499 * In accordance of the aim of being a lightweight library, libusb does not 500 * create threads internally. This means that libusb code does not execute 501 * at any time other than when your application is calling a libusb function. 502 * However, an asynchronous model requires that libusb perform work at various 515 * An asynchronous model requires that libusb perform work at various 503 516 * points in time - namely processing the results of previously-submitted 504 517 * transfers and invoking the user-supplied callback function. … … 508 521 * the opportunity to reap pending transfers, invoke callbacks, etc. 509 522 * 510 * The first issue to discuss here is how your application can figure out 511 * when libusb has work to do. In fact, there are two naive options which 512 * do not actually require your application to know this: 513 * -# Periodically call libusb_handle_events() in non-blocking mode at fixed 514 * short intervals from your main loop 523 * There are 2 different approaches to dealing with libusb_handle_events: 524 * 515 525 * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated 516 526 * thread. 517 * 518 * The first option is plainly not very nice, and will cause unnecessary 519 * CPU wakeups leading to increased power usage and decreased battery life. 520 * The second option is not very nice either, but may be the nicest option 521 * available to you if the "proper" approach can not be applied to your 522 * application (read on...). 523 * 524 * The recommended option is to integrate libusb with your application main 525 * event loop. libusb exposes a set of file descriptors which allow you to do 526 * this. Your main loop is probably already calling poll() or select() or a 527 * -# Integrate libusb with your application's main event loop. libusb 528 * exposes a set of file descriptors which allow you to do this. 529 * 530 * The first approach has the big advantage that it will also work on Windows 531 * were libusb' poll API for select / poll integration is not available. So 532 * if you want to support Windows and use the async API, you must use this 533 * approach, see the \ref eventthread "Using an event handling thread" section 534 * below for details. 535 * 536 * If you prefer a single threaded approach with a single central event loop, 537 * see the \ref libusb_poll "polling and timing" section for how to integrate libusb 538 * into your application's main event loop. 539 * 540 * \section eventthread Using an event handling thread 541 * 542 * Lets begin with stating the obvious: If you're going to use a separate 543 * thread for libusb event handling, your callback functions MUST be 544 * threadsafe. 545 * 546 * Other then that doing event handling from a separate thread, is mostly 547 * simple. You can use an event thread function as follows: 548 \code 549 void *event_thread_func(void *ctx) 550 { 551 while (event_thread_run) 552 libusb_handle_events(ctx); 553 554 return NULL; 555 } 556 \endcode 557 * 558 * There is one caveat though, stopping this thread requires setting the 559 * event_thread_run variable to 0, and after that libusb_handle_events() needs 560 * to return control to event_thread_func. But unless some event happens, 561 * libusb_handle_events() will not return. 562 * 563 * There are 2 different ways of dealing with this, depending on if your 564 * application uses libusb' \ref libusb_hotplug "hotplug" support or not. 565 * 566 * Applications which do not use hotplug support, should not start the event 567 * thread until after their first call to libusb_open(), and should stop the 568 * thread when closing the last open device as follows: 569 \code 570 void my_close_handle(libusb_device_handle *dev_handle) 571 { 572 if (open_devs == 1) 573 event_thread_run = 0; 574 575 libusb_close(dev_handle); // This wakes up libusb_handle_events() 576 577 if (open_devs == 1) 578 pthread_join(event_thread); 579 580 open_devs--; 581 } 582 \endcode 583 * 584 * Applications using hotplug support should start the thread at program init, 585 * after having successfully called libusb_hotplug_register_callback(), and 586 * should stop the thread at program exit as follows: 587 \code 588 void my_libusb_exit(void) 589 { 590 event_thread_run = 0; 591 libusb_hotplug_deregister_callback(ctx, hotplug_cb_handle); // This wakes up libusb_handle_events() 592 pthread_join(event_thread); 593 libusb_exit(ctx); 594 } 595 \endcode 596 */ 597 598 /** 599 * @defgroup libusb_poll Polling and timing 600 * 601 * This page documents libusb's functions for polling events and timing. 602 * These functions are only necessary for users of the 603 * \ref libusb_asyncio "asynchronous API". If you are only using the simpler 604 * \ref libusb_syncio "synchronous API" then you do not need to ever call these 605 * functions. 606 * 607 * The justification for the functionality described here has already been 608 * discussed in the \ref asyncevent "event handling" section of the 609 * asynchronous API documentation. In summary, libusb does not create internal 610 * threads for event processing and hence relies on your application calling 611 * into libusb at certain points in time so that pending events can be handled. 612 * 613 * Your main loop is probably already calling poll() or select() or a 527 614 * variant on a set of file descriptors for other event sources (e.g. keyboard 528 615 * button presses, mouse movements, network sockets, etc). You then add … … 532 619 * 533 620 * There is one final event handling complication. libusb supports 534 * asynchronous transfers which time out after a specified time period, and 535 * this requires that libusb is called into at or after the timeout so that 536 * the timeout can be handled. So, in addition to considering libusb's file 621 * asynchronous transfers which time out after a specified time period. 622 * 623 * On some platforms a timerfd is used, so the timeout handling is just another 624 * fd, on other platforms this requires that libusb is called into at or after 625 * the timeout to handle it. So, in addition to considering libusb's file 537 626 * descriptors in your main event loop, you must also consider that libusb 538 627 * sometimes needs to be called into at fixed points in time even when there 539 * is no file descriptor activity. 540 * 541 * For the details on retrieving the set of file descriptors and determining 542 * the next timeout, see the \ref poll "polling and timing" API documentation. 543 */ 544 545 /** 546 * @defgroup poll Polling and timing 547 * 548 * This page documents libusb's functions for polling events and timing. 549 * These functions are only necessary for users of the 550 * \ref asyncio "asynchronous API". If you are only using the simpler 551 * \ref syncio "synchronous API" then you do not need to ever call these 552 * functions. 553 * 554 * The justification for the functionality described here has already been 555 * discussed in the \ref asyncevent "event handling" section of the 556 * asynchronous API documentation. In summary, libusb does not create internal 557 * threads for event processing and hence relies on your application calling 558 * into libusb at certain points in time so that pending events can be handled. 628 * is no file descriptor activity, see \ref polltime details. 629 * 559 630 * In order to know precisely when libusb needs to be called into, libusb 560 631 * offers you a set of pollable file descriptors and information about when … … 583 654 * handle those details internally. 584 655 * 585 * \section pollmain The more advanced option656 * \section libusb_pollmain The more advanced option 586 657 * 587 658 * \note This functionality is currently only available on Unix-like platforms. 588 * On Windows, libusb_get_pollfds() simply returns NULL. Exposing event sources 589 * on Windows will require some further thought and design. 659 * On Windows, libusb_get_pollfds() simply returns NULL. Applications which 660 * want to support Windows are advised to use an \ref eventthread 661 * "event handling thread" instead. 590 662 * 591 663 * In more advanced applications, you will already have a main loop which … … 697 769 * with these entities otherwise. 698 770 * 699 * See the extra documentation: \ref mtasync700 */ 701 702 /** \page mtasync Multi-threaded applications and asynchronous I/O771 * See the extra documentation: \ref libusb_mtasync 772 */ 773 774 /** \page libusb_mtasync Multi-threaded applications and asynchronous I/O 703 775 * 704 776 * libusb is a thread-safe library, but extra considerations must be applied … … 708 780 * revolves around monitoring file descriptors through the poll()/select() 709 781 * system calls. This is directly exposed at the 710 * \ref asyncio "asynchronous interface" but it is important to note that the711 * \ref syncio "synchronous interface" is implemented on top of the782 * \ref libusb_asyncio "asynchronous interface" but it is important to note that the 783 * \ref libusb_syncio "synchronous interface" is implemented on top of the 712 784 * asynchonrous interface, therefore the same considerations apply. 713 785 * … … 732 804 void myfunc() { 733 805 struct libusb_transfer *transfer; 734 unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE] ;806 unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE] __attribute__ ((aligned (2))); 735 807 int completed = 0; 736 808 … … 975 1047 * -# During initialization, libusb opens an internal pipe, and it adds the read 976 1048 * end of this pipe to the set of file descriptors to be polled. 977 * -# During libusb_close(), libusb writes some dummy data on this controlpipe.1049 * -# During libusb_close(), libusb writes some dummy data on this event pipe. 978 1050 * This immediately interrupts the event handler. libusb also records 979 1051 * internally that it is trying to interrupt event handlers for this … … 1008 1080 * 1009 1081 * -# The device is opened and a file descriptor is added to the poll set. 1010 * -# libusb sends some dummy data on the controlpipe, and records that it1082 * -# libusb sends some dummy data on the event pipe, and records that it 1011 1083 * is trying to modify the poll descriptor set. 1012 1084 * -# The event handler is interrupted, and the same behaviour change as for … … 1036 1108 * and another trying to send a synchronous USB transfer, you will end up with 1037 1109 * two threads monitoring the same descriptors, and the above-described 1038 * undesirable behaviour occur ing. The solution is for your polling thread to1110 * undesirable behaviour occurring. The solution is for your polling thread to 1039 1111 * play by the rules; the synchronous I/O functions do so, and this will result 1040 1112 * in them getting along in perfect harmony. … … 1053 1125 int r; 1054 1126 1055 usbi_mutex_init(&ctx->flying_transfers_lock , NULL);1056 usbi_mutex_init(&ctx-> pollfds_lock, NULL);1057 usbi_mutex_init(&ctx-> pollfd_modify_lock, NULL);1058 usbi_ mutex_init_recursive(&ctx->events_lock, NULL);1059 usbi_mutex_init(&ctx->event_ waiters_lock, NULL);1060 usbi_ cond_init(&ctx->event_waiters_cond, NULL);1127 usbi_mutex_init(&ctx->flying_transfers_lock); 1128 usbi_mutex_init(&ctx->events_lock); 1129 usbi_mutex_init(&ctx->event_waiters_lock); 1130 usbi_cond_init(&ctx->event_waiters_cond); 1131 usbi_mutex_init(&ctx->event_data_lock); 1132 usbi_tls_key_create(&ctx->event_handling_key); 1061 1133 list_init(&ctx->flying_transfers); 1062 list_init(&ctx->pollfds); 1134 list_init(&ctx->ipollfds); 1135 list_init(&ctx->hotplug_msgs); 1136 list_init(&ctx->completed_transfers); 1063 1137 1064 1138 /* FIXME should use an eventfd on kernels that support it */ 1065 1066 r = usbi_pipe(ctx->ctrl_pipe); 1067 1139 r = usbi_pipe(ctx->event_pipe); 1068 1140 if (r < 0) { 1069 1141 r = LIBUSB_ERROR_OTHER; … … 1071 1143 } 1072 1144 1073 r = usbi_add_pollfd(ctx, ctx-> ctrl_pipe[0], POLLIN);1145 r = usbi_add_pollfd(ctx, ctx->event_pipe[0], POLLIN); 1074 1146 if (r < 0) 1075 1147 goto err_close_pipe; 1076 1077 /* create hotplug pipe */1078 r = usbi_pipe(ctx->hotplug_pipe);1079 if (r < 0) {1080 r = LIBUSB_ERROR_OTHER;1081 goto err;1082 }1083 1084 #ifndef OS_WINDOWS1085 fcntl (ctx->hotplug_pipe[1], F_SETFD, O_NONBLOCK);1086 #endif1087 r = usbi_add_pollfd(ctx, ctx->hotplug_pipe[0], POLLIN);1088 if (r < 0)1089 goto err_close_hp_pipe;1090 1148 1091 1149 #ifdef USBI_TIMERFD_AVAILABLE … … 1095 1153 usbi_dbg("using timerfd for timeouts"); 1096 1154 r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN); 1097 if (r < 0) { 1098 usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]); 1099 close(ctx->timerfd); 1100 goto err_close_hp_pipe; 1101 } 1155 if (r < 0) 1156 goto err_close_timerfd; 1102 1157 } else { 1103 1158 usbi_dbg("timerfd not available (code %d error %d)", ctx->timerfd, errno); … … 1108 1163 return 0; 1109 1164 1110 err_close_hp_pipe: 1111 usbi_close(ctx->hotplug_pipe[0]); 1112 usbi_close(ctx->hotplug_pipe[1]); 1165 #ifdef USBI_TIMERFD_AVAILABLE 1166 err_close_timerfd: 1167 close(ctx->timerfd); 1168 usbi_remove_pollfd(ctx, ctx->event_pipe[0]); 1169 #endif 1113 1170 err_close_pipe: 1114 usbi_close(ctx-> ctrl_pipe[0]);1115 usbi_close(ctx-> ctrl_pipe[1]);1171 usbi_close(ctx->event_pipe[0]); 1172 usbi_close(ctx->event_pipe[1]); 1116 1173 err: 1117 1174 usbi_mutex_destroy(&ctx->flying_transfers_lock); 1118 usbi_mutex_destroy(&ctx->pollfds_lock);1119 usbi_mutex_destroy(&ctx->pollfd_modify_lock);1120 1175 usbi_mutex_destroy(&ctx->events_lock); 1121 1176 usbi_mutex_destroy(&ctx->event_waiters_lock); 1122 1177 usbi_cond_destroy(&ctx->event_waiters_cond); 1178 usbi_mutex_destroy(&ctx->event_data_lock); 1179 usbi_tls_key_delete(ctx->event_handling_key); 1123 1180 return r; 1124 1181 } … … 1126 1183 void usbi_io_exit(struct libusb_context *ctx) 1127 1184 { 1128 usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]); 1129 usbi_close(ctx->ctrl_pipe[0]); 1130 usbi_close(ctx->ctrl_pipe[1]); 1131 usbi_remove_pollfd(ctx, ctx->hotplug_pipe[0]); 1132 usbi_close(ctx->hotplug_pipe[0]); 1133 usbi_close(ctx->hotplug_pipe[1]); 1185 usbi_remove_pollfd(ctx, ctx->event_pipe[0]); 1186 usbi_close(ctx->event_pipe[0]); 1187 usbi_close(ctx->event_pipe[1]); 1134 1188 #ifdef USBI_TIMERFD_AVAILABLE 1135 1189 if (usbi_using_timerfd(ctx)) { … … 1139 1193 #endif 1140 1194 usbi_mutex_destroy(&ctx->flying_transfers_lock); 1141 usbi_mutex_destroy(&ctx->pollfds_lock);1142 usbi_mutex_destroy(&ctx->pollfd_modify_lock);1143 1195 usbi_mutex_destroy(&ctx->events_lock); 1144 1196 usbi_mutex_destroy(&ctx->event_waiters_lock); 1145 1197 usbi_cond_destroy(&ctx->event_waiters_cond); 1198 usbi_mutex_destroy(&ctx->event_data_lock); 1199 usbi_tls_key_delete(ctx->event_handling_key); 1200 if (ctx->pollfds) 1201 free(ctx->pollfds); 1146 1202 } 1147 1203 … … 1175 1231 } 1176 1232 1177 /* add a transfer to the (timeout-sorted) active transfers list. 1178 * returns 1 if the transfer has a timeout and it is the timeout next to 1179 * expire */ 1180 static int add_to_flying_list(struct usbi_transfer *transfer) 1181 { 1182 struct usbi_transfer *cur; 1183 struct timeval *timeout = &transfer->timeout; 1184 struct libusb_context *ctx = ITRANSFER_CTX(transfer); 1185 int r = 0; 1186 int first = 1; 1187 1188 usbi_mutex_lock(&ctx->flying_transfers_lock); 1189 1190 /* if we have no other flying transfers, start the list with this one */ 1191 if (list_empty(&ctx->flying_transfers)) { 1192 list_add(&transfer->list, &ctx->flying_transfers); 1193 if (timerisset(timeout)) 1194 r = 1; 1195 goto out; 1196 } 1197 1198 /* if we have infinite timeout, append to end of list */ 1199 if (!timerisset(timeout)) { 1200 list_add_tail(&transfer->list, &ctx->flying_transfers); 1201 goto out; 1202 } 1203 1204 /* otherwise, find appropriate place in list */ 1205 list_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) { 1206 /* find first timeout that occurs after the transfer in question */ 1207 struct timeval *cur_tv = &cur->timeout; 1208 1209 if (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) || 1210 (cur_tv->tv_sec == timeout->tv_sec && 1211 cur_tv->tv_usec > timeout->tv_usec)) { 1212 list_add_tail(&transfer->list, &cur->list); 1213 r = first; 1214 goto out; 1215 } 1216 first = 0; 1217 } 1218 1219 /* otherwise we need to be inserted at the end */ 1220 list_add_tail(&transfer->list, &ctx->flying_transfers); 1221 out: 1222 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1223 return r; 1224 } 1225 1226 /** \ingroup asyncio 1233 /** \ingroup libusb_asyncio 1227 1234 * Allocate a libusb transfer with a specified number of isochronous packet 1228 1235 * descriptors. The returned transfer is pre-initialized for you. When the new … … 1251 1258 int iso_packets) 1252 1259 { 1253 s ize_t os_alloc_size = usbi_backend->transfer_priv_size1254 + (usbi_backend->add_iso_packet_size * iso_packets);1260 struct libusb_transfer *transfer; 1261 size_t os_alloc_size = usbi_backend->transfer_priv_size; 1255 1262 size_t alloc_size = sizeof(struct usbi_transfer) 1256 1263 + sizeof(struct libusb_transfer) … … 1258 1265 + os_alloc_size; 1259 1266 #ifndef __OS2__ 1260 struct usbi_transfer *itransfer = malloc(alloc_size);1267 struct usbi_transfer *itransfer = calloc(1, alloc_size); 1261 1268 #else 1262 1269 /* ensure memory is allocated in low memory arena */ … … 1266 1273 return NULL; 1267 1274 1268 memset(itransfer, 0, alloc_size);1269 1275 itransfer->num_iso_packets = iso_packets; 1270 usbi_mutex_init(&itransfer->lock, NULL); 1271 return USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1272 } 1273 1274 /** \ingroup asyncio 1276 usbi_mutex_init(&itransfer->lock); 1277 transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1278 usbi_dbg("transfer %p", transfer); 1279 return transfer; 1280 } 1281 1282 /** \ingroup libusb_asyncio 1275 1283 * Free a transfer structure. This should be called for all transfers 1276 1284 * allocated with libusb_alloc_transfer(). … … 1295 1303 return; 1296 1304 1305 usbi_dbg("transfer %p", transfer); 1297 1306 if (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer) 1298 1307 free(transfer->buffer); … … 1301 1310 usbi_mutex_destroy(&itransfer->lock); 1302 1311 free(itransfer); 1303 }1304 1305 /** \ingroup asyncio1306 * Submit a transfer. This function will fire off the USB transfer and then1307 * return immediately.1308 *1309 * \param transfer the transfer to submit1310 * \returns 0 on success1311 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected1312 * \returns LIBUSB_ERROR_BUSY if the transfer has already been submitted.1313 * \returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported1314 * by the operating system.1315 * \returns another LIBUSB_ERROR code on other failure1316 */1317 int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer)1318 {1319 struct libusb_context *ctx = TRANSFER_CTX(transfer);1320 struct usbi_transfer *itransfer =1321 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);1322 int r;1323 int first;1324 int updated_fds;1325 1326 usbi_mutex_lock(&itransfer->lock);1327 itransfer->transferred = 0;1328 itransfer->flags = 0;1329 r = calculate_timeout(itransfer);1330 if (r < 0) {1331 r = LIBUSB_ERROR_OTHER;1332 goto out;1333 }1334 1335 first = add_to_flying_list(itransfer);1336 r = usbi_backend->submit_transfer(itransfer);1337 if (r) {1338 usbi_mutex_lock(&ctx->flying_transfers_lock);1339 list_del(&itransfer->list);1340 usbi_mutex_unlock(&ctx->flying_transfers_lock);1341 }1342 #ifdef USBI_TIMERFD_AVAILABLE1343 else if (first && usbi_using_timerfd(ctx)) {1344 /* if this transfer has the lowest timeout of all active transfers,1345 * rearm the timerfd with this transfer's timeout */1346 const struct itimerspec it = { {0, 0},1347 { itransfer->timeout.tv_sec, itransfer->timeout.tv_usec * 1000 } };1348 usbi_dbg("arm timerfd for timeout in %dms (first in line)", transfer->timeout);1349 r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);1350 if (r < 0)1351 r = LIBUSB_ERROR_OTHER;1352 }1353 #else1354 (void)first;1355 #endif1356 1357 out:1358 updated_fds = (itransfer->flags & USBI_TRANSFER_UPDATED_FDS);1359 usbi_mutex_unlock(&itransfer->lock);1360 if (updated_fds)1361 usbi_fd_notification(ctx);1362 return r;1363 }1364 1365 /** \ingroup asyncio1366 * Asynchronously cancel a previously submitted transfer.1367 * This function returns immediately, but this does not indicate cancellation1368 * is complete. Your callback function will be invoked at some later time1369 * with a transfer status of1370 * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED1371 * "LIBUSB_TRANSFER_CANCELLED."1372 *1373 * \param transfer the transfer to cancel1374 * \returns 0 on success1375 * \returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or1376 * cancelled.1377 * \returns a LIBUSB_ERROR code on failure1378 */1379 int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer)1380 {1381 struct usbi_transfer *itransfer =1382 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);1383 int r;1384 1385 usbi_dbg("");1386 usbi_mutex_lock(&itransfer->lock);1387 r = usbi_backend->cancel_transfer(itransfer);1388 if (r < 0) {1389 if (r != LIBUSB_ERROR_NOT_FOUND)1390 usbi_err(TRANSFER_CTX(transfer),1391 "cancel transfer failed error %d", r);1392 else1393 usbi_dbg("cancel transfer failed error %d", r);1394 1395 if (r == LIBUSB_ERROR_NO_DEVICE)1396 itransfer->flags |= USBI_TRANSFER_DEVICE_DISAPPEARED;1397 }1398 1399 itransfer->flags |= USBI_TRANSFER_CANCELLING;1400 1401 usbi_mutex_unlock(&itransfer->lock);1402 return r;1403 1312 } 1404 1313 … … 1420 1329 * next upcoming timeout. 1421 1330 * must be called with flying_list locked. 1422 * returns 0 if there was no timeout to arm, 1 if the next timeout was armed, 1423 * or a LIBUSB_ERROR code on failure. 1331 * returns 0 on success or a LIBUSB_ERROR code on failure. 1424 1332 */ 1425 1333 static int arm_timerfd_for_next_timeout(struct libusb_context *ctx) … … 1433 1341 * arming to do */ 1434 1342 if (!timerisset(cur_tv)) 1435 return 0;1436 1437 /* act on first transfer that is not already cancelled */1438 if (!(transfer-> flags & USBI_TRANSFER_TIMED_OUT)) {1343 goto disarm; 1344 1345 /* act on first transfer that has not already been handled */ 1346 if (!(transfer->timeout_flags & (USBI_TRANSFER_TIMEOUT_HANDLED | USBI_TRANSFER_OS_HANDLES_TIMEOUT))) { 1439 1347 int r; 1440 1348 const struct itimerspec it = { {0, 0}, … … 1444 1352 if (r < 0) 1445 1353 return LIBUSB_ERROR_OTHER; 1446 return 1;1354 return 0; 1447 1355 } 1448 1356 } 1449 1357 1358 disarm: 1359 return disarm_timerfd(ctx); 1360 } 1361 #else 1362 static int arm_timerfd_for_next_timeout(struct libusb_context *ctx) 1363 { 1364 UNUSED(ctx); 1450 1365 return 0; 1451 1366 } 1367 #endif 1368 1369 /* add a transfer to the (timeout-sorted) active transfers list. 1370 * This function will return non 0 if fails to update the timer, 1371 * in which case the transfer is *not* on the flying_transfers list. */ 1372 static int add_to_flying_list(struct usbi_transfer *transfer) 1373 { 1374 struct usbi_transfer *cur; 1375 struct timeval *timeout = &transfer->timeout; 1376 struct libusb_context *ctx = ITRANSFER_CTX(transfer); 1377 int r; 1378 int first = 1; 1379 1380 r = calculate_timeout(transfer); 1381 if (r) 1382 return r; 1383 1384 /* if we have no other flying transfers, start the list with this one */ 1385 if (list_empty(&ctx->flying_transfers)) { 1386 list_add(&transfer->list, &ctx->flying_transfers); 1387 goto out; 1388 } 1389 1390 /* if we have infinite timeout, append to end of list */ 1391 if (!timerisset(timeout)) { 1392 list_add_tail(&transfer->list, &ctx->flying_transfers); 1393 /* first is irrelevant in this case */ 1394 goto out; 1395 } 1396 1397 /* otherwise, find appropriate place in list */ 1398 list_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) { 1399 /* find first timeout that occurs after the transfer in question */ 1400 struct timeval *cur_tv = &cur->timeout; 1401 1402 if (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) || 1403 (cur_tv->tv_sec == timeout->tv_sec && 1404 cur_tv->tv_usec > timeout->tv_usec)) { 1405 list_add_tail(&transfer->list, &cur->list); 1406 goto out; 1407 } 1408 first = 0; 1409 } 1410 /* first is 0 at this stage (list not empty) */ 1411 1412 /* otherwise we need to be inserted at the end */ 1413 list_add_tail(&transfer->list, &ctx->flying_transfers); 1414 out: 1415 #ifdef USBI_TIMERFD_AVAILABLE 1416 if (first && usbi_using_timerfd(ctx) && timerisset(timeout)) { 1417 /* if this transfer has the lowest timeout of all active transfers, 1418 * rearm the timerfd with this transfer's timeout */ 1419 const struct itimerspec it = { {0, 0}, 1420 { timeout->tv_sec, timeout->tv_usec * 1000 } }; 1421 usbi_dbg("arm timerfd for timeout in %dms (first in line)", 1422 USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout); 1423 r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL); 1424 if (r < 0) { 1425 usbi_warn(ctx, "failed to arm first timerfd (errno %d)", errno); 1426 r = LIBUSB_ERROR_OTHER; 1427 } 1428 } 1452 1429 #else 1453 static int disarm_timerfd(struct libusb_context *ctx) 1454 { 1455 (void)ctx; 1456 return 0; 1457 } 1458 static int arm_timerfd_for_next_timeout(struct libusb_context *ctx) 1459 { 1460 (void)ctx; 1461 return 0; 1462 } 1430 UNUSED(first); 1463 1431 #endif 1432 1433 if (r) 1434 list_del(&transfer->list); 1435 1436 return r; 1437 } 1438 1439 /* remove a transfer from the active transfers list. 1440 * This function will *always* remove the transfer from the 1441 * flying_transfers list. It will return a LIBUSB_ERROR code 1442 * if it fails to update the timer for the next timeout. */ 1443 static int remove_from_flying_list(struct usbi_transfer *transfer) 1444 { 1445 struct libusb_context *ctx = ITRANSFER_CTX(transfer); 1446 int rearm_timerfd; 1447 int r = 0; 1448 1449 usbi_mutex_lock(&ctx->flying_transfers_lock); 1450 rearm_timerfd = (timerisset(&transfer->timeout) && 1451 list_first_entry(&ctx->flying_transfers, struct usbi_transfer, list) == transfer); 1452 list_del(&transfer->list); 1453 if (usbi_using_timerfd(ctx) && rearm_timerfd) 1454 r = arm_timerfd_for_next_timeout(ctx); 1455 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1456 1457 return r; 1458 } 1459 1460 /** \ingroup libusb_asyncio 1461 * Submit a transfer. This function will fire off the USB transfer and then 1462 * return immediately. 1463 * 1464 * \param transfer the transfer to submit 1465 * \returns 0 on success 1466 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 1467 * \returns LIBUSB_ERROR_BUSY if the transfer has already been submitted. 1468 * \returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported 1469 * by the operating system. 1470 * \returns LIBUSB_ERROR_INVALID_PARAM if the transfer size is larger than 1471 * the operating system and/or hardware can support 1472 * \returns another LIBUSB_ERROR code on other failure 1473 */ 1474 int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) 1475 { 1476 struct usbi_transfer *itransfer = 1477 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); 1478 struct libusb_context *ctx = TRANSFER_CTX(transfer); 1479 int r; 1480 1481 usbi_dbg("transfer %p", transfer); 1482 1483 /* 1484 * Important note on locking, this function takes / releases locks 1485 * in the following order: 1486 * take flying_transfers_lock 1487 * take itransfer->lock 1488 * clear transfer 1489 * add to flying_transfers list 1490 * release flying_transfers_lock 1491 * submit transfer 1492 * release itransfer->lock 1493 * if submit failed: 1494 * take flying_transfers_lock 1495 * remove from flying_transfers list 1496 * release flying_transfers_lock 1497 * 1498 * Note that it takes locks in the order a-b and then releases them 1499 * in the same order a-b. This is somewhat unusual but not wrong, 1500 * release order is not important as long as *all* locks are released 1501 * before re-acquiring any locks. 1502 * 1503 * This means that the ordering of first releasing itransfer->lock 1504 * and then re-acquiring the flying_transfers_list on error is 1505 * important and must not be changed! 1506 * 1507 * This is done this way because when we take both locks we must always 1508 * take flying_transfers_lock first to avoid ab-ba style deadlocks with 1509 * the timeout handling and usbi_handle_disconnect paths. 1510 * 1511 * And we cannot release itransfer->lock before the submission is 1512 * complete otherwise timeout handling for transfers with short 1513 * timeouts may run before submission. 1514 */ 1515 usbi_mutex_lock(&ctx->flying_transfers_lock); 1516 usbi_mutex_lock(&itransfer->lock); 1517 if (itransfer->state_flags & USBI_TRANSFER_IN_FLIGHT) { 1518 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1519 usbi_mutex_unlock(&itransfer->lock); 1520 return LIBUSB_ERROR_BUSY; 1521 } 1522 itransfer->transferred = 0; 1523 itransfer->state_flags = 0; 1524 itransfer->timeout_flags = 0; 1525 r = add_to_flying_list(itransfer); 1526 if (r) { 1527 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1528 usbi_mutex_unlock(&itransfer->lock); 1529 return r; 1530 } 1531 /* 1532 * We must release the flying transfers lock here, because with 1533 * some backends the submit_transfer method is synchroneous. 1534 */ 1535 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1536 1537 r = usbi_backend->submit_transfer(itransfer); 1538 if (r == LIBUSB_SUCCESS) { 1539 itransfer->state_flags |= USBI_TRANSFER_IN_FLIGHT; 1540 /* keep a reference to this device */ 1541 libusb_ref_device(transfer->dev_handle->dev); 1542 } 1543 usbi_mutex_unlock(&itransfer->lock); 1544 1545 if (r != LIBUSB_SUCCESS) 1546 remove_from_flying_list(itransfer); 1547 1548 return r; 1549 } 1550 1551 /** \ingroup libusb_asyncio 1552 * Asynchronously cancel a previously submitted transfer. 1553 * This function returns immediately, but this does not indicate cancellation 1554 * is complete. Your callback function will be invoked at some later time 1555 * with a transfer status of 1556 * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED 1557 * "LIBUSB_TRANSFER_CANCELLED." 1558 * 1559 * \param transfer the transfer to cancel 1560 * \returns 0 on success 1561 * \returns LIBUSB_ERROR_NOT_FOUND if the transfer is not in progress, 1562 * already complete, or already cancelled. 1563 * \returns a LIBUSB_ERROR code on failure 1564 */ 1565 int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer) 1566 { 1567 struct usbi_transfer *itransfer = 1568 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); 1569 int r; 1570 1571 usbi_dbg("transfer %p", transfer ); 1572 usbi_mutex_lock(&itransfer->lock); 1573 if (!(itransfer->state_flags & USBI_TRANSFER_IN_FLIGHT) 1574 || (itransfer->state_flags & USBI_TRANSFER_CANCELLING)) { 1575 r = LIBUSB_ERROR_NOT_FOUND; 1576 goto out; 1577 } 1578 r = usbi_backend->cancel_transfer(itransfer); 1579 if (r < 0) { 1580 if (r != LIBUSB_ERROR_NOT_FOUND && 1581 r != LIBUSB_ERROR_NO_DEVICE) 1582 usbi_err(TRANSFER_CTX(transfer), 1583 "cancel transfer failed error %d", r); 1584 else 1585 usbi_dbg("cancel transfer failed error %d", r); 1586 1587 if (r == LIBUSB_ERROR_NO_DEVICE) 1588 itransfer->state_flags |= USBI_TRANSFER_DEVICE_DISAPPEARED; 1589 } 1590 1591 itransfer->state_flags |= USBI_TRANSFER_CANCELLING; 1592 1593 out: 1594 usbi_mutex_unlock(&itransfer->lock); 1595 return r; 1596 } 1597 1598 /** \ingroup libusb_asyncio 1599 * Set a transfers bulk stream id. Note users are advised to use 1600 * libusb_fill_bulk_stream_transfer() instead of calling this function 1601 * directly. 1602 * 1603 * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 1604 * 1605 * \param transfer the transfer to set the stream id for 1606 * \param stream_id the stream id to set 1607 * \see libusb_alloc_streams() 1608 */ 1609 void API_EXPORTED libusb_transfer_set_stream_id( 1610 struct libusb_transfer *transfer, uint32_t stream_id) 1611 { 1612 struct usbi_transfer *itransfer = 1613 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); 1614 1615 itransfer->stream_id = stream_id; 1616 } 1617 1618 /** \ingroup libusb_asyncio 1619 * Get a transfers bulk stream id. 1620 * 1621 * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 1622 * 1623 * \param transfer the transfer to get the stream id for 1624 * \returns the stream id for the transfer 1625 */ 1626 uint32_t API_EXPORTED libusb_transfer_get_stream_id( 1627 struct libusb_transfer *transfer) 1628 { 1629 struct usbi_transfer *itransfer = 1630 LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); 1631 1632 return itransfer->stream_id; 1633 } 1464 1634 1465 1635 /* Handle completion of a transfer (completion might be an error condition). … … 1476 1646 struct libusb_transfer *transfer = 1477 1647 USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1478 struct libusb_ context *ctx = TRANSFER_CTX(transfer);1648 struct libusb_device_handle *dev_handle = transfer->dev_handle; 1479 1649 uint8_t flags; 1480 int r = 0; 1481 1482 /* FIXME: could be more intelligent with the timerfd here. we don't need 1483 * to disarm the timerfd if there was no timer running, and we only need 1484 * to rearm the timerfd if the transfer that expired was the one with 1485 * the shortest timeout. */ 1486 1487 usbi_mutex_lock(&ctx->flying_transfers_lock); 1488 list_del(&itransfer->list); 1489 if (usbi_using_timerfd(ctx)) { 1490 r = arm_timerfd_for_next_timeout(ctx); 1491 if (0 == r) 1492 r = disarm_timerfd(ctx); 1493 } 1494 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1650 int r; 1651 1652 r = remove_from_flying_list(itransfer); 1495 1653 if (r < 0) 1496 return r; 1654 usbi_err(ITRANSFER_CTX(itransfer), "failed to set timer for next timeout, errno=%d", errno); 1655 1656 usbi_mutex_lock(&itransfer->lock); 1657 itransfer->state_flags &= ~USBI_TRANSFER_IN_FLIGHT; 1658 usbi_mutex_unlock(&itransfer->lock); 1497 1659 1498 1660 if (status == LIBUSB_TRANSFER_COMPLETED … … 1517 1679 if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) 1518 1680 libusb_free_transfer(transfer); 1519 usbi_mutex_lock(&ctx->event_waiters_lock); 1520 usbi_cond_broadcast(&ctx->event_waiters_cond); 1521 usbi_mutex_unlock(&ctx->event_waiters_lock); 1522 return 0; 1681 libusb_unref_device(dev_handle->dev); 1682 return r; 1523 1683 } 1524 1684 … … 1531 1691 int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer) 1532 1692 { 1693 struct libusb_context *ctx = ITRANSFER_CTX(transfer); 1694 uint8_t timed_out; 1695 1696 usbi_mutex_lock(&ctx->flying_transfers_lock); 1697 timed_out = transfer->timeout_flags & USBI_TRANSFER_TIMED_OUT; 1698 usbi_mutex_unlock(&ctx->flying_transfers_lock); 1699 1533 1700 /* if the URB was cancelled due to timeout, report timeout to the user */ 1534 if (t ransfer->flags & USBI_TRANSFER_TIMED_OUT) {1701 if (timed_out) { 1535 1702 usbi_dbg("detected timeout cancellation"); 1536 1703 return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT); … … 1541 1708 } 1542 1709 1543 /** \ingroup poll 1710 /* Add a completed transfer to the completed_transfers list of the 1711 * context and signal the event. The backend's handle_transfer_completion() 1712 * function will be called the next time an event handler runs. */ 1713 void usbi_signal_transfer_completion(struct usbi_transfer *transfer) 1714 { 1715 struct libusb_context *ctx = ITRANSFER_CTX(transfer); 1716 int pending_events; 1717 1718 usbi_mutex_lock(&ctx->event_data_lock); 1719 pending_events = usbi_pending_events(ctx); 1720 list_add_tail(&transfer->completed_list, &ctx->completed_transfers); 1721 if (!pending_events) 1722 usbi_signal_event(ctx); 1723 usbi_mutex_unlock(&ctx->event_data_lock); 1724 } 1725 1726 /** \ingroup libusb_poll 1544 1727 * Attempt to acquire the event handling lock. This lock is used to ensure that 1545 1728 * only one thread is monitoring libusb event sources at any one time. … … 1558 1741 * \returns 0 if the lock was obtained successfully 1559 1742 * \returns 1 if the lock was not obtained (i.e. another thread holds the lock) 1560 * \ see \refmtasync1743 * \ref libusb_mtasync 1561 1744 */ 1562 1745 int API_EXPORTED libusb_try_lock_events(libusb_context *ctx) 1563 1746 { 1564 1747 int r; 1748 unsigned int ru; 1565 1749 USBI_GET_CONTEXT(ctx); 1566 1750 1567 /* is someone else waiting to modify poll fds? if so, don't let this thread1751 /* is someone else waiting to close a device? if so, don't let this thread 1568 1752 * start event handling */ 1569 usbi_mutex_lock(&ctx-> pollfd_modify_lock);1570 r = ctx->pollfd_modify;1571 usbi_mutex_unlock(&ctx-> pollfd_modify_lock);1572 if (r ) {1573 usbi_dbg("someone else is modifying poll fds");1753 usbi_mutex_lock(&ctx->event_data_lock); 1754 ru = ctx->device_close; 1755 usbi_mutex_unlock(&ctx->event_data_lock); 1756 if (ru) { 1757 usbi_dbg("someone else is closing a device"); 1574 1758 return 1; 1575 1759 } … … 1583 1767 } 1584 1768 1585 /** \ingroup poll1769 /** \ingroup libusb_poll 1586 1770 * Acquire the event handling lock, blocking until successful acquisition if 1587 1771 * it is contended. This lock is used to ensure that only one thread is … … 1599 1783 * 1600 1784 * \param ctx the context to operate on, or NULL for the default context 1601 * \ see \refmtasync1785 * \ref libusb_mtasync 1602 1786 */ 1603 1787 void API_EXPORTED libusb_lock_events(libusb_context *ctx) … … 1608 1792 } 1609 1793 1610 /** \ingroup poll1794 /** \ingroup libusb_poll 1611 1795 * Release the lock previously acquired with libusb_try_lock_events() or 1612 1796 * libusb_lock_events(). Releasing this lock will wake up any threads blocked … … 1614 1798 * 1615 1799 * \param ctx the context to operate on, or NULL for the default context 1616 * \ see \refmtasync1800 * \ref libusb_mtasync 1617 1801 */ 1618 1802 void API_EXPORTED libusb_unlock_events(libusb_context *ctx) … … 1624 1808 /* FIXME: perhaps we should be a bit more efficient by not broadcasting 1625 1809 * the availability of the events lock when we are modifying pollfds 1626 * (check ctx-> pollfd_modify)? */1810 * (check ctx->device_close)? */ 1627 1811 usbi_mutex_lock(&ctx->event_waiters_lock); 1628 1812 usbi_cond_broadcast(&ctx->event_waiters_cond); … … 1630 1814 } 1631 1815 1632 /** \ingroup poll1816 /** \ingroup libusb_poll 1633 1817 * Determine if it is still OK for this thread to be doing event handling. 1634 1818 * … … 1638 1822 * 1639 1823 * If this function instructs your thread to give up the events lock, you 1640 * should just continue the usual logic that is documented in \ref mtasync.1824 * should just continue the usual logic that is documented in \ref libusb_mtasync. 1641 1825 * On the next iteration, your thread will fail to obtain the events lock, 1642 1826 * and will hence become an event waiter. … … 1649 1833 * \returns 1 if event handling can start or continue 1650 1834 * \returns 0 if this thread must give up the events lock 1651 * \ see \ref fullstory "Multi-threaded I/O: the full story"1835 * \ref fullstory "Multi-threaded I/O: the full story" 1652 1836 */ 1653 1837 int API_EXPORTED libusb_event_handling_ok(libusb_context *ctx) 1654 1838 { 1655 int r;1839 unsigned int r; 1656 1840 USBI_GET_CONTEXT(ctx); 1657 1841 1658 /* is someone else waiting to modify poll fds? if so, don't let this thread1842 /* is someone else waiting to close a device? if so, don't let this thread 1659 1843 * continue event handling */ 1660 usbi_mutex_lock(&ctx-> pollfd_modify_lock);1661 r = ctx-> pollfd_modify;1662 usbi_mutex_unlock(&ctx-> pollfd_modify_lock);1844 usbi_mutex_lock(&ctx->event_data_lock); 1845 r = ctx->device_close; 1846 usbi_mutex_unlock(&ctx->event_data_lock); 1663 1847 if (r) { 1664 usbi_dbg("someone else is modifying poll fds");1848 usbi_dbg("someone else is closing a device"); 1665 1849 return 0; 1666 1850 } … … 1670 1854 1671 1855 1672 /** \ingroup poll1856 /** \ingroup libusb_poll 1673 1857 * Determine if an active thread is handling events (i.e. if anyone is holding 1674 1858 * the event handling lock). … … 1677 1861 * \returns 1 if a thread is handling events 1678 1862 * \returns 0 if there are no threads currently handling events 1679 * \ see \refmtasync1863 * \ref libusb_mtasync 1680 1864 */ 1681 1865 int API_EXPORTED libusb_event_handler_active(libusb_context *ctx) 1682 1866 { 1683 int r;1867 unsigned int r; 1684 1868 USBI_GET_CONTEXT(ctx); 1685 1869 1686 /* is someone else waiting to modify poll fds? if so, don't let this thread1870 /* is someone else waiting to close a device? if so, don't let this thread 1687 1871 * start event handling -- indicate that event handling is happening */ 1688 usbi_mutex_lock(&ctx-> pollfd_modify_lock);1689 r = ctx-> pollfd_modify;1690 usbi_mutex_unlock(&ctx-> pollfd_modify_lock);1872 usbi_mutex_lock(&ctx->event_data_lock); 1873 r = ctx->device_close; 1874 usbi_mutex_unlock(&ctx->event_data_lock); 1691 1875 if (r) { 1692 usbi_dbg("someone else is modifying poll fds");1876 usbi_dbg("someone else is closing a device"); 1693 1877 return 1; 1694 1878 } … … 1697 1881 } 1698 1882 1699 /** \ingroup poll 1883 /** \ingroup libusb_poll 1884 * Interrupt any active thread that is handling events. This is mainly useful 1885 * for interrupting a dedicated event handling thread when an application 1886 * wishes to call libusb_exit(). 1887 * 1888 * Since version 1.0.21, \ref LIBUSB_API_VERSION >= 0x01000105 1889 * 1890 * \param ctx the context to operate on, or NULL for the default context 1891 * \ref libusb_mtasync 1892 */ 1893 void API_EXPORTED libusb_interrupt_event_handler(libusb_context *ctx) 1894 { 1895 USBI_GET_CONTEXT(ctx); 1896 1897 usbi_dbg(""); 1898 usbi_mutex_lock(&ctx->event_data_lock); 1899 if (!usbi_pending_events(ctx)) { 1900 ctx->event_flags |= USBI_EVENT_USER_INTERRUPT; 1901 usbi_signal_event(ctx); 1902 } 1903 usbi_mutex_unlock(&ctx->event_data_lock); 1904 } 1905 1906 /** \ingroup libusb_poll 1700 1907 * Acquire the event waiters lock. This lock is designed to be obtained under 1701 1908 * the situation where you want to be aware when events are completed, but … … 1714 1921 * 1715 1922 * \param ctx the context to operate on, or NULL for the default context 1716 * \ see \refmtasync1923 * \ref libusb_mtasync 1717 1924 */ 1718 1925 void API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx) … … 1722 1929 } 1723 1930 1724 /** \ingroup poll1931 /** \ingroup libusb_poll 1725 1932 * Release the event waiters lock. 1726 1933 * \param ctx the context to operate on, or NULL for the default context 1727 * \ see \refmtasync1934 * \ref libusb_mtasync 1728 1935 */ 1729 1936 void API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx) … … 1733 1940 } 1734 1941 1735 /** \ingroup poll1942 /** \ingroup libusb_poll 1736 1943 * Wait for another thread to signal completion of an event. Must be called 1737 1944 * with the event waiters lock held, see libusb_lock_event_waiters(). … … 1756 1963 * \returns 0 after a transfer completes or another thread stops event handling 1757 1964 * \returns 1 if the timeout expired 1758 * \ see \refmtasync1965 * \ref libusb_mtasync 1759 1966 */ 1760 1967 int API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) 1761 1968 { 1762 struct timespec timeout;1763 1969 int r; 1764 1970 … … 1769 1975 } 1770 1976 1771 r = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout);1772 if (r < 0) {1773 usbi_err(ctx, "failed to read realtime clock, error %d", errno);1774 return LIBUSB_ERROR_OTHER;1775 }1776 1777 timeout.tv_sec += tv->tv_sec;1778 timeout.tv_nsec += tv->tv_usec * 1000;1779 while (timeout.tv_nsec >= 1000000000) {1780 timeout.tv_nsec -= 1000000000;1781 timeout.tv_sec++;1782 }1783 1784 1977 r = usbi_cond_timedwait(&ctx->event_waiters_cond, 1785 &ctx->event_waiters_lock, &timeout); 1786 return (r == ETIMEDOUT); 1978 &ctx->event_waiters_lock, tv); 1979 1980 if (r < 0) 1981 return r; 1982 else 1983 return (r == ETIMEDOUT); 1787 1984 } 1788 1985 … … 1793 1990 int r; 1794 1991 1795 itransfer-> flags |= USBI_TRANSFER_TIMED_OUT;1992 itransfer->timeout_flags |= USBI_TRANSFER_TIMEOUT_HANDLED; 1796 1993 r = libusb_cancel_transfer(transfer); 1797 if (r < 0) 1994 if (r == LIBUSB_SUCCESS) 1995 itransfer->timeout_flags |= USBI_TRANSFER_TIMED_OUT; 1996 else 1798 1997 usbi_warn(TRANSFER_CTX(transfer), 1799 1998 "async cancel failed %d errno=%d", r, errno); … … 1827 2026 1828 2027 /* ignore timeouts we've already handled */ 1829 if (transfer-> flags & (USBI_TRANSFER_TIMED_OUT| USBI_TRANSFER_OS_HANDLES_TIMEOUT))2028 if (transfer->timeout_flags & (USBI_TRANSFER_TIMEOUT_HANDLED | USBI_TRANSFER_OS_HANDLES_TIMEOUT)) 1830 2029 continue; 1831 2030 … … 1857 2056 int r; 1858 2057 1859 r = disarm_timerfd(ctx);1860 if (r < 0)1861 return r;1862 1863 2058 usbi_mutex_lock(&ctx->flying_transfers_lock); 1864 2059 … … 1884 2079 struct usbi_pollfd *ipollfd; 1885 2080 POLL_NFDS_TYPE nfds = 0; 1886 struct pollfd *fds; 2081 POLL_NFDS_TYPE internal_nfds; 2082 struct pollfd *fds = NULL; 1887 2083 int i = -1; 1888 2084 int timeout_ms; 1889 1890 usbi_mutex_lock(&ctx->pollfds_lock); 1891 list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) 1892 nfds++; 1893 1894 /* TODO: malloc when number of fd's changes, not on every poll */ 1895 fds = malloc(sizeof(*fds) * nfds); 1896 if (!fds) { 1897 usbi_mutex_unlock(&ctx->pollfds_lock); 1898 return LIBUSB_ERROR_NO_MEM; 1899 } 1900 1901 list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) { 1902 struct libusb_pollfd *pollfd = &ipollfd->pollfd; 1903 int fd = pollfd->fd; 1904 i++; 1905 fds[i].fd = fd; 1906 fds[i].events = pollfd->events; 1907 fds[i].revents = 0; 1908 } 1909 usbi_mutex_unlock(&ctx->pollfds_lock); 1910 1911 timeout_ms = (tv->tv_sec * 1000) + (tv->tv_usec / 1000); 2085 int special_event; 2086 2087 /* prevent attempts to recursively handle events (e.g. calling into 2088 * libusb_handle_events() from within a hotplug or transfer callback) */ 2089 if (usbi_handling_events(ctx)) 2090 return LIBUSB_ERROR_BUSY; 2091 usbi_start_event_handling(ctx); 2092 2093 /* there are certain fds that libusb uses internally, currently: 2094 * 2095 * 1) event pipe 2096 * 2) timerfd 2097 * 2098 * the backend will never need to attempt to handle events on these fds, so 2099 * we determine how many fds are in use internally for this context and when 2100 * handle_events() is called in the backend, the pollfd list and count will 2101 * be adjusted to skip over these internal fds */ 2102 if (usbi_using_timerfd(ctx)) 2103 internal_nfds = 2; 2104 else 2105 internal_nfds = 1; 2106 2107 /* only reallocate the poll fds when the list of poll fds has been modified 2108 * since the last poll, otherwise reuse them to save the additional overhead */ 2109 usbi_mutex_lock(&ctx->event_data_lock); 2110 if (ctx->event_flags & USBI_EVENT_POLLFDS_MODIFIED) { 2111 usbi_dbg("poll fds modified, reallocating"); 2112 2113 if (ctx->pollfds) { 2114 free(ctx->pollfds); 2115 ctx->pollfds = NULL; 2116 } 2117 2118 /* sanity check - it is invalid for a context to have fewer than the 2119 * required internal fds (memory corruption?) */ 2120 assert(ctx->pollfds_cnt >= internal_nfds); 2121 2122 ctx->pollfds = calloc(ctx->pollfds_cnt, sizeof(*ctx->pollfds)); 2123 if (!ctx->pollfds) { 2124 usbi_mutex_unlock(&ctx->event_data_lock); 2125 r = LIBUSB_ERROR_NO_MEM; 2126 goto done; 2127 } 2128 2129 list_for_each_entry(ipollfd, &ctx->ipollfds, list, struct usbi_pollfd) { 2130 struct libusb_pollfd *pollfd = &ipollfd->pollfd; 2131 i++; 2132 ctx->pollfds[i].fd = pollfd->fd; 2133 ctx->pollfds[i].events = pollfd->events; 2134 } 2135 2136 /* reset the flag now that we have the updated list */ 2137 ctx->event_flags &= ~USBI_EVENT_POLLFDS_MODIFIED; 2138 2139 /* if no further pending events, clear the event pipe so that we do 2140 * not immediately return from poll */ 2141 if (!usbi_pending_events(ctx)) 2142 usbi_clear_event(ctx); 2143 } 2144 fds = ctx->pollfds; 2145 nfds = ctx->pollfds_cnt; 2146 usbi_mutex_unlock(&ctx->event_data_lock); 2147 2148 timeout_ms = (int)(tv->tv_sec * 1000) + (tv->tv_usec / 1000); 1912 2149 1913 2150 /* round up to next millisecond */ … … 1915 2152 timeout_ms++; 1916 2153 2154 redo_poll: 1917 2155 usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms); 1918 2156 r = usbi_poll(fds, nfds, timeout_ms); 1919 2157 usbi_dbg("poll() returned %d", r); 1920 2158 if (r == 0) { 1921 free(fds); 1922 return handle_timeouts(ctx); 1923 } else if (r == -1 && errno == EINTR) { 1924 free(fds); 1925 return LIBUSB_ERROR_INTERRUPTED; 1926 } else if (r < 0) { 1927 free(fds); 1928 usbi_err(ctx, "poll failed %d err=%d\n", r, errno); 1929 return LIBUSB_ERROR_IO; 1930 } 1931 1932 /* fd[0] is always the ctrl pipe */ 2159 r = handle_timeouts(ctx); 2160 goto done; 2161 } 2162 else if (r == -1 && errno == EINTR) { 2163 r = LIBUSB_ERROR_INTERRUPTED; 2164 goto done; 2165 } 2166 else if (r < 0) { 2167 usbi_err(ctx, "poll failed %d err=%d", r, errno); 2168 r = LIBUSB_ERROR_IO; 2169 goto done; 2170 } 2171 2172 special_event = 0; 2173 2174 /* fds[0] is always the event pipe */ 1933 2175 if (fds[0].revents) { 1934 /* another thread wanted to interrupt event handling, and it succeeded! 1935 * handle any other events that cropped up at the same time, and 1936 * simply return */ 1937 usbi_dbg("caught a fish on the control pipe"); 1938 1939 if (r == 1) { 1940 r = 0; 2176 libusb_hotplug_message *message = NULL; 2177 struct usbi_transfer *itransfer; 2178 int ret = 0; 2179 2180 usbi_dbg("caught a fish on the event pipe"); 2181 2182 /* take the the event data lock while processing events */ 2183 usbi_mutex_lock(&ctx->event_data_lock); 2184 2185 /* check if someone added a new poll fd */ 2186 if (ctx->event_flags & USBI_EVENT_POLLFDS_MODIFIED) 2187 usbi_dbg("someone updated the poll fds"); 2188 2189 if (ctx->event_flags & USBI_EVENT_USER_INTERRUPT) { 2190 usbi_dbg("someone purposely interrupted"); 2191 ctx->event_flags &= ~USBI_EVENT_USER_INTERRUPT; 2192 } 2193 2194 /* check if someone is closing a device */ 2195 if (ctx->device_close) 2196 usbi_dbg("someone is closing a device"); 2197 2198 /* check for any pending hotplug messages */ 2199 if (!list_empty(&ctx->hotplug_msgs)) { 2200 usbi_dbg("hotplug message received"); 2201 special_event = 1; 2202 message = list_first_entry(&ctx->hotplug_msgs, libusb_hotplug_message, list); 2203 list_del(&message->list); 2204 } 2205 2206 /* complete any pending transfers */ 2207 while (ret == 0 && !list_empty(&ctx->completed_transfers)) { 2208 itransfer = list_first_entry(&ctx->completed_transfers, struct usbi_transfer, completed_list); 2209 list_del(&itransfer->completed_list); 2210 usbi_mutex_unlock(&ctx->event_data_lock); 2211 ret = usbi_backend->handle_transfer_completion(itransfer); 2212 if (ret) 2213 usbi_err(ctx, "backend handle_transfer_completion failed with error %d", ret); 2214 usbi_mutex_lock(&ctx->event_data_lock); 2215 } 2216 2217 /* if no further pending events, clear the event pipe */ 2218 if (!usbi_pending_events(ctx)) 2219 usbi_clear_event(ctx); 2220 2221 usbi_mutex_unlock(&ctx->event_data_lock); 2222 2223 /* process the hotplug message, if any */ 2224 if (message) { 2225 usbi_hotplug_match(ctx, message->device, message->event); 2226 2227 /* the device left, dereference the device */ 2228 if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == message->event) 2229 libusb_unref_device(message->device); 2230 2231 free(message); 2232 } 2233 2234 if (ret) { 2235 /* return error code */ 2236 r = ret; 2237 goto done; 2238 } 2239 2240 if (0 == --r) 1941 2241 goto handled; 1942 } else { 1943 /* prevent OS backend from trying to handle events on ctrl pipe */ 1944 fds[0].revents = 0; 1945 r--; 1946 } 1947 } 1948 1949 /* fd[1] is always the hotplug pipe */ 1950 if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && fds[1].revents) { 1951 libusb_hotplug_message message; 1952 int ret; 1953 1954 /* read the message from the hotplug thread */ 1955 ret = read(ctx->hotplug_pipe[0], &message, sizeof (message)); 1956 if (ret < sizeof(message)) { 1957 ret = LIBUSB_ERROR_OTHER; 1958 goto handled; 1959 } 1960 1961 usbi_hotplug_match(message.device, message.event); 1962 1963 /* the device left. dereference the device */ 1964 if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == message.event) 1965 libusb_unref_device(message.device); 1966 1967 fds[1].revents = 0; 1968 if (1 == r--) 1969 goto handled; 1970 } /* else there shouldn't be anything on this pipe */ 2242 } 1971 2243 1972 2244 #ifdef USBI_TIMERFD_AVAILABLE 1973 /* on timerfd configurations, fds[ 2] is the timerfd */1974 if (usbi_using_timerfd(ctx) && fds[ 2].revents) {2245 /* on timerfd configurations, fds[1] is the timerfd */ 2246 if (usbi_using_timerfd(ctx) && fds[1].revents) { 1975 2247 /* timerfd indicates that a timeout has expired */ 1976 2248 int ret; 1977 2249 usbi_dbg("timerfd triggered"); 2250 special_event = 1; 1978 2251 1979 2252 ret = handle_timerfd_trigger(ctx); … … 1981 2254 /* return error code */ 1982 2255 r = ret; 2256 goto done; 2257 } 2258 2259 if (0 == --r) 1983 2260 goto handled; 1984 } else if (r == 1) {1985 /* no more active file descriptors, nothing more to do */1986 r = 0;1987 goto handled;1988 } else {1989 /* more events pending...1990 * prevent OS backend from trying to handle events on timerfd */1991 fds[2].revents = 0;1992 r--;1993 }1994 2261 } 1995 2262 #endif 1996 2263 1997 r = usbi_backend->handle_events(ctx, fds ,nfds, r);2264 r = usbi_backend->handle_events(ctx, fds + internal_nfds, nfds - internal_nfds, r); 1998 2265 if (r) 1999 2266 usbi_err(ctx, "backend handle_events failed with error %d", r); 2000 2267 2001 2268 handled: 2002 free(fds); 2269 if (r == 0 && special_event) { 2270 timeout_ms = 0; 2271 goto redo_poll; 2272 } 2273 2274 done: 2275 usbi_end_event_handling(ctx); 2003 2276 return r; 2004 2277 } … … 2031 2304 } 2032 2305 2033 /** \ingroup poll2306 /** \ingroup libusb_poll 2034 2307 * Handle any pending events. 2035 2308 * … … 2055 2328 * \param completed pointer to completion integer to check, or NULL 2056 2329 * \returns 0 on success, or a LIBUSB_ERROR code on failure 2057 * \ see \refmtasync2330 * \ref libusb_mtasync 2058 2331 */ 2059 2332 int API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx, … … 2110 2383 } 2111 2384 2112 /** \ingroup poll2385 /** \ingroup libusb_poll 2113 2386 * Handle any pending events 2114 2387 * … … 2132 2405 } 2133 2406 2134 /** \ingroup poll2407 /** \ingroup libusb_poll 2135 2408 * Handle any pending events in blocking mode. There is currently a timeout 2136 2409 * hardcoded at 60 seconds but we plan to make it unlimited in future. For … … 2154 2427 } 2155 2428 2156 /** \ingroup poll2429 /** \ingroup libusb_poll 2157 2430 * Handle any pending events in blocking mode. 2158 2431 * … … 2166 2439 * \param completed pointer to completion integer to check, or NULL 2167 2440 * \returns 0 on success, or a LIBUSB_ERROR code on failure 2168 * \ see \refmtasync2441 * \ref libusb_mtasync 2169 2442 */ 2170 2443 int API_EXPORTED libusb_handle_events_completed(libusb_context *ctx, … … 2177 2450 } 2178 2451 2179 /** \ingroup poll2452 /** \ingroup libusb_poll 2180 2453 * Handle any pending events by polling file descriptors, without checking if 2181 2454 * any other threads are already doing so. Must be called with the event lock … … 2192 2465 * non-blocking mode 2193 2466 * \returns 0 on success, or a LIBUSB_ERROR code on failure 2194 * \ see \refmtasync2467 * \ref libusb_mtasync 2195 2468 */ 2196 2469 int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx, … … 2210 2483 } 2211 2484 2212 /** \ingroup poll2485 /** \ingroup libusb_poll 2213 2486 * Determines whether your application must apply special timing considerations 2214 2487 * when monitoring libusb's file descriptors. 2215 2488 * 2216 2489 * This function is only useful for applications which retrieve and poll 2217 * libusb's file descriptors in their own main loop (\ref pollmain).2490 * libusb's file descriptors in their own main loop (\ref libusb_pollmain). 2218 2491 * 2219 2492 * Ordinarily, libusb's event handler needs to be called into at specific … … 2236 2509 * libusb_get_next_timeout(), or 1 if all timeout events are handled internally 2237 2510 * or through regular activity on the file descriptors. 2238 * \ see \refpollmain "Polling libusb file descriptors for event handling"2511 * \ref libusb_pollmain "Polling libusb file descriptors for event handling" 2239 2512 */ 2240 2513 int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) … … 2244 2517 return usbi_using_timerfd(ctx); 2245 2518 #else 2246 (void)ctx;2519 UNUSED(ctx); 2247 2520 return 0; 2248 2521 #endif 2249 2522 } 2250 2523 2251 /** \ingroup poll2524 /** \ingroup libusb_poll 2252 2525 * Determine the next internal timeout that libusb needs to handle. You only 2253 2526 * need to use this function if you are calling poll() or select() or similar … … 2283 2556 struct timespec cur_ts; 2284 2557 struct timeval cur_tv; 2285 struct timeval *next_timeout;2558 struct timeval next_timeout = { 0, 0 }; 2286 2559 int r; 2287 int found = 0;2288 2560 2289 2561 USBI_GET_CONTEXT(ctx); … … 2300 2572 /* find next transfer which hasn't already been processed as timed out */ 2301 2573 list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { 2302 if (transfer-> flags & (USBI_TRANSFER_TIMED_OUT| USBI_TRANSFER_OS_HANDLES_TIMEOUT))2574 if (transfer->timeout_flags & (USBI_TRANSFER_TIMEOUT_HANDLED | USBI_TRANSFER_OS_HANDLES_TIMEOUT)) 2303 2575 continue; 2304 2576 2305 /* no timeout for this transfer?*/2577 /* if we've reached transfers of infinte timeout, we're done looking */ 2306 2578 if (!timerisset(&transfer->timeout)) 2307 continue;2308 2309 found = 1;2579 break; 2580 2581 next_timeout = transfer->timeout; 2310 2582 break; 2311 2583 } 2312 2584 usbi_mutex_unlock(&ctx->flying_transfers_lock); 2313 2585 2314 if (! found) {2586 if (!timerisset(&next_timeout)) { 2315 2587 usbi_dbg("no URB with timeout or all handled by OS; no timeout!"); 2316 2588 return 0; 2317 2589 } 2318 2319 next_timeout = &transfer->timeout;2320 2590 2321 2591 r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts); 2322 2592 if (r < 0) { 2323 2593 usbi_err(ctx, "failed to read monotonic clock, errno=%d", errno); 2324 return LIBUSB_ERROR_OTHER;2594 return 0; 2325 2595 } 2326 2596 TIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts); 2327 2597 2328 if (!timercmp(&cur_tv, next_timeout, <)) {2598 if (!timercmp(&cur_tv, &next_timeout, <)) { 2329 2599 usbi_dbg("first timeout already expired"); 2330 2600 timerclear(tv); 2331 2601 } else { 2332 timersub( next_timeout, &cur_tv, tv);2602 timersub(&next_timeout, &cur_tv, tv); 2333 2603 usbi_dbg("next timeout in %d.%06ds", tv->tv_sec, tv->tv_usec); 2334 2604 } … … 2337 2607 } 2338 2608 2339 /** \ingroup poll2609 /** \ingroup libusb_poll 2340 2610 * Register notification functions for file descriptor additions/removals. 2341 2611 * These functions will be invoked for every new or removed file descriptor … … 2368 2638 } 2369 2639 2640 /* 2641 * Interrupt the iteration of the event handling thread, so that it picks 2642 * up the fd change. Callers of this function must hold the event_data_lock. 2643 */ 2644 static void usbi_fd_notification(struct libusb_context *ctx) 2645 { 2646 int pending_events; 2647 2648 /* Record that there is a new poll fd. 2649 * Only signal an event if there are no prior pending events. */ 2650 pending_events = usbi_pending_events(ctx); 2651 ctx->event_flags |= USBI_EVENT_POLLFDS_MODIFIED; 2652 if (!pending_events) 2653 usbi_signal_event(ctx); 2654 } 2655 2370 2656 /* Add a file descriptor to the list of file descriptors to be monitored. 2371 2657 * events should be specified as a bitmask of events passed to poll(), e.g. … … 2380 2666 ipollfd->pollfd.fd = fd; 2381 2667 ipollfd->pollfd.events = events; 2382 usbi_mutex_lock(&ctx->pollfds_lock); 2383 list_add_tail(&ipollfd->list, &ctx->pollfds); 2384 usbi_mutex_unlock(&ctx->pollfds_lock); 2668 usbi_mutex_lock(&ctx->event_data_lock); 2669 list_add_tail(&ipollfd->list, &ctx->ipollfds); 2670 ctx->pollfds_cnt++; 2671 usbi_fd_notification(ctx); 2672 usbi_mutex_unlock(&ctx->event_data_lock); 2385 2673 2386 2674 if (ctx->fd_added_cb) … … 2396 2684 2397 2685 usbi_dbg("remove fd %d", fd); 2398 usbi_mutex_lock(&ctx-> pollfds_lock);2399 list_for_each_entry(ipollfd, &ctx-> pollfds, list, struct usbi_pollfd)2686 usbi_mutex_lock(&ctx->event_data_lock); 2687 list_for_each_entry(ipollfd, &ctx->ipollfds, list, struct usbi_pollfd) 2400 2688 if (ipollfd->pollfd.fd == fd) { 2401 2689 found = 1; … … 2405 2693 if (!found) { 2406 2694 usbi_dbg("couldn't find fd %d to remove", fd); 2407 usbi_mutex_unlock(&ctx-> pollfds_lock);2695 usbi_mutex_unlock(&ctx->event_data_lock); 2408 2696 return; 2409 2697 } 2410 2698 2411 2699 list_del(&ipollfd->list); 2412 usbi_mutex_unlock(&ctx->pollfds_lock); 2700 ctx->pollfds_cnt--; 2701 usbi_fd_notification(ctx); 2702 usbi_mutex_unlock(&ctx->event_data_lock); 2413 2703 free(ipollfd); 2414 2704 if (ctx->fd_removed_cb) … … 2416 2706 } 2417 2707 2418 /** \ingroup poll2708 /** \ingroup libusb_poll 2419 2709 * Retrieve a list of file descriptors that should be polled by your main loop 2420 2710 * as libusb event sources. 2421 2711 * 2422 * The returned list is NULL-terminated and should be freed with free() when2423 * done. The actual list contents must not be touched.2712 * The returned list is NULL-terminated and should be freed with libusb_free_pollfds() 2713 * when done. The actual list contents must not be touched. 2424 2714 * 2425 2715 * As file descriptors are a Unix-specific concept, this function is not … … 2439 2729 struct usbi_pollfd *ipollfd; 2440 2730 size_t i = 0; 2441 size_t cnt = 0;2442 2731 USBI_GET_CONTEXT(ctx); 2443 2732 2444 usbi_mutex_lock(&ctx->pollfds_lock); 2445 list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) 2446 cnt++; 2447 2448 ret = calloc(cnt + 1, sizeof(struct libusb_pollfd *)); 2733 usbi_mutex_lock(&ctx->event_data_lock); 2734 2735 ret = calloc(ctx->pollfds_cnt + 1, sizeof(struct libusb_pollfd *)); 2449 2736 if (!ret) 2450 2737 goto out; 2451 2738 2452 list_for_each_entry(ipollfd, &ctx-> pollfds, list, struct usbi_pollfd)2739 list_for_each_entry(ipollfd, &ctx->ipollfds, list, struct usbi_pollfd) 2453 2740 ret[i++] = (struct libusb_pollfd *) ipollfd; 2454 ret[c nt] = NULL;2741 ret[ctx->pollfds_cnt] = NULL; 2455 2742 2456 2743 out: 2457 usbi_mutex_unlock(&ctx-> pollfds_lock);2744 usbi_mutex_unlock(&ctx->event_data_lock); 2458 2745 return (const struct libusb_pollfd **) ret; 2459 2746 #else … … 2464 2751 } 2465 2752 2466 /* Backends call this from handle_events to report disconnection of a device. 2467 * The transfers get cancelled appropriately. 2468 */ 2469 void usbi_handle_disconnect(struct libusb_device_handle *handle) 2753 /** \ingroup libusb_poll 2754 * Free a list of libusb_pollfd structures. This should be called for all 2755 * pollfd lists allocated with libusb_get_pollfds(). 2756 * 2757 * Since version 1.0.20, \ref LIBUSB_API_VERSION >= 0x01000104 2758 * 2759 * It is legal to call this function with a NULL pollfd list. In this case, 2760 * the function will simply return safely. 2761 * 2762 * \param pollfds the list of libusb_pollfd structures to free 2763 */ 2764 void API_EXPORTED libusb_free_pollfds(const struct libusb_pollfd **pollfds) 2765 { 2766 if (!pollfds) 2767 return; 2768 2769 free((void *)pollfds); 2770 } 2771 2772 /* Backends may call this from handle_events to report disconnection of a 2773 * device. This function ensures transfers get cancelled appropriately. 2774 * Callers of this function must hold the events_lock. 2775 */ 2776 void usbi_handle_disconnect(struct libusb_device_handle *dev_handle) 2470 2777 { 2471 2778 struct usbi_transfer *cur; … … 2473 2780 2474 2781 usbi_dbg("device %d.%d", 2475 handle->dev->bus_number,handle->dev->device_address);2782 dev_handle->dev->bus_number, dev_handle->dev->device_address); 2476 2783 2477 2784 /* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE 2478 2785 * status code. 2479 2786 * 2480 * this is a bit tricky because:2481 * 1. we can't do transfer completion while holding flying_transfers_lock2482 * 2. the transfers list can change underneath us - if we were to build a2483 * list of transfers to complete (while holding look), the situation2484 * might be different by the time we come to free them2485 * 2486 * so we resort to a loop-based approach as below2487 * FIXME: is this still potentially racy?2787 * when we find a transfer for this device on the list, there are two 2788 * possible scenarios: 2789 * 1. the transfer is currently in-flight, in which case we terminate the 2790 * transfer here 2791 * 2. the transfer has been added to the flying transfer list by 2792 * libusb_submit_transfer, has failed to submit and 2793 * libusb_submit_transfer is waiting for us to release the 2794 * flying_transfers_lock to remove it, so we ignore it 2488 2795 */ 2489 2796 2490 2797 while (1) { 2491 usbi_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock);2492 2798 to_cancel = NULL; 2493 list_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list, struct usbi_transfer) 2494 if (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) { 2495 to_cancel = cur; 2496 break; 2799 usbi_mutex_lock(&HANDLE_CTX(dev_handle)->flying_transfers_lock); 2800 list_for_each_entry(cur, &HANDLE_CTX(dev_handle)->flying_transfers, list, struct usbi_transfer) 2801 if (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == dev_handle) { 2802 usbi_mutex_lock(&cur->lock); 2803 if (cur->state_flags & USBI_TRANSFER_IN_FLIGHT) 2804 to_cancel = cur; 2805 usbi_mutex_unlock(&cur->lock); 2806 2807 if (to_cancel) 2808 break; 2497 2809 } 2498 usbi_mutex_unlock(&HANDLE_CTX( handle)->flying_transfers_lock);2810 usbi_mutex_unlock(&HANDLE_CTX(dev_handle)->flying_transfers_lock); 2499 2811 2500 2812 if (!to_cancel) 2501 2813 break; 2502 2814 2815 usbi_dbg("cancelling transfer %p from disconnect", 2816 USBI_TRANSFER_TO_LIBUSB_TRANSFER(to_cancel)); 2817 2818 usbi_mutex_lock(&to_cancel->lock); 2503 2819 usbi_backend->clear_transfer_priv(to_cancel); 2820 usbi_mutex_unlock(&to_cancel->lock); 2504 2821 usbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE); 2505 2822 } -
TabularUnified libusb1/trunk/libusb/libusb-1.0.def ¶
r1876 r1882 1 LIBRARY 1 LIBRARY "libusb-1.0.dll" 2 2 EXPORTS 3 libusb_alloc_streams 4 libusb_alloc_streams@16 = libusb_alloc_streams 3 5 libusb_alloc_transfer 4 6 libusb_alloc_transfer@4 = libusb_alloc_transfer … … 19 21 libusb_detach_kernel_driver 20 22 libusb_detach_kernel_driver@8 = libusb_detach_kernel_driver 23 libusb_dev_mem_alloc 24 libusb_dev_mem_alloc@8 = libusb_dev_mem_alloc 25 libusb_dev_mem_free 26 libusb_dev_mem_free@12 = libusb_dev_mem_free 21 27 libusb_error_name 22 28 libusb_error_name@4 = libusb_error_name … … 27 33 libusb_exit 28 34 libusb_exit@4 = libusb_exit 35 libusb_free_bos_descriptor 36 libusb_free_bos_descriptor@4 = libusb_free_bos_descriptor 29 37 libusb_free_config_descriptor 30 38 libusb_free_config_descriptor@4 = libusb_free_config_descriptor 39 libusb_free_container_id_descriptor 40 libusb_free_container_id_descriptor@4 = libusb_free_container_id_descriptor 31 41 libusb_free_device_list 32 42 libusb_free_device_list@8 = libusb_free_device_list 43 libusb_free_pollfds 44 libusb_free_pollfds@4 = libusb_free_pollfds 45 libusb_free_ss_endpoint_companion_descriptor 46 libusb_free_ss_endpoint_companion_descriptor@4 = libusb_free_ss_endpoint_companion_descriptor 47 libusb_free_ss_usb_device_capability_descriptor 48 libusb_free_ss_usb_device_capability_descriptor@4 = libusb_free_ss_usb_device_capability_descriptor 49 libusb_free_streams 50 libusb_free_streams@12 = libusb_free_streams 33 51 libusb_free_transfer 34 52 libusb_free_transfer@4 = libusb_free_transfer 53 libusb_free_usb_2_0_extension_descriptor 54 libusb_free_usb_2_0_extension_descriptor@4 = libusb_free_usb_2_0_extension_descriptor 35 55 libusb_get_active_config_descriptor 36 56 libusb_get_active_config_descriptor@8 = libusb_get_active_config_descriptor 57 libusb_get_bos_descriptor 58 libusb_get_bos_descriptor@8 = libusb_get_bos_descriptor 37 59 libusb_get_bus_number 38 60 libusb_get_bus_number@4 = libusb_get_bus_number … … 43 65 libusb_get_configuration 44 66 libusb_get_configuration@8 = libusb_get_configuration 67 libusb_get_container_id_descriptor 68 libusb_get_container_id_descriptor@12 = libusb_get_container_id_descriptor 45 69 libusb_get_device 46 70 libusb_get_device@4 = libusb_get_device … … 59 83 libusb_get_next_timeout 60 84 libusb_get_next_timeout@8 = libusb_get_next_timeout 85 libusb_get_parent 86 libusb_get_parent@4 = libusb_get_parent 61 87 libusb_get_pollfds 62 88 libusb_get_pollfds@4 = libusb_get_pollfds 89 libusb_get_port_number 90 libusb_get_port_number@4 = libusb_get_port_number 91 libusb_get_port_numbers 92 libusb_get_port_numbers@12 = libusb_get_port_numbers 93 libusb_get_port_path 94 libusb_get_port_path@16 = libusb_get_port_path 95 libusb_get_ss_endpoint_companion_descriptor 96 libusb_get_ss_endpoint_companion_descriptor@12 = libusb_get_ss_endpoint_companion_descriptor 97 libusb_get_ss_usb_device_capability_descriptor 98 libusb_get_ss_usb_device_capability_descriptor@12 = libusb_get_ss_usb_device_capability_descriptor 63 99 libusb_get_string_descriptor_ascii 64 100 libusb_get_string_descriptor_ascii@16 = libusb_get_string_descriptor_ascii 101 libusb_get_usb_2_0_extension_descriptor 102 libusb_get_usb_2_0_extension_descriptor@12 = libusb_get_usb_2_0_extension_descriptor 65 103 libusb_get_version 66 104 libusb_get_version@0 = libusb_get_version … … 77 115 libusb_has_capability 78 116 libusb_has_capability@4 = libusb_has_capability 117 libusb_hotplug_deregister_callback 118 libusb_hotplug_deregister_callback@8 = libusb_hotplug_deregister_callback 119 libusb_hotplug_register_callback 120 libusb_hotplug_register_callback@36 = libusb_hotplug_register_callback 79 121 libusb_init 80 122 libusb_init@4 = libusb_init 123 libusb_interrupt_event_handler 124 libusb_interrupt_event_handler@4 = libusb_interrupt_event_handler 81 125 libusb_interrupt_transfer 82 126 libusb_interrupt_transfer@24 = libusb_interrupt_transfer 83 127 libusb_kernel_driver_active 84 128 libusb_kernel_driver_active@8 = libusb_kernel_driver_active 129 libusb_lock_events 130 libusb_lock_events@4 = libusb_lock_events 85 131 libusb_lock_event_waiters 86 132 libusb_lock_event_waiters@4 = libusb_lock_event_waiters 87 libusb_lock_events88 libusb_lock_events@4 = libusb_lock_events89 133 libusb_open 90 134 libusb_open@8 = libusb_open … … 99 143 libusb_reset_device 100 144 libusb_reset_device@4 = libusb_reset_device 145 libusb_set_auto_detach_kernel_driver 146 libusb_set_auto_detach_kernel_driver@8 = libusb_set_auto_detach_kernel_driver 101 147 libusb_set_configuration 102 148 libusb_set_configuration@8 = libusb_set_configuration … … 105 151 libusb_set_interface_alt_setting 106 152 libusb_set_interface_alt_setting@12 = libusb_set_interface_alt_setting 153 libusb_setlocale 154 libusb_setlocale@4 = libusb_setlocale 107 155 libusb_set_pollfd_notifiers 108 156 libusb_set_pollfd_notifiers@16 = libusb_set_pollfd_notifiers 157 libusb_strerror 158 libusb_strerror@4 = libusb_strerror 109 159 libusb_submit_transfer 110 160 libusb_submit_transfer@4 = libusb_submit_transfer 161 libusb_transfer_get_stream_id 162 libusb_transfer_get_stream_id@4 = libusb_transfer_get_stream_id 163 libusb_transfer_set_stream_id 164 libusb_transfer_set_stream_id@8 = libusb_transfer_set_stream_id 111 165 libusb_try_lock_events 112 166 libusb_try_lock_events@4 = libusb_try_lock_events 167 libusb_unlock_events 168 libusb_unlock_events@4 = libusb_unlock_events 113 169 libusb_unlock_event_waiters 114 170 libusb_unlock_event_waiters@4 = libusb_unlock_event_waiters 115 libusb_unlock_events116 libusb_unlock_events@4 = libusb_unlock_events117 171 libusb_unref_device 118 172 libusb_unref_device@4 = libusb_unref_device -
TabularUnified libusb1/trunk/libusb/libusb-1.0.rc ¶
r1876 r1882 6 6 * viewed with utilities such as Windows Explorer. 7 7 */ 8 #ifndef _WIN32_WCE 8 9 #include "winresrc.h" 10 #endif 9 11 10 12 #include "version.h" … … 13 15 #define LU_XSTR(s) LU_STR(s) 14 16 #if LIBUSB_NANO > 0 15 #define LIBUSB_VERSIONSTRING LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." LU_XSTR(LIBUSB_MICRO) "." LU_XSTR(LIBUSB_NANO) LIBUSB_RC "\0" 17 #define LIBUSB_VERSIONSTRING \ 18 LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." \ 19 LU_XSTR(LIBUSB_MICRO) "." LU_XSTR(LIBUSB_NANO) LIBUSB_RC "\0" 16 20 #else 17 #define LIBUSB_VERSIONSTRING LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." LU_XSTR(LIBUSB_MICRO) LIBUSB_RC "\0" 21 #define LIBUSB_VERSIONSTRING \ 22 LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." \ 23 LU_XSTR(LIBUSB_MICRO) LIBUSB_RC "\0" 18 24 #endif 19 25 #endif … … 36 42 BLOCK "040904b0" 37 43 BEGIN 38 VALUE "Comments", "\0" 39 VALUE "CompanyName", "libusb.org\0" 44 VALUE "CompanyName", "libusb.info\0" 40 45 VALUE "FileDescription", "C library for writing portable USB drivers in userspace\0" 41 46 VALUE "FileVersion", LIBUSB_VERSIONSTRING -
TabularUnified libusb1/trunk/libusb/libusb.h ¶
r1876 r1882 1 1 /* 2 2 * Public libusb header file 3 * Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.org> 4 * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> 5 * Copyright (C) 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu> 6 * Copyright (C) 2012 Peter Stuge <peter@stuge.se> 3 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 4 * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org> 5 * Copyright © 2012 Pete Batard <pete@akeo.ie> 6 * Copyright © 2012 Nathan Hjelm <hjelmn@cs.unm.edu> 7 * For more information, please visit: http://libusb.info 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 26 27 #ifdef _MSC_VER 27 28 /* on MS environments, the inline keyword is available in C++ only */ 29 #if !defined(__cplusplus) 28 30 #define inline __inline 31 #endif 29 32 /* ssize_t is also not available (copy/paste from MinGW) */ 30 33 #ifndef _SSIZE_T_DEFINED … … 39 42 #endif /* _MSC_VER */ 40 43 41 /* stdint.h is also not usually available on MS*/44 /* stdint.h is not available on older MSVC */ 42 45 #if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) 43 46 typedef unsigned __int8 uint8_t; … … 48 51 #endif 49 52 53 #if !defined(_WIN32_WCE) 50 54 #include <sys/types.h> 55 #endif 56 57 #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__) 58 #include <sys/time.h> 59 #endif 60 51 61 #include <time.h> 52 62 #include <limits.h> 53 54 #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)55 #include <sys/time.h>56 #endif57 63 58 64 /* 'interface' might be defined as a macro on Windows, so we need to … … 61 67 * As this can be problematic if you include windows.h after libusb.h 62 68 * in your sources, we force windows.h to be included first. */ 63 #if defined(_WIN32) || defined(__CYGWIN__) 69 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 64 70 #include <windows.h> 65 71 #if defined(interface) 66 72 #undef interface 67 73 #endif 74 #if !defined(__CYGWIN__) 75 #include <winsock.h> 68 76 #endif 77 #endif 78 79 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 80 #define LIBUSB_DEPRECATED_FOR(f) \ 81 __attribute__((deprecated("Use " #f " instead"))) 82 #else 83 #define LIBUSB_DEPRECATED_FOR(f) 84 #endif /* __GNUC__ */ 69 85 70 86 /** \def LIBUSB_CALL 71 * \ingroup misc87 * \ingroup libusb_misc 72 88 * libusb's Windows calling convention. 73 89 * … … 75 91 * means that, unlike other platforms, there is not <em>one true calling 76 92 * convention</em> (calling convention: the manner in which parameters are 77 * passed to func ions in the generated assembly code).93 * passed to functions in the generated assembly code). 78 94 * 79 95 * Matching the Windows API itself, libusb uses the WINAPI convention (which … … 100 116 * API_EXPORTED. 101 117 */ 102 #if defined(_WIN32) || defined(__CYGWIN__) 118 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 103 119 #define LIBUSB_CALL WINAPI 104 120 #else … … 106 122 #endif 107 123 124 /** \def LIBUSB_API_VERSION 125 * \ingroup libusb_misc 126 * libusb's API version. 127 * 128 * Since version 1.0.13, to help with feature detection, libusb defines 129 * a LIBUSB_API_VERSION macro that gets increased every time there is a 130 * significant change to the API, such as the introduction of a new call, 131 * the definition of a new macro/enum member, or any other element that 132 * libusb applications may want to detect at compilation time. 133 * 134 * The macro is typically used in an application as follows: 135 * \code 136 * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234) 137 * // Use one of the newer features from the libusb API 138 * #endif 139 * \endcode 140 * 141 * Internally, LIBUSB_API_VERSION is defined as follows: 142 * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental) 143 */ 144 #define LIBUSB_API_VERSION 0x01000105 145 146 /* The following is kept for compatibility, but will be deprecated in the future */ 147 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION 148 108 149 #ifdef __cplusplus 109 150 extern "C" { 110 151 #endif 111 152 112 /** \def libusb_cpu_to_le16113 * \ingroup misc153 /** 154 * \ingroup libusb_misc 114 155 * Convert a 16-bit value from host-endian to little-endian format. On 115 156 * little endian systems, this function does nothing. On big endian systems, … … 124 165 uint16_t b16; 125 166 } _tmp; 126 _tmp.b8[1] = x >> 8;127 _tmp.b8[0] = x & 0xff;167 _tmp.b8[1] = (uint8_t) (x >> 8); 168 _tmp.b8[0] = (uint8_t) (x & 0xff); 128 169 return _tmp.b16; 129 170 } 130 171 131 172 /** \def libusb_le16_to_cpu 132 * \ingroup misc173 * \ingroup libusb_misc 133 174 * Convert a 16-bit value from little-endian to host-endian format. On 134 175 * little endian systems, this function does nothing. On big endian systems, … … 141 182 /* standard USB stuff */ 142 183 143 /** \ingroup desc184 /** \ingroup libusb_desc 144 185 * Device and/or Interface Class codes */ 145 186 enum libusb_class_code { … … 203 244 }; 204 245 205 /** \ingroup desc246 /** \ingroup libusb_desc 206 247 * Descriptor types as defined by the USB specification. */ 207 248 enum libusb_descriptor_type { … … 221 262 LIBUSB_DT_ENDPOINT = 0x05, 222 263 264 /** BOS descriptor */ 265 LIBUSB_DT_BOS = 0x0f, 266 267 /** Device Capability descriptor */ 268 LIBUSB_DT_DEVICE_CAPABILITY = 0x10, 269 223 270 /** HID descriptor */ 224 271 LIBUSB_DT_HID = 0x21, … … 233 280 LIBUSB_DT_HUB = 0x29, 234 281 235 /** BOS descriptor */ 236 LIBUSB_DT_BOS = 0x0f, 237 238 /** Device Capability descriptor */ 239 LIBUSB_DT_DEVICE_CAPABILITY = 0x10, 282 /** SuperSpeed Hub descriptor */ 283 LIBUSB_DT_SUPERSPEED_HUB = 0x2a, 240 284 241 285 /** SuperSpeed Endpoint Companion descriptor */ … … 247 291 #define LIBUSB_DT_CONFIG_SIZE 9 248 292 #define LIBUSB_DT_INTERFACE_SIZE 9 249 #define LIBUSB_DT_ENDPOINT_SIZE 7250 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */293 #define LIBUSB_DT_ENDPOINT_SIZE 7 294 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ 251 295 #define LIBUSB_DT_HUB_NONVAR_SIZE 7 252 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 296 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 253 297 #define LIBUSB_DT_BOS_SIZE 5 254 #define LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 255 #define LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE 10 256 #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) + \ 257 (LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE) + \ 258 (LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE)) 298 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3 299 300 /* BOS descriptor sizes */ 301 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7 302 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10 303 #define LIBUSB_BT_CONTAINER_ID_SIZE 20 304 305 /* We unwrap the BOS => define its max size */ 306 #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\ 307 (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\ 308 (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\ 309 (LIBUSB_BT_CONTAINER_ID_SIZE)) 259 310 260 311 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ 261 312 #define LIBUSB_ENDPOINT_DIR_MASK 0x80 262 313 263 /** \ingroup desc314 /** \ingroup libusb_desc 264 315 * Endpoint direction. Values for bit 7 of the 265 316 * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme. … … 275 326 #define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */ 276 327 277 /** \ingroup desc328 /** \ingroup libusb_desc 278 329 * Endpoint transfer type. Values for bits 0:1 of the 279 330 * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field. … … 290 341 291 342 /** Interrupt endpoint */ 292 LIBUSB_TRANSFER_TYPE_INTERRUPT = 3 293 }; 294 295 /** \ingroup misc 296 * Standard requests, as defined in table 9-3 of the USB2 specifications */ 343 LIBUSB_TRANSFER_TYPE_INTERRUPT = 3, 344 345 /** Stream endpoint */ 346 LIBUSB_TRANSFER_TYPE_BULK_STREAM = 4, 347 }; 348 349 /** \ingroup libusb_misc 350 * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */ 297 351 enum libusb_standard_request { 298 352 /** Request status of the specific recipient */ … … 332 386 /** Set then report an endpoint's synchronization frame */ 333 387 LIBUSB_REQUEST_SYNCH_FRAME = 0x0C, 334 }; 335 336 /** \ingroup misc 388 389 /** Sets both the U1 and U2 Exit Latency */ 390 LIBUSB_REQUEST_SET_SEL = 0x30, 391 392 /** Delay from the time a host transmits a packet to the time it is 393 * received by the device. */ 394 LIBUSB_SET_ISOCH_DELAY = 0x31, 395 }; 396 397 /** \ingroup libusb_misc 337 398 * Request type bits of the 338 399 * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control … … 352 413 }; 353 414 354 /** \ingroup misc415 /** \ingroup libusb_misc 355 416 * Recipient bits of the 356 417 * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control … … 372 433 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C 373 434 374 /** \ingroup desc435 /** \ingroup libusb_desc 375 436 * Synchronization type for isochronous endpoints. Values for bits 2:3 of the 376 437 * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in … … 393 454 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30 394 455 395 /** \ingroup desc456 /** \ingroup libusb_desc 396 457 * Usage type for isochronous endpoints. Values for bits 4:5 of the 397 458 * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in … … 409 470 }; 410 471 411 /** \ingroup desc472 /** \ingroup libusb_desc 412 473 * A structure representing the standard USB device descriptor. This 413 * descriptor is documented in section 9.6.1 of the USB 2.0 specification.474 * descriptor is documented in section 9.6.1 of the USB 3.0 specification. 414 475 * All multiple-byte fields are represented in host-endian format. 415 476 */ … … 463 524 }; 464 525 465 /** \ingroup desc 466 * A structure representing the superspeed endpoint companion 467 * descriptor. This descriptor is documented in section 9.6.7 of 468 * the USB 3.0 specification. All ultiple-byte fields are represented in 469 * host-endian format. 470 */ 471 struct libusb_ss_endpoint_companion_descriptor { 472 473 /** Size of this descriptor (in bytes) */ 474 uint8_t bLength; 475 476 /** Descriptor type. Will have value 477 * \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in 478 * this context. */ 479 uint8_t bDescriptorType; 480 481 482 /** The maximum number of packets the endpoint can send or 483 * recieve as part of a burst. */ 484 uint8_t bMaxBurst; 485 486 /** In bulk EP: bits 4:0 represents the maximum number of 487 * streams the EP supports. In isochronous EP: bits 1:0 488 * represents the Mult - a zero based value that determines 489 * the maximum number of packets within a service interval */ 490 uint8_t bmAttributes; 491 492 /** The total number of bytes this EP will transfer every 493 * service interval. valid only for periodic EPs. */ 494 uint16_t wBytesPerInterval; 495 }; 496 497 /** \ingroup desc 526 /** \ingroup libusb_desc 498 527 * A structure representing the standard USB endpoint descriptor. This 499 * descriptor is documented in section 9.6. 3 of the USB 2.0 specification.528 * descriptor is documented in section 9.6.6 of the USB 3.0 specification. 500 529 * All multiple-byte fields are represented in host-endian format. 501 530 */ … … 545 574 }; 546 575 547 548 /** \ingroup desc 576 /** \ingroup libusb_desc 549 577 * A structure representing the standard USB interface descriptor. This 550 * descriptor is documented in section 9.6.5 of the USB 2.0 specification.578 * descriptor is documented in section 9.6.5 of the USB 3.0 specification. 551 579 * All multiple-byte fields are represented in host-endian format. 552 580 */ … … 596 624 }; 597 625 598 /** \ingroup desc626 /** \ingroup libusb_desc 599 627 * A collection of alternate settings for a particular USB interface. 600 628 */ … … 608 636 }; 609 637 610 /** \ingroup desc638 /** \ingroup libusb_desc 611 639 * A structure representing the standard USB configuration descriptor. This 612 * descriptor is documented in section 9.6.3 of the USB 2.0 specification.640 * descriptor is documented in section 9.6.3 of the USB 3.0 specification. 613 641 * All multiple-byte fields are represented in host-endian format. 614 642 */ … … 638 666 639 667 /** Maximum power consumption of the USB device from this bus in this 640 * configuration when the device is fully opreation. Expressed in units 641 * of 2 mA. */ 668 * configuration when the device is fully operation. Expressed in units 669 * of 2 mA when the device is operating in high-speed mode and in units 670 * of 8 mA when the device is operating in super-speed mode. */ 642 671 uint8_t MaxPower; 643 672 … … 654 683 }; 655 684 656 /** \ingroup desc657 * A structure representing the BOS descriptor. This658 * descriptor is documented in section 9.6.2 of the USB 3.0659 * specification. All multiple-byte fields are represented in685 /** \ingroup libusb_desc 686 * A structure representing the superspeed endpoint companion 687 * descriptor. This descriptor is documented in section 9.6.7 of 688 * the USB 3.0 specification. All multiple-byte fields are represented in 660 689 * host-endian format. 690 */ 691 struct libusb_ss_endpoint_companion_descriptor { 692 693 /** Size of this descriptor (in bytes) */ 694 uint8_t bLength; 695 696 /** Descriptor type. Will have value 697 * \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in 698 * this context. */ 699 uint8_t bDescriptorType; 700 701 702 /** The maximum number of packets the endpoint can send or 703 * receive as part of a burst. */ 704 uint8_t bMaxBurst; 705 706 /** In bulk EP: bits 4:0 represents the maximum number of 707 * streams the EP supports. In isochronous EP: bits 1:0 708 * represents the Mult - a zero based value that determines 709 * the maximum number of packets within a service interval */ 710 uint8_t bmAttributes; 711 712 /** The total number of bytes this EP will transfer every 713 * service interval. valid only for periodic EPs. */ 714 uint16_t wBytesPerInterval; 715 }; 716 717 /** \ingroup libusb_desc 718 * A generic representation of a BOS Device Capability descriptor. It is 719 * advised to check bDevCapabilityType and call the matching 720 * libusb_get_*_descriptor function to get a structure fully matching the type. 721 */ 722 struct libusb_bos_dev_capability_descriptor { 723 /** Size of this descriptor (in bytes) */ 724 uint8_t bLength; 725 /** Descriptor type. Will have value 726 * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 727 * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 728 uint8_t bDescriptorType; 729 /** Device Capability type */ 730 uint8_t bDevCapabilityType; 731 /** Device Capability data (bLength - 3 bytes) */ 732 uint8_t dev_capability_data 733 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 734 [] /* valid C99 code */ 735 #else 736 [0] /* non-standard, but usually working code */ 737 #endif 738 ; 739 }; 740 741 /** \ingroup libusb_desc 742 * A structure representing the Binary Device Object Store (BOS) descriptor. 743 * This descriptor is documented in section 9.6.2 of the USB 3.0 specification. 744 * All multiple-byte fields are represented in host-endian format. 661 745 */ 662 746 struct libusb_bos_descriptor { … … 676 760 uint8_t bNumDeviceCaps; 677 761 678 /** USB 2.0 extension capability descriptor */ 679 struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; 680 681 /** SuperSpeed capabilty descriptor */ 682 struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; 683 }; 684 685 /** \ingroup desc 686 * A structure representing the device capability descriptor for 687 * USB 2.0. This descriptor is documented in section 9.6.2.1 of 688 * the USB 3.0 specification. All mutiple-byte fields are represented 689 * in host-endian format. 690 */ 691 struct libusb_usb_2_0_device_capability_descriptor { 762 /** bNumDeviceCap Device Capability Descriptors */ 763 struct libusb_bos_dev_capability_descriptor *dev_capability 764 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 765 [] /* valid C99 code */ 766 #else 767 [0] /* non-standard, but usually working code */ 768 #endif 769 ; 770 }; 771 772 /** \ingroup libusb_desc 773 * A structure representing the USB 2.0 Extension descriptor 774 * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification. 775 * All multiple-byte fields are represented in host-endian format. 776 */ 777 struct libusb_usb_2_0_extension_descriptor { 692 778 /** Size of this descriptor (in bytes) */ 693 779 uint8_t bLength; … … 699 785 700 786 /** Capability type. Will have value 701 * \ref libusb_capability_type::LIBUSB_ USB_CAP_TYPE_EXT702 * LIBUSB_ USB_CAP_TYPE_EXTin this context. */787 * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION 788 * LIBUSB_BT_USB_2_0_EXTENSION in this context. */ 703 789 uint8_t bDevCapabilityType; 704 790 … … 706 792 * A value of one in a bit location indicates a feature is 707 793 * supported; a value of zero indicates it is not supported. 708 * See \ref libusb_ capability_attributes. */794 * See \ref libusb_usb_2_0_extension_attributes. */ 709 795 uint32_t bmAttributes; 710 796 }; 711 797 712 /** \ingroup desc 713 * A structure representing the device capability descriptor for 714 * USB 3.0. This descriptor is documented in section 9.6.2.2 of 715 * the USB 3.0 specification. All mutiple-byte fields are represented 716 * in host-endian format. 798 /** \ingroup libusb_desc 799 * A structure representing the SuperSpeed USB Device Capability descriptor 800 * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification. 801 * All multiple-byte fields are represented in host-endian format. 717 802 */ 718 803 struct libusb_ss_usb_device_capability_descriptor { … … 726 811 727 812 /** Capability type. Will have value 728 * \ref libusb_capability_type::LIBUSB_ SS_USB_CAP_TYPE729 * LIBUSB_ SS_USB_CAP_TYPEin this context. */813 * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY 814 * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */ 730 815 uint8_t bDevCapabilityType; 731 816 … … 733 818 * A value of one in a bit location indicates a feature is 734 819 * supported; a value of zero indicates it is not supported. 735 * See \ref libusb_ capability_attributes. */820 * See \ref libusb_ss_usb_device_capability_attributes. */ 736 821 uint8_t bmAttributes; 737 822 … … 753 838 }; 754 839 755 756 /** \ingroup asyncio 840 /** \ingroup libusb_desc 841 * A structure representing the Container ID descriptor. 842 * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification. 843 * All multiple-byte fields, except UUIDs, are represented in host-endian format. 844 */ 845 struct libusb_container_id_descriptor { 846 /** Size of this descriptor (in bytes) */ 847 uint8_t bLength; 848 849 /** Descriptor type. Will have value 850 * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY 851 * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ 852 uint8_t bDescriptorType; 853 854 /** Capability type. Will have value 855 * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID 856 * LIBUSB_BT_CONTAINER_ID in this context. */ 857 uint8_t bDevCapabilityType; 858 859 /** Reserved field */ 860 uint8_t bReserved; 861 862 /** 128 bit UUID */ 863 uint8_t ContainerID[16]; 864 }; 865 866 /** \ingroup libusb_asyncio 757 867 * Setup packet for control transfers. */ 758 868 struct libusb_control_setup { … … 789 899 struct libusb_device; 790 900 struct libusb_device_handle; 791 struct libusb_hotplug_callback; 792 793 /** \ingroup lib 794 * Structure representing the libusb version. 901 902 /** \ingroup libusb_lib 903 * Structure providing the version of the libusb runtime 795 904 */ 796 905 struct libusb_version { … … 804 913 const uint16_t micro; 805 914 806 /** Library nano version. This field is only nonzero on Windows.*/915 /** Library nano version. */ 807 916 const uint16_t nano; 808 917 … … 810 919 const char *rc; 811 920 812 /** Output of `git describe --tags` at library build time. */813 const char *describe;814 }; 815 816 /** \ingroup lib 921 /** For ABI compatibility only. */ 922 const char* describe; 923 }; 924 925 /** \ingroup libusb_lib 817 926 * Structure representing a libusb session. The concept of individual libusb 818 927 * sessions allows for your program to use two libraries (or dynamically … … 829 938 * will be used. 830 939 * 831 * For more information, see \ref contexts.940 * For more information, see \ref libusb_contexts. 832 941 */ 833 942 typedef struct libusb_context libusb_context; 834 943 835 /** \ingroup dev944 /** \ingroup libusb_dev 836 945 * Structure representing a USB device detected on the system. This is an 837 946 * opaque type for which you are only ever provided with a pointer, usually … … 851 960 852 961 853 /** \ingroup dev962 /** \ingroup libusb_dev 854 963 * Structure representing a handle on a USB device. This is an opaque type for 855 964 * which you are only ever provided with a pointer, usually originating from … … 861 970 typedef struct libusb_device_handle libusb_device_handle; 862 971 863 /** \ingroup dev972 /** \ingroup libusb_dev 864 973 * Speed codes. Indicates the speed at which the device is operating. 865 974 */ 866 975 enum libusb_speed { 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 }; 882 883 /** \ingroup dev976 /** The OS doesn't report or know the device speed. */ 977 LIBUSB_SPEED_UNKNOWN = 0, 978 979 /** The device is operating at low speed (1.5MBit/s). */ 980 LIBUSB_SPEED_LOW = 1, 981 982 /** The device is operating at full speed (12MBit/s). */ 983 LIBUSB_SPEED_FULL = 2, 984 985 /** The device is operating at high speed (480MBit/s). */ 986 LIBUSB_SPEED_HIGH = 3, 987 988 /** The device is operating at super speed (5000MBit/s). */ 989 LIBUSB_SPEED_SUPER = 4, 990 }; 991 992 /** \ingroup libusb_dev 884 993 * Supported speeds (wSpeedSupported) bitfield. Indicates what 885 994 * speeds the device supports. … … 887 996 enum libusb_supported_speed { 888 997 /** Low speed operation supported (1.5MBit/s). */ 889 LIBUSB_LOW_SPEED_OPERATION = 1,998 LIBUSB_LOW_SPEED_OPERATION = 1, 890 999 891 1000 /** Full speed operation supported (12MBit/s). */ 892 LIBUSB_FULL_SPEED_OPERATION = 2,1001 LIBUSB_FULL_SPEED_OPERATION = 2, 893 1002 894 1003 /** High speed operation supported (480MBit/s). */ 895 LIBUSB_HIGH_SPEED_OPERATION = 4,1004 LIBUSB_HIGH_SPEED_OPERATION = 4, 896 1005 897 1006 /** Superspeed operation supported (5000MBit/s). */ 898 LIBUSB_5GBPS_OPERATION = 8, 899 }; 900 901 /** \ingroup dev 902 * Capability attributes 903 */ 904 enum libusb_capability_attributes { 1007 LIBUSB_SUPER_SPEED_OPERATION = 8, 1008 }; 1009 1010 /** \ingroup libusb_dev 1011 * Masks for the bits of the 1012 * \ref libusb_usb_2_0_extension_descriptor::bmAttributes "bmAttributes" field 1013 * of the USB 2.0 Extension descriptor. 1014 */ 1015 enum libusb_usb_2_0_extension_attributes { 905 1016 /** Supports Link Power Management (LPM) */ 906 LIBUSB_LPM_SUPPORT = 2, 907 }; 908 909 /** \ingroup dev 1017 LIBUSB_BM_LPM_SUPPORT = 2, 1018 }; 1019 1020 /** \ingroup libusb_dev 1021 * Masks for the bits of the 1022 * \ref libusb_ss_usb_device_capability_descriptor::bmAttributes "bmAttributes" field 1023 * field of the SuperSpeed USB Device Capability descriptor. 1024 */ 1025 enum libusb_ss_usb_device_capability_attributes { 1026 /** Supports Latency Tolerance Messages (LTM) */ 1027 LIBUSB_BM_LTM_SUPPORT = 2, 1028 }; 1029 1030 /** \ingroup libusb_dev 910 1031 * USB capability types 911 1032 */ 912 enum libusb_capability_type { 913 /** USB 2.0 extension capability type */ 914 LIBUSB_USB_CAP_TYPE_EXT = 2, 915 916 /** SuperSpeed capability type */ 917 LIBUSB_SS_USB_CAP_TYPE = 3, 918 }; 919 920 /** \ingroup misc 1033 enum libusb_bos_type { 1034 /** Wireless USB device capability */ 1035 LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1, 1036 1037 /** USB 2.0 extensions */ 1038 LIBUSB_BT_USB_2_0_EXTENSION = 2, 1039 1040 /** SuperSpeed USB device capability */ 1041 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3, 1042 1043 /** Container ID type */ 1044 LIBUSB_BT_CONTAINER_ID = 4, 1045 }; 1046 1047 /** \ingroup libusb_misc 921 1048 * Error codes. Most libusb functions return 0 on success or one of these 922 1049 * codes on failure. 923 * You can call \ref libusb_error_name() to retrieve a string representation 924 * of an error code. 1050 * You can call libusb_error_name() to retrieve a string representation of an 1051 * error code or libusb_strerror() to get an end-user suitable description of 1052 * an error code. 925 1053 */ 926 1054 enum libusb_error { … … 964 1092 LIBUSB_ERROR_NOT_SUPPORTED = -12, 965 1093 966 /* NB ! Remember to update libusb_error_name()967 when adding new error codes here. */1094 /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the 1095 message strings in strerror.c when adding new error codes here. */ 968 1096 969 1097 /** Other error */ … … 971 1099 }; 972 1100 973 /** \ingroup asyncio 1101 /* Total number of error codes in enum libusb_error */ 1102 #define LIBUSB_ERROR_COUNT 14 1103 1104 /** \ingroup libusb_asyncio 974 1105 * Transfer status codes */ 975 1106 enum libusb_transfer_status { … … 996 1127 /** Device sent more data than requested */ 997 1128 LIBUSB_TRANSFER_OVERFLOW, 998 }; 999 1000 /** \ingroup asyncio 1129 1130 /* NB! Remember to update libusb_error_name() 1131 when adding new status codes here. */ 1132 }; 1133 1134 /** \ingroup libusb_asyncio 1001 1135 * libusb_transfer.flags values */ 1002 1136 enum libusb_transfer_flags { … … 1004 1138 LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0, 1005 1139 1006 /** Automatically free() transfer buffer during libusb_free_transfer() */ 1140 /** Automatically free() transfer buffer during libusb_free_transfer(). 1141 * Note that buffers allocated with libusb_dev_mem_alloc() should not 1142 * be attempted freed in this way, since free() is not an appropriate 1143 * way to release such memory. */ 1007 1144 LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, 1008 1145 … … 1039 1176 }; 1040 1177 1041 /** \ingroup asyncio1178 /** \ingroup libusb_asyncio 1042 1179 * Isochronous packet descriptor. */ 1043 1180 struct libusb_iso_packet_descriptor { … … 1054 1191 struct libusb_transfer; 1055 1192 1056 /** \ingroup asyncio1193 /** \ingroup libusb_asyncio 1057 1194 * Asynchronous transfer callback function type. When submitting asynchronous 1058 1195 * transfers, you pass a pointer to a callback function of this type via the 1059 1196 * \ref libusb_transfer::callback "callback" member of the libusb_transfer 1060 1197 * structure. libusb will call this function later, when the transfer has 1061 * completed or failed. See \ref asyncio for more information.1198 * completed or failed. See \ref libusb_asyncio for more information. 1062 1199 * \param transfer The libusb_transfer struct the callback function is being 1063 1200 * notified about. … … 1065 1202 typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer); 1066 1203 1067 /** \ingroup asyncio1204 /** \ingroup libusb_asyncio 1068 1205 * The generic USB transfer structure. The user populates this structure and 1069 1206 * then submits it in order to request a transfer. After the transfer has … … 1129 1266 }; 1130 1267 1131 /** \ingroup misc1132 * Capabilities supported by this instance of libusb. Test if the loaded1133 * library supports a given capability by calling1268 /** \ingroup libusb_misc 1269 * Capabilities supported by an instance of libusb on the current running 1270 * platform. Test if the loaded library supports a given capability by calling 1134 1271 * \ref libusb_has_capability(). 1135 1272 */ 1136 1273 enum libusb_capability { 1137 1274 /** The libusb_has_capability() API is available. */ 1138 LIBUSB_CAP_HAS_CAPABILITY = 0, 1139 /** The libusb hotplug API is available. */ 1140 LIBUSB_CAP_HAS_HOTPLUG = 1, 1275 LIBUSB_CAP_HAS_CAPABILITY = 0x0000, 1276 /** Hotplug support is available on this platform. */ 1277 LIBUSB_CAP_HAS_HOTPLUG = 0x0001, 1278 /** The library can access HID devices without requiring user intervention. 1279 * Note that before being able to actually access an HID device, you may 1280 * still have to call additional libusb functions such as 1281 * \ref libusb_detach_kernel_driver(). */ 1282 LIBUSB_CAP_HAS_HID_ACCESS = 0x0100, 1283 /** The library supports detaching of the default USB driver, using 1284 * \ref libusb_detach_kernel_driver(), if one is set by the OS kernel */ 1285 LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101 1286 }; 1287 1288 /** \ingroup libusb_lib 1289 * Log message levels. 1290 * - LIBUSB_LOG_LEVEL_NONE (0) : no messages ever printed by the library (default) 1291 * - LIBUSB_LOG_LEVEL_ERROR (1) : error messages are printed to stderr 1292 * - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr 1293 * - LIBUSB_LOG_LEVEL_INFO (3) : informational messages are printed to stdout, warning 1294 * and error messages are printed to stderr 1295 * - LIBUSB_LOG_LEVEL_DEBUG (4) : debug and informational messages are printed to stdout, 1296 * warnings and errors to stderr 1297 */ 1298 enum libusb_log_level { 1299 LIBUSB_LOG_LEVEL_NONE = 0, 1300 LIBUSB_LOG_LEVEL_ERROR, 1301 LIBUSB_LOG_LEVEL_WARNING, 1302 LIBUSB_LOG_LEVEL_INFO, 1303 LIBUSB_LOG_LEVEL_DEBUG, 1141 1304 }; 1142 1305 … … 1147 1310 int LIBUSB_CALL libusb_has_capability(uint32_t capability); 1148 1311 const char * LIBUSB_CALL libusb_error_name(int errcode); 1312 int LIBUSB_CALL libusb_setlocale(const char *locale); 1313 const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode); 1149 1314 1150 1315 ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, … … 1167 1332 void LIBUSB_CALL libusb_free_config_descriptor( 1168 1333 struct libusb_config_descriptor *config); 1334 int LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor( 1335 struct libusb_context *ctx, 1336 const struct libusb_endpoint_descriptor *endpoint, 1337 struct libusb_ss_endpoint_companion_descriptor **ep_comp); 1338 void LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor( 1339 struct libusb_ss_endpoint_companion_descriptor *ep_comp); 1340 int LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *dev_handle, 1341 struct libusb_bos_descriptor **bos); 1342 void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); 1343 int LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor( 1344 struct libusb_context *ctx, 1345 struct libusb_bos_dev_capability_descriptor *dev_cap, 1346 struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension); 1347 void LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor( 1348 struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension); 1349 int LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor( 1350 struct libusb_context *ctx, 1351 struct libusb_bos_dev_capability_descriptor *dev_cap, 1352 struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap); 1353 void LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor( 1354 struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap); 1355 int LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx, 1356 struct libusb_bos_dev_capability_descriptor *dev_cap, 1357 struct libusb_container_id_descriptor **container_id); 1358 void LIBUSB_CALL libusb_free_container_id_descriptor( 1359 struct libusb_container_id_descriptor *container_id); 1169 1360 uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); 1361 uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev); 1362 int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len); 1363 LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers) 1364 int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length); 1365 libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev); 1170 1366 uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); 1171 1367 int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev); … … 1175 1371 unsigned char endpoint); 1176 1372 1177 int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle ** handle);1373 int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **dev_handle); 1178 1374 void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle); 1179 1375 libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle); 1180 1376 1181 int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev ,1377 int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev_handle, 1182 1378 int configuration); 1183 int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev ,1379 int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev_handle, 1184 1380 int interface_number); 1185 int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev ,1381 int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev_handle, 1186 1382 int interface_number); 1187 1383 … … 1189 1385 libusb_context *ctx, uint16_t vendor_id, uint16_t product_id); 1190 1386 1191 int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev ,1387 int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev_handle, 1192 1388 int interface_number, int alternate_setting); 1193 int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev ,1389 int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev_handle, 1194 1390 unsigned char endpoint); 1195 int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); 1196 1197 int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, 1391 int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev_handle); 1392 1393 int LIBUSB_CALL libusb_alloc_streams(libusb_device_handle *dev_handle, 1394 uint32_t num_streams, unsigned char *endpoints, int num_endpoints); 1395 int LIBUSB_CALL libusb_free_streams(libusb_device_handle *dev_handle, 1396 unsigned char *endpoints, int num_endpoints); 1397 1398 unsigned char * LIBUSB_CALL libusb_dev_mem_alloc(libusb_device_handle *dev_handle, 1399 size_t length); 1400 int LIBUSB_CALL libusb_dev_mem_free(libusb_device_handle *dev_handle, 1401 unsigned char *buffer, size_t length); 1402 1403 int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev_handle, 1198 1404 int interface_number); 1199 int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev ,1405 int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev_handle, 1200 1406 int interface_number); 1201 int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev ,1407 int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev_handle, 1202 1408 int interface_number); 1409 int LIBUSB_CALL libusb_set_auto_detach_kernel_driver( 1410 libusb_device_handle *dev_handle, int enable); 1203 1411 1204 1412 /* async I/O */ 1205 1413 1206 /** \ingroup asyncio1414 /** \ingroup libusb_asyncio 1207 1415 * Get the data section of a control transfer. This convenience function is here 1208 1416 * to remind you that the data does not start until 8 bytes into the actual … … 1222 1430 } 1223 1431 1224 /** \ingroup asyncio1432 /** \ingroup libusb_asyncio 1225 1433 * Get the control setup packet of a control transfer. This convenience 1226 1434 * function is here to remind you that the control setup occupies the first … … 1237 1445 struct libusb_transfer *transfer) 1238 1446 { 1239 return (struct libusb_control_setup *) transfer->buffer;1447 return (struct libusb_control_setup *)(void *) transfer->buffer; 1240 1448 } 1241 1449 1242 /** \ingroup asyncio1450 /** \ingroup libusb_asyncio 1243 1451 * Helper function to populate the setup packet (first 8 bytes of the data 1244 1452 * buffer) for a control transfer. The wIndex, wValue and wLength values should … … 1246 1454 * 1247 1455 * \param buffer buffer to output the setup packet into 1456 * This pointer must be aligned to at least 2 bytes boundary. 1248 1457 * \param bmRequestType see the 1249 1458 * \ref libusb_control_setup::bmRequestType "bmRequestType" field of … … 1266 1475 uint16_t wLength) 1267 1476 { 1268 struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;1477 struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; 1269 1478 setup->bmRequestType = bmRequestType; 1270 1479 setup->bRequest = bRequest; … … 1278 1487 int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); 1279 1488 void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); 1280 1281 /** \ingroup asyncio 1489 void LIBUSB_CALL libusb_transfer_set_stream_id( 1490 struct libusb_transfer *transfer, uint32_t stream_id); 1491 uint32_t LIBUSB_CALL libusb_transfer_get_stream_id( 1492 struct libusb_transfer *transfer); 1493 1494 /** \ingroup libusb_asyncio 1282 1495 * Helper function to populate the required \ref libusb_transfer fields 1283 1496 * for a control transfer. … … 1302 1515 * \param buffer data buffer. If provided, this function will interpret the 1303 1516 * first 8 bytes as a setup packet and infer the transfer length from that. 1517 * This pointer must be aligned to at least 2 bytes boundary. 1304 1518 * \param callback callback function to be invoked on transfer completion 1305 1519 * \param user_data user data to pass to callback function … … 1311 1525 unsigned int timeout) 1312 1526 { 1313 struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;1527 struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; 1314 1528 transfer->dev_handle = dev_handle; 1315 1529 transfer->endpoint = 0; … … 1318 1532 transfer->buffer = buffer; 1319 1533 if (setup) 1320 transfer->length = LIBUSB_CONTROL_SETUP_SIZE1321 + libusb_le16_to_cpu(setup->wLength) ;1534 transfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE 1535 + libusb_le16_to_cpu(setup->wLength)); 1322 1536 transfer->user_data = user_data; 1323 1537 transfer->callback = callback; 1324 1538 } 1325 1539 1326 /** \ingroup asyncio1540 /** \ingroup libusb_asyncio 1327 1541 * Helper function to populate the required \ref libusb_transfer fields 1328 1542 * for a bulk transfer. … … 1352 1566 } 1353 1567 1354 /** \ingroup asyncio 1568 /** \ingroup libusb_asyncio 1569 * Helper function to populate the required \ref libusb_transfer fields 1570 * for a bulk transfer using bulk streams. 1571 * 1572 * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 1573 * 1574 * \param transfer the transfer to populate 1575 * \param dev_handle handle of the device that will handle the transfer 1576 * \param endpoint address of the endpoint where this transfer will be sent 1577 * \param stream_id bulk stream id for this transfer 1578 * \param buffer data buffer 1579 * \param length length of data buffer 1580 * \param callback callback function to be invoked on transfer completion 1581 * \param user_data user data to pass to callback function 1582 * \param timeout timeout for the transfer in milliseconds 1583 */ 1584 static inline void libusb_fill_bulk_stream_transfer( 1585 struct libusb_transfer *transfer, libusb_device_handle *dev_handle, 1586 unsigned char endpoint, uint32_t stream_id, 1587 unsigned char *buffer, int length, libusb_transfer_cb_fn callback, 1588 void *user_data, unsigned int timeout) 1589 { 1590 libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, 1591 length, callback, user_data, timeout); 1592 transfer->type = LIBUSB_TRANSFER_TYPE_BULK_STREAM; 1593 libusb_transfer_set_stream_id(transfer, stream_id); 1594 } 1595 1596 /** \ingroup libusb_asyncio 1355 1597 * Helper function to populate the required \ref libusb_transfer fields 1356 1598 * for an interrupt transfer. … … 1380 1622 } 1381 1623 1382 /** \ingroup asyncio1624 /** \ingroup libusb_asyncio 1383 1625 * Helper function to populate the required \ref libusb_transfer fields 1384 1626 * for an isochronous transfer. … … 1410 1652 } 1411 1653 1412 /** \ingroup asyncio1654 /** \ingroup libusb_asyncio 1413 1655 * Convenience function to set the length of all packets in an isochronous 1414 1656 * transfer, based on the num_iso_packets field in the transfer structure. … … 1426 1668 } 1427 1669 1428 /** \ingroup asyncio1670 /** \ingroup libusb_asyncio 1429 1671 * Convenience function to locate the position of an isochronous packet 1430 1672 * within the buffer of an isochronous transfer. … … 1454 1696 if (packet > INT_MAX) 1455 1697 return NULL; 1456 _packet = packet;1698 _packet = (int) packet; 1457 1699 1458 1700 if (_packet >= transfer->num_iso_packets) … … 1465 1707 } 1466 1708 1467 /** \ingroup asyncio1709 /** \ingroup libusb_asyncio 1468 1710 * Convenience function to locate the position of an isochronous packet 1469 1711 * within the buffer of an isochronous transfer, for transfers where each … … 1494 1736 if (packet > INT_MAX) 1495 1737 return NULL; 1496 _packet = packet;1738 _packet = (int) packet; 1497 1739 1498 1740 if (_packet >= transfer->num_iso_packets) 1499 1741 return NULL; 1500 1742 1501 return transfer->buffer + ( transfer->iso_packet_desc[0].length * _packet);1743 return transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet); 1502 1744 } 1503 1745 … … 1516 1758 int *actual_length, unsigned int timeout); 1517 1759 1518 /** \ingroup desc1760 /** \ingroup libusb_desc 1519 1761 * Retrieve a descriptor from the default control pipe. 1520 1762 * This is a convenience function which formulates the appropriate control 1521 1763 * message to retrieve the descriptor. 1522 1764 * 1523 * \param dev a device handle1765 * \param dev_handle a device handle 1524 1766 * \param desc_type the descriptor type, see \ref libusb_descriptor_type 1525 1767 * \param desc_index the index of the descriptor to retrieve … … 1528 1770 * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure 1529 1771 */ 1530 static inline int libusb_get_descriptor(libusb_device_handle *dev ,1772 static inline int libusb_get_descriptor(libusb_device_handle *dev_handle, 1531 1773 uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length) 1532 1774 { 1533 return libusb_control_transfer(dev , LIBUSB_ENDPOINT_IN,1534 LIBUSB_REQUEST_GET_DESCRIPTOR, ( desc_type << 8) | desc_index, 0, data,1535 (uint16_t) length, 1000);1775 return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN, 1776 LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index), 1777 0, data, (uint16_t) length, 1000); 1536 1778 } 1537 1779 1538 /** \ingroup desc1780 /** \ingroup libusb_desc 1539 1781 * Retrieve a descriptor from a device. 1540 1782 * This is a convenience function which formulates the appropriate control … … 1542 1784 * detailed in the USB specifications. 1543 1785 * 1544 * \param dev a device handle1786 * \param dev_handle a device handle 1545 1787 * \param desc_index the index of the descriptor to retrieve 1546 1788 * \param langid the language ID for the string descriptor … … 1550 1792 * \see libusb_get_string_descriptor_ascii() 1551 1793 */ 1552 static inline int libusb_get_string_descriptor(libusb_device_handle *dev ,1794 static inline int libusb_get_string_descriptor(libusb_device_handle *dev_handle, 1553 1795 uint8_t desc_index, uint16_t langid, unsigned char *data, int length) 1554 1796 { 1555 return libusb_control_transfer(dev , LIBUSB_ENDPOINT_IN,1797 return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN, 1556 1798 LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index), 1557 1799 langid, data, (uint16_t) length, 1000); 1558 1800 } 1559 1801 1560 int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev ,1802 int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev_handle, 1561 1803 uint8_t desc_index, unsigned char *data, int length); 1562 1804 … … 1568 1810 int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx); 1569 1811 int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx); 1812 void LIBUSB_CALL libusb_interrupt_event_handler(libusb_context *ctx); 1570 1813 void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx); 1571 1814 void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx); … … 1584 1827 struct timeval *tv); 1585 1828 1586 /** \ingroup poll1829 /** \ingroup libusb_poll 1587 1830 * File descriptor for polling 1588 1831 */ … … 1598 1841 }; 1599 1842 1600 /** \ingroup poll1843 /** \ingroup libusb_poll 1601 1844 * Callback function, invoked when a new file descriptor should be added 1602 1845 * to the set of file descriptors monitored for events. … … 1611 1854 void *user_data); 1612 1855 1613 /** \ingroup poll1856 /** \ingroup libusb_poll 1614 1857 * Callback function, invoked when a file descriptor should be removed from 1615 1858 * the set of file descriptors being monitored for events. After returning … … 1624 1867 const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( 1625 1868 libusb_context *ctx); 1869 void LIBUSB_CALL libusb_free_pollfds(const struct libusb_pollfd **pollfds); 1626 1870 void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, 1627 1871 libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, 1628 1872 void *user_data); 1629 1873 1630 /** \ingroup desc 1631 * Parse a USB 3.0 endpoint companion descriptor. 1632 * 1633 * \param[in] buf the buffer containing the endpoint companion descriptor 1634 * \param[in] len the length of the buffer 1635 * \param[out] ep_comp a parsed endpoint companion descriptor. must be freed by 1636 * libusb_free_ss_endpoint_comp() 1637 * 1638 * \returns LIBUSB_SUCCESS on success 1639 * \returns LIBUSB_ERROR code on error 1640 */ 1641 int LIBUSB_CALL libusb_parse_ss_endpoint_comp(const void *buf, int len, 1642 struct libusb_ss_endpoint_companion_descriptor **ep_comp); 1643 1644 /** \ingroup desc 1645 * Free a USB 3.0 endpoint companion descriptor. 1646 * 1647 * \param[in] ep_comp the descriptor to free 1648 */ 1649 void LIBUSB_CALL libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp); 1650 1651 /** \ingroup desc 1652 * Parse a Binary Object Store (BOS) descriptor. 1653 * 1654 * \param[in] buf the buffer containing the BOS descriptor 1655 * \param[in] len the length of the buffer 1656 * \param[out] bos a parsed BOS descriptor. must be freed by 1657 * libusb_free_bos_descriptor() 1658 * 1659 * \returns LIBUSB_SUCCESS on success 1660 * \returns LIBUSB_ERROR code on error 1661 */ 1662 int LIBUSB_CALL libusb_parse_bos_descriptor(const void *buf, int len, 1663 struct libusb_bos_descriptor **bos); 1664 1665 /** \ingroup desc 1666 * Free a Binary Object Store (BOS) descriptor. 1667 * 1668 * \param[in] bos the descriptor to free 1669 */ 1670 void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); 1671 1672 /** \ingroup hotplug 1874 /** \ingroup libusb_hotplug 1673 1875 * Callback handle. 1674 1876 * … … 1678 1880 * on an already deregisted callback. 1679 1881 * 1680 * For more information, see \ref hotplug. 1882 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1883 * 1884 * For more information, see \ref libusb_hotplug. 1681 1885 */ 1682 1886 typedef int libusb_hotplug_callback_handle; 1683 1887 1684 /** \ingroup hotplug 1888 /** \ingroup libusb_hotplug 1889 * 1890 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1891 * 1685 1892 * Flags for hotplug events */ 1686 1893 typedef enum { 1894 /** Default value when not using any flags. */ 1895 LIBUSB_HOTPLUG_NO_FLAGS = 0, 1896 1687 1897 /** Arm the callback and fire it for all matching currently attached devices. */ 1688 LIBUSB_HOTPLUG_ENUMERATE = 1 ,1898 LIBUSB_HOTPLUG_ENUMERATE = 1<<0, 1689 1899 } libusb_hotplug_flag; 1690 1900 1691 /** \ingroup hotplug 1901 /** \ingroup libusb_hotplug 1902 * 1903 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1904 * 1692 1905 * Hotplug events */ 1693 1906 typedef enum { … … 1701 1914 } libusb_hotplug_event; 1702 1915 1703 /** \ingroup hotplug1916 /** \ingroup libusb_hotplug 1704 1917 * Wildcard matching for hotplug events */ 1705 1918 #define LIBUSB_HOTPLUG_MATCH_ANY -1 1706 1919 1707 /** \ingroup hotplug1920 /** \ingroup libusb_hotplug 1708 1921 * Hotplug callback function type. When requesting hotplug event notifications, 1709 1922 * you pass a pointer to a callback function of this type. … … 1713 1926 * 1714 1927 * libusb will call this function later, when a matching event had happened on 1715 * a matching device. See \ref hotplug for more information.1928 * a matching device. See \ref libusb_hotplug for more information. 1716 1929 * 1717 1930 * It is safe to call either libusb_hotplug_register_callback() or 1718 1931 * libusb_hotplug_deregister_callback() from within a callback function. 1719 1932 * 1720 * \param libusb_context context of this notification 1933 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1934 * 1935 * \param ctx context of this notification 1721 1936 * \param device libusb_device this event occurred on 1722 1937 * \param event event that occurred … … 1726 1941 */ 1727 1942 typedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx, 1728 1729 1730 1731 1732 /** \ingroup hotplug1943 libusb_device *device, 1944 libusb_hotplug_event event, 1945 void *user_data); 1946 1947 /** \ingroup libusb_hotplug 1733 1948 * Register a hotplug callback function 1734 1949 * … … 1737 1952 * armed until either it is deregistered with libusb_hotplug_deregister_callback() 1738 1953 * or the supplied callback returns 1 to indicate it is finished processing events. 1954 * 1955 * If the \ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be 1956 * called with a \ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices 1957 * already plugged into the machine. Note that libusb modifies its internal 1958 * device list from a separate thread, while calling hotplug callbacks from 1959 * libusb_handle_events(), so it is possible for a device to already be present 1960 * on, or removed from, its internal device list, while the hotplug callbacks 1961 * still need to be dispatched. This means that when using \ref 1962 * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival 1963 * of the same device, once from libusb_hotplug_register_callback() and once 1964 * from libusb_handle_events(); and/or your callback may be called for the 1965 * removal of a device for which an arrived call was never made. 1966 * 1967 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1739 1968 * 1740 1969 * \param[in] ctx context to register this callback with … … 1747 1976 * \param[in] cb_fn the function to be invoked on a matching event/device 1748 1977 * \param[in] user_data user data to pass to the callback function 1749 * \param[out] handle pointer to store the handle of the allocated callback (can be NULL)1978 * \param[out] callback_handle pointer to store the handle of the allocated callback (can be NULL) 1750 1979 * \returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure 1751 1980 */ 1752 1981 int LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx, 1753 1754 1755 1756 1757 1758 1759 libusb_hotplug_callback_handle *handle);1760 1761 /** \ingroup hotplug1982 libusb_hotplug_event events, 1983 libusb_hotplug_flag flags, 1984 int vendor_id, int product_id, 1985 int dev_class, 1986 libusb_hotplug_callback_fn cb_fn, 1987 void *user_data, 1988 libusb_hotplug_callback_handle *callback_handle); 1989 1990 /** \ingroup libusb_hotplug 1762 1991 * Deregisters a hotplug callback. 1763 1992 * … … 1765 1994 * a hotplug callback. 1766 1995 * 1996 * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 1997 * 1767 1998 * \param[in] ctx context this callback is registered with 1768 * \param[in] handle the handle of the callback to deregister1999 * \param[in] callback_handle the handle of the callback to deregister 1769 2000 */ 1770 2001 void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx, 1771 libusb_hotplug_callback_handlehandle);2002 libusb_hotplug_callback_handle callback_handle); 1772 2003 1773 2004 #ifdef __cplusplus -
TabularUnified libusb1/trunk/libusb/libusbi.h ¶
r1879 r1882 1 1 /* 2 2 * Internal header for libusb 3 * Copyright (C)2007-2009 Daniel Drake <dsd@gentoo.org>4 * Copyright (c)2001 Johannes Erdfelt <johannes@erdfelt.com>3 * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org> 4 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 24 24 #include <config.h> 25 25 26 #include <stdlib.h> 27 26 28 #include <stddef.h> 27 29 #include <stdint.h> 28 30 #include <time.h> 29 #include <sys/time.h>30 31 #include <stdarg.h> 31 32 #ifdef HAVE_POLL_H 32 33 #include <poll.h> 33 34 #endif 34 35 #include <libusb.h> 36 #include <version.h> 35 #ifdef HAVE_MISSING_H 36 #include <missing.h> 37 #endif 38 39 #include "libusb.h" 40 #include "version.h" 37 41 38 42 /* Inside the libusb code, mark all public functions as follows: … … 45 49 #define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY 46 50 47 #define DEVICE_DESC_LENGTH 18 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 #define DEVICE_DESC_LENGTH 18 48 56 49 57 #define USB_MAXENDPOINTS 32 … … 51 59 #define USB_MAXCONFIG 8 52 60 61 /* Backend specific capabilities */ 62 #define USBI_CAP_HAS_HID_ACCESS 0x00010000 63 #define USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER 0x00020000 64 65 /* Maximum number of bytes in a log line */ 66 #define USBI_MAX_LOG_LEN 1024 67 /* Terminator for log lines */ 68 #define USBI_LOG_LINE_END "\n" 69 70 /* The following is used to silence warnings for unused variables */ 71 #define UNUSED(var) do { (void)(var); } while(0) 72 73 #if !defined(ARRAYSIZE) 74 #define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0])) 75 #endif 76 53 77 struct list_head { 54 78 struct list_head *prev, *next; … … 56 80 57 81 /* Get an entry from the list 58 * 59 * 60 * 82 * ptr - the address of this list_head element in "type" 83 * type - the data type that contains "member" 84 * member - the list_head element in "type" 61 85 */ 62 86 #define list_entry(ptr, type, member) \ 63 ((type *)((uintptr_t)(ptr) - (uintptr_t)(&((type *)0L)->member))) 87 ((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member))) 88 89 #define list_first_entry(ptr, type, member) \ 90 list_entry((ptr)->next, type, member) 64 91 65 92 /* Get each entry from a list 66 * 67 * 68 * 69 * 93 * pos - A structure pointer has a "member" element 94 * head - list head 95 * member - the list_head element in "pos" 96 * type - the type of the first parameter 70 97 */ 71 98 #define list_for_each_entry(pos, head, member, type) \ 72 99 for (pos = list_entry((head)->next, type, member); \ 73 &pos->member != (head);\74 100 &pos->member != (head); \ 101 pos = list_entry(pos->member.next, type, member)) 75 102 76 103 #define list_for_each_entry_safe(pos, n, head, member, type) \ 77 104 for (pos = list_entry((head)->next, type, member), \ 78 n = list_entry(pos->member.next, type, member);\79 &pos->member != (head);\80 105 n = list_entry(pos->member.next, type, member); \ 106 &pos->member != (head); \ 107 pos = n, n = list_entry(n->member.next, type, member)) 81 108 82 109 #define list_empty(entry) ((entry)->next == (entry)) … … 110 137 entry->next->prev = entry->prev; 111 138 entry->prev->next = entry->next; 139 entry->next = entry->prev = NULL; 112 140 } 113 141 114 #define container_of(ptr, type, member) ({ \ 115 const typeof( ((type *)0)->member ) *mptr = (ptr); \ 116 (type *)( (char *)mptr - offsetof(type,member) );}) 117 142 static inline void *usbi_reallocf(void *ptr, size_t size) 143 { 144 void *ret = realloc(ptr, size); 145 if (!ret) 146 free(ptr); 147 return ret; 148 } 149 150 #define container_of(ptr, type, member) ({ \ 151 const typeof( ((type *)0)->member ) *mptr = (ptr); \ 152 (type *)( (char *)mptr - offsetof(type,member) );}) 153 154 #ifndef MIN 118 155 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 156 #endif 157 #ifndef MAX 119 158 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 159 #endif 120 160 121 161 #define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0) 122 162 123 enum usbi_log_level { 124 LOG_LEVEL_DEBUG, 125 LOG_LEVEL_INFO, 126 LOG_LEVEL_WARNING, 127 LOG_LEVEL_ERROR, 128 }; 129 130 void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, 163 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 164 #define TIMEVAL_TV_SEC_TYPE long 165 #else 166 #define TIMEVAL_TV_SEC_TYPE time_t 167 #endif 168 169 /* Some platforms don't have this define */ 170 #ifndef TIMESPEC_TO_TIMEVAL 171 #define TIMESPEC_TO_TIMEVAL(tv, ts) \ 172 do { \ 173 (tv)->tv_sec = (TIMEVAL_TV_SEC_TYPE) (ts)->tv_sec; \ 174 (tv)->tv_usec = (ts)->tv_nsec / 1000; \ 175 } while (0) 176 #endif 177 178 void usbi_log(struct libusb_context *ctx, enum libusb_log_level level, 131 179 const char *function, const char *format, ...); 132 180 133 void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level,181 void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, 134 182 const char *function, const char *format, va_list args); 135 183 … … 138 186 #ifdef ENABLE_LOGGING 139 187 #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__) 188 #define usbi_dbg(...) _usbi_log(NULL, LIBUSB_LOG_LEVEL_DEBUG, __VA_ARGS__) 140 189 #else 141 190 #define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0) 142 #endif 143 144 #ifdef ENABLE_DEBUG_LOGGING 145 #define usbi_dbg(...) _usbi_log(NULL, LOG_LEVEL_DEBUG, __VA_ARGS__) 191 #define usbi_dbg(...) do {} while(0) 192 #endif 193 194 #define usbi_info(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_INFO, __VA_ARGS__) 195 #define usbi_warn(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_WARNING, __VA_ARGS__) 196 #define usbi_err(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_ERROR, __VA_ARGS__) 197 198 #else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ 199 200 #ifdef ENABLE_LOGGING 201 #define LOG_BODY(ctxt, level) \ 202 { \ 203 va_list args; \ 204 va_start(args, format); \ 205 usbi_log_v(ctxt, level, "", format, args); \ 206 va_end(args); \ 207 } 146 208 #else 147 #define usbi_dbg(...) do {} while(0) 148 #endif 149 150 #define usbi_info(ctx, ...) _usbi_log(ctx, LOG_LEVEL_INFO, __VA_ARGS__) 151 #define usbi_warn(ctx, ...) _usbi_log(ctx, LOG_LEVEL_WARNING, __VA_ARGS__) 152 #define usbi_err(ctx, ...) _usbi_log(ctx, LOG_LEVEL_ERROR, __VA_ARGS__) 153 154 #else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ 155 156 /* Old MS compilers don't support variadic macros. The code is simple, so we 157 * repeat it for each loglevel. Note that the debug case is special. 158 * 159 * Support for variadic macros was introduced in Visual C++ 2005. 160 * http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx 161 */ 162 163 static inline void usbi_info(struct libusb_context *ctx, const char *fmt, ...) 164 { 165 #ifdef ENABLE_LOGGING 166 va_list args; 167 va_start(args, fmt); 168 usbi_log_v(ctx, LOG_LEVEL_INFO, "", fmt, args); 169 va_end(args); 170 #else 171 (void)ctx; 172 #endif 209 #define LOG_BODY(ctxt, level) \ 210 { \ 211 (void)(ctxt); \ 173 212 } 174 175 static inline void usbi_warn(struct libusb_context *ctx, const char *fmt, ...) 176 { 177 #ifdef ENABLE_LOGGING 178 va_list args; 179 va_start(args, fmt); 180 usbi_log_v(ctx, LOG_LEVEL_WARNING, "", fmt, args); 181 va_end(args); 182 #else 183 (void)ctx; 184 #endif 185 } 186 187 static inline void usbi_err(struct libusb_context *ctx, const char *fmt, ...) 188 { 189 #ifdef ENABLE_LOGGING 190 va_list args; 191 va_start(args, fmt); 192 usbi_log_v(ctx, LOG_LEVEL_ERROR, "", fmt, args); 193 va_end(args); 194 #else 195 (void)ctx; 196 #endif 197 } 198 199 static inline void usbi_dbg(const char *fmt, ...) 200 { 201 #ifdef ENABLE_DEBUG_LOGGING 202 va_list args; 203 va_start(args, fmt); 204 usbi_log_v(NULL, LOG_LEVEL_DEBUG, "", fmt, args); 205 va_end(args); 206 #else 207 (void)fmt; 208 #endif 209 } 213 #endif 214 215 static inline void usbi_info(struct libusb_context *ctx, const char *format, ...) 216 LOG_BODY(ctx, LIBUSB_LOG_LEVEL_INFO) 217 static inline void usbi_warn(struct libusb_context *ctx, const char *format, ...) 218 LOG_BODY(ctx, LIBUSB_LOG_LEVEL_WARNING) 219 static inline void usbi_err(struct libusb_context *ctx, const char *format, ...) 220 LOG_BODY(ctx, LIBUSB_LOG_LEVEL_ERROR) 221 222 static inline void usbi_dbg(const char *format, ...) 223 LOG_BODY(NULL, LIBUSB_LOG_LEVEL_DEBUG) 210 224 211 225 #endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ 212 226 213 #define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context 214 #define DEVICE_CTX(dev) ((dev)->ctx) 215 #define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev)) 216 #define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle)) 227 #define USBI_GET_CONTEXT(ctx) \ 228 do { \ 229 if (!(ctx)) \ 230 (ctx) = usbi_default_context; \ 231 } while(0) 232 233 #define DEVICE_CTX(dev) ((dev)->ctx) 234 #define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev)) 235 #define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle)) 217 236 #define ITRANSFER_CTX(transfer) \ 218 237 (TRANSFER_CTX(USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer))) 219 238 220 #define IS_EPIN(ep) 221 #define IS_EPOUT(ep) 222 #define IS_XFERIN(xfer) 223 #define IS_XFEROUT(xfer) 224 225 /* Internal abstraction s for thread synchronization and poll*/239 #define IS_EPIN(ep) (0 != ((ep) & LIBUSB_ENDPOINT_IN)) 240 #define IS_EPOUT(ep) (!IS_EPIN(ep)) 241 #define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN)) 242 #define IS_XFEROUT(xfer) (!IS_XFERIN(xfer)) 243 244 /* Internal abstraction for thread synchronization */ 226 245 #if defined(THREADS_POSIX) 227 #include <os/threads_posix.h> 228 #elif defined(OS_WINDOWS) 229 #include <os/threads_windows.h> 230 #endif 231 232 #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) 233 #include <unistd.h> 234 #include <os/poll_posix.h> 235 #elif defined(OS_WINDOWS) 236 #include <os/poll_windows.h> 237 #elif defined(OS_OS2) 238 #include <os/poll_os2.h> 239 #endif 240 241 #if defined(OS_WINDOWS) && !defined(__GCC__) 242 #undef HAVE_GETTIMEOFDAY 243 int usbi_gettimeofday(struct timeval *tp, void *tzp); 244 #define LIBUSB_GETTIMEOFDAY_WIN32 245 #define HAVE_USBI_GETTIMEOFDAY 246 #else 247 #ifdef HAVE_GETTIMEOFDAY 248 #define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz)) 249 #define HAVE_USBI_GETTIMEOFDAY 250 #endif 246 #include "os/threads_posix.h" 247 #elif defined(OS_WINDOWS) || defined(OS_WINCE) 248 #include "os/threads_windows.h" 251 249 #endif 252 250 253 251 extern struct libusb_context *usbi_default_context; 252 253 /* Forward declaration for use in context (fully defined inside poll abstraction) */ 254 struct pollfd; 254 255 255 256 struct libusb_context { … … 257 258 int debug_fixed; 258 259 259 /* internal control pipe, used for interrupting event handling when 260 * something needs to modify poll fds. */ 261 int ctrl_pipe[2]; 260 /* internal event pipe, used for signalling occurrence of an internal event. */ 261 int event_pipe[2]; 262 262 263 263 struct list_head usb_devs; … … 272 272 struct list_head hotplug_cbs; 273 273 usbi_mutex_t hotplug_cbs_lock; 274 int hotplug_pipe[2];275 274 276 275 /* this is a list of in-flight transfer handles, sorted by timeout … … 279 278 * infinite timeout are always placed at the very end. */ 280 279 struct list_head flying_transfers; 280 /* Note paths taking both this and usbi_transfer->lock must always 281 * take this lock first */ 281 282 usbi_mutex_t flying_transfers_lock; 282 283 /* list of poll fds */284 struct list_head pollfds;285 usbi_mutex_t pollfds_lock;286 287 /* a counter that is set when we want to interrupt event handling, in order288 * to modify the poll fd set. and a lock to protect it. */289 unsigned int pollfd_modify;290 usbi_mutex_t pollfd_modify_lock;291 283 292 284 /* user callbacks for pollfd changes */ … … 301 293 int event_handler_active; 302 294 295 /* A thread-local storage key to track which thread is performing event 296 * handling */ 297 usbi_tls_key_t event_handling_key; 298 303 299 /* used to wait for event completion in threads other than the one that is 304 300 * event handling */ … … 306 302 usbi_cond_t event_waiters_cond; 307 303 304 /* A lock to protect internal context event data. */ 305 usbi_mutex_t event_data_lock; 306 307 /* A bitmask of flags that are set to indicate specific events that need to 308 * be handled. Protected by event_data_lock. */ 309 unsigned int event_flags; 310 311 /* A counter that is set when we want to interrupt and prevent event handling, 312 * in order to safely close a device. Protected by event_data_lock. */ 313 unsigned int device_close; 314 315 /* list and count of poll fds and an array of poll fd structures that is 316 * (re)allocated as necessary prior to polling. Protected by event_data_lock. */ 317 struct list_head ipollfds; 318 struct pollfd *pollfds; 319 POLL_NFDS_TYPE pollfds_cnt; 320 321 /* A list of pending hotplug messages. Protected by event_data_lock. */ 322 struct list_head hotplug_msgs; 323 324 /* A list of pending completed transfers. Protected by event_data_lock. */ 325 struct list_head completed_transfers; 326 308 327 #ifdef USBI_TIMERFD_AVAILABLE 309 328 /* used for timeout handling, if supported by OS. … … 312 331 #endif 313 332 314 struct list_head list; 315 }; 333 struct list_head list; 334 }; 335 336 enum usbi_event_flags { 337 /* The list of pollfds has been modified */ 338 USBI_EVENT_POLLFDS_MODIFIED = 1 << 0, 339 340 /* The user has interrupted the event handler */ 341 USBI_EVENT_USER_INTERRUPT = 1 << 1, 342 }; 343 344 /* Macros for managing event handling state */ 345 #define usbi_handling_events(ctx) \ 346 (usbi_tls_key_get((ctx)->event_handling_key) != NULL) 347 348 #define usbi_start_event_handling(ctx) \ 349 usbi_tls_key_set((ctx)->event_handling_key, ctx) 350 351 #define usbi_end_event_handling(ctx) \ 352 usbi_tls_key_set((ctx)->event_handling_key, NULL) 353 354 /* Update the following macro if new event sources are added */ 355 #define usbi_pending_events(ctx) \ 356 ((ctx)->event_flags || (ctx)->device_close \ 357 || !list_empty(&(ctx)->hotplug_msgs) || !list_empty(&(ctx)->completed_transfers)) 316 358 317 359 #ifdef USBI_TIMERFD_AVAILABLE … … 330 372 331 373 uint8_t bus_number; 374 uint8_t port_number; 375 struct libusb_device* parent_dev; 332 376 uint8_t device_address; 333 377 uint8_t num_configurations; … … 340 384 int attached; 341 385 342 unsigned char os_priv[0]; 386 unsigned char os_priv 387 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 388 [] /* valid C99 code */ 389 #else 390 [0] /* non-standard, but usually working code */ 391 #endif 392 #if defined(OS_SUNOS) 393 __attribute__ ((aligned (8))); 394 #else 395 ; 396 #endif 343 397 }; 344 398 … … 350 404 struct list_head list; 351 405 struct libusb_device *dev; 352 unsigned char os_priv[0]; 406 int auto_detach_kernel_driver; 407 unsigned char os_priv 408 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 409 [] /* valid C99 code */ 410 #else 411 [0] /* non-standard, but usually working code */ 412 #endif 413 #if defined(OS_SUNOS) 414 __attribute__ ((aligned (8))); 415 #else 416 ; 417 #endif 353 418 }; 354 419 355 420 enum { 356 357 421 USBI_CLOCK_MONOTONIC, 422 USBI_CLOCK_REALTIME 358 423 }; 359 424 … … 374 439 int num_iso_packets; 375 440 struct list_head list; 441 struct list_head completed_list; 376 442 struct timeval timeout; 377 443 int transferred; 378 uint8_t flags; 444 uint32_t stream_id; 445 uint8_t state_flags; /* Protected by usbi_transfer->lock */ 446 uint8_t timeout_flags; /* Protected by the flying_stransfers_lock */ 379 447 380 448 /* this lock is held during libusb_submit_transfer() and … … 384 452 * cancelling the transfer from another thread while you are processing 385 453 * its completion (presumably there would be races within your OS backend 386 * if this were possible). */ 454 * if this were possible). 455 * Note paths taking both this and the flying_transfers_lock must 456 * always take the flying_transfers_lock first */ 387 457 usbi_mutex_t lock; 388 458 }; 389 459 390 enum usbi_transfer_flags { 391 /* The transfer has timed out */ 392 USBI_TRANSFER_TIMED_OUT = 1 << 0, 393 460 enum usbi_transfer_state_flags { 461 /* Transfer successfully submitted by backend */ 462 USBI_TRANSFER_IN_FLIGHT = 1 << 0, 463 464 /* Cancellation was requested via libusb_cancel_transfer() */ 465 USBI_TRANSFER_CANCELLING = 1 << 1, 466 467 /* Operation on the transfer failed because the device disappeared */ 468 USBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 2, 469 }; 470 471 enum usbi_transfer_timeout_flags { 394 472 /* Set by backend submit_transfer() if the OS handles timeout */ 395 USBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 1, 396 397 /* Cancellation was requested via libusb_cancel_transfer() */ 398 USBI_TRANSFER_CANCELLING = 1 << 2, 399 400 /* Operation on the transfer failed because the device disappeared */ 401 USBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 3, 402 403 /* Set by backend submit_transfer() if the fds in use were updated */ 404 USBI_TRANSFER_UPDATED_FDS = 1 << 4, 405 }; 406 407 #define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \ 408 ((struct libusb_transfer *)(((unsigned char *)(transfer)) \ 473 USBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 0, 474 475 /* The transfer timeout has been handled */ 476 USBI_TRANSFER_TIMEOUT_HANDLED = 1 << 1, 477 478 /* The transfer timeout was successfully processed */ 479 USBI_TRANSFER_TIMED_OUT = 1 << 2, 480 }; 481 482 #define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \ 483 ((struct libusb_transfer *)(((unsigned char *)(transfer)) \ 409 484 + sizeof(struct usbi_transfer))) 410 #define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) 411 ((struct usbi_transfer *)(((unsigned char *)(transfer)) 485 #define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \ 486 ((struct usbi_transfer *)(((unsigned char *)(transfer)) \ 412 487 - sizeof(struct usbi_transfer))) 413 488 … … 424 499 /* All standard descriptors have these 2 fields in common */ 425 500 struct usb_descriptor_header { 426 uint8_t 427 uint8_t 501 uint8_t bLength; 502 uint8_t bDescriptorType; 428 503 }; 429 504 … … 438 513 unsigned long session_id); 439 514 int usbi_sanitize_device(struct libusb_device *dev); 440 void usbi_handle_disconnect(struct libusb_device_handle * handle);515 void usbi_handle_disconnect(struct libusb_device_handle *dev_handle); 441 516 442 517 int usbi_handle_transfer_completion(struct usbi_transfer *itransfer, 443 518 enum libusb_transfer_status status); 444 519 int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer); 520 void usbi_signal_transfer_completion(struct usbi_transfer *transfer); 445 521 446 522 int usbi_parse_descriptor(const unsigned char *source, const char *descriptor, … … 453 529 void usbi_disconnect_device (struct libusb_device *dev); 454 530 455 /* polling */ 531 int usbi_signal_event(struct libusb_context *ctx); 532 int usbi_clear_event(struct libusb_context *ctx); 533 534 /* Internal abstraction for poll (needs struct usbi_transfer on Windows) */ 535 #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD) ||\ 536 defined(OS_HAIKU) || defined(OS_SUNOS) 537 #include <unistd.h> 538 #include "os/poll_posix.h" 539 #elif defined(OS_WINDOWS) || defined(OS_WINCE) 540 #include "os/poll_windows.h" 541 #endif 542 543 #if (defined(OS_WINDOWS) || defined(OS_WINCE)) && !defined(__GNUC__) 544 #define snprintf _snprintf 545 #define vsnprintf _vsnprintf 546 int usbi_gettimeofday(struct timeval *tp, void *tzp); 547 #define LIBUSB_GETTIMEOFDAY_WIN32 548 #define HAVE_USBI_GETTIMEOFDAY 549 #else 550 #ifdef HAVE_GETTIMEOFDAY 551 #define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz)) 552 #define HAVE_USBI_GETTIMEOFDAY 553 #endif 554 #endif 456 555 457 556 struct usbi_pollfd { … … 464 563 int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events); 465 564 void usbi_remove_pollfd(struct libusb_context *ctx, int fd); 466 void usbi_fd_notification(struct libusb_context *ctx);467 565 468 566 /* device discovery */ … … 476 574 size_t len; 477 575 size_t capacity; 478 struct libusb_device *devices[0]; 576 struct libusb_device *devices 577 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) 578 [] /* valid C99 code */ 579 #else 580 [0] /* non-standard, but usually working code */ 581 #endif 582 ; 479 583 }; 480 584 … … 489 593 /* A human-readable name for your backend, e.g. "Linux usbfs" */ 490 594 const char *name; 595 596 /* Binary mask for backend specific capabilities */ 597 uint32_t caps; 491 598 492 599 /* Perform initialization of your backend. You might use this function … … 525 632 * After computing a session ID for a device, call 526 633 * usbi_get_device_by_session_id(). This function checks if libusb already 527 * knows about the device, and if so, it provides you with a libusb_device528 * structure for it.634 * knows about the device, and if so, it provides you with a reference 635 * to a libusb_device structure for it. 529 636 * 530 637 * If usbi_get_device_by_session_id() returns NULL, it is time to allocate … … 555 662 * of USB devices connected to the system. 556 663 * 664 * If the backend has hotplug support, this function is not used! 665 * 557 666 * Return 0 on success, or a LIBUSB_ERROR code on failure. 558 667 */ 559 668 int (*get_device_list)(struct libusb_context *ctx, 560 669 struct discovered_devs **discdevs); 670 671 /* Apps which were written before hotplug support, may listen for 672 * hotplug events on their own and call libusb_get_device_list on 673 * device addition. In this case libusb_get_device_list will likely 674 * return a list without the new device in there, as the hotplug 675 * event thread will still be busy enumerating the device, which may 676 * take a while, or may not even have seen the event yet. 677 * 678 * To avoid this libusb_get_device_list will call this optional 679 * function for backends with hotplug support before copying 680 * ctx->usb_devs to the user. In this function the backend should 681 * ensure any pending hotplug events are fully processed before 682 * returning. 683 * 684 * Optional, should be implemented by backends with hotplug support. 685 */ 686 void (*hotplug_poll)(void); 561 687 562 688 /* Open a device for I/O and other USB operations. The device handle … … 585 711 * do this for you. 586 712 */ 587 int (*open)(struct libusb_device_handle * handle);713 int (*open)(struct libusb_device_handle *dev_handle); 588 714 589 715 /* Close a device such that the handle cannot be used again. Your backend … … 595 721 * This function is called when the user closes a device handle. 596 722 */ 597 void (*close)(struct libusb_device_handle * handle);723 void (*close)(struct libusb_device_handle *dev_handle); 598 724 599 725 /* Retrieve the device descriptor from a device. … … 663 789 * set the host_endian output parameter to "1". 664 790 * 665 * Return 0on success or a LIBUSB_ERROR code on failure.791 * Return the length read on success or a LIBUSB_ERROR code on failure. 666 792 */ 667 793 int (*get_config_descriptor)(struct libusb_device *device, 668 794 uint8_t config_index, unsigned char *buffer, size_t len, 795 int *host_endian); 796 797 /* Like get_config_descriptor but then by bConfigurationValue instead 798 * of by index. 799 * 800 * Optional, if not present the core will call get_config_descriptor 801 * for all configs until it finds the desired bConfigurationValue. 802 * 803 * Returns a pointer to the raw-descriptor in *buffer, this memory 804 * is valid as long as device is valid. 805 * 806 * Returns the length of the returned raw-descriptor on success, 807 * or a LIBUSB_ERROR code on failure. 808 */ 809 int (*get_config_descriptor_by_value)(struct libusb_device *device, 810 uint8_t bConfigurationValue, unsigned char **buffer, 669 811 int *host_endian); 670 812 … … 686 828 * - another LIBUSB_ERROR code on other failure. 687 829 */ 688 int (*get_configuration)(struct libusb_device_handle * handle, int *config);830 int (*get_configuration)(struct libusb_device_handle *dev_handle, int *config); 689 831 690 832 /* Set the active configuration for a device. … … 703 845 * - another LIBUSB_ERROR code on other failure. 704 846 */ 705 int (*set_configuration)(struct libusb_device_handle * handle, int config);847 int (*set_configuration)(struct libusb_device_handle *dev_handle, int config); 706 848 707 849 /* Claim an interface. When claimed, the application can then perform … … 711 853 * Interface claiming is a logical operation that simply ensures that 712 854 * no other drivers/applications are using the interface, and after 713 * claiming, no other drivers/applicatio sncan use the interface because855 * claiming, no other drivers/applications can use the interface because 714 856 * we now "own" it. 715 857 * … … 722 864 * - another LIBUSB_ERROR code on other failure 723 865 */ 724 int (*claim_interface)(struct libusb_device_handle * handle, int interface_number);866 int (*claim_interface)(struct libusb_device_handle *dev_handle, int interface_number); 725 867 726 868 /* Release a previously claimed interface. … … 739 881 * - another LIBUSB_ERROR code on other failure 740 882 */ 741 int (*release_interface)(struct libusb_device_handle * handle, int interface_number);883 int (*release_interface)(struct libusb_device_handle *dev_handle, int interface_number); 742 884 743 885 /* Set the alternate setting for an interface. … … 755 897 * - another LIBUSB_ERROR code on other failure 756 898 */ 757 int (*set_interface_altsetting)(struct libusb_device_handle * handle,899 int (*set_interface_altsetting)(struct libusb_device_handle *dev_handle, 758 900 int interface_number, int altsetting); 759 901 … … 769 911 * - another LIBUSB_ERROR code on other failure 770 912 */ 771 int (*clear_halt)(struct libusb_device_handle * handle,913 int (*clear_halt)(struct libusb_device_handle *dev_handle, 772 914 unsigned char endpoint); 773 915 774 916 /* Perform a USB port reset to reinitialize a device. 775 917 * 776 * If possible, the handle should still be usable after the reset918 * If possible, the device handle should still be usable after the reset 777 919 * completes, assuming that the device descriptors did not change during 778 920 * reset and all previous interface state can be restored. … … 788 930 * - another LIBUSB_ERROR code on other failure 789 931 */ 790 int (*reset_device)(struct libusb_device_handle *handle); 932 int (*reset_device)(struct libusb_device_handle *dev_handle); 933 934 /* Alloc num_streams usb3 bulk streams on the passed in endpoints */ 935 int (*alloc_streams)(struct libusb_device_handle *dev_handle, 936 uint32_t num_streams, unsigned char *endpoints, int num_endpoints); 937 938 /* Free usb3 bulk streams allocated with alloc_streams */ 939 int (*free_streams)(struct libusb_device_handle *dev_handle, 940 unsigned char *endpoints, int num_endpoints); 941 942 /* Allocate persistent DMA memory for the given device, suitable for 943 * zerocopy. May return NULL on failure. Optional to implement. 944 */ 945 unsigned char *(*dev_mem_alloc)(struct libusb_device_handle *handle, 946 size_t len); 947 948 /* Free memory allocated by dev_mem_alloc. */ 949 int (*dev_mem_free)(struct libusb_device_handle *handle, 950 unsigned char *buffer, size_t len); 791 951 792 952 /* Determine if a kernel driver is active on an interface. Optional. … … 802 962 * - another LIBUSB_ERROR code on other failure 803 963 */ 804 int (*kernel_driver_active)(struct libusb_device_handle * handle,964 int (*kernel_driver_active)(struct libusb_device_handle *dev_handle, 805 965 int interface_number); 806 966 … … 818 978 * - another LIBUSB_ERROR code on other failure 819 979 */ 820 int (*detach_kernel_driver)(struct libusb_device_handle * handle,980 int (*detach_kernel_driver)(struct libusb_device_handle *dev_handle, 821 981 int interface_number); 822 982 … … 835 995 * - another LIBUSB_ERROR code on other failure 836 996 */ 837 int (*attach_kernel_driver)(struct libusb_device_handle * handle,997 int (*attach_kernel_driver)(struct libusb_device_handle *dev_handle, 838 998 int interface_number); 839 999 … … 851 1011 * 852 1012 * This function must not block. 1013 * 1014 * This function gets called with the flying_transfers_lock locked! 853 1015 * 854 1016 * Return: … … 879 1041 void (*clear_transfer_priv)(struct usbi_transfer *itransfer); 880 1042 881 /* Handle any pending events. This involves monitoring any active 882 * transfers and processing their completion or cancellation. 1043 /* Handle any pending events on file descriptors. Optional. 1044 * 1045 * Provide this function when file descriptors directly indicate device 1046 * or transfer activity. If your backend does not have such file descriptors, 1047 * implement the handle_transfer_completion function below. 1048 * 1049 * This involves monitoring any active transfers and processing their 1050 * completion or cancellation. 883 1051 * 884 1052 * The function is passed an array of pollfd structures (size nfds) … … 908 1076 struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready); 909 1077 1078 /* Handle transfer completion. Optional. 1079 * 1080 * Provide this function when there are no file descriptors available 1081 * that directly indicate device or transfer activity. If your backend does 1082 * have such file descriptors, implement the handle_events function above. 1083 * 1084 * Your backend must tell the library when a transfer has completed by 1085 * calling usbi_signal_transfer_completion(). You should store any private 1086 * information about the transfer and its completion status in the transfer's 1087 * private backend data. 1088 * 1089 * During event handling, this function will be called on each transfer for 1090 * which usbi_signal_transfer_completion() was called. 1091 * 1092 * For any cancelled transfers, call usbi_handle_transfer_cancellation(). 1093 * For completed transfers, call usbi_handle_transfer_completion(). 1094 * For control/bulk/interrupt transfers, populate the "transferred" 1095 * element of the appropriate usbi_transfer structure before calling the 1096 * above functions. For isochronous transfers, populate the status and 1097 * transferred fields of the iso packet descriptors of the transfer. 1098 * 1099 * Return 0 on success, or a LIBUSB_ERROR code on failure. 1100 */ 1101 int (*handle_transfer_completion)(struct usbi_transfer *itransfer); 1102 910 1103 /* Get time from specified clock. At least two clocks must be implemented 911 1104 by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC. … … 938 1131 */ 939 1132 size_t transfer_priv_size; 940 941 /* Mumber of additional bytes for os_priv for each iso packet.942 * Can your backend use this? */943 /* FIXME: linux can't use this any more. if other OS's cannot either,944 * then remove this */945 size_t add_iso_packet_size;946 1133 }; 947 1134 … … 952 1139 extern const struct usbi_os_backend openbsd_backend; 953 1140 extern const struct usbi_os_backend os2_backend; 1141 extern const struct usbi_os_backend netbsd_backend; 954 1142 extern const struct usbi_os_backend windows_backend; 1143 extern const struct usbi_os_backend usbdk_backend; 1144 extern const struct usbi_os_backend wince_backend; 1145 extern const struct usbi_os_backend haiku_usb_raw_backend; 1146 extern const struct usbi_os_backend sunos_backend; 955 1147 956 1148 extern struct list_head active_contexts_list; 957 1149 extern usbi_mutex_static_t active_contexts_lock; 958 1150 959 #endif 960 1151 #ifdef __cplusplus 1152 } 1153 #endif 1154 1155 #endif -
TabularUnified libusb1/trunk/libusb/os/darwin_usb.c ¶
r1876 r1882 2 2 /* 3 3 * darwin backend for libusb 1.0 4 * Copyright (C) 2008-2013Nathan Hjelm <hjelmn@users.sourceforge.net>4 * Copyright © 2008-2016 Nathan Hjelm <hjelmn@users.sourceforge.net> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 19 19 */ 20 20 21 #include <config.h> 21 #include "config.h" 22 #include <time.h> 22 23 #include <ctype.h> 23 24 #include <errno.h> … … 29 30 #include <unistd.h> 30 31 #include <fcntl.h> 31 #include < libkern/OSAtomic.h>32 #include <sys/sysctl.h> 32 33 33 34 #include <mach/clock.h> … … 37 38 38 39 #include <AvailabilityMacros.h> 39 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 40 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && MAC_OS_X_VERSION_MIN_REQUIRED < 101200 40 41 #include <objc/objc-auto.h> 42 #endif 43 44 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 45 /* Apple deprecated the darwin atomics in 10.12 in favor of C11 atomics */ 46 #include <stdatomic.h> 47 #define libusb_darwin_atomic_fetch_add(x, y) atomic_fetch_add(x, y) 48 49 _Atomic int32_t initCount = ATOMIC_VAR_INIT(0); 50 #else 51 /* use darwin atomics if the target is older than 10.12 */ 52 #include <libkern/OSAtomic.h> 53 54 /* OSAtomicAdd32Barrier returns the new value */ 55 #define libusb_darwin_atomic_fetch_add(x, y) (OSAtomicAdd32Barrier(y, x) - y) 56 57 static volatile int32_t initCount = 0; 41 58 #endif 42 59 … … 47 64 static pthread_cond_t libusb_darwin_at_cond = PTHREAD_COND_INITIALIZER; 48 65 66 static pthread_once_t darwin_init_once = PTHREAD_ONCE_INIT; 67 49 68 static clock_serv_t clock_realtime; 50 69 static clock_serv_t clock_monotonic; 51 70 52 71 static CFRunLoopRef libusb_darwin_acfl = NULL; /* event cf loop */ 53 static volatile int32_t initCount = 0; 72 static CFRunLoopSourceRef libusb_darwin_acfls = NULL; /* shutdown signal for event cf loop */ 73 74 static usbi_mutex_t darwin_cached_devices_lock = PTHREAD_MUTEX_INITIALIZER; 75 static struct list_head darwin_cached_devices = {&darwin_cached_devices, &darwin_cached_devices}; 76 static char *darwin_device_class = kIOUSBDeviceClassName; 77 78 #define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev)) 54 79 55 80 /* async event thread */ … … 63 88 64 89 static int darwin_scan_devices(struct libusb_context *ctx); 65 static int process_new_device (struct libusb_context *ctx, usb_device_t **device, UInt32 locationID);90 static int process_new_device (struct libusb_context *ctx, io_service_t service); 66 91 67 92 #if defined(ENABLE_LOGGING) 68 93 static const char *darwin_error_str (int result) { 94 static char string_buffer[50]; 69 95 switch (result) { 70 96 case kIOReturnSuccess: … … 94 120 case kIOReturnCannotWire: 95 121 return "physical memory can not be wired down"; 122 case kIOReturnNoResources: 123 return "out of resources"; 124 case kIOUSBHighSpeedSplitError: 125 return "high speed split error"; 96 126 default: 97 return "unknown error"; 127 snprintf(string_buffer, sizeof(string_buffer), "unknown error (0x%x)", result); 128 return string_buffer; 98 129 } 99 130 } … … 125 156 } 126 157 127 128 static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) { 158 /* this function must be called with the darwin_cached_devices_lock held */ 159 static void darwin_deref_cached_device(struct darwin_cached_device *cached_dev) { 160 cached_dev->refcount--; 161 /* free the device and remove it from the cache */ 162 if (0 == cached_dev->refcount) { 163 list_del(&cached_dev->list); 164 165 (*(cached_dev->device))->Release(cached_dev->device); 166 free (cached_dev); 167 } 168 } 169 170 static void darwin_ref_cached_device(struct darwin_cached_device *cached_dev) { 171 cached_dev->refcount++; 172 } 173 174 static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp, struct darwin_interface **interface_out) { 129 175 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; 130 176 … … 134 180 int8_t i, iface; 135 181 136 usbi_ info (HANDLE_CTX(dev_handle),"converting ep address 0x%02x to pipeRef and interface", ep);182 usbi_dbg ("converting ep address 0x%02x to pipeRef and interface", ep); 137 183 138 184 for (iface = 0 ; iface < USB_MAXINTERFACES ; iface++) { … … 143 189 if (cInterface->endpoint_addrs[i] == ep) { 144 190 *pipep = i + 1; 145 *ifcp = iface; 146 usbi_info (HANDLE_CTX(dev_handle), "pipe %d on interface %d matches", *pipep, *ifcp); 191 192 if (ifcp) 193 *ifcp = iface; 194 195 if (interface_out) 196 *interface_out = cInterface; 197 198 usbi_dbg ("pipe %d on interface %d matches", *pipep, iface); 147 199 return 0; 148 200 } … … 154 206 usbi_warn (HANDLE_CTX(dev_handle), "no pipeRef found with endpoint address 0x%02x.", ep); 155 207 156 return -1;208 return LIBUSB_ERROR_NOT_FOUND; 157 209 } 158 210 159 211 static int usb_setup_device_iterator (io_iterator_t *deviceIterator, UInt32 location) { 160 CFMutableDictionaryRef matchingDict = IOServiceMatching( kIOUSBDeviceClassName);212 CFMutableDictionaryRef matchingDict = IOServiceMatching(darwin_device_class); 161 213 162 214 if (!matchingDict) … … 187 239 } 188 240 189 static usb_device_t **usb_get_next_device (io_iterator_t deviceIterator, UInt32 *locationp) { 241 /* Returns 1 on success, 0 on failure. */ 242 static int get_ioregistry_value_number (io_service_t service, CFStringRef property, CFNumberType type, void *p) { 243 CFTypeRef cfNumber = IORegistryEntryCreateCFProperty (service, property, kCFAllocatorDefault, 0); 244 int ret = 0; 245 246 if (cfNumber) { 247 if (CFGetTypeID(cfNumber) == CFNumberGetTypeID()) { 248 ret = CFNumberGetValue(cfNumber, type, p); 249 } 250 251 CFRelease (cfNumber); 252 } 253 254 return ret; 255 } 256 257 static int get_ioregistry_value_data (io_service_t service, CFStringRef property, ssize_t size, void *p) { 258 CFTypeRef cfData = IORegistryEntryCreateCFProperty (service, property, kCFAllocatorDefault, 0); 259 int ret = 0; 260 261 if (cfData) { 262 if (CFGetTypeID (cfData) == CFDataGetTypeID ()) { 263 CFIndex length = CFDataGetLength (cfData); 264 if (length < size) { 265 size = length; 266 } 267 268 CFDataGetBytes (cfData, CFRangeMake(0, size), p); 269 ret = 1; 270 } 271 272 CFRelease (cfData); 273 } 274 275 return ret; 276 } 277 278 static usb_device_t **darwin_device_from_service (io_service_t service) 279 { 190 280 io_cf_plugin_ref_t *plugInInterface = NULL; 191 281 usb_device_t **device; 192 io_service_t usbDevice; 193 long result; 282 kern_return_t result; 194 283 SInt32 score; 195 284 196 if (!IOIteratorIsValid (deviceIterator)) 285 result = IOCreatePlugInInterfaceForService(service, kIOUSBDeviceUserClientTypeID, 286 kIOCFPlugInInterfaceID, &plugInInterface, 287 &score); 288 289 if (kIOReturnSuccess != result || !plugInInterface) { 290 usbi_dbg ("could not set up plugin for service: %s", darwin_error_str (result)); 197 291 return NULL; 198 199 200 while ((usbDevice = IOIteratorNext(deviceIterator))) { 201 result = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, 202 kIOCFPlugInInterfaceID, &plugInInterface, 203 &score); 204 205 /* we are done with the usb_device_t */ 206 (void)IOObjectRelease(usbDevice); 207 if (kIOReturnSuccess == result && plugInInterface) 208 break; 209 210 usbi_dbg ("libusb/darwin.c usb_get_next_device: could not set up plugin for service: %s\n", darwin_error_str (result)); 211 } 212 213 if (!usbDevice) 214 return NULL; 292 } 215 293 216 294 (void)(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID), … … 219 297 (*plugInInterface)->Release (plugInInterface); 220 298 221 /* get the location from the device */222 if (locationp)223 (*(device))->GetLocationID(device, locationp);224 225 299 return device; 226 300 } … … 228 302 static void darwin_devices_attached (void *ptr, io_iterator_t add_devices) { 229 303 struct libusb_context *ctx; 230 usb_device_t **device; 231 UInt32 location; 304 io_service_t service; 232 305 233 306 usbi_mutex_lock(&active_contexts_lock); 234 307 235 while (( device = usb_get_next_device (add_devices, &location))) {308 while ((service = IOIteratorNext(add_devices))) { 236 309 /* add this device to each active context's device list */ 237 310 list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) { 238 process_new_device (ctx, device, location); 239 } 240 241 /* release extra reference */ 242 (*device)->Release (device); 311 process_new_device (ctx, service);; 312 } 313 314 IOObjectRelease(service); 243 315 } 244 316 … … 249 321 struct libusb_device *dev = NULL; 250 322 struct libusb_context *ctx; 251 struct darwin_ device_priv *dpriv;323 struct darwin_cached_device *old_device; 252 324 253 325 io_service_t device; 254 bool locationValid; 255 UInt32 location; 256 CFTypeRef locationCF; 326 UInt64 session; 327 int ret; 328 329 usbi_mutex_lock(&active_contexts_lock); 257 330 258 331 while ((device = IOIteratorNext (rem_devices)) != 0) { 259 332 /* get the location from the i/o registry */ 260 locationCF = IORegistryEntryCreateCFProperty (device, CFSTR(kUSBDevicePropertyLocationID), kCFAllocatorDefault, 0); 261 333 ret = get_ioregistry_value_number (device, CFSTR("sessionID"), kCFNumberSInt64Type, &session); 262 334 IOObjectRelease (device); 263 264 if (!locationCF) 335 if (!ret) 265 336 continue; 266 337 267 locationValid = CFGetTypeID(locationCF) == CFNumberGetTypeID() && 268 CFNumberGetValue(locationCF, kCFNumberSInt32Type, &location); 269 270 CFRelease (locationCF); 271 272 if (!locationValid) 273 continue; 274 275 usbi_mutex_lock(&active_contexts_lock); 338 /* we need to match darwin_ref_cached_device call made in darwin_get_cached_device function 339 otherwise no cached device will ever get freed */ 340 usbi_mutex_lock(&darwin_cached_devices_lock); 341 list_for_each_entry(old_device, &darwin_cached_devices, list, struct darwin_cached_device) { 342 if (old_device->session == session) { 343 darwin_deref_cached_device (old_device); 344 break; 345 } 346 } 347 usbi_mutex_unlock(&darwin_cached_devices_lock); 276 348 277 349 list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) { 278 usbi_dbg ("libusb/darwin.c darwin_devices_detached: notifying context %p of device disconnect", ctx); 279 280 dev = usbi_get_device_by_session_id (ctx, location); 281 if (!dev) { 282 continue; 350 usbi_dbg ("notifying context %p of device disconnect", ctx); 351 352 dev = usbi_get_device_by_session_id(ctx, (unsigned long) session); 353 if (dev) { 354 /* signal the core that this device has been disconnected. the core will tear down this device 355 when the reference count reaches 0 */ 356 usbi_disconnect_device(dev); 357 libusb_unref_device(dev); 283 358 } 284 dpriv = (struct darwin_device_priv *) dev->os_priv; 285 286 /* signal the core that this device has been disconnected. the core will tear down this device 287 when the reference count reaches 0 */ 288 usbi_disconnect_device (dev); 289 } 290 291 usbi_mutex_unlock(&active_contexts_lock); 292 } 359 } 360 } 361 362 usbi_mutex_unlock(&active_contexts_lock); 363 } 364 365 static void darwin_hotplug_poll (void) 366 { 367 /* not sure if 5 seconds will be too long/short but it should work ok */ 368 mach_timespec_t timeout = {.tv_sec = 5, .tv_nsec = 0}; 369 370 /* since a kernel thread may nodify the IOInterators used for 371 * hotplug notidication we can't just clear the iterators. 372 * instead just wait until all IOService providers are quiet */ 373 (void) IOKitWaitQuiet (kIOMasterPortDefault, &timeout); 293 374 } 294 375 … … 305 386 CFRunLoopRef runloop; 306 387 388 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 307 389 /* Set this thread's name, so it can be seen in the debugger 308 390 and crash reports. */ 309 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060310 391 pthread_setname_np ("org.libusb.device-hotplug"); 311 392 #endif 312 393 394 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && MAC_OS_X_VERSION_MIN_REQUIRED < 101200 313 395 /* Tell the Objective-C garbage collector about this thread. 314 396 This is required because, unlike NSThreads, pthreads are 315 397 not automatically registered. Although we don't use 316 Objective-C, we use CoreFoundation, which does. */ 317 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 398 Objective-C, we use CoreFoundation, which does. 399 Garbage collection support was entirely removed in 10.12, 400 so don't bother there. */ 318 401 objc_registerThreadWithCollector(); 319 402 #endif 320 403 321 404 /* hotplug (device arrival/removal) sources */ 405 CFRunLoopSourceContext libusb_shutdown_cfsourcectx; 322 406 CFRunLoopSourceRef libusb_notification_cfsource; 323 407 io_notification_port_t libusb_notification_port; … … 325 409 io_iterator_t libusb_add_device_iterator; 326 410 327 usbi_ info (ctx,"creating hotplug event source");411 usbi_dbg ("creating hotplug event source"); 328 412 329 413 runloop = CFRunLoopGetCurrent (); 330 414 CFRetain (runloop); 415 416 /* add the shutdown cfsource to the run loop */ 417 memset(&libusb_shutdown_cfsourcectx, 0, sizeof(libusb_shutdown_cfsourcectx)); 418 libusb_shutdown_cfsourcectx.info = runloop; 419 libusb_shutdown_cfsourcectx.perform = (void (*)(void *))CFRunLoopStop; 420 libusb_darwin_acfls = CFRunLoopSourceCreate(NULL, 0, &libusb_shutdown_cfsourcectx); 421 CFRunLoopAddSource(runloop, libusb_darwin_acfls, kCFRunLoopDefaultMode); 331 422 332 423 /* add the notification port to the run loop */ … … 337 428 /* create notifications for removed devices */ 338 429 kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification, 339 IOServiceMatching( kIOUSBDeviceClassName),340 (IOServiceMatchingCallback)darwin_devices_detached,341 (void *)ctx, &libusb_rem_device_iterator);430 IOServiceMatching(darwin_device_class), 431 darwin_devices_detached, 432 ctx, &libusb_rem_device_iterator); 342 433 343 434 if (kresult != kIOReturnSuccess) { … … 348 439 349 440 /* create notifications for attached devices */ 350 kresult = IOServiceAddMatchingNotification 351 IOServiceMatching( kIOUSBDeviceClassName),352 (IOServiceMatchingCallback)darwin_devices_attached,353 (void *)ctx, &libusb_add_device_iterator);441 kresult = IOServiceAddMatchingNotification(libusb_notification_port, kIOFirstMatchNotification, 442 IOServiceMatching(darwin_device_class), 443 darwin_devices_attached, 444 ctx, &libusb_add_device_iterator); 354 445 355 446 if (kresult != kIOReturnSuccess) { … … 363 454 darwin_clear_iterator (libusb_add_device_iterator); 364 455 365 usbi_ info (ctx,"darwin event thread ready to receive events");456 usbi_dbg ("darwin event thread ready to receive events"); 366 457 367 458 /* signal the main thread that the hotplug runloop has been created. */ … … 374 465 CFRunLoopRun(); 375 466 376 usbi_info (ctx, "darwin event thread exiting"); 467 usbi_dbg ("darwin event thread exiting"); 468 469 /* remove the notification cfsource */ 470 CFRunLoopRemoveSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode); 471 472 /* remove the shutdown cfsource */ 473 CFRunLoopRemoveSource(runloop, libusb_darwin_acfls, kCFRunLoopDefaultMode); 377 474 378 475 /* delete notification port */ … … 383 480 IOObjectRelease (libusb_add_device_iterator); 384 481 482 CFRelease (libusb_darwin_acfls); 385 483 CFRelease (runloop); 386 484 485 libusb_darwin_acfls = NULL; 387 486 libusb_darwin_acfl = NULL; 388 487 389 488 pthread_exit (NULL); 489 } 490 491 /* cleanup function to destroy cached devices */ 492 static void __attribute__((destructor)) _darwin_finalize(void) { 493 struct darwin_cached_device *dev, *next; 494 495 usbi_mutex_lock(&darwin_cached_devices_lock); 496 list_for_each_entry_safe(dev, next, &darwin_cached_devices, list, struct darwin_cached_device) { 497 darwin_deref_cached_device(dev); 498 } 499 usbi_mutex_unlock(&darwin_cached_devices_lock); 500 } 501 502 static void darwin_check_version (void) { 503 /* adjust for changes in the USB stack in xnu 15 */ 504 int sysctl_args[] = {CTL_KERN, KERN_OSRELEASE}; 505 long version; 506 char version_string[256] = {'\0',}; 507 size_t length = 256; 508 509 sysctl(sysctl_args, 2, version_string, &length, NULL, 0); 510 511 errno = 0; 512 version = strtol (version_string, NULL, 10); 513 if (0 == errno && version >= 15) { 514 darwin_device_class = "IOUSBHostDevice"; 515 } 390 516 } 391 517 … … 394 520 int rc; 395 521 522 rc = pthread_once (&darwin_init_once, darwin_check_version); 523 if (rc) { 524 return LIBUSB_ERROR_OTHER; 525 } 526 396 527 rc = darwin_scan_devices (ctx); 397 528 if (LIBUSB_SUCCESS != rc) { … … 399 530 } 400 531 401 if ( OSAtomicIncrement32Barrier(&initCount) == 1) {532 if (libusb_darwin_atomic_fetch_add (&initCount, 1) == 0) { 402 533 /* create the clocks that will be used */ 403 534 … … 407 538 mach_port_deallocate(mach_task_self(), host_self); 408 539 409 pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, (void *)ctx);540 pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, ctx); 410 541 411 542 pthread_mutex_lock (&libusb_darwin_at_mutex); 412 543 while (!libusb_darwin_acfl) 413 544 pthread_cond_wait (&libusb_darwin_at_cond, &libusb_darwin_at_mutex); 414 } 415 416 return 0; 545 pthread_mutex_unlock (&libusb_darwin_at_mutex); 546 } 547 548 return rc; 417 549 } 418 550 419 551 static void darwin_exit (void) { 420 if ( OSAtomicDecrement32Barrier(&initCount) == 0) {552 if (libusb_darwin_atomic_fetch_add (&initCount, -1) == 1) { 421 553 mach_port_deallocate(mach_task_self(), clock_realtime); 422 554 mach_port_deallocate(mach_task_self(), clock_monotonic); 423 555 424 556 /* stop the event runloop and wait for the thread to terminate. */ 425 CFRunLoopStop (libusb_darwin_acfl); 557 CFRunLoopSourceSignal(libusb_darwin_acfls); 558 CFRunLoopWakeUp (libusb_darwin_acfl); 426 559 pthread_join (libusb_darwin_at, NULL); 427 560 } … … 429 562 430 563 static int darwin_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian) { 431 struct darwin_ device_priv *priv = (struct darwin_device_priv *)dev->os_priv;564 struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev); 432 565 433 566 /* return cached copy */ … … 440 573 441 574 static int get_configuration_index (struct libusb_device *dev, int config_value) { 442 struct darwin_ device_priv *priv = (struct darwin_device_priv *)dev->os_priv;575 struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev); 443 576 UInt8 i, numConfig; 444 577 IOUSBConfigurationDescriptorPtr desc; … … 458 591 459 592 /* configuration not found */ 460 return LIBUSB_ERROR_ OTHER;593 return LIBUSB_ERROR_NOT_FOUND; 461 594 } 462 595 463 596 static int darwin_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) { 464 struct darwin_ device_priv *priv = (struct darwin_device_priv *)dev->os_priv;597 struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev); 465 598 int config_index; 466 599 467 600 if (0 == priv->active_config) 468 return LIBUSB_ERROR_ INVALID_PARAM;601 return LIBUSB_ERROR_NOT_FOUND; 469 602 470 603 config_index = get_configuration_index (dev, priv->active_config); … … 476 609 477 610 static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) { 478 struct darwin_ device_priv *priv = (struct darwin_device_priv *)dev->os_priv;611 struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev); 479 612 IOUSBConfigurationDescriptorPtr desc; 480 613 IOReturn kresult; 614 int ret; 481 615 482 616 if (!priv || !priv->device) … … 495 629 } 496 630 497 return darwin_to_libusb (kresult); 631 ret = darwin_to_libusb (kresult); 632 if (ret != LIBUSB_SUCCESS) 633 return ret; 634 635 return (int) len; 498 636 } 499 637 500 638 /* check whether the os has configured the device */ 501 static int darwin_check_configuration (struct libusb_context *ctx, struct libusb_device *dev, usb_device_t **darwin_device) {502 struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv;639 static int darwin_check_configuration (struct libusb_context *ctx, struct darwin_cached_device *dev) { 640 usb_device_t **darwin_device = dev->device; 503 641 504 642 IOUSBConfigurationDescriptorPtr configDesc; … … 508 646 io_service_t firstInterface; 509 647 510 if ( priv->dev_descriptor.bNumConfigurations < 1) {648 if (dev->dev_descriptor.bNumConfigurations < 1) { 511 649 usbi_err (ctx, "device has no configurations"); 512 650 return LIBUSB_ERROR_OTHER; /* no configurations at this speed so we can't use it */ 513 651 } 514 652 653 /* checking the configuration of a root hub simulation takes ~1 s in 10.11. the device is 654 not usable anyway */ 655 if (0x05ac == dev->dev_descriptor.idVendor && 0x8005 == dev->dev_descriptor.idProduct) { 656 usbi_dbg ("ignoring configuration on root hub simulation"); 657 dev->active_config = 0; 658 return 0; 659 } 660 515 661 /* find the first configuration */ 516 662 kresult = (*darwin_device)->GetConfigurationDescriptorPtr (darwin_device, 0, &configDesc); 517 priv->first_config = (kIOReturnSuccess == kresult) ? configDesc->bConfigurationValue : 1;663 dev->first_config = (kIOReturnSuccess == kresult) ? configDesc->bConfigurationValue : 1; 518 664 519 665 /* check if the device is already configured. there is probably a better way than iterating over the … … 541 687 542 688 /* device is configured */ 543 if ( priv->dev_descriptor.bNumConfigurations == 1)689 if (dev->dev_descriptor.bNumConfigurations == 1) 544 690 /* to avoid problems with some devices get the configurations value from the configuration descriptor */ 545 priv->active_config = priv->first_config;691 dev->active_config = dev->first_config; 546 692 else 547 693 /* devices with more than one configuration should work with GetConfiguration */ 548 (*darwin_device)->GetConfiguration (darwin_device, & priv->active_config);694 (*darwin_device)->GetConfiguration (darwin_device, &dev->active_config); 549 695 } else 550 696 /* not configured */ 551 priv->active_config = 0;697 dev->active_config = 0; 552 698 553 usbi_ info (ctx, "active config: %u, first config: %u", priv->active_config, priv->first_config);699 usbi_dbg ("active config: %u, first config: %u", dev->active_config, dev->first_config); 554 700 555 701 return 0; … … 557 703 558 704 static int darwin_request_descriptor (usb_device_t **device, UInt8 desc, UInt8 desc_index, void *buffer, size_t buffer_size) { 559 IOUSBDevRequest req;705 IOUSBDevRequestTO req; 560 706 561 707 memset (buffer, 0, buffer_size); … … 568 714 req.wLength = buffer_size; 569 715 req.pData = buffer; 570 571 return (*device)->DeviceRequest (device, &req); 572 } 573 574 static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct libusb_device *dev, usb_device_t **device) { 575 struct darwin_device_priv *priv; 576 int retries = 2, delay = 30000; 716 req.noDataTimeout = 20; 717 req.completionTimeout = 100; 718 719 return (*device)->DeviceRequestTO (device, &req); 720 } 721 722 static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct darwin_cached_device *dev) { 723 usb_device_t **device = dev->device; 724 int retries = 1, delay = 30000; 577 725 int unsuspended = 0, try_unsuspend = 1, try_reconfigure = 1; 578 726 int is_open = 0; … … 581 729 UInt16 idProduct, idVendor; 582 730 731 dev->can_enumerate = 0; 732 583 733 (*device)->GetDeviceClass (device, &bDeviceClass); 584 734 (*device)->GetDeviceProduct (device, &idProduct); 585 735 (*device)->GetDeviceVendor (device, &idVendor); 586 736 587 priv = (struct darwin_device_priv *)dev->os_priv;588 589 /* try to open the device (we can usually continue even if this fails)*/737 /* According to Apple's documentation the device must be open for DeviceRequest but we may not be able to open some 738 * devices and Apple's USB Prober doesn't bother to open the device before issuing a descriptor request. Still, 739 * to follow the spec as closely as possible, try opening the device */ 590 740 is_open = ((*device)->USBDeviceOpenSeize(device) == kIOReturnSuccess); 591 741 592 /**** retrieve device descriptor ****/593 742 do { 594 /* according to Apple's documentation the device must be open for DeviceRequest but we may not be able to open some 595 * devices and Apple's USB Prober doesn't bother to open the device before issuing a descriptor request. Still, 596 * to follow the spec as closely as possible, try opening the device */ 597 ret = darwin_request_descriptor (device, kUSBDeviceDesc, 0, &priv->dev_descriptor, sizeof(priv->dev_descriptor)); 598 599 600 if (kIOReturnOverrun == ret && kUSBDeviceDesc == priv->dev_descriptor.bDescriptorType) 743 /**** retrieve device descriptor ****/ 744 ret = darwin_request_descriptor (device, kUSBDeviceDesc, 0, &dev->dev_descriptor, sizeof(dev->dev_descriptor)); 745 746 if (kIOReturnOverrun == ret && kUSBDeviceDesc == dev->dev_descriptor.bDescriptorType) 601 747 /* received an overrun error but we still received a device descriptor */ 602 748 ret = kIOReturnSuccess; … … 607 753 } 608 754 609 if (kIOReturnSuccess == ret && (0 == priv->dev_descriptor.bNumConfigurations ||610 0 == priv->dev_descriptor.bcdUSB)) {755 if (kIOReturnSuccess == ret && (0 == dev->dev_descriptor.bNumConfigurations || 756 0 == dev->dev_descriptor.bcdUSB)) { 611 757 /* work around for incorrectly configured devices */ 612 758 if (try_reconfigure && is_open) { … … 626 772 /* device may be suspended. unsuspend it and try again */ 627 773 #if DeviceVersion >= 320 628 UInt32 info ;774 UInt32 info = 0; 629 775 630 776 /* IOUSBFamily 320+ provides a way to detect device suspension but earlier versions do not */ 631 777 (void)(*device)->GetUSBDeviceInformation (device, &info); 632 778 633 try_unsuspend = info & (1 << kUSBInformationDeviceIsSuspendedBit); 779 /* note that the device was suspended */ 780 if (info & (1 << kUSBInformationDeviceIsSuspendedBit) || 0 == info) 781 try_unsuspend = 1; 634 782 #endif 635 783 636 784 if (try_unsuspend) { 637 /* resumethe device */785 /* try to unsuspend the device */ 638 786 ret2 = (*device)->USBDeviceSuspend (device, 0); 639 787 if (kIOReturnSuccess != ret2) { … … 651 799 usbi_dbg("kernel responded with code: 0x%08x. sleeping for %d ms before trying again", ret, delay/1000); 652 800 /* sleep for a little while before trying again */ 653 usleep (delay);801 nanosleep(&(struct timespec){delay / 1000000, (delay * 1000) % 1000000000UL}, NULL); 654 802 } 655 803 } while (kIOReturnSuccess != ret && retries--); … … 665 813 /* a debug message was already printed out for this error */ 666 814 if (LIBUSB_CLASS_HUB == bDeviceClass) 667 usbi_dbg ("could not retrieve device descriptor %.4x:%.4x: %s. skipping device", idVendor, idProduct, darwin_error_str (ret)); 815 usbi_dbg ("could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device", 816 idVendor, idProduct, darwin_error_str (ret), ret); 668 817 else 669 usbi_warn (ctx, "could not retrieve device descriptor %.4x:%.4x: %s. skipping device", idVendor, idProduct, darwin_error_str (ret)); 670 671 return -1; 672 } 673 674 usbi_dbg ("device descriptor:"); 675 usbi_dbg (" bDescriptorType: 0x%02x", priv->dev_descriptor.bDescriptorType); 676 usbi_dbg (" bcdUSB: 0x%04x", priv->dev_descriptor.bcdUSB); 677 usbi_dbg (" bDeviceClass: 0x%02x", priv->dev_descriptor.bDeviceClass); 678 usbi_dbg (" bDeviceSubClass: 0x%02x", priv->dev_descriptor.bDeviceSubClass); 679 usbi_dbg (" bDeviceProtocol: 0x%02x", priv->dev_descriptor.bDeviceProtocol); 680 usbi_dbg (" bMaxPacketSize0: 0x%02x", priv->dev_descriptor.bMaxPacketSize0); 681 usbi_dbg (" idVendor: 0x%04x", priv->dev_descriptor.idVendor); 682 usbi_dbg (" idProduct: 0x%04x", priv->dev_descriptor.idProduct); 683 usbi_dbg (" bcdDevice: 0x%04x", priv->dev_descriptor.bcdDevice); 684 usbi_dbg (" iManufacturer: 0x%02x", priv->dev_descriptor.iManufacturer); 685 usbi_dbg (" iProduct: 0x%02x", priv->dev_descriptor.iProduct); 686 usbi_dbg (" iSerialNumber: 0x%02x", priv->dev_descriptor.iSerialNumber); 687 usbi_dbg (" bNumConfigurations: 0x%02x", priv->dev_descriptor.bNumConfigurations); 818 usbi_warn (ctx, "could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device", 819 idVendor, idProduct, darwin_error_str (ret), ret); 820 return darwin_to_libusb (ret); 821 } 688 822 689 823 /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */ 690 if (libusb_le16_to_cpu ( priv->dev_descriptor.idProduct) != idProduct) {824 if (libusb_le16_to_cpu (dev->dev_descriptor.idProduct) != idProduct) { 691 825 /* not a valid device */ 692 826 usbi_warn (ctx, "idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device", 693 idProduct, libusb_le16_to_cpu (priv->dev_descriptor.idProduct)); 694 return -1; 695 } 696 697 return 0; 698 } 699 700 static int process_new_device (struct libusb_context *ctx, usb_device_t **device, UInt32 locationID) { 827 idProduct, libusb_le16_to_cpu (dev->dev_descriptor.idProduct)); 828 return LIBUSB_ERROR_NO_DEVICE; 829 } 830 831 usbi_dbg ("cached device descriptor:"); 832 usbi_dbg (" bDescriptorType: 0x%02x", dev->dev_descriptor.bDescriptorType); 833 usbi_dbg (" bcdUSB: 0x%04x", dev->dev_descriptor.bcdUSB); 834 usbi_dbg (" bDeviceClass: 0x%02x", dev->dev_descriptor.bDeviceClass); 835 usbi_dbg (" bDeviceSubClass: 0x%02x", dev->dev_descriptor.bDeviceSubClass); 836 usbi_dbg (" bDeviceProtocol: 0x%02x", dev->dev_descriptor.bDeviceProtocol); 837 usbi_dbg (" bMaxPacketSize0: 0x%02x", dev->dev_descriptor.bMaxPacketSize0); 838 usbi_dbg (" idVendor: 0x%04x", dev->dev_descriptor.idVendor); 839 usbi_dbg (" idProduct: 0x%04x", dev->dev_descriptor.idProduct); 840 usbi_dbg (" bcdDevice: 0x%04x", dev->dev_descriptor.bcdDevice); 841 usbi_dbg (" iManufacturer: 0x%02x", dev->dev_descriptor.iManufacturer); 842 usbi_dbg (" iProduct: 0x%02x", dev->dev_descriptor.iProduct); 843 usbi_dbg (" iSerialNumber: 0x%02x", dev->dev_descriptor.iSerialNumber); 844 usbi_dbg (" bNumConfigurations: 0x%02x", dev->dev_descriptor.bNumConfigurations); 845 846 dev->can_enumerate = 1; 847 848 return LIBUSB_SUCCESS; 849 } 850 851 static int get_device_port (io_service_t service, UInt8 *port) { 852 kern_return_t result; 853 io_service_t parent; 854 int ret = 0; 855 856 if (get_ioregistry_value_number (service, CFSTR("PortNum"), kCFNumberSInt8Type, port)) { 857 return 1; 858 } 859 860 result = IORegistryEntryGetParentEntry (service, kIOServicePlane, &parent); 861 if (kIOReturnSuccess == result) { 862 ret = get_ioregistry_value_data (parent, CFSTR("port"), 1, port); 863 IOObjectRelease (parent); 864 } 865 866 return ret; 867 } 868 869 static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t service, 870 struct darwin_cached_device **cached_out) { 871 struct darwin_cached_device *new_device; 872 UInt64 sessionID = 0, parent_sessionID = 0; 873 int ret = LIBUSB_SUCCESS; 874 usb_device_t **device; 875 io_service_t parent; 876 kern_return_t result; 877 UInt8 port = 0; 878 879 /* get some info from the io registry */ 880 (void) get_ioregistry_value_number (service, CFSTR("sessionID"), kCFNumberSInt64Type, &sessionID); 881 if (!get_device_port (service, &port)) { 882 usbi_dbg("could not get connected port number"); 883 } 884 885 usbi_dbg("finding cached device for sessionID 0x%" PRIx64, sessionID); 886 887 result = IORegistryEntryGetParentEntry (service, kIOUSBPlane, &parent); 888 889 if (kIOReturnSuccess == result) { 890 (void) get_ioregistry_value_number (parent, CFSTR("sessionID"), kCFNumberSInt64Type, &parent_sessionID); 891 IOObjectRelease(parent); 892 } 893 894 usbi_mutex_lock(&darwin_cached_devices_lock); 895 do { 896 *cached_out = NULL; 897 898 list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) { 899 usbi_dbg("matching sessionID 0x%" PRIx64 " against cached device with sessionID 0x%" PRIx64, sessionID, new_device->session); 900 if (new_device->session == sessionID) { 901 usbi_dbg("using cached device for device"); 902 *cached_out = new_device; 903 break; 904 } 905 } 906 907 if (*cached_out) 908 break; 909 910 usbi_dbg("caching new device with sessionID 0x%" PRIx64, sessionID); 911 912 device = darwin_device_from_service (service); 913 if (!device) { 914 ret = LIBUSB_ERROR_NO_DEVICE; 915 break; 916 } 917 918 new_device = calloc (1, sizeof (*new_device)); 919 if (!new_device) { 920 ret = LIBUSB_ERROR_NO_MEM; 921 break; 922 } 923 924 /* add this device to the cached device list */ 925 list_add(&new_device->list, &darwin_cached_devices); 926 927 (*device)->GetDeviceAddress (device, (USBDeviceAddress *)&new_device->address); 928 929 /* keep a reference to this device */ 930 darwin_ref_cached_device(new_device); 931 932 new_device->device = device; 933 new_device->session = sessionID; 934 (*device)->GetLocationID (device, &new_device->location); 935 new_device->port = port; 936 new_device->parent_session = parent_sessionID; 937 938 /* cache the device descriptor */ 939 ret = darwin_cache_device_descriptor(ctx, new_device); 940 if (ret) 941 break; 942 943 if (new_device->can_enumerate) { 944 snprintf(new_device->sys_path, 20, "%03i-%04x-%04x-%02x-%02x", new_device->address, 945 new_device->dev_descriptor.idVendor, new_device->dev_descriptor.idProduct, 946 new_device->dev_descriptor.bDeviceClass, new_device->dev_descriptor.bDeviceSubClass); 947 } 948 } while (0); 949 950 usbi_mutex_unlock(&darwin_cached_devices_lock); 951 952 /* keep track of devices regardless of if we successfully enumerate them to 953 prevent them from being enumerated multiple times */ 954 955 *cached_out = new_device; 956 957 return ret; 958 } 959 960 static int process_new_device (struct libusb_context *ctx, io_service_t service) { 961 struct darwin_device_priv *priv; 701 962 struct libusb_device *dev = NULL; 702 struct darwin_ device_priv *priv;963 struct darwin_cached_device *cached_device; 703 964 UInt8 devSpeed; 704 UInt16 address;705 965 int ret = 0; 706 966 707 967 do { 708 usbi_info (ctx, "allocating new device for location 0x%08x", locationID); 709 710 dev = usbi_alloc_device(ctx, locationID); 968 ret = darwin_get_cached_device (ctx, service, &cached_device); 969 970 if (ret < 0 || !cached_device->can_enumerate) { 971 return ret; 972 } 973 974 /* check current active configuration (and cache the first configuration value-- 975 which may be used by claim_interface) */ 976 ret = darwin_check_configuration (ctx, cached_device); 977 if (ret) 978 break; 979 980 usbi_dbg ("allocating new device in context %p for with session 0x%" PRIx64, 981 ctx, cached_device->session); 982 983 dev = usbi_alloc_device(ctx, (unsigned long) cached_device->session); 711 984 if (!dev) { 712 985 return LIBUSB_ERROR_NO_MEM; … … 714 987 715 988 priv = (struct darwin_device_priv *)dev->os_priv; 716 priv->device = device; 717 718 /* increment the device's reference count (it is decremented in darwin_destroy_device) */ 719 (*device)->AddRef (device); 720 721 (*device)->GetDeviceAddress (device, (USBDeviceAddress *)&address); 722 723 ret = darwin_cache_device_descriptor (ctx, dev, device); 724 if (ret < 0) 725 break; 726 727 /* check current active configuration (and cache the first configuration value-- which may be used by claim_interface) */ 728 ret = darwin_check_configuration (ctx, dev, device); 729 if (ret < 0) 730 break; 731 732 dev->bus_number = locationID >> 24; 733 dev->device_address = address; 734 735 (*device)->GetDeviceSpeed (device, &devSpeed); 989 990 priv->dev = cached_device; 991 darwin_ref_cached_device (priv->dev); 992 993 if (cached_device->parent_session > 0) { 994 dev->parent_dev = usbi_get_device_by_session_id (ctx, (unsigned long) cached_device->parent_session); 995 } else { 996 dev->parent_dev = NULL; 997 } 998 dev->port_number = cached_device->port; 999 dev->bus_number = cached_device->location >> 24; 1000 dev->device_address = cached_device->address; 1001 1002 (*(priv->dev->device))->GetDeviceSpeed (priv->dev->device, &devSpeed); 736 1003 737 1004 switch (devSpeed) { … … 746 1013 } 747 1014 748 /* save our location, we'll need this later */749 priv->location = locationID;750 snprintf(priv->sys_path, 20, "%03i-%04x-%04x-%02x-%02x", address, priv->dev_descriptor.idVendor, priv->dev_descriptor.idProduct,751 priv->dev_descriptor.bDeviceClass, priv->dev_descriptor.bDeviceSubClass);752 753 1015 ret = usbi_sanitize_device (dev); 754 1016 if (ret < 0) 755 1017 break; 756 1018 757 usbi_info (ctx, "found device with address %d at %s", dev->device_address, priv->sys_path); 1019 usbi_dbg ("found device with address %d port = %d parent = %p at %p", dev->device_address, 1020 dev->port_number, (void *) dev->parent_dev, priv->dev->sys_path); 758 1021 } while (0); 759 1022 … … 768 1031 769 1032 static int darwin_scan_devices(struct libusb_context *ctx) { 770 io_iterator_t deviceIterator; 771 usb_device_t **device; 772 kern_return_t kresult; 773 UInt32 location; 1033 io_iterator_t deviceIterator; 1034 io_service_t service; 1035 kern_return_t kresult; 774 1036 775 1037 kresult = usb_setup_device_iterator (&deviceIterator, 0); … … 777 1039 return darwin_to_libusb (kresult); 778 1040 779 while ((device = usb_get_next_device (deviceIterator, &location)) != NULL) { 780 (void) process_new_device (ctx, device, location); 781 782 /* process_new_device added a reference so we need to release the one 783 from QueryInterface */ 784 (*device)->Release (device); 1041 while ((service = IOIteratorNext (deviceIterator))) { 1042 (void) process_new_device (ctx, service); 1043 1044 IOObjectRelease(service); 785 1045 } 786 1046 … … 792 1052 static int darwin_open (struct libusb_device_handle *dev_handle) { 793 1053 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; 794 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1054 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 795 1055 IOReturn kresult; 796 1056 … … 799 1059 kresult = (*(dpriv->device))->USBDeviceOpenSeize (dpriv->device); 800 1060 if (kresult != kIOReturnSuccess) { 801 usbi_ err(HANDLE_CTX (dev_handle), "USBDeviceOpen: %s", darwin_error_str(kresult));1061 usbi_warn (HANDLE_CTX (dev_handle), "USBDeviceOpen: %s", darwin_error_str(kresult)); 802 1062 803 1063 if (kIOReturnExclusiveAccess != kresult) { … … 825 1085 } 826 1086 1087 CFRetain (libusb_darwin_acfl); 1088 827 1089 /* add the cfSource to the aync run loop */ 828 1090 CFRunLoopAddSource(libusb_darwin_acfl, priv->cfSource, kCFRunLoopCommonModes); … … 832 1094 dpriv->open_count++; 833 1095 834 /* create a file descriptor for notifications */ 835 pipe (priv->fds); 836 837 /* set the pipe to be non-blocking */ 838 fcntl (priv->fds[1], F_SETFD, O_NONBLOCK); 839 840 usbi_add_pollfd(HANDLE_CTX(dev_handle), priv->fds[0], POLLIN); 841 842 usbi_info (HANDLE_CTX (dev_handle), "device open for access"); 1096 usbi_dbg ("device open for access"); 843 1097 844 1098 return 0; … … 847 1101 static void darwin_close (struct libusb_device_handle *dev_handle) { 848 1102 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; 849 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1103 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 850 1104 IOReturn kresult; 851 1105 int i; … … 853 1107 if (dpriv->open_count == 0) { 854 1108 /* something is probably very wrong if this is the case */ 855 usbi_err (HANDLE_CTX (dev_handle), "Close called on a device that was not open! \n");1109 usbi_err (HANDLE_CTX (dev_handle), "Close called on a device that was not open!"); 856 1110 return; 857 1111 } … … 870 1124 CFRelease (priv->cfSource); 871 1125 priv->cfSource = NULL; 1126 CFRelease (libusb_darwin_acfl); 872 1127 } 873 1128 … … 878 1133 /* Log the fact that we had a problem closing the file, however failing a 879 1134 * close isn't really an error, so return success anyway */ 880 usbi_ err(HANDLE_CTX (dev_handle), "USBDeviceClose: %s", darwin_error_str(kresult));1135 usbi_warn (HANDLE_CTX (dev_handle), "USBDeviceClose: %s", darwin_error_str(kresult)); 881 1136 } 882 1137 } 883 1138 } 884 885 /* file descriptors are maintained per-instance */886 usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]);887 close (priv->fds[1]);888 close (priv->fds[0]);889 890 priv->fds[0] = priv->fds[1] = -1;891 1139 } 892 1140 893 1141 static int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) { 894 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1142 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 895 1143 896 1144 *config = (int) dpriv->active_config; … … 900 1148 901 1149 static int darwin_set_configuration(struct libusb_device_handle *dev_handle, int config) { 902 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1150 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 903 1151 IOReturn kresult; 904 1152 int i; … … 928 1176 kern_return_t kresult; 929 1177 io_iterator_t interface_iterator; 930 CFTypeRef bInterfaceNumberCF;931 int bInterfaceNumber;1178 UInt8 bInterfaceNumber; 1179 int ret; 932 1180 933 1181 *usbInterfacep = IO_OBJECT_NULL; … … 945 1193 while ((*usbInterfacep = IOIteratorNext(interface_iterator))) { 946 1194 /* find the interface number */ 947 bInterfaceNumberCF = IORegistryEntryCreateCFProperty (*usbInterfacep, CFSTR("bInterfaceNumber"), 948 kCFAllocatorDefault, 0); 949 if (!bInterfaceNumberCF) { 950 continue; 951 } 952 953 CFNumberGetValue(bInterfaceNumberCF, kCFNumberIntType, &bInterfaceNumber); 954 955 if ((uint8_t) bInterfaceNumber == ifc) { 1195 ret = get_ioregistry_value_number (*usbInterfacep, CFSTR("bInterfaceNumber"), kCFNumberSInt8Type, 1196 &bInterfaceNumber); 1197 1198 if (ret && bInterfaceNumber == ifc) { 956 1199 break; 957 1200 } … … 977 1220 u_int8_t dont_care1, dont_care3; 978 1221 u_int16_t dont_care2; 979 int i;980 981 usbi_ info (HANDLE_CTX (dev_handle),"building table of endpoints.");1222 int rc; 1223 1224 usbi_dbg ("building table of endpoints."); 982 1225 983 1226 /* retrieve the total number of endpoints on this interface */ … … 989 1232 990 1233 /* iterate through pipe references */ 991 for (i = 1 ; i <= numep ; i++) {1234 for (int i = 1 ; i <= numep ; i++) { 992 1235 kresult = (*(cInterface->interface))->GetPipeProperties(cInterface->interface, i, &direction, &number, &dont_care1, 993 1236 &dont_care2, &dont_care3); 994 1237 995 1238 if (kresult != kIOReturnSuccess) { 996 usbi_err (HANDLE_CTX (dev_handle), "error getting pipe information for pipe %d: %s", i, darwin_error_str(kresult)); 997 998 return darwin_to_libusb (kresult); 999 } 1000 1001 usbi_info (HANDLE_CTX (dev_handle), "interface: %i pipe %i: dir: %i number: %i", iface, i, direction, number); 1002 1003 cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK)); 1239 /* probably a buggy device. try to get the endpoint address from the descriptors */ 1240 struct libusb_config_descriptor *config; 1241 const struct libusb_endpoint_descriptor *endpoint_desc; 1242 UInt8 alt_setting; 1243 1244 kresult = (*(cInterface->interface))->GetAlternateSetting (cInterface->interface, &alt_setting); 1245 if (kresult) { 1246 usbi_err (HANDLE_CTX (dev_handle), "can't get alternate setting for interface"); 1247 return darwin_to_libusb (kresult); 1248 } 1249 1250 rc = libusb_get_active_config_descriptor (dev_handle->dev, &config); 1251 if (LIBUSB_SUCCESS != rc) { 1252 return rc; 1253 } 1254 1255 endpoint_desc = config->interface[iface].altsetting[alt_setting].endpoint + i - 1; 1256 1257 cInterface->endpoint_addrs[i - 1] = endpoint_desc->bEndpointAddress; 1258 } else { 1259 cInterface->endpoint_addrs[i - 1] = (((kUSBIn == direction) << kUSBRqDirnShift) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK)); 1260 } 1261 1262 usbi_dbg ("interface: %i pipe %i: dir: %i number: %i", iface, i, cInterface->endpoint_addrs[i - 1] >> kUSBRqDirnShift, 1263 cInterface->endpoint_addrs[i - 1] & LIBUSB_ENDPOINT_ADDRESS_MASK); 1004 1264 } 1005 1265 … … 1010 1270 1011 1271 static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface) { 1012 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1272 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 1013 1273 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; 1014 1274 io_service_t usbInterface = IO_OBJECT_NULL; … … 1108 1368 CFRunLoopAddSource(libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode); 1109 1369 1110 usbi_ info (HANDLE_CTX (dev_handle),"interface opened");1370 usbi_dbg ("interface opened"); 1111 1371 1112 1372 return 0; … … 1135 1395 kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface); 1136 1396 if (kresult) 1137 usbi_ err(HANDLE_CTX (dev_handle), "USBInterfaceClose: %s", darwin_error_str(kresult));1397 usbi_warn (HANDLE_CTX (dev_handle), "USBInterfaceClose: %s", darwin_error_str(kresult)); 1138 1398 1139 1399 kresult = (*(cInterface->interface))->Release(cInterface->interface); 1140 1400 if (kresult != kIOReturnSuccess) 1141 usbi_ err(HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult));1142 1143 cInterface->interface = IO_OBJECT_NULL;1401 usbi_warn (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult)); 1402 1403 cInterface->interface = (usb_interface_t **) IO_OBJECT_NULL; 1144 1404 1145 1405 return darwin_to_libusb (kresult); … … 1173 1433 1174 1434 static int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) { 1175 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;1176 1177 1435 /* current interface */ 1178 1436 struct darwin_interface *cInterface; 1179 uint8_t pipeRef, iface;1180 1437 IOReturn kresult; 1438 uint8_t pipeRef; 1181 1439 1182 1440 /* determine the interface/endpoint to use */ 1183 if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) {1441 if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, NULL, &cInterface) != 0) { 1184 1442 usbi_err (HANDLE_CTX (dev_handle), "endpoint not found on any open interface"); 1185 1443 … … 1187 1445 } 1188 1446 1189 cInterface = &priv->interfaces[iface];1190 1191 #if (InterfaceVersion < 190)1192 kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef);1193 #else1194 1447 /* newer versions of darwin support clearing additional bits on the device's endpoint */ 1195 1448 kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); 1196 #endif1197 1449 if (kresult) 1198 usbi_ err(HANDLE_CTX (dev_handle), "ClearPipeStall: %s", darwin_error_str (kresult));1450 usbi_warn (HANDLE_CTX (dev_handle), "ClearPipeStall: %s", darwin_error_str (kresult)); 1199 1451 1200 1452 return darwin_to_libusb (kresult); … … 1202 1454 1203 1455 static int darwin_reset_device(struct libusb_device_handle *dev_handle) { 1204 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1456 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 1205 1457 IOUSBDeviceDescriptor descriptor; 1206 1458 IOUSBConfigurationDescriptorPtr cached_configuration; … … 1254 1506 1255 1507 static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, int interface) { 1256 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;1508 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev); 1257 1509 io_service_t usbInterface; 1258 1510 CFTypeRef driver; … … 1281 1533 /* attaching/detaching kernel drivers is not currently supported (maybe in the future?) */ 1282 1534 static int darwin_attach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) { 1283 (void)dev_handle;1284 (void)interface;1535 UNUSED(dev_handle); 1536 UNUSED(interface); 1285 1537 return LIBUSB_ERROR_NOT_SUPPORTED; 1286 1538 } 1287 1539 1288 1540 static int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) { 1289 (void)dev_handle;1290 (void)interface;1541 UNUSED(dev_handle); 1542 UNUSED(interface); 1291 1543 return LIBUSB_ERROR_NOT_SUPPORTED; 1292 1544 } … … 1295 1547 struct darwin_device_priv *dpriv = (struct darwin_device_priv *) dev->os_priv; 1296 1548 1297 if (dpriv->device) { 1298 /* it is an internal error if the reference count of a device is < 0 after release */ 1299 assert(0 <= (*(dpriv->device))->Release(dpriv->device)); 1300 1301 dpriv->device = NULL; 1549 if (dpriv->dev) { 1550 /* need to hold the lock in case this is the last reference to the device */ 1551 usbi_mutex_lock(&darwin_cached_devices_lock); 1552 darwin_deref_cached_device (dpriv->dev); 1553 dpriv->dev = NULL; 1554 usbi_mutex_unlock(&darwin_cached_devices_lock); 1302 1555 } 1303 1556 } … … 1305 1558 static int submit_bulk_transfer(struct usbi_transfer *itransfer) { 1306 1559 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1307 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;1308 1560 1309 1561 IOReturn ret; 1310 1562 uint8_t transferType; 1311 /* None of the values below are used in libusb for bulk transfers */1312 uint8_t direction, number, interval, pipeRef , iface;1563 /* None of the values below are used in libusbx for bulk transfers */ 1564 uint8_t direction, number, interval, pipeRef; 1313 1565 uint16_t maxPacketSize; 1314 1566 1315 1567 struct darwin_interface *cInterface; 1316 1568 1317 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {1569 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { 1318 1570 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); 1319 1571 … … 1321 1573 } 1322 1574 1323 cInterface = &priv->interfaces[iface]; 1324 1325 (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, 1326 &transferType, &maxPacketSize, &interval); 1575 ret = (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, 1576 &transferType, &maxPacketSize, &interval); 1577 1578 if (ret) { 1579 usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out", 1580 darwin_error_str(ret), ret); 1581 return darwin_to_libusb (ret); 1582 } 1327 1583 1328 1584 if (0 != (transfer->length % maxPacketSize)) { … … 1341 1597 transfer->length, darwin_async_io_callback, itransfer); 1342 1598 } else { 1343 itransfer-> flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;1599 itransfer->timeout_flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; 1344 1600 1345 1601 if (IS_XFERIN(transfer)) … … 1360 1616 } 1361 1617 1618 #if InterfaceVersion >= 550 1619 static int submit_stream_transfer(struct usbi_transfer *itransfer) { 1620 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1621 struct darwin_interface *cInterface; 1622 uint8_t pipeRef; 1623 IOReturn ret; 1624 1625 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { 1626 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); 1627 1628 return LIBUSB_ERROR_NOT_FOUND; 1629 } 1630 1631 itransfer->timeout_flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; 1632 1633 if (IS_XFERIN(transfer)) 1634 ret = (*(cInterface->interface))->ReadStreamsPipeAsyncTO(cInterface->interface, pipeRef, itransfer->stream_id, 1635 transfer->buffer, transfer->length, transfer->timeout, 1636 transfer->timeout, darwin_async_io_callback, (void *)itransfer); 1637 else 1638 ret = (*(cInterface->interface))->WriteStreamsPipeAsyncTO(cInterface->interface, pipeRef, itransfer->stream_id, 1639 transfer->buffer, transfer->length, transfer->timeout, 1640 transfer->timeout, darwin_async_io_callback, (void *)itransfer); 1641 1642 if (ret) 1643 usbi_err (TRANSFER_CTX (transfer), "bulk stream transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out", 1644 darwin_error_str(ret), ret); 1645 1646 return darwin_to_libusb (ret); 1647 } 1648 #endif 1649 1362 1650 static int submit_iso_transfer(struct usbi_transfer *itransfer) { 1363 1651 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1364 1652 struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); 1365 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;1366 1653 1367 1654 IOReturn kresult; 1368 uint8_t direction, number, interval, pipeRef, iface,transferType;1655 uint8_t direction, number, interval, pipeRef, transferType; 1369 1656 uint16_t maxPacketSize; 1370 1657 UInt64 frame; … … 1392 1679 1393 1680 /* determine the interface/endpoint to use */ 1394 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {1681 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { 1395 1682 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); 1396 1683 … … 1398 1685 } 1399 1686 1400 cInterface = &priv->interfaces[iface]; 1687 /* determine the properties of this endpoint and the speed of the device */ 1688 (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, 1689 &transferType, &maxPacketSize, &interval); 1401 1690 1402 1691 /* Last but not least we need the bus frame number */ … … 1429 1718 itransfer); 1430 1719 1431 cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1)) / 8; 1720 if (LIBUSB_SPEED_FULL == transfer->dev_handle->dev->speed) 1721 /* Full speed */ 1722 cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1)); 1723 else 1724 /* High/super speed */ 1725 cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1)) / 8; 1432 1726 1433 1727 if (kresult != kIOReturnSuccess) { … … 1444 1738 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1445 1739 struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer; 1446 struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv; 1447 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; 1740 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev); 1448 1741 struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); 1449 1742 … … 1452 1745 bzero(&tpriv->req, sizeof(tpriv->req)); 1453 1746 1454 /* IOUSBDeviceInterface expects the request in cpu endian ess */1747 /* IOUSBDeviceInterface expects the request in cpu endianness */ 1455 1748 tpriv->req.bmRequestType = setup->bmRequestType; 1456 1749 tpriv->req.bRequest = setup->bRequest; … … 1464 1757 tpriv->req.noDataTimeout = transfer->timeout; 1465 1758 1466 itransfer-> flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;1759 itransfer->timeout_flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; 1467 1760 1468 1761 /* all transfers in libusb-1.0 are async */ … … 1470 1763 if (transfer->endpoint) { 1471 1764 struct darwin_interface *cInterface; 1472 uint8_t pipeRef , iface;1473 1474 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {1765 uint8_t pipeRef; 1766 1767 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface) != 0) { 1475 1768 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); 1476 1769 1477 1770 return LIBUSB_ERROR_NOT_FOUND; 1478 1771 } 1479 1480 cInterface = &priv->interfaces[iface];1481 1772 1482 1773 kresult = (*(cInterface->interface))->ControlRequestAsyncTO (cInterface->interface, pipeRef, &(tpriv->req), darwin_async_io_callback, itransfer); … … 1502 1793 case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: 1503 1794 return submit_iso_transfer(itransfer); 1795 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 1796 #if InterfaceVersion >= 550 1797 return submit_stream_transfer(itransfer); 1798 #else 1799 usbi_err (TRANSFER_CTX(transfer), "IOUSBFamily version does not support bulk stream transfers"); 1800 return LIBUSB_ERROR_NOT_SUPPORTED; 1801 #endif 1504 1802 default: 1505 1803 usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); … … 1510 1808 static int cancel_control_transfer(struct usbi_transfer *itransfer) { 1511 1809 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1512 struct darwin_ device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv;1810 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev); 1513 1811 IOReturn kresult; 1514 1812 1515 usbi_ info (ITRANSFER_CTX (itransfer), "WARNING:aborting all transactions control pipe");1813 usbi_warn (ITRANSFER_CTX (itransfer), "aborting all transactions control pipe"); 1516 1814 1517 1815 if (!dpriv->device) … … 1525 1823 static int darwin_abort_transfers (struct usbi_transfer *itransfer) { 1526 1824 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1527 struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv; 1528 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; 1825 struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev); 1529 1826 struct darwin_interface *cInterface; 1530 1827 uint8_t pipeRef, iface; 1531 1828 IOReturn kresult; 1532 1829 1533 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface ) != 0) {1830 if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface, &cInterface) != 0) { 1534 1831 usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); 1535 1832 1536 1833 return LIBUSB_ERROR_NOT_FOUND; 1537 1834 } 1538 1539 cInterface = &priv->interfaces[iface];1540 1835 1541 1836 if (!dpriv->device) 1542 1837 return LIBUSB_ERROR_NO_DEVICE; 1543 1838 1544 usbi_ info (ITRANSFER_CTX (itransfer), "WARNING:aborting all transactions on interface %d pipe %d", iface, pipeRef);1839 usbi_warn (ITRANSFER_CTX (itransfer), "aborting all transactions on interface %d pipe %d", iface, pipeRef); 1545 1840 1546 1841 /* abort transactions */ 1547 (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef); 1548 1549 usbi_info (ITRANSFER_CTX (itransfer), "calling clear pipe stall to clear the data toggle bit"); 1550 1551 /* clear the data toggle bit */ 1552 #if (InterfaceVersion < 190) 1553 kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef); 1554 #else 1842 #if InterfaceVersion >= 550 1843 if (LIBUSB_TRANSFER_TYPE_BULK_STREAM == transfer->type) 1844 (*(cInterface->interface))->AbortStreamsPipe (cInterface->interface, pipeRef, itransfer->stream_id); 1845 else 1846 #endif 1847 (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef); 1848 1849 usbi_dbg ("calling clear pipe stall to clear the data toggle bit"); 1850 1555 1851 /* newer versions of darwin support clearing additional bits on the device's endpoint */ 1556 1852 kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); 1557 #endif1558 1853 1559 1854 return darwin_to_libusb (kresult); … … 1589 1884 struct usbi_transfer *itransfer = (struct usbi_transfer *)refcon; 1590 1885 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1591 struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; 1592 UInt32 message, size; 1593 1594 usbi_info (ITRANSFER_CTX (itransfer), "an async io operation has completed"); 1886 struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); 1887 1888 usbi_dbg ("an async io operation has completed"); 1595 1889 1596 1890 /* if requested write a zero packet */ 1597 1891 if (kIOReturnSuccess == result && IS_XFEROUT(transfer) && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) { 1598 1892 struct darwin_interface *cInterface; 1599 uint8_t iface, pipeRef; 1600 1601 (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface); 1602 cInterface = &priv->interfaces[iface]; 1893 uint8_t pipeRef; 1894 1895 (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, NULL, &cInterface); 1603 1896 1604 1897 (*(cInterface->interface))->WritePipe (cInterface->interface, pipeRef, transfer->buffer, 0); 1605 1898 } 1606 1899 1607 size = (UInt32) (uintptr_t) arg0; 1608 1609 /* send a completion message to the device's file descriptor */ 1610 message = MESSAGE_ASYNC_IO_COMPLETE; 1611 write (priv->fds[1], &message, sizeof (message)); 1612 write (priv->fds[1], &itransfer, sizeof (itransfer)); 1613 write (priv->fds[1], &result, sizeof (IOReturn)); 1614 write (priv->fds[1], &size, sizeof (size)); 1900 tpriv->result = result; 1901 tpriv->size = (UInt32) (uintptr_t) arg0; 1902 1903 /* signal the core that this transfer is complete */ 1904 usbi_signal_transfer_completion(itransfer); 1615 1905 } 1616 1906 1617 1907 static int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) { 1618 if (itransfer-> flags & USBI_TRANSFER_TIMED_OUT)1908 if (itransfer->timeout_flags & USBI_TRANSFER_TIMED_OUT) 1619 1909 result = kIOUSBTransactionTimeout; 1620 1910 … … 1626 1916 return LIBUSB_TRANSFER_CANCELLED; 1627 1917 case kIOUSBPipeStalled: 1628 usbi_ warn (ITRANSFER_CTX (itransfer),"transfer error: pipe is stalled");1918 usbi_dbg ("transfer error: pipe is stalled"); 1629 1919 return LIBUSB_TRANSFER_STALL; 1630 1920 case kIOReturnOverrun: 1631 usbi_ err(ITRANSFER_CTX (itransfer), "transfer error: data overrun");1921 usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: data overrun"); 1632 1922 return LIBUSB_TRANSFER_OVERFLOW; 1633 1923 case kIOUSBTransactionTimeout: 1634 usbi_ err(ITRANSFER_CTX (itransfer), "transfer error: timed out");1635 itransfer-> flags |= USBI_TRANSFER_TIMED_OUT;1924 usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: timed out"); 1925 itransfer->timeout_flags |= USBI_TRANSFER_TIMED_OUT; 1636 1926 return LIBUSB_TRANSFER_TIMED_OUT; 1637 1927 default: 1638 usbi_ err(ITRANSFER_CTX (itransfer), "transfer error: %s (value = 0x%08x)", darwin_error_str (result), result);1928 usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: %s (value = 0x%08x)", darwin_error_str (result), result); 1639 1929 return LIBUSB_TRANSFER_ERROR; 1640 1930 } 1641 1931 } 1642 1932 1643 static void darwin_handle_callback (struct usbi_transfer *itransfer, kern_return_t result, UInt32 io_size) {1933 static int darwin_handle_transfer_completion (struct usbi_transfer *itransfer) { 1644 1934 struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 1645 1935 struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); … … 1652 1942 if (!isIsoc && !isBulk && !isControl && !isInterrupt) { 1653 1943 usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); 1654 return ;1655 } 1656 1657 usbi_ info (ITRANSFER_CTX (itransfer),"handling %s completion with kernel status %d",1658 isControl ? "control" : isBulk ? "bulk" : isIsoc ? "isoc" : "interrupt", result);1659 1660 if (kIOReturnSuccess == result || kIOReturnUnderrun ==result) {1944 return LIBUSB_ERROR_INVALID_PARAM; 1945 } 1946 1947 usbi_dbg ("handling %s completion with kernel status %d", 1948 isControl ? "control" : isBulk ? "bulk" : isIsoc ? "isoc" : "interrupt", tpriv->result); 1949 1950 if (kIOReturnSuccess == tpriv->result || kIOReturnUnderrun == tpriv->result) { 1661 1951 if (isIsoc && tpriv->isoc_framelist) { 1662 1952 /* copy isochronous results back */ … … 1668 1958 } 1669 1959 } else if (!isIsoc) 1670 itransfer->transferred += io_size;1960 itransfer->transferred += tpriv->size; 1671 1961 } 1672 1962 1673 1963 /* it is ok to handle cancelled transfers without calling usbi_handle_transfer_cancellation (we catch timeout transfers) */ 1674 usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, result)); 1675 } 1676 1677 static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) { 1678 struct usbi_transfer *itransfer; 1679 UInt32 io_size; 1680 IOReturn kresult; 1681 POLL_NFDS_TYPE i = 0; 1682 ssize_t ret; 1683 UInt32 message; 1684 1685 usbi_mutex_lock(&ctx->open_devs_lock); 1686 for (i = 0; i < nfds && num_ready > 0; i++) { 1687 struct pollfd *pollfd = &fds[i]; 1688 struct libusb_device_handle *handle; 1689 struct darwin_device_handle_priv *hpriv = NULL; 1690 1691 usbi_info (ctx, "checking fd %i with revents = %x", fds[i], pollfd->revents); 1692 1693 if (!pollfd->revents) 1694 continue; 1695 1696 num_ready--; 1697 list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { 1698 hpriv = (struct darwin_device_handle_priv *)handle->os_priv; 1699 if (hpriv->fds[0] == pollfd->fd) 1700 break; 1701 } 1702 1703 if (!(pollfd->revents & POLLERR)) { 1704 ret = read (hpriv->fds[0], &message, sizeof (message)); 1705 if (ret < (ssize_t)sizeof (message)) 1706 continue; 1707 } else { 1708 /* could not poll the device-- response is to delete the device (this seems a little heavy-handed) */ 1709 /* remove the device's async port from the runloop */ 1710 if (hpriv->cfSource) { 1711 if (libusb_darwin_acfl) 1712 CFRunLoopRemoveSource (libusb_darwin_acfl, hpriv->cfSource, kCFRunLoopDefaultMode); 1713 CFRelease (hpriv->cfSource); 1714 hpriv->cfSource = NULL; 1715 } 1716 1717 usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fds[0]); 1718 usbi_handle_disconnect(handle); 1719 1720 /* done with this device */ 1721 } 1722 1723 switch (message) { 1724 case MESSAGE_ASYNC_IO_COMPLETE: 1725 read (hpriv->fds[0], &itransfer, sizeof (itransfer)); 1726 read (hpriv->fds[0], &kresult, sizeof (IOReturn)); 1727 read (hpriv->fds[0], &io_size, sizeof (UInt32)); 1728 1729 darwin_handle_callback (itransfer, kresult, io_size); 1730 break; 1731 default: 1732 usbi_err (ctx, "unknown message received from device pipe"); 1733 } 1734 } 1735 1736 usbi_mutex_unlock(&ctx->open_devs_lock); 1737 1738 return 0; 1964 return usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, tpriv->result)); 1739 1965 } 1740 1966 … … 1764 1990 } 1765 1991 1992 #if InterfaceVersion >= 550 1993 static int darwin_alloc_streams (struct libusb_device_handle *dev_handle, uint32_t num_streams, unsigned char *endpoints, 1994 int num_endpoints) { 1995 struct darwin_interface *cInterface; 1996 UInt32 supportsStreams; 1997 uint8_t pipeRef; 1998 int rc, i; 1999 2000 /* find the mimimum number of supported streams on the endpoint list */ 2001 for (i = 0 ; i < num_endpoints ; ++i) { 2002 if (0 != (rc = ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface))) { 2003 return rc; 2004 } 2005 2006 (*(cInterface->interface))->SupportsStreams (cInterface->interface, pipeRef, &supportsStreams); 2007 if (num_streams > supportsStreams) 2008 num_streams = supportsStreams; 2009 } 2010 2011 /* it is an error if any endpoint in endpoints does not support streams */ 2012 if (0 == num_streams) 2013 return LIBUSB_ERROR_INVALID_PARAM; 2014 2015 /* create the streams */ 2016 for (i = 0 ; i < num_endpoints ; ++i) { 2017 (void) ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface); 2018 2019 rc = (*(cInterface->interface))->CreateStreams (cInterface->interface, pipeRef, num_streams); 2020 if (kIOReturnSuccess != rc) 2021 return darwin_to_libusb(rc); 2022 } 2023 2024 return num_streams; 2025 } 2026 2027 static int darwin_free_streams (struct libusb_device_handle *dev_handle, unsigned char *endpoints, int num_endpoints) { 2028 struct darwin_interface *cInterface; 2029 UInt32 supportsStreams; 2030 uint8_t pipeRef; 2031 int rc; 2032 2033 for (int i = 0 ; i < num_endpoints ; ++i) { 2034 if (0 != (rc = ep_to_pipeRef (dev_handle, endpoints[i], &pipeRef, NULL, &cInterface))) 2035 return rc; 2036 2037 (*(cInterface->interface))->SupportsStreams (cInterface->interface, pipeRef, &supportsStreams); 2038 if (0 == supportsStreams) 2039 return LIBUSB_ERROR_INVALID_PARAM; 2040 2041 rc = (*(cInterface->interface))->CreateStreams (cInterface->interface, pipeRef, 0); 2042 if (kIOReturnSuccess != rc) 2043 return darwin_to_libusb(rc); 2044 } 2045 2046 return LIBUSB_SUCCESS; 2047 } 2048 #endif 2049 1766 2050 const struct usbi_os_backend darwin_backend = { 1767 2051 .name = "Darwin", 2052 .caps = 0, 1768 2053 .init = darwin_init, 1769 2054 .exit = darwin_exit, … … 1772 2057 .get_active_config_descriptor = darwin_get_active_config_descriptor, 1773 2058 .get_config_descriptor = darwin_get_config_descriptor, 2059 .hotplug_poll = darwin_hotplug_poll, 1774 2060 1775 2061 .open = darwin_open, … … 1784 2070 .reset_device = darwin_reset_device, 1785 2071 2072 #if InterfaceVersion >= 550 2073 .alloc_streams = darwin_alloc_streams, 2074 .free_streams = darwin_free_streams, 2075 #endif 2076 1786 2077 .kernel_driver_active = darwin_kernel_driver_active, 1787 2078 .detach_kernel_driver = darwin_detach_kernel_driver, … … 1794 2085 .clear_transfer_priv = darwin_clear_transfer_priv, 1795 2086 1796 .handle_ events = op_handle_events,2087 .handle_transfer_completion = darwin_handle_transfer_completion, 1797 2088 1798 2089 .clock_gettime = darwin_clock_gettime, … … 1801 2092 .device_handle_priv_size = sizeof(struct darwin_device_handle_priv), 1802 2093 .transfer_priv_size = sizeof(struct darwin_transfer_priv), 1803 .add_iso_packet_size = 0,1804 2094 }; 1805 -
TabularUnified libusb1/trunk/libusb/os/darwin_usb.h ¶
r1876 r1882 1 1 /* 2 2 * darwin backend for libusb 1.0 3 * Copyright (C) 2008-2009Nathan Hjelm <hjelmn@users.sourceforge.net>3 * Copyright © 2008-2015 Nathan Hjelm <hjelmn@users.sourceforge.net> 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 29 29 30 30 /* IOUSBInterfaceInferface */ 31 #if defined (kIOUSBInterfaceInterfaceID300) 31 #if defined (kIOUSBInterfaceInterfaceID700) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 32 33 #define usb_interface_t IOUSBInterfaceInterface700 34 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID700 35 #define InterfaceVersion 700 36 37 #elif defined (kIOUSBInterfaceInterfaceID550) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 38 39 #define usb_interface_t IOUSBInterfaceInterface550 40 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID550 41 #define InterfaceVersion 550 42 43 #elif defined (kIOUSBInterfaceInterfaceID500) 44 45 #define usb_interface_t IOUSBInterfaceInterface500 46 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID500 47 #define InterfaceVersion 500 48 49 #elif defined (kIOUSBInterfaceInterfaceID300) 32 50 33 51 #define usb_interface_t IOUSBInterfaceInterface300 … … 47 65 #define InterfaceVersion 220 48 66 49 #elif defined (kIOUSBInterfaceInterfaceID197)50 51 #define usb_interface_t IOUSBInterfaceInterface19752 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID19753 #define InterfaceVersion 19754 55 #elif defined (kIOUSBInterfaceInterfaceID190)56 57 #define usb_interface_t IOUSBInterfaceInterface19058 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID19059 #define InterfaceVersion 19060 61 #elif defined (kIOUSBInterfaceInterfaceID182)62 63 #define usb_interface_t IOUSBInterfaceInterface18264 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID18265 #define InterfaceVersion 18266 67 67 #else 68 68 … … 72 72 73 73 /* IOUSBDeviceInterface */ 74 #if defined (kIOUSBDeviceInterfaceID500) 74 #if defined (kIOUSBDeviceInterfaceID500) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 75 75 76 76 #define usb_device_t IOUSBDeviceInterface500 … … 96 96 #define DeviceVersion 245 97 97 98 #elif defined (kIOUSBDeviceInterfaceID197) 99 98 #elif defined (kIOUSBDeviceInterfaceID220) 100 99 #define usb_device_t IOUSBDeviceInterface197 101 100 #define DeviceInterfaceID kIOUSBDeviceInterfaceID197 102 101 #define DeviceVersion 197 103 104 #elif defined (kIOUSBDeviceInterfaceID187)105 106 #define usb_device_t IOUSBDeviceInterface187107 #define DeviceInterfaceID kIOUSBDeviceInterfaceID187108 #define DeviceVersion 187109 110 #elif defined (kIOUSBDeviceInterfaceID182)111 112 #define usb_device_t IOUSBDeviceInterface182113 #define DeviceInterfaceID kIOUSBDeviceInterfaceID182114 #define DeviceVersion 182115 102 116 103 #else … … 128 115 129 116 /* private structures */ 130 struct darwin_device_priv { 117 struct darwin_cached_device { 118 struct list_head list; 131 119 IOUSBDeviceDescriptor dev_descriptor; 132 120 UInt32 location; 121 UInt64 parent_session; 122 UInt64 session; 123 UInt16 address; 133 124 char sys_path[21]; 134 125 usb_device_t **device; 135 126 int open_count; 136 UInt8 first_config, active_config; 127 UInt8 first_config, active_config, port; 128 int can_enumerate; 129 int refcount; 130 }; 131 132 struct darwin_device_priv { 133 struct darwin_cached_device *dev; 137 134 }; 138 135 … … 140 137 int is_open; 141 138 CFRunLoopSourceRef cfSource; 142 int fds[2];143 139 144 140 struct darwin_interface { … … 147 143 CFRunLoopSourceRef cfSource; 148 144 uint64_t frames[256]; 149 uint8_t endpoint_addrs[USB_MAXENDPOINTS];145 uint8_t endpoint_addrs[USB_MAXENDPOINTS]; 150 146 } interfaces[USB_MAXINTERFACES]; 151 147 }; … … 157 153 158 154 /* Control */ 159 #if !defined (LIBUSB_NO_TIMEOUT_DEVICE)160 155 IOUSBDevRequestTO req; 161 #else162 IOUSBDevRequest req;163 #endif164 156 165 157 /* Bulk */ 166 };167 158 168 enum { 169 MESSAGE_ASYNC_IO_COMPLETE 159 /* Completion status */ 160 IOReturn result; 161 UInt32 size; 170 162 }; 171 163 -
TabularUnified libusb1/trunk/libusb/os/linux_netlink.c ¶
r1876 r1882 5 5 * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> 6 6 * Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.com> 7 * Copyright (c) 2016 Chris Dickens <christopher.a.dickens@gmail.com> 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 21 22 */ 22 23 23 #include "config.h"24 #include <ctype.h> 25 #include < dirent.h>24 #include <config.h> 25 26 #include <assert.h> 26 27 #include <errno.h> 27 28 #include <fcntl.h> … … 30 31 #include <stdlib.h> 31 32 #include <string.h> 33 #include <unistd.h> 32 34 #include <sys/types.h> 35 36 #ifdef HAVE_ASM_TYPES_H 37 #include <asm/types.h> 38 #endif 39 33 40 #include <sys/socket.h> 34 #include <arpa/inet.h> 35 36 #include "libusb.h" 41 #include <linux/netlink.h> 42 37 43 #include "libusbi.h" 38 44 #include "linux_usbfs.h" 39 45 40 #include <linux/netlink.h> 41 #include <linux/filter.h> 42 43 #define KERNEL 1 46 #define NL_GROUP_KERNEL 1 44 47 45 48 static int linux_netlink_socket = -1; 49 static int netlink_control_pipe[2] = { -1, -1 }; 46 50 static pthread_t libusb_linux_event_thread; 47 51 48 52 static void *linux_netlink_event_thread_main(void *arg); 49 53 50 struct sockaddr_nl snl = { .nl_family=AF_NETLINK, .nl_groups=KERNEL }; 54 static int set_fd_cloexec_nb(int fd) 55 { 56 int flags; 57 58 #if defined(FD_CLOEXEC) 59 flags = fcntl(fd, F_GETFD); 60 if (flags == -1) { 61 usbi_err(NULL, "failed to get netlink fd flags (%d)", errno); 62 return -1; 63 } 64 65 if (!(flags & FD_CLOEXEC)) { 66 if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) { 67 usbi_err(NULL, "failed to set netlink fd flags (%d)", errno); 68 return -1; 69 } 70 } 71 #endif 72 73 flags = fcntl(fd, F_GETFL); 74 if (flags == -1) { 75 usbi_err(NULL, "failed to get netlink fd status flags (%d)", errno); 76 return -1; 77 } 78 79 if (!(flags & O_NONBLOCK)) { 80 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) { 81 usbi_err(NULL, "failed to set netlink fd status flags (%d)", errno); 82 return -1; 83 } 84 } 85 86 return 0; 87 } 51 88 52 89 int linux_netlink_start_event_monitor(void) 53 90 { 91 struct sockaddr_nl sa_nl = { .nl_family = AF_NETLINK, .nl_groups = NL_GROUP_KERNEL }; 92 int socktype = SOCK_RAW; 93 int opt = 1; 54 94 int ret; 55 95 56 snl.nl_groups = KERNEL; 57 58 linux_netlink_socket = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT); 59 if (-1 == linux_netlink_socket) { 60 return LIBUSB_ERROR_OTHER; 61 } 62 63 ret = bind(linux_netlink_socket, (struct sockaddr *) &snl, sizeof(snl)); 64 if (0 != ret) { 65 return LIBUSB_ERROR_OTHER; 66 } 67 68 /* TODO -- add authentication */ 69 /* setsockopt(linux_netlink_socket, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); */ 96 #if defined(SOCK_CLOEXEC) 97 socktype |= SOCK_CLOEXEC; 98 #endif 99 #if defined(SOCK_NONBLOCK) 100 socktype |= SOCK_NONBLOCK; 101 #endif 102 103 linux_netlink_socket = socket(PF_NETLINK, socktype, NETLINK_KOBJECT_UEVENT); 104 if (linux_netlink_socket == -1 && errno == EINVAL) { 105 usbi_dbg("failed to create netlink socket of type %d, attempting SOCK_RAW", socktype); 106 linux_netlink_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_KOBJECT_UEVENT); 107 } 108 109 if (linux_netlink_socket == -1) { 110 usbi_err(NULL, "failed to create netlink socket (%d)", errno); 111 goto err; 112 } 113 114 ret = set_fd_cloexec_nb(linux_netlink_socket); 115 if (ret == -1) 116 goto err_close_socket; 117 118 ret = bind(linux_netlink_socket, (struct sockaddr *)&sa_nl, sizeof(sa_nl)); 119 if (ret == -1) { 120 usbi_err(NULL, "failed to bind netlink socket (%d)", errno); 121 goto err_close_socket; 122 } 123 124 ret = setsockopt(linux_netlink_socket, SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt)); 125 if (ret == -1) { 126 usbi_err(NULL, "failed to set netlink socket SO_PASSCRED option (%d)", errno); 127 goto err_close_socket; 128 } 129 130 ret = usbi_pipe(netlink_control_pipe); 131 if (ret) { 132 usbi_err(NULL, "failed to create netlink control pipe"); 133 goto err_close_socket; 134 } 70 135 71 136 ret = pthread_create(&libusb_linux_event_thread, NULL, linux_netlink_event_thread_main, NULL); 72 if (0 != ret) { 73 return LIBUSB_ERROR_OTHER; 137 if (ret != 0) { 138 usbi_err(NULL, "failed to create netlink event thread (%d)", ret); 139 goto err_close_pipe; 74 140 } 75 141 76 142 return LIBUSB_SUCCESS; 143 144 err_close_pipe: 145 close(netlink_control_pipe[0]); 146 close(netlink_control_pipe[1]); 147 netlink_control_pipe[0] = -1; 148 netlink_control_pipe[1] = -1; 149 err_close_socket: 150 close(linux_netlink_socket); 151 linux_netlink_socket = -1; 152 err: 153 return LIBUSB_ERROR_OTHER; 77 154 } 78 155 79 156 int linux_netlink_stop_event_monitor(void) 80 157 { 81 int r; 82 83 if (-1 == linux_netlink_socket) { 84 /* already closed. nothing to do */ 85 return LIBUSB_SUCCESS; 86 } 87 88 r = close(linux_netlink_socket); 89 if (0 > r) { 90 usbi_err(NULL, "error closing netlink socket. %s", strerror(errno)); 91 return LIBUSB_ERROR_OTHER; 92 } 93 94 pthread_cancel(libusb_linux_event_thread); 95 158 char dummy = 1; 159 ssize_t r; 160 161 assert(linux_netlink_socket != -1); 162 163 /* Write some dummy data to the control pipe and 164 * wait for the thread to exit */ 165 r = usbi_write(netlink_control_pipe[1], &dummy, sizeof(dummy)); 166 if (r <= 0) 167 usbi_warn(NULL, "netlink control pipe signal failed"); 168 169 pthread_join(libusb_linux_event_thread, NULL); 170 171 close(linux_netlink_socket); 96 172 linux_netlink_socket = -1; 97 173 174 /* close and reset control pipe */ 175 close(netlink_control_pipe[0]); 176 close(netlink_control_pipe[1]); 177 netlink_control_pipe[0] = -1; 178 netlink_control_pipe[1] = -1; 179 98 180 return LIBUSB_SUCCESS; 99 181 } 100 182 101 static const char *netlink_message_parse (const char *buffer, size_t len, const char *key) 102 { 183 static const char *netlink_message_parse(const char *buffer, size_t len, const char *key) 184 { 185 const char *end = buffer + len; 103 186 size_t keylen = strlen(key); 104 size_t offset; 105 106 for (offset = 0 ; offset < len && '\0' != buffer[offset] ; offset += strlen(buffer + offset) + 1) { 107 if (0 == strncmp(buffer + offset, key, keylen) && 108 '=' == buffer[offset + keylen]) { 109 return buffer + offset + keylen + 1; 110 } 187 188 while (buffer < end && *buffer) { 189 if (strncmp(buffer, key, keylen) == 0 && buffer[keylen] == '=') 190 return buffer + keylen + 1; 191 buffer += strlen(buffer) + 1; 111 192 } 112 193 … … 115 196 116 197 /* parse parts of netlink message common to both libudev and the kernel */ 117 static int linux_netlink_parse(c har *buffer, size_t len, int *detached, const char **sys_name,118 uint8_t *busnum, uint8_t *devaddr) {119 const char *tmp; 120 int i;198 static int linux_netlink_parse(const char *buffer, size_t len, int *detached, 199 const char **sys_name, uint8_t *busnum, uint8_t *devaddr) 200 { 201 const char *tmp, *slash; 121 202 122 203 errno = 0; … … 127 208 *devaddr = 0; 128 209 129 tmp = netlink_message_parse((const char *) buffer, len, "ACTION"); 130 if (0 == strcmp(tmp, "remove")) { 210 tmp = netlink_message_parse(buffer, len, "ACTION"); 211 if (!tmp) { 212 return -1; 213 } else if (strcmp(tmp, "remove") == 0) { 131 214 *detached = 1; 132 } else if ( 0 != strcmp(tmp, "add")) {133 usbi_dbg("unknown device action ");215 } else if (strcmp(tmp, "add") != 0) { 216 usbi_dbg("unknown device action %s", tmp); 134 217 return -1; 135 218 } … … 137 220 /* check that this is a usb message */ 138 221 tmp = netlink_message_parse(buffer, len, "SUBSYSTEM"); 139 if ( NULL == tmp || 0 != strcmp(tmp, "usb")) {222 if (!tmp || strcmp(tmp, "usb") != 0) { 140 223 /* not usb. ignore */ 141 224 return -1; 142 225 } 143 226 227 /* check that this is an actual usb device */ 228 tmp = netlink_message_parse(buffer, len, "DEVTYPE"); 229 if (!tmp || strcmp(tmp, "usb_device") != 0) { 230 /* not usb. ignore */ 231 return -1; 232 } 233 144 234 tmp = netlink_message_parse(buffer, len, "BUSNUM"); 145 if (NULL == tmp) { 146 /* no bus number (likely a usb interface). ignore*/ 147 return -1; 148 } 149 150 *busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff); 151 if (errno) { 152 errno = 0; 153 return -1; 154 } 155 156 tmp = netlink_message_parse(buffer, len, "DEVNUM"); 157 if (NULL == tmp) { 158 return -1; 159 } 160 161 *devaddr = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff); 162 if (errno) { 163 errno = 0; 164 return -1; 235 if (tmp) { 236 *busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff); 237 if (errno) { 238 errno = 0; 239 return -1; 240 } 241 242 tmp = netlink_message_parse(buffer, len, "DEVNUM"); 243 if (NULL == tmp) 244 return -1; 245 246 *devaddr = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff); 247 if (errno) { 248 errno = 0; 249 return -1; 250 } 251 } else { 252 /* no bus number. try "DEVICE" */ 253 tmp = netlink_message_parse(buffer, len, "DEVICE"); 254 if (!tmp) { 255 /* not usb. ignore */ 256 return -1; 257 } 258 259 /* Parse a device path such as /dev/bus/usb/003/004 */ 260 slash = strrchr(tmp, '/'); 261 if (!slash) 262 return -1; 263 264 *busnum = (uint8_t)(strtoul(slash - 3, NULL, 10) & 0xff); 265 if (errno) { 266 errno = 0; 267 return -1; 268 } 269 270 *devaddr = (uint8_t)(strtoul(slash + 1, NULL, 10) & 0xff); 271 if (errno) { 272 errno = 0; 273 return -1; 274 } 275 276 return 0; 165 277 } 166 278 167 279 tmp = netlink_message_parse(buffer, len, "DEVPATH"); 168 if (NULL == tmp) { 169 return -1; 170 } 171 172 for (i = strlen(tmp) - 1 ; i ; --i) { 173 if ('/' ==tmp[i]) { 174 *sys_name = tmp + i + 1; 175 break; 176 } 177 } 280 if (!tmp) 281 return -1; 282 283 slash = strrchr(tmp, '/'); 284 if (slash) 285 *sys_name = slash + 1; 178 286 179 287 /* found a usb device */ … … 181 289 } 182 290 183 static void *linux_netlink_event_thread_main(void *arg) 184 { 185 struct pollfd fds = {.fd = linux_netlink_socket, 186 .events = POLLIN}; 187 unsigned char buffer[1024]; 188 struct iovec iov = {.iov_base = buffer, .iov_len = sizeof(buffer)}; 189 struct msghdr meh = { .msg_iov=&iov, .msg_iovlen=1, 190 .msg_name=&snl, .msg_namelen=sizeof(snl) }; 291 static int linux_netlink_read_message(void) 292 { 293 char cred_buffer[CMSG_SPACE(sizeof(struct ucred))]; 294 char msg_buffer[2048]; 295 const char *sys_name = NULL; 191 296 uint8_t busnum, devaddr; 192 297 int detached, r; 193 size_t len; 194 195 /* silence compiler warning */ 196 (void) arg; 197 198 while (1 == poll(&fds, 1, -1)) { 199 const char *sys_name = NULL; 200 201 if (POLLIN != fds.revents) { 298 ssize_t len; 299 struct cmsghdr *cmsg; 300 struct ucred *cred; 301 struct sockaddr_nl sa_nl; 302 struct iovec iov = { .iov_base = msg_buffer, .iov_len = sizeof(msg_buffer) }; 303 struct msghdr msg = { 304 .msg_iov = &iov, .msg_iovlen = 1, 305 .msg_control = cred_buffer, .msg_controllen = sizeof(cred_buffer), 306 .msg_name = &sa_nl, .msg_namelen = sizeof(sa_nl) 307 }; 308 309 /* read netlink message */ 310 len = recvmsg(linux_netlink_socket, &msg, 0); 311 if (len == -1) { 312 if (errno != EAGAIN && errno != EINTR) 313 usbi_err(NULL, "error receiving message from netlink (%d)", errno); 314 return -1; 315 } 316 317 if (len < 32 || (msg.msg_flags & MSG_TRUNC)) { 318 usbi_err(NULL, "invalid netlink message length"); 319 return -1; 320 } 321 322 if (sa_nl.nl_groups != NL_GROUP_KERNEL || sa_nl.nl_pid != 0) { 323 usbi_dbg("ignoring netlink message from unknown group/PID (%u/%u)", 324 (unsigned int)sa_nl.nl_groups, (unsigned int)sa_nl.nl_pid); 325 return -1; 326 } 327 328 cmsg = CMSG_FIRSTHDR(&msg); 329 if (!cmsg || cmsg->cmsg_type != SCM_CREDENTIALS) { 330 usbi_dbg("ignoring netlink message with no sender credentials"); 331 return -1; 332 } 333 334 cred = (struct ucred *)CMSG_DATA(cmsg); 335 if (cred->uid != 0) { 336 usbi_dbg("ignoring netlink message with non-zero sender UID %u", (unsigned int)cred->uid); 337 return -1; 338 } 339 340 r = linux_netlink_parse(msg_buffer, (size_t)len, &detached, &sys_name, &busnum, &devaddr); 341 if (r) 342 return r; 343 344 usbi_dbg("netlink hotplug found device busnum: %hhu, devaddr: %hhu, sys_name: %s, removed: %s", 345 busnum, devaddr, sys_name, detached ? "yes" : "no"); 346 347 /* signal device is available (or not) to all contexts */ 348 if (detached) 349 linux_device_disconnected(busnum, devaddr); 350 else 351 linux_hotplug_enumerate(busnum, devaddr, sys_name); 352 353 return 0; 354 } 355 356 static void *linux_netlink_event_thread_main(void *arg) 357 { 358 char dummy; 359 ssize_t r; 360 struct pollfd fds[] = { 361 { .fd = netlink_control_pipe[0], 362 .events = POLLIN }, 363 { .fd = linux_netlink_socket, 364 .events = POLLIN }, 365 }; 366 367 UNUSED(arg); 368 369 usbi_dbg("netlink event thread entering"); 370 371 while (poll(fds, 2, -1) >= 0) { 372 if (fds[0].revents & POLLIN) { 373 /* activity on control pipe, read the byte and exit */ 374 r = usbi_read(netlink_control_pipe[0], &dummy, sizeof(dummy)); 375 if (r <= 0) 376 usbi_warn(NULL, "netlink control pipe read failed"); 202 377 break; 203 378 } 204 205 /* read netlink message */ 206 memset(buffer, 0, sizeof(buffer)); 207 len = recvmsg(linux_netlink_socket, &meh, 0); 208 if (len < 32) { 209 usbi_dbg("error recieving message from netlink"); 210 continue; 211 } 212 213 /* TODO -- authenticate this message is from the kernel or udevd */ 214 215 r = linux_netlink_parse(buffer, len, &detached, &sys_name, 216 &busnum, &devaddr); 217 if (r) 218 continue; 219 220 usbi_dbg("netlink hotplug found device busnum: %hhu, devaddr: %hhu, sys_name: %s, removed: %s", 221 busnum, devaddr, sys_name, detached ? "yes" : "no"); 222 223 /* signal device is available (or not) to all contexts */ 224 if (detached) 225 linux_hotplug_disconnected(busnum, devaddr, sys_name); 226 else 227 linux_hotplug_enumerate(busnum, devaddr, sys_name); 228 } 229 230 return NULL; 231 } 379 if (fds[1].revents & POLLIN) { 380 usbi_mutex_static_lock(&linux_hotplug_lock); 381 linux_netlink_read_message(); 382 usbi_mutex_static_unlock(&linux_hotplug_lock); 383 } 384 } 385 386 usbi_dbg("netlink event thread exiting"); 387 388 return NULL; 389 } 390 391 void linux_netlink_hotplug_poll(void) 392 { 393 int r; 394 395 usbi_mutex_static_lock(&linux_hotplug_lock); 396 do { 397 r = linux_netlink_read_message(); 398 } while (r == 0); 399 usbi_mutex_static_unlock(&linux_hotplug_lock); 400 } -
TabularUnified libusb1/trunk/libusb/os/linux_udev.c ¶
r1876 r1882 22 22 23 23 #include <config.h> 24 25 #include <assert.h> 24 26 #include <ctype.h> 25 27 #include <dirent.h> … … 38 40 #include <libudev.h> 39 41 40 #include "libusb.h"41 42 #include "libusbi.h" 42 43 #include "linux_usbfs.h" … … 45 46 static struct udev *udev_ctx = NULL; 46 47 static int udev_monitor_fd = -1; 48 static int udev_control_pipe[2] = {-1, -1}; 47 49 static struct udev_monitor *udev_monitor = NULL; 48 50 static pthread_t linux_event_thread; 49 51 50 static void udev_hotplug_event( void);52 static void udev_hotplug_event(struct udev_device* udev_dev); 51 53 static void *linux_udev_event_thread_main(void *arg); 52 54 … … 55 57 int r; 56 58 57 if (NULL == udev_ctx) { 58 udev_ctx = udev_new(); 59 if (!udev_ctx) { 60 return LIBUSB_ERROR_OTHER; 61 } 62 } 63 64 udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev"); 65 if (!udev_monitor) { 66 usbi_err(NULL, "could not initialize udev monitor"); 67 return LIBUSB_ERROR_OTHER; 68 } 69 70 r = udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "usb", 0); 71 if (r) { 72 usbi_err(NULL, "could not initialize udev monitor filter for \"usb\" subsystem"); 73 return LIBUSB_ERROR_OTHER; 74 } 75 76 if (udev_monitor_enable_receiving(udev_monitor)) { 77 usbi_err(NULL, "failed to enable the udev monitor"); 78 return LIBUSB_ERROR_OTHER; 79 } 80 81 udev_monitor_fd = udev_monitor_get_fd(udev_monitor); 82 83 pthread_create(&linux_event_thread, NULL, linux_udev_event_thread_main, NULL); 84 85 return LIBUSB_SUCCESS; 59 assert(udev_ctx == NULL); 60 udev_ctx = udev_new(); 61 if (!udev_ctx) { 62 usbi_err(NULL, "could not create udev context"); 63 goto err; 64 } 65 66 udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev"); 67 if (!udev_monitor) { 68 usbi_err(NULL, "could not initialize udev monitor"); 69 goto err_free_ctx; 70 } 71 72 r = udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "usb", "usb_device"); 73 if (r) { 74 usbi_err(NULL, "could not initialize udev monitor filter for \"usb\" subsystem"); 75 goto err_free_monitor; 76 } 77 78 if (udev_monitor_enable_receiving(udev_monitor)) { 79 usbi_err(NULL, "failed to enable the udev monitor"); 80 goto err_free_monitor; 81 } 82 83 udev_monitor_fd = udev_monitor_get_fd(udev_monitor); 84 85 /* Some older versions of udev are not non-blocking by default, 86 * so make sure this is set */ 87 r = fcntl(udev_monitor_fd, F_GETFL); 88 if (r == -1) { 89 usbi_err(NULL, "getting udev monitor fd flags (%d)", errno); 90 goto err_free_monitor; 91 } 92 r = fcntl(udev_monitor_fd, F_SETFL, r | O_NONBLOCK); 93 if (r) { 94 usbi_err(NULL, "setting udev monitor fd flags (%d)", errno); 95 goto err_free_monitor; 96 } 97 98 r = usbi_pipe(udev_control_pipe); 99 if (r) { 100 usbi_err(NULL, "could not create udev control pipe"); 101 goto err_free_monitor; 102 } 103 104 r = pthread_create(&linux_event_thread, NULL, linux_udev_event_thread_main, NULL); 105 if (r) { 106 usbi_err(NULL, "creating hotplug event thread (%d)", r); 107 goto err_close_pipe; 108 } 109 110 return LIBUSB_SUCCESS; 111 112 err_close_pipe: 113 close(udev_control_pipe[0]); 114 close(udev_control_pipe[1]); 115 err_free_monitor: 116 udev_monitor_unref(udev_monitor); 117 udev_monitor = NULL; 118 udev_monitor_fd = -1; 119 err_free_ctx: 120 udev_unref(udev_ctx); 121 err: 122 udev_ctx = NULL; 123 return LIBUSB_ERROR_OTHER; 86 124 } 87 125 88 126 int linux_udev_stop_event_monitor(void) 89 127 { 90 if (-1 == udev_monitor_fd) { 91 /* this should never happen */ 92 return LIBUSB_ERROR_OTHER; 93 } 94 95 /* Cancel the event thread. This is the only way to garauntee the thread 96 exits since closing the monitor fd won't necessarily cause poll 97 to return. */ 98 pthread_cancel(linux_event_thread); 128 char dummy = 1; 129 int r; 130 131 assert(udev_ctx != NULL); 132 assert(udev_monitor != NULL); 133 assert(udev_monitor_fd != -1); 134 135 /* Write some dummy data to the control pipe and 136 * wait for the thread to exit */ 137 r = usbi_write(udev_control_pipe[1], &dummy, sizeof(dummy)); 138 if (r <= 0) { 139 usbi_warn(NULL, "udev control pipe signal failed"); 140 } 141 pthread_join(linux_event_thread, NULL); 99 142 100 143 /* Release the udev monitor */ 101 144 udev_monitor_unref(udev_monitor); 102 145 udev_monitor = NULL; 103 146 udev_monitor_fd = -1; 104 147 105 148 /* Clean up the udev context */ … … 107 150 udev_ctx = NULL; 108 151 109 return LIBUSB_SUCCESS; 152 /* close and reset control pipe */ 153 close(udev_control_pipe[0]); 154 close(udev_control_pipe[1]); 155 udev_control_pipe[0] = -1; 156 udev_control_pipe[1] = -1; 157 158 return LIBUSB_SUCCESS; 110 159 } 111 160 112 161 static void *linux_udev_event_thread_main(void *arg) 113 162 { 114 struct pollfd fds = {.fd = udev_monitor_fd, 115 .events = POLLIN}; 163 char dummy; 164 int r; 165 struct udev_device* udev_dev; 166 struct pollfd fds[] = { 167 {.fd = udev_control_pipe[0], 168 .events = POLLIN}, 169 {.fd = udev_monitor_fd, 170 .events = POLLIN}, 171 }; 116 172 117 173 usbi_dbg("udev event thread entering."); 118 174 119 while (1 == poll(&fds, 1, -1)) { 120 if (NULL == udev_monitor || POLLIN != fds.revents) { 175 while (poll(fds, 2, -1) >= 0) { 176 if (fds[0].revents & POLLIN) { 177 /* activity on control pipe, read the byte and exit */ 178 r = usbi_read(udev_control_pipe[0], &dummy, sizeof(dummy)); 179 if (r <= 0) { 180 usbi_warn(NULL, "udev control pipe read failed"); 181 } 121 182 break; 122 183 } 123 124 udev_hotplug_event(); 184 if (fds[1].revents & POLLIN) { 185 usbi_mutex_static_lock(&linux_hotplug_lock); 186 udev_dev = udev_monitor_receive_device(udev_monitor); 187 if (udev_dev) 188 udev_hotplug_event(udev_dev); 189 usbi_mutex_static_unlock(&linux_hotplug_lock); 190 } 125 191 } 126 192 … … 145 211 } 146 212 147 213 return linux_get_device_address(ctx, detached, busnum, devaddr, 148 214 dev_node, *sys_name); 149 215 } 150 216 151 static void udev_hotplug_event(void) 152 { 153 struct udev_device* udev_dev; 217 static void udev_hotplug_event(struct udev_device* udev_dev) 218 { 154 219 const char* udev_action; 155 220 const char* sys_name = NULL; … … 158 223 int r; 159 224 160 if (NULL == udev_monitor) {161 return;162 }163 164 225 do { 165 udev_dev = udev_monitor_receive_device(udev_monitor);166 if (!udev_dev) {167 usbi_err(NULL, "failed to read data from udev monitor socket.");168 return;169 }170 171 226 udev_action = udev_device_get_action(udev_dev); 172 227 if (!udev_action) { … … 186 241 linux_hotplug_enumerate(busnum, devaddr, sys_name); 187 242 } else if (detached) { 188 linux_ hotplug_disconnected(busnum, devaddr, sys_name);243 linux_device_disconnected(busnum, devaddr); 189 244 } else { 190 245 usbi_err(NULL, "ignoring udev action %s", udev_action); … … 203 258 int r; 204 259 205 if (NULL == udev_ctx) { 206 udev_ctx = udev_new(); 207 if (!udev_ctx) { 208 return LIBUSB_ERROR_OTHER; 209 } 210 } 260 assert(udev_ctx != NULL); 211 261 212 262 enumerator = udev_enumerate_new(udev_ctx); … … 217 267 218 268 udev_enumerate_add_match_subsystem(enumerator, "usb"); 269 udev_enumerate_add_match_property(enumerator, "DEVTYPE", "usb_device"); 219 270 udev_enumerate_scan_devices(enumerator); 220 271 devices = udev_enumerate_get_list_entry(enumerator); … … 238 289 udev_enumerate_unref(enumerator); 239 290 240 return LIBUSB_SUCCESS; 241 } 242 291 return LIBUSB_SUCCESS; 292 } 293 294 void linux_udev_hotplug_poll(void) 295 { 296 struct udev_device* udev_dev; 297 298 usbi_mutex_static_lock(&linux_hotplug_lock); 299 do { 300 udev_dev = udev_monitor_receive_device(udev_monitor); 301 if (udev_dev) { 302 usbi_dbg("Handling hotplug event from hotplug_poll"); 303 udev_hotplug_event(udev_dev); 304 } 305 } while (udev_dev); 306 usbi_mutex_static_unlock(&linux_hotplug_lock); 307 } -
TabularUnified libusb1/trunk/libusb/os/linux_usbfs.c ¶
r1876 r1882 2 2 /* 3 3 * Linux usbfs backend for libusb 4 * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org> 5 * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> 6 * Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.com> 4 * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org> 5 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 6 * Copyright © 2013 Nathan Hjelm <hjelmn@mac.com> 7 * Copyright © 2012-2013 Hans de Goede <hdegoede@redhat.com> 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 21 22 */ 22 23 23 #include <config.h> 24 #include "config.h" 25 26 #include <assert.h> 24 27 #include <ctype.h> 25 28 #include <dirent.h> … … 31 34 #include <string.h> 32 35 #include <sys/ioctl.h> 36 #include <sys/mman.h> 33 37 #include <sys/stat.h> 34 38 #include <sys/types.h> 35 39 #include <sys/utsname.h> 36 #include <unistd.h> 37 38 #include "libusb.h" 40 #include <time.h> 41 39 42 #include "libusbi.h" 40 43 #include "linux_usbfs.h" … … 46 49 * sysfs allows us to read the kernel's in-memory copies of device descriptors 47 50 * and so forth, avoiding the need to open the device: 48 * - The binary "descriptors" file was added in 2.6.23. 49 * - The "busnum" file was added in 2.6.22 51 * - The binary "descriptors" file contains all config descriptors since 52 * 2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed 53 * - The binary "descriptors" file was added in 2.6.23, commit 54 * 69d42a78f935d19384d1f6e4f94b65bb162b36df, but it only contains the 55 * active config descriptors 56 * - The "busnum" file was added in 2.6.22, commit 57 * 83f7d958eab2fbc6b159ee92bf1493924e1d0f72 50 58 * - The "devnum" file has been present since pre-2.6.18 51 59 * - the "bConfigurationValue" file has been present since pre-2.6.18 … … 53 61 * If we have bConfigurationValue, busnum, and devnum, then we can determine 54 62 * the active configuration without having to open the usbfs node in RDWR mode. 55 * We assume this is the case if we see the busnum file (indicates 2.6.22+).56 63 * The busnum file is important as that is the only way we can relate sysfs 57 64 * devices to usbfs nodes. 58 65 * 59 * If we also have descriptors, we can obtain the device descriptor and active66 * If we also have all descriptors, we can obtain the device descriptor and 60 67 * configuration without touching usbfs at all. 61 *62 * The descriptors file originally only contained the active configuration63 * descriptor alongside the device descriptor, but all configurations are64 * included as of Linux 2.6.26.65 68 */ 66 69 … … 70 73 * descriptor as host endian. Multi-byte fields in the other descriptors are 71 74 * bus-endian. The kernel documentation says otherwise, but it is wrong. 75 * 76 * In sysfs all descriptors are bus-endian. 72 77 */ 73 78 74 const char *usbfs_path = NULL;79 static const char *usbfs_path = NULL; 75 80 76 81 /* use usbdev*.* device names in /dev instead of the usbfs bus directories */ … … 104 109 static clockid_t monotonic_clkid = -1; 105 110 106 /* do we have a busnum to relate devices? this also implies that we can read 111 /* Linux 2.6.22 (commit 83f7d958eab2fbc6b159ee92bf1493924e1d0f72) adds a busnum 112 * to sysfs, so we can relate devices. This also implies that we can read 107 113 * the active configuration through bConfigurationValue */ 108 static int sysfs_can_relate_devices = 0; 109 110 /* do we have a descriptors file? */ 111 static int sysfs_has_descriptors = 0; 114 static int sysfs_can_relate_devices = -1; 115 116 /* Linux 2.6.26 (commit 217a9081d8e69026186067711131b77f0ce219ed) adds all 117 * config descriptors (rather then just the active config) to the sysfs 118 * descriptors file, so from then on we can use them. */ 119 static int sysfs_has_descriptors = -1; 112 120 113 121 /* how many times have we initted (and not exited) ? */ 114 static volatile int init_count = 0; 115 116 /* lock for init_count */ 117 static pthread_mutex_t hotplug_lock = PTHREAD_MUTEX_INITIALIZER; 122 static int init_count = 0; 123 124 /* Serialize hotplug start/stop */ 125 static usbi_mutex_static_t linux_hotplug_startstop_lock = USBI_MUTEX_INITIALIZER; 126 /* Serialize scan-devices, event-thread, and poll */ 127 usbi_mutex_static_t linux_hotplug_lock = USBI_MUTEX_INITIALIZER; 118 128 119 129 static int linux_start_event_monitor(void); 120 130 static int linux_stop_event_monitor(void); 121 131 static int linux_scan_devices(struct libusb_context *ctx); 132 static int sysfs_scan_device(struct libusb_context *ctx, const char *devname); 133 static int detach_kernel_driver_and_claim(struct libusb_device_handle *, int); 122 134 123 135 #if !defined(USE_UDEV) … … 127 139 struct linux_device_priv { 128 140 char *sysfs_dir; 129 unsigned char *dev_descriptor; 130 unsigned char *config_descriptor; 141 unsigned char *descriptors; 142 int descriptors_len; 143 int active_config; /* cache val for !sysfs_can_relate_devices */ 131 144 }; 132 145 133 146 struct linux_device_handle_priv { 134 147 int fd; 148 int fd_removed; 135 149 uint32_t caps; 136 150 }; … … 167 181 }; 168 182 169 static void _get_usbfs_path(struct libusb_device *dev, char *path) 170 { 183 static int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent) 184 { 185 struct libusb_context *ctx = DEVICE_CTX(dev); 186 char path[PATH_MAX]; 187 int fd; 188 int delay = 10000; 189 171 190 if (usbdev_names) 172 191 snprintf(path, PATH_MAX, "%s/usbdev%d.%d", … … 175 194 snprintf(path, PATH_MAX, "%s/%03d/%03d", 176 195 usbfs_path, dev->bus_number, dev->device_address); 196 197 fd = open(path, mode); 198 if (fd != -1) 199 return fd; /* Success */ 200 201 if (errno == ENOENT) { 202 if (!silent) 203 usbi_err(ctx, "File doesn't exist, wait %d ms and try again", delay/1000); 204 205 /* Wait 10ms for USB device path creation.*/ 206 nanosleep(&(struct timespec){delay / 1000000, (delay * 1000) % 1000000000UL}, NULL); 207 208 fd = open(path, mode); 209 if (fd != -1) 210 return fd; /* Success */ 211 } 212 213 if (!silent) { 214 usbi_err(ctx, "libusb couldn't open USB device %s: %s", 215 path, strerror(errno)); 216 if (errno == EACCES && mode == O_RDWR) 217 usbi_err(ctx, "libusb requires write access to USB " 218 "device nodes."); 219 } 220 221 if (errno == EACCES) 222 return LIBUSB_ERROR_ACCESS; 223 if (errno == ENOENT) 224 return LIBUSB_ERROR_NO_DEVICE; 225 return LIBUSB_ERROR_IO; 177 226 } 178 227 … … 261 310 } 262 311 312 /* On udev based systems without any usb-devices /dev/bus/usb will not 313 * exist. So if we've not found anything and we're using udev for hotplug 314 * simply assume /dev/bus/usb rather then making libusb_init fail. */ 315 #if defined(USE_UDEV) 316 if (ret == NULL) 317 ret = "/dev/bus/usb"; 318 #endif 319 263 320 if (ret != NULL) 264 321 usbi_dbg("found usbfs at %s", ret); … … 317 374 } 318 375 319 /* Return 1 if filename exists inside dirname in sysfs.320 SYSFS_DEVICE_PATH is assumed to be the beginning of the path. */321 static int sysfs_has_file(const char *dirname, const char *filename)322 {323 struct stat statbuf;324 char path[PATH_MAX];325 int r;326 327 snprintf(path, PATH_MAX, "%s/%s/%s", SYSFS_DEVICE_PATH, dirname, filename);328 r = stat(path, &statbuf);329 if (r == 0 && S_ISREG(statbuf.st_mode))330 return 1;331 332 return 0;333 }334 335 376 static int op_init(struct libusb_context *ctx) 336 377 { … … 371 412 usbi_dbg("zero length packet flag supported"); 372 413 373 r = stat(SYSFS_DEVICE_PATH, &statbuf); 374 if (r == 0 && S_ISDIR(statbuf.st_mode)) { 375 DIR *devices = opendir(SYSFS_DEVICE_PATH); 376 struct dirent *entry; 377 378 usbi_dbg("found usb devices in sysfs"); 379 380 if (!devices) { 381 usbi_err(ctx, "opendir devices failed errno=%d", errno); 382 return LIBUSB_ERROR_IO; 383 } 384 385 /* Make sure sysfs supports all the required files. If it 386 * does not, then usbfs will be used instead. Determine 387 * this by looping through the directories in 388 * SYSFS_DEVICE_PATH. With the assumption that there will 389 * always be subdirectories of the name usbN (usb1, usb2, 390 * etc) representing the root hubs, check the usbN 391 * subdirectories to see if they have all the needed files. 392 * This algorithm uses the usbN subdirectories (root hubs) 393 * because a device disconnection will cause a race 394 * condition regarding which files are available, sometimes 395 * causing an incorrect result. The root hubs are used 396 * because it is assumed that they will always be present. 397 * See the "sysfs vs usbfs" comment at the top of this file 398 * for more details. */ 399 while ((entry = readdir(devices))) { 400 int has_busnum=0, has_devnum=0, has_descriptors=0; 401 int has_configuration_value=0; 402 403 /* Only check the usbN directories. */ 404 if (strncmp(entry->d_name, "usb", 3) != 0) 405 continue; 406 407 /* Check for the files libusb needs from sysfs. */ 408 has_busnum = sysfs_has_file(entry->d_name, "busnum"); 409 has_devnum = sysfs_has_file(entry->d_name, "devnum"); 410 has_descriptors = sysfs_has_file(entry->d_name, "descriptors"); 411 has_configuration_value = sysfs_has_file(entry->d_name, "bConfigurationValue"); 412 413 if (has_busnum && has_devnum && has_configuration_value) 414 sysfs_can_relate_devices = 1; 415 if (has_descriptors) 416 sysfs_has_descriptors = 1; 417 418 /* Only need to check until we've found ONE device which 419 has all the attributes. */ 420 if (sysfs_has_descriptors && sysfs_can_relate_devices) 421 break; 422 } 423 closedir(devices); 424 425 /* Only use sysfs descriptors if the rest of 426 sysfs will work for libusb. */ 427 if (!sysfs_can_relate_devices) 414 if (-1 == sysfs_has_descriptors) { 415 /* sysfs descriptors has all descriptors since Linux 2.6.26 */ 416 sysfs_has_descriptors = kernel_version_ge(2,6,26); 417 if (-1 == sysfs_has_descriptors) { 418 usbi_err(ctx, "error checking for sysfs descriptors"); 419 return LIBUSB_ERROR_OTHER; 420 } 421 } 422 423 if (-1 == sysfs_can_relate_devices) { 424 /* sysfs has busnum since Linux 2.6.22 */ 425 sysfs_can_relate_devices = kernel_version_ge(2,6,22); 426 if (-1 == sysfs_can_relate_devices) { 427 usbi_err(ctx, "error checking for sysfs busnum"); 428 return LIBUSB_ERROR_OTHER; 429 } 430 } 431 432 if (sysfs_can_relate_devices || sysfs_has_descriptors) { 433 r = stat(SYSFS_DEVICE_PATH, &statbuf); 434 if (r != 0 || !S_ISDIR(statbuf.st_mode)) { 435 usbi_warn(ctx, "sysfs not mounted"); 436 sysfs_can_relate_devices = 0; 428 437 sysfs_has_descriptors = 0; 429 } else { 430 usbi_dbg("sysfs usb info not available"); 431 sysfs_has_descriptors = 0; 432 sysfs_can_relate_devices = 0; 433 } 434 435 pthread_mutex_lock(&hotplug_lock); 436 if (!init_count++) { 437 /* start up hotplug event handler */ 438 r = linux_start_event_monitor(); 439 if (LIBUSB_SUCCESS != r) { 440 usbi_err(ctx, "error starting hotplug event monitor"); 441 return r; 442 } 443 } 444 pthread_mutex_unlock(&hotplug_lock); 445 446 r = linux_scan_devices(ctx); 447 if (LIBUSB_SUCCESS != r) { 448 return r; 449 } 438 } 439 } 440 441 if (sysfs_can_relate_devices) 442 usbi_dbg("sysfs can relate devices"); 443 444 if (sysfs_has_descriptors) 445 usbi_dbg("sysfs has complete descriptors"); 446 447 usbi_mutex_static_lock(&linux_hotplug_startstop_lock); 448 r = LIBUSB_SUCCESS; 449 if (init_count == 0) { 450 /* start up hotplug event handler */ 451 r = linux_start_event_monitor(); 452 } 453 if (r == LIBUSB_SUCCESS) { 454 r = linux_scan_devices(ctx); 455 if (r == LIBUSB_SUCCESS) 456 init_count++; 457 else if (init_count == 0) 458 linux_stop_event_monitor(); 459 } else 460 usbi_err(ctx, "error starting hotplug event monitor"); 461 usbi_mutex_static_unlock(&linux_hotplug_startstop_lock); 450 462 451 463 return r; … … 454 466 static void op_exit(void) 455 467 { 456 if (!init_count) { 457 /* should not happen */ 458 return; 459 } 460 461 pthread_mutex_lock(&hotplug_lock); 462 if (!--init_count) { 463 /* tear down event handler */ 464 (void)linux_stop_event_monitor(); 465 } 466 pthread_mutex_unlock(&hotplug_lock); 468 usbi_mutex_static_lock(&linux_hotplug_startstop_lock); 469 assert(init_count != 0); 470 if (!--init_count) { 471 /* tear down event handler */ 472 (void)linux_stop_event_monitor(); 473 } 474 usbi_mutex_static_unlock(&linux_hotplug_startstop_lock); 467 475 } 468 476 … … 470 478 { 471 479 #if defined(USE_UDEV) 472 480 return linux_udev_start_event_monitor(); 473 481 #else 474 482 return linux_netlink_start_event_monitor(); 475 483 #endif 476 484 } … … 479 487 { 480 488 #if defined(USE_UDEV) 481 489 return linux_udev_stop_event_monitor(); 482 490 #else 483 491 return linux_netlink_stop_event_monitor(); 484 492 #endif 485 493 } … … 487 495 static int linux_scan_devices(struct libusb_context *ctx) 488 496 { 497 int ret; 498 499 usbi_mutex_static_lock(&linux_hotplug_lock); 500 489 501 #if defined(USE_UDEV) 490 returnlinux_udev_scan_devices(ctx);502 ret = linux_udev_scan_devices(ctx); 491 503 #else 492 returnlinux_default_scan_devices(ctx);504 ret = linux_default_scan_devices(ctx); 493 505 #endif 494 } 495 496 static int usbfs_get_device_descriptor(struct libusb_device *dev, 497 unsigned char *buffer) 498 { 499 struct linux_device_priv *priv = _device_priv(dev); 500 501 /* return cached copy */ 502 memcpy(buffer, priv->dev_descriptor, DEVICE_DESC_LENGTH); 503 return 0; 506 507 usbi_mutex_static_unlock(&linux_hotplug_lock); 508 509 return ret; 510 } 511 512 static void op_hotplug_poll(void) 513 { 514 #if defined(USE_UDEV) 515 linux_udev_hotplug_poll(); 516 #else 517 linux_netlink_hotplug_poll(); 518 #endif 504 519 } 505 520 … … 557 572 } 558 573 559 static int sysfs_get_device_descriptor(struct libusb_device *dev,560 unsigned char *buffer)561 {562 int fd;563 ssize_t r;564 565 /* sysfs provides access to an in-memory copy of the device descriptor,566 * so we use that rather than keeping our own copy */567 568 fd = _open_sysfs_attr(dev, "descriptors");569 if (fd < 0)570 return fd;571 572 r = read(fd, buffer, DEVICE_DESC_LENGTH);;573 close(fd);574 if (r < 0) {575 usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", fd, errno);576 return LIBUSB_ERROR_IO;577 } else if (r < DEVICE_DESC_LENGTH) {578 usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, DEVICE_DESC_LENGTH);579 return LIBUSB_ERROR_IO;580 }581 582 return 0;583 }584 585 574 static int op_get_device_descriptor(struct libusb_device *dev, 586 575 unsigned char *buffer, int *host_endian) 587 576 { 588 if (sysfs_has_descriptors) {589 *host_endian = 0;590 return sysfs_get_device_descriptor(dev, buffer);591 } else {592 *host_endian = 1;593 return usbfs_get_device_descriptor(dev, buffer);594 }595 }596 597 static int usbfs_get_active_config_descriptor(struct libusb_device *dev,598 unsigned char *buffer, size_t len)599 {600 577 struct linux_device_priv *priv = _device_priv(dev); 601 if (!priv->config_descriptor) 602 return LIBUSB_ERROR_NOT_FOUND; /* device is unconfigured */ 603 604 /* retrieve cached copy */ 605 memcpy(buffer, priv->config_descriptor, len); 578 579 *host_endian = sysfs_has_descriptors ? 0 : 1; 580 memcpy(buffer, priv->descriptors, DEVICE_DESC_LENGTH); 581 606 582 return 0; 607 583 } … … 611 587 { 612 588 char *endptr; 613 char tmp[ 4] = {0, 0, 0, 0};589 char tmp[5] = {0, 0, 0, 0, 0}; 614 590 long num; 615 591 int fd; … … 623 599 close(fd); 624 600 if (r < 0) { 625 usbi_err(DEVICE_CTX(dev), 601 usbi_err(DEVICE_CTX(dev), 626 602 "read bConfigurationValue failed ret=%d errno=%d", r, errno); 627 603 return LIBUSB_ERROR_IO; … … 650 626 } 651 627 652 /* takes a usbfs/descriptors fd seeked to the start of a configuration, and 653 * seeks to the next one. */ 654 static int seek_to_next_config(struct libusb_context *ctx, int fd, 655 int host_endian) 628 int linux_get_device_address (struct libusb_context *ctx, int detached, 629 uint8_t *busnum, uint8_t *devaddr,const char *dev_node, 630 const char *sys_name) 631 { 632 int sysfs_attr; 633 634 usbi_dbg("getting address for device: %s detached: %d", sys_name, detached); 635 /* can't use sysfs to read the bus and device number if the 636 * device has been detached */ 637 if (!sysfs_can_relate_devices || detached || NULL == sys_name) { 638 if (NULL == dev_node) { 639 return LIBUSB_ERROR_OTHER; 640 } 641 642 /* will this work with all supported kernel versions? */ 643 if (!strncmp(dev_node, "/dev/bus/usb", 12)) { 644 sscanf (dev_node, "/dev/bus/usb/%hhu/%hhu", busnum, devaddr); 645 } else if (!strncmp(dev_node, "/proc/bus/usb", 13)) { 646 sscanf (dev_node, "/proc/bus/usb/%hhu/%hhu", busnum, devaddr); 647 } 648 649 return LIBUSB_SUCCESS; 650 } 651 652 usbi_dbg("scan %s", sys_name); 653 654 sysfs_attr = __read_sysfs_attr(ctx, sys_name, "busnum"); 655 if (0 > sysfs_attr) 656 return sysfs_attr; 657 if (sysfs_attr > 255) 658 return LIBUSB_ERROR_INVALID_PARAM; 659 *busnum = (uint8_t) sysfs_attr; 660 661 sysfs_attr = __read_sysfs_attr(ctx, sys_name, "devnum"); 662 if (0 > sysfs_attr) 663 return sysfs_attr; 664 if (sysfs_attr > 255) 665 return LIBUSB_ERROR_INVALID_PARAM; 666 667 *devaddr = (uint8_t) sysfs_attr; 668 669 usbi_dbg("bus=%d dev=%d", *busnum, *devaddr); 670 671 return LIBUSB_SUCCESS; 672 } 673 674 /* Return offset of the next descriptor with the given type */ 675 static int seek_to_next_descriptor(struct libusb_context *ctx, 676 uint8_t descriptor_type, unsigned char *buffer, int size) 677 { 678 struct usb_descriptor_header header; 679 int i; 680 681 for (i = 0; size >= 0; i += header.bLength, size -= header.bLength) { 682 if (size == 0) 683 return LIBUSB_ERROR_NOT_FOUND; 684 685 if (size < 2) { 686 usbi_err(ctx, "short descriptor read %d/2", size); 687 return LIBUSB_ERROR_IO; 688 } 689 usbi_parse_descriptor(buffer + i, "bb", &header, 0); 690 691 if (i && header.bDescriptorType == descriptor_type) 692 return i; 693 } 694 usbi_err(ctx, "bLength overflow by %d bytes", -size); 695 return LIBUSB_ERROR_IO; 696 } 697 698 /* Return offset to next config */ 699 static int seek_to_next_config(struct libusb_context *ctx, 700 unsigned char *buffer, int size) 656 701 { 657 702 struct libusb_config_descriptor config; 658 unsigned char tmp[6]; 659 off_t off; 660 ssize_t r; 661 662 /* read first 6 bytes of descriptor */ 663 r = read(fd, tmp, sizeof(tmp)); 664 if (r < 0) { 665 usbi_err(ctx, "read failed ret=%d errno=%d", r, errno); 703 704 if (size == 0) 705 return LIBUSB_ERROR_NOT_FOUND; 706 707 if (size < LIBUSB_DT_CONFIG_SIZE) { 708 usbi_err(ctx, "short descriptor read %d/%d", 709 size, LIBUSB_DT_CONFIG_SIZE); 666 710 return LIBUSB_ERROR_IO; 667 } else if (r < sizeof(tmp)) { 668 usbi_err(ctx, "short descriptor read %d/%d", r, sizeof(tmp)); 711 } 712 713 usbi_parse_descriptor(buffer, "bbwbbbbb", &config, 0); 714 if (config.bDescriptorType != LIBUSB_DT_CONFIG) { 715 usbi_err(ctx, "descriptor is not a config desc (type 0x%02x)", 716 config.bDescriptorType); 669 717 return LIBUSB_ERROR_IO; 670 718 } 671 719 672 /* seek forward to end of config */ 673 usbi_parse_descriptor(tmp, "bbwbb", &config, host_endian); 674 off = lseek(fd, config.wTotalLength - sizeof(tmp), SEEK_CUR); 675 if (off < 0) { 676 usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno); 677 return LIBUSB_ERROR_IO; 678 } 679 680 return 0; 681 } 682 683 static int sysfs_get_active_config_descriptor(struct libusb_device *dev, 684 unsigned char *buffer, size_t len) 685 { 686 int fd; 687 ssize_t r; 688 off_t off; 689 int to_copy; 690 int config; 691 unsigned char tmp[6]; 692 693 r = sysfs_get_active_config(dev, &config); 720 /* 721 * In usbfs the config descriptors are config.wTotalLength bytes apart, 722 * with any short reads from the device appearing as holes in the file. 723 * 724 * In sysfs wTotalLength is ignored, instead the kernel returns a 725 * config descriptor with verified bLength fields, with descriptors 726 * with an invalid bLength removed. 727 */ 728 if (sysfs_has_descriptors) { 729 int next = seek_to_next_descriptor(ctx, LIBUSB_DT_CONFIG, 730 buffer, size); 731 if (next == LIBUSB_ERROR_NOT_FOUND) 732 next = size; 733 if (next < 0) 734 return next; 735 736 if (next != config.wTotalLength) 737 usbi_warn(ctx, "config length mismatch wTotalLength " 738 "%d real %d", config.wTotalLength, next); 739 return next; 740 } else { 741 if (config.wTotalLength < LIBUSB_DT_CONFIG_SIZE) { 742 usbi_err(ctx, "invalid wTotalLength %d", 743 config.wTotalLength); 744 return LIBUSB_ERROR_IO; 745 } else if (config.wTotalLength > size) { 746 usbi_warn(ctx, "short descriptor read %d/%d", 747 size, config.wTotalLength); 748 return size; 749 } else 750 return config.wTotalLength; 751 } 752 } 753 754 static int op_get_config_descriptor_by_value(struct libusb_device *dev, 755 uint8_t value, unsigned char **buffer, int *host_endian) 756 { 757 struct libusb_context *ctx = DEVICE_CTX(dev); 758 struct linux_device_priv *priv = _device_priv(dev); 759 unsigned char *descriptors = priv->descriptors; 760 int size = priv->descriptors_len; 761 struct libusb_config_descriptor *config; 762 763 *buffer = NULL; 764 /* Unlike the device desc. config descs. are always in raw format */ 765 *host_endian = 0; 766 767 /* Skip device header */ 768 descriptors += DEVICE_DESC_LENGTH; 769 size -= DEVICE_DESC_LENGTH; 770 771 /* Seek till the config is found, or till "EOF" */ 772 while (1) { 773 int next = seek_to_next_config(ctx, descriptors, size); 774 if (next < 0) 775 return next; 776 config = (struct libusb_config_descriptor *)descriptors; 777 if (config->bConfigurationValue == value) { 778 *buffer = descriptors; 779 return next; 780 } 781 size -= next; 782 descriptors += next; 783 } 784 } 785 786 static int op_get_active_config_descriptor(struct libusb_device *dev, 787 unsigned char *buffer, size_t len, int *host_endian) 788 { 789 int r, config; 790 unsigned char *config_desc; 791 792 if (sysfs_can_relate_devices) { 793 r = sysfs_get_active_config(dev, &config); 794 if (r < 0) 795 return r; 796 } else { 797 /* Use cached bConfigurationValue */ 798 struct linux_device_priv *priv = _device_priv(dev); 799 config = priv->active_config; 800 } 801 if (config == -1) 802 return LIBUSB_ERROR_NOT_FOUND; 803 804 r = op_get_config_descriptor_by_value(dev, config, &config_desc, 805 host_endian); 694 806 if (r < 0) 695 807 return r; 696 if (config == -1) 697 return LIBUSB_ERROR_NOT_FOUND; 698 699 usbi_dbg("active configuration %d", config); 700 701 /* sysfs provides access to an in-memory copy of the device descriptor, 702 * so we use that rather than keeping our own copy */ 703 704 fd = _open_sysfs_attr(dev, "descriptors"); 705 if (fd < 0) 706 return fd; 707 708 /* device might have been unconfigured since we read bConfigurationValue, 709 * so first check that there is any config descriptor data at all... */ 710 off = lseek(fd, 0, SEEK_END); 711 if (off < 1) { 712 usbi_err(DEVICE_CTX(dev), "end seek failed, ret=%d errno=%d", 713 off, errno); 714 close(fd); 715 return LIBUSB_ERROR_IO; 716 } else if (off == DEVICE_DESC_LENGTH) { 717 close(fd); 718 return LIBUSB_ERROR_NOT_FOUND; 719 } 720 721 off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET); 722 if (off < 0) { 723 usbi_err(DEVICE_CTX(dev), "seek failed, ret=%d errno=%d", off, errno); 724 close(fd); 725 return LIBUSB_ERROR_IO; 726 } 727 728 /* unbounded loop: we expect the descriptor to be present under all 729 * circumstances */ 730 while (1) { 731 r = read(fd, tmp, sizeof(tmp)); 732 if (r < 0) { 733 usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", 734 fd, errno); 735 return LIBUSB_ERROR_IO; 736 } else if (r < sizeof(tmp)) { 737 usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, sizeof(tmp)); 738 return LIBUSB_ERROR_IO; 739 } 740 741 /* check bConfigurationValue */ 742 if (tmp[5] == config) 743 break; 744 745 /* try the next descriptor */ 746 off = lseek(fd, 0 - sizeof(tmp), SEEK_CUR); 747 if (off < 0) 748 return LIBUSB_ERROR_IO; 749 750 r = seek_to_next_config(DEVICE_CTX(dev), fd, 0); 808 809 len = MIN(len, r); 810 memcpy(buffer, config_desc, len); 811 return len; 812 } 813 814 static int op_get_config_descriptor(struct libusb_device *dev, 815 uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) 816 { 817 struct linux_device_priv *priv = _device_priv(dev); 818 unsigned char *descriptors = priv->descriptors; 819 int i, r, size = priv->descriptors_len; 820 821 /* Unlike the device desc. config descs. are always in raw format */ 822 *host_endian = 0; 823 824 /* Skip device header */ 825 descriptors += DEVICE_DESC_LENGTH; 826 size -= DEVICE_DESC_LENGTH; 827 828 /* Seek till the config is found, or till "EOF" */ 829 for (i = 0; ; i++) { 830 r = seek_to_next_config(DEVICE_CTX(dev), descriptors, size); 751 831 if (r < 0) 752 832 return r; 753 } 754 755 to_copy = (len < sizeof(tmp)) ? len : sizeof(tmp); 756 memcpy(buffer, tmp, to_copy); 757 if (len > sizeof(tmp)) { 758 r = read(fd, buffer + sizeof(tmp), len - sizeof(tmp)); 759 if (r < 0) { 760 usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", 761 fd, errno); 762 r = LIBUSB_ERROR_IO; 763 } else if (r == 0) { 764 usbi_dbg("device is unconfigured"); 765 r = LIBUSB_ERROR_NOT_FOUND; 766 } else if (r < len - sizeof(tmp)) { 767 usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, len); 768 r = LIBUSB_ERROR_IO; 769 } 770 } else { 771 r = 0; 772 } 773 774 close(fd); 775 return r; 776 } 777 778 int linux_get_device_address (struct libusb_context *ctx, int detached, 779 uint8_t *busnum, uint8_t *devaddr, 780 const char *dev_node, const char *sys_name) 781 { 782 usbi_dbg("getting address for device: %s detached: %d", 783 sys_name, detached); 784 /* can't use sysfs to read the bus and device number if the 785 device has been detached */ 786 if (!sysfs_can_relate_devices || detached || NULL == sys_name) { 787 if (NULL == dev_node) { 788 return LIBUSB_ERROR_OTHER; 789 } 790 791 /* will this work with all supported kernel versions? */ 792 if (!strncmp(dev_node, "/dev/bus/usb", 12)) { 793 sscanf (dev_node, "/dev/bus/usb/%hhd/%hhd", busnum, devaddr); 794 } else if (!strncmp(dev_node, "/proc/bus/usb", 13)) { 795 sscanf (dev_node, "/proc/bus/usb/%hhd/%hhd", busnum, devaddr); 796 } 797 798 return LIBUSB_SUCCESS; 799 } 800 801 usbi_dbg("scan %s", sys_name); 802 803 *busnum = __read_sysfs_attr(ctx, sys_name, "busnum"); 804 if (0 > *busnum) 805 return *busnum; 806 807 *devaddr = __read_sysfs_attr(ctx, sys_name, "devnum"); 808 if (0 > *devaddr) 809 return *devaddr; 810 811 usbi_dbg("bus=%d dev=%d", *busnum, *devaddr); 812 if (*busnum > 255 || *devaddr > 255) 813 return LIBUSB_ERROR_INVALID_PARAM; 814 815 return LIBUSB_SUCCESS; 816 } 817 818 static int op_get_active_config_descriptor(struct libusb_device *dev, 819 unsigned char *buffer, size_t len, int *host_endian) 820 { 821 if (sysfs_has_descriptors) { 822 return sysfs_get_active_config_descriptor(dev, buffer, len); 823 } else { 824 return usbfs_get_active_config_descriptor(dev, buffer, len); 825 } 826 } 827 828 /* takes a usbfs fd, attempts to find the requested config and copy a certain 829 * amount of it into an output buffer. */ 830 static int get_config_descriptor(struct libusb_context *ctx, int fd, 831 uint8_t config_index, unsigned char *buffer, size_t len) 832 { 833 off_t off; 834 ssize_t r; 835 836 off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET); 837 if (off < 0) { 838 usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno); 839 return LIBUSB_ERROR_IO; 840 } 841 842 /* might need to skip some configuration descriptors to reach the 843 * requested configuration */ 844 while (config_index > 0) { 845 r = seek_to_next_config(ctx, fd, 1); 846 if (r < 0) 847 return r; 848 config_index--; 849 } 850 851 /* read the rest of the descriptor */ 852 r = read(fd, buffer, len); 853 if (r < 0) { 854 usbi_err(ctx, "read failed ret=%d errno=%d", r, errno); 855 return LIBUSB_ERROR_IO; 856 } else if (r < len) { 857 usbi_err(ctx, "short output read %d/%d", r, len); 858 return LIBUSB_ERROR_IO; 859 } 860 861 return 0; 862 } 863 864 static int op_get_config_descriptor(struct libusb_device *dev, 865 uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) 866 { 867 char filename[PATH_MAX]; 868 int fd; 869 int r; 870 871 /* always read from usbfs: sysfs only has the active descriptor 872 * this will involve waking the device up, but oh well! */ 873 874 /* FIXME: the above is no longer true, new kernels have all descriptors 875 * in the descriptors file. but its kinda hard to detect if the kernel 876 * is sufficiently new. */ 877 878 _get_usbfs_path(dev, filename); 879 fd = open(filename, O_RDONLY); 880 if (fd < 0) { 881 usbi_err(DEVICE_CTX(dev), 882 "open '%s' failed, ret=%d errno=%d", filename, fd, errno); 883 return LIBUSB_ERROR_IO; 884 } 885 886 r = get_config_descriptor(DEVICE_CTX(dev), fd, config_index, buffer, len); 887 close(fd); 888 return r; 889 } 890 891 /* cache the active config descriptor in memory. a value of -1 means that 892 * we aren't sure which one is active, so just assume the first one. 893 * only for usbfs. */ 894 static int cache_active_config(struct libusb_device *dev, int fd, 895 int active_config) 896 { 897 struct linux_device_priv *priv = _device_priv(dev); 898 struct libusb_config_descriptor config; 899 unsigned char tmp[8]; 900 unsigned char *buf; 901 int idx; 902 int r; 903 904 if (active_config == -1) { 905 idx = 0; 906 } else { 907 r = usbi_get_config_index_by_value(dev, active_config, &idx); 908 if (r < 0) 909 return r; 910 if (idx == -1) 911 return LIBUSB_ERROR_NOT_FOUND; 912 } 913 914 r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, tmp, sizeof(tmp)); 915 if (r < 0) { 916 usbi_err(DEVICE_CTX(dev), "first read error %d", r); 917 return r; 918 } 919 920 usbi_parse_descriptor(tmp, "bbw", &config, 0); 921 buf = malloc(config.wTotalLength); 922 if (!buf) 923 return LIBUSB_ERROR_NO_MEM; 924 925 r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, buf, 926 config.wTotalLength); 927 if (r < 0) { 928 free(buf); 929 return r; 930 } 931 932 if (priv->config_descriptor) 933 free(priv->config_descriptor); 934 priv->config_descriptor = buf; 935 return 0; 833 if (i == config_index) 834 break; 835 size -= r; 836 descriptors += r; 837 } 838 839 len = MIN(len, r); 840 memcpy(buffer, descriptors, len); 841 return len; 936 842 } 937 843 … … 939 845 static int usbfs_get_active_config(struct libusb_device *dev, int fd) 940 846 { 847 struct linux_device_priv *priv = _device_priv(dev); 941 848 unsigned char active_config = 0; 942 849 int r; … … 960 867 usbi_warn(DEVICE_CTX(dev), 961 868 "get_configuration failed ret=%d errno=%d", r, errno); 962 return LIBUSB_ERROR_IO; 963 } 964 965 return active_config; 869 priv->active_config = -1; 870 } else { 871 if (active_config > 0) { 872 priv->active_config = active_config; 873 } else { 874 /* some buggy devices have a configuration 0, but we're 875 * reaching into the corner of a corner case here, so let's 876 * not support buggy devices in these circumstances. 877 * stick to the specs: a configuration value of 0 means 878 * unconfigured. */ 879 usbi_warn(DEVICE_CTX(dev), 880 "active cfg 0? assuming unconfigured device"); 881 priv->active_config = -1; 882 } 883 } 884 885 return LIBUSB_SUCCESS; 966 886 } 967 887 … … 970 890 { 971 891 struct linux_device_priv *priv = _device_priv(dev); 972 unsigned char *dev_buf;973 char path[PATH_MAX];892 struct libusb_context *ctx = DEVICE_CTX(dev); 893 int descriptors_size = 512; /* Begin with a 1024 byte alloc */ 974 894 int fd, speed; 975 int active_config = 0;976 int device_configured = 1;977 895 ssize_t r; 978 896 … … 981 899 982 900 if (sysfs_dir) { 983 priv->sysfs_dir = malloc(strlen(sysfs_dir) + 1);901 priv->sysfs_dir = strdup(sysfs_dir); 984 902 if (!priv->sysfs_dir) 985 903 return LIBUSB_ERROR_NO_MEM; 986 strcpy(priv->sysfs_dir, sysfs_dir);987 904 988 905 /* Note speed can contain 1.5, in this case __read_sysfs_attr … … 1001 918 } 1002 919 920 /* cache descriptors in memory */ 1003 921 if (sysfs_has_descriptors) 1004 return 0; 1005 1006 /* cache device descriptor in memory so that we can retrieve it later 1007 * without waking the device up (op_get_device_descriptor) */ 1008 1009 priv->dev_descriptor = NULL; 1010 priv->config_descriptor = NULL; 1011 1012 if (sysfs_can_relate_devices) { 1013 int tmp = sysfs_get_active_config(dev, &active_config); 1014 if (tmp < 0) 1015 return tmp; 1016 if (active_config == -1) 1017 device_configured = 0; 1018 } 1019 1020 _get_usbfs_path(dev, path); 1021 fd = open(path, O_RDWR); 1022 if (fd < 0 && errno == EACCES) { 1023 fd = open(path, O_RDONLY); 1024 /* if we only have read-only access to the device, we cannot 1025 * send a control message to determine the active config. just 1026 * assume the first one is active. */ 1027 active_config = -1; 1028 } 1029 922 fd = _open_sysfs_attr(dev, "descriptors"); 923 else 924 fd = _get_usbfs_fd(dev, O_RDONLY, 0); 925 if (fd < 0) 926 return fd; 927 928 do { 929 descriptors_size *= 2; 930 priv->descriptors = usbi_reallocf(priv->descriptors, 931 descriptors_size); 932 if (!priv->descriptors) { 933 close(fd); 934 return LIBUSB_ERROR_NO_MEM; 935 } 936 /* usbfs has holes in the file */ 937 if (!sysfs_has_descriptors) { 938 memset(priv->descriptors + priv->descriptors_len, 939 0, descriptors_size - priv->descriptors_len); 940 } 941 r = read(fd, priv->descriptors + priv->descriptors_len, 942 descriptors_size - priv->descriptors_len); 943 if (r < 0) { 944 usbi_err(ctx, "read descriptor failed ret=%d errno=%d", 945 fd, errno); 946 close(fd); 947 return LIBUSB_ERROR_IO; 948 } 949 priv->descriptors_len += r; 950 } while (priv->descriptors_len == descriptors_size); 951 952 close(fd); 953 954 if (priv->descriptors_len < DEVICE_DESC_LENGTH) { 955 usbi_err(ctx, "short descriptor read (%d)", 956 priv->descriptors_len); 957 return LIBUSB_ERROR_IO; 958 } 959 960 if (sysfs_can_relate_devices) 961 return LIBUSB_SUCCESS; 962 963 /* cache active config */ 964 fd = _get_usbfs_fd(dev, O_RDWR, 1); 1030 965 if (fd < 0) { 1031 usbi_err(DEVICE_CTX(dev), "open failed, ret=%d errno=%d", fd, errno); 1032 return LIBUSB_ERROR_IO; 1033 } 1034 1035 if (!sysfs_can_relate_devices) { 1036 if (active_config == -1) { 1037 /* if we only have read-only access to the device, we cannot 1038 * send a control message to determine the active config. just 1039 * assume the first one is active. */ 1040 usbi_warn(DEVICE_CTX(dev), "access to %s is read-only; cannot " 1041 "determine active configuration descriptor", path); 1042 } else { 1043 active_config = usbfs_get_active_config(dev, fd); 1044 if (active_config == LIBUSB_ERROR_IO) { 1045 /* buggy devices sometimes fail to report their active config. 1046 * assume unconfigured and continue the probing */ 1047 usbi_warn(DEVICE_CTX(dev), "couldn't query active " 1048 "configuration, assumung unconfigured"); 1049 device_configured = 0; 1050 } else if (active_config < 0) { 1051 close(fd); 1052 return active_config; 1053 } else if (active_config == 0) { 1054 /* some buggy devices have a configuration 0, but we're 1055 * reaching into the corner of a corner case here, so let's 1056 * not support buggy devices in these circumstances. 1057 * stick to the specs: a configuration value of 0 means 1058 * unconfigured. */ 1059 usbi_dbg("active cfg 0? assuming unconfigured device"); 1060 device_configured = 0; 1061 } 1062 } 1063 } 1064 1065 dev_buf = malloc(DEVICE_DESC_LENGTH); 1066 if (!dev_buf) { 1067 close(fd); 966 /* cannot send a control message to determine the active 967 * config. just assume the first one is active. */ 968 usbi_warn(ctx, "Missing rw usbfs access; cannot determine " 969 "active configuration descriptor"); 970 if (priv->descriptors_len >= 971 (DEVICE_DESC_LENGTH + LIBUSB_DT_CONFIG_SIZE)) { 972 struct libusb_config_descriptor config; 973 usbi_parse_descriptor( 974 priv->descriptors + DEVICE_DESC_LENGTH, 975 "bbwbbbbb", &config, 0); 976 priv->active_config = config.bConfigurationValue; 977 } else 978 priv->active_config = -1; /* No config dt */ 979 980 return LIBUSB_SUCCESS; 981 } 982 983 r = usbfs_get_active_config(dev, fd); 984 close(fd); 985 986 return r; 987 } 988 989 static int linux_get_parent_info(struct libusb_device *dev, const char *sysfs_dir) 990 { 991 struct libusb_context *ctx = DEVICE_CTX(dev); 992 struct libusb_device *it; 993 char *parent_sysfs_dir, *tmp; 994 int ret, add_parent = 1; 995 996 /* XXX -- can we figure out the topology when using usbfs? */ 997 if (NULL == sysfs_dir || 0 == strncmp(sysfs_dir, "usb", 3)) { 998 /* either using usbfs or finding the parent of a root hub */ 999 return LIBUSB_SUCCESS; 1000 } 1001 1002 parent_sysfs_dir = strdup(sysfs_dir); 1003 if (NULL == parent_sysfs_dir) { 1068 1004 return LIBUSB_ERROR_NO_MEM; 1069 1005 } 1070 1071 r = read(fd, dev_buf, DEVICE_DESC_LENGTH); 1072 if (r < 0) { 1073 usbi_err(DEVICE_CTX(dev), 1074 "read descriptor failed ret=%d errno=%d", fd, errno); 1075 free(dev_buf); 1076 close(fd); 1077 return LIBUSB_ERROR_IO; 1078 } else if (r < DEVICE_DESC_LENGTH) { 1079 usbi_err(DEVICE_CTX(dev), "short descriptor read (%d)", r); 1080 free(dev_buf); 1081 close(fd); 1082 return LIBUSB_ERROR_IO; 1083 } 1084 1085 /* bit of a hack: set num_configurations now because cache_active_config() 1086 * calls usbi_get_config_index_by_value() which uses it */ 1087 dev->num_configurations = dev_buf[DEVICE_DESC_LENGTH - 1]; 1088 1089 if (device_configured) { 1090 r = cache_active_config(dev, fd, active_config); 1091 if (r < 0) { 1092 close(fd); 1093 free(dev_buf); 1094 return r; 1095 } 1096 } 1097 1098 close(fd); 1099 priv->dev_descriptor = dev_buf; 1100 return 0; 1006 if (NULL != (tmp = strrchr(parent_sysfs_dir, '.')) || 1007 NULL != (tmp = strrchr(parent_sysfs_dir, '-'))) { 1008 dev->port_number = atoi(tmp + 1); 1009 *tmp = '\0'; 1010 } else { 1011 usbi_warn(ctx, "Can not parse sysfs_dir: %s, no parent info", 1012 parent_sysfs_dir); 1013 free (parent_sysfs_dir); 1014 return LIBUSB_SUCCESS; 1015 } 1016 1017 /* is the parent a root hub? */ 1018 if (NULL == strchr(parent_sysfs_dir, '-')) { 1019 tmp = parent_sysfs_dir; 1020 ret = asprintf (&parent_sysfs_dir, "usb%s", tmp); 1021 free (tmp); 1022 if (0 > ret) { 1023 return LIBUSB_ERROR_NO_MEM; 1024 } 1025 } 1026 1027 retry: 1028 /* find the parent in the context */ 1029 usbi_mutex_lock(&ctx->usb_devs_lock); 1030 list_for_each_entry(it, &ctx->usb_devs, list, struct libusb_device) { 1031 struct linux_device_priv *priv = _device_priv(it); 1032 if (0 == strcmp (priv->sysfs_dir, parent_sysfs_dir)) { 1033 dev->parent_dev = libusb_ref_device(it); 1034 break; 1035 } 1036 } 1037 usbi_mutex_unlock(&ctx->usb_devs_lock); 1038 1039 if (!dev->parent_dev && add_parent) { 1040 usbi_dbg("parent_dev %s not enumerated yet, enumerating now", 1041 parent_sysfs_dir); 1042 sysfs_scan_device(ctx, parent_sysfs_dir); 1043 add_parent = 0; 1044 goto retry; 1045 } 1046 1047 usbi_dbg("Dev %p (%s) has parent %p (%s) port %d", dev, sysfs_dir, 1048 dev->parent_dev, parent_sysfs_dir, dev->port_number); 1049 1050 free (parent_sysfs_dir); 1051 1052 return LIBUSB_SUCCESS; 1101 1053 } 1102 1054 1103 1055 int linux_enumerate_device(struct libusb_context *ctx, 1104 uint8_t busnum, uint8_t devaddr, 1105 const char *sysfs_dir) 1056 uint8_t busnum, uint8_t devaddr, const char *sysfs_dir) 1106 1057 { 1107 1058 unsigned long session_id; … … 1116 1067 session_id); 1117 1068 1069 dev = usbi_get_device_by_session_id(ctx, session_id); 1070 if (dev) { 1071 /* device already exists in the context */ 1072 usbi_dbg("session_id %ld already exists", session_id); 1073 libusb_unref_device(dev); 1074 return LIBUSB_SUCCESS; 1075 } 1076 1118 1077 usbi_dbg("allocating new device for %d/%d (session %ld)", 1119 1078 busnum, devaddr, session_id); … … 1126 1085 goto out; 1127 1086 r = usbi_sanitize_device(dev); 1087 if (r < 0) 1088 goto out; 1089 1090 r = linux_get_parent_info(dev, sysfs_dir); 1128 1091 if (r < 0) 1129 1092 goto out; … … 1141 1104 struct libusb_context *ctx; 1142 1105 1106 usbi_mutex_static_lock(&active_contexts_lock); 1143 1107 list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) { 1144 if (usbi_get_device_by_session_id(ctx, busnum << 8 | devaddr)) {1145 /* device already exists in the context */1146 usbi_dbg("device already exists in context");1147 continue;1148 }1149 1150 1108 linux_enumerate_device(ctx, busnum, devaddr, sys_name); 1151 1109 } 1152 } 1153 1154 void linux_hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name) 1110 usbi_mutex_static_unlock(&active_contexts_lock); 1111 } 1112 1113 void linux_device_disconnected(uint8_t busnum, uint8_t devaddr) 1155 1114 { 1156 1115 struct libusb_context *ctx; 1157 1116 struct libusb_device *dev; 1158 1117 unsigned long session_id = busnum << 8 | devaddr; 1118 1119 usbi_mutex_static_lock(&active_contexts_lock); 1159 1120 list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) { 1160 dev = usbi_get_device_by_session_id (ctx, busnum << 8 | devaddr);1121 dev = usbi_get_device_by_session_id (ctx, session_id); 1161 1122 if (NULL != dev) { 1162 1123 usbi_disconnect_device (dev); 1124 libusb_unref_device(dev); 1163 1125 } else { 1164 usbi_err(ctx, "device not found for session %x", busnum << 8 | devaddr); 1165 } 1166 } 1126 usbi_dbg("device not found for session %x", session_id); 1127 } 1128 } 1129 usbi_mutex_static_unlock(&active_contexts_lock); 1167 1130 } 1168 1131 … … 1254 1217 1255 1218 } 1219 #endif 1256 1220 1257 1221 static int sysfs_scan_device(struct libusb_context *ctx, const char *devname) … … 1269 1233 } 1270 1234 1235 #if !defined(USE_UDEV) 1271 1236 static int sysfs_get_device_list(struct libusb_context *ctx) 1272 1237 { … … 1319 1284 { 1320 1285 struct linux_device_handle_priv *hpriv = _device_handle_priv(handle); 1321 char filename[PATH_MAX];1322 1286 int r; 1323 1287 1324 _get_usbfs_path(handle->dev, filename); 1325 usbi_dbg("opening %s", filename); 1326 hpriv->fd = open(filename, O_RDWR); 1288 hpriv->fd = _get_usbfs_fd(handle->dev, O_RDWR, 0); 1327 1289 if (hpriv->fd < 0) { 1328 if (errno == EACCES) { 1329 usbi_err(HANDLE_CTX(handle), "libusb couldn't open USB device %s: " 1330 "Permission denied.", filename); 1331 usbi_err(HANDLE_CTX(handle), 1332 "libusb requires write access to USB device nodes."); 1333 return LIBUSB_ERROR_ACCESS; 1334 } else if (errno == ENOENT) { 1335 usbi_err(HANDLE_CTX(handle), "libusb couldn't open USB device %s: " 1336 "No such file or directory.", filename); 1337 return LIBUSB_ERROR_NO_DEVICE; 1338 } else { 1339 usbi_err(HANDLE_CTX(handle), 1340 "open failed, code %d errno %d", hpriv->fd, errno); 1341 return LIBUSB_ERROR_IO; 1342 } 1290 if (hpriv->fd == LIBUSB_ERROR_NO_DEVICE) { 1291 /* device will still be marked as attached if hotplug monitor thread 1292 * hasn't processed remove event yet */ 1293 usbi_mutex_static_lock(&linux_hotplug_lock); 1294 if (handle->dev->attached) { 1295 usbi_dbg("open failed with no device, but device still attached"); 1296 linux_device_disconnected(handle->dev->bus_number, 1297 handle->dev->device_address); 1298 } 1299 usbi_mutex_static_unlock(&linux_hotplug_lock); 1300 } 1301 return hpriv->fd; 1343 1302 } 1344 1303 … … 1346 1305 if (r < 0) { 1347 1306 if (errno == ENOTTY) 1348 usbi_dbg(" %s: getcap not available", filename);1307 usbi_dbg("getcap not available"); 1349 1308 else 1350 usbi_err(HANDLE_CTX(handle), 1351 "%s: getcap failed (%d)", filename, errno); 1309 usbi_err(HANDLE_CTX(handle), "getcap failed (%d)", errno); 1352 1310 hpriv->caps = 0; 1353 1311 if (supports_flag_zero_packet) … … 1357 1315 } 1358 1316 1359 return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT); 1317 r = usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT); 1318 if (r < 0) 1319 close(hpriv->fd); 1320 1321 return r; 1360 1322 } 1361 1323 1362 1324 static void op_close(struct libusb_device_handle *dev_handle) 1363 1325 { 1364 int fd = _device_handle_priv(dev_handle)->fd; 1365 usbi_remove_pollfd(HANDLE_CTX(dev_handle), fd); 1366 close(fd); 1326 struct linux_device_handle_priv *hpriv = _device_handle_priv(dev_handle); 1327 /* fd may have already been removed by POLLERR condition in op_handle_events() */ 1328 if (!hpriv->fd_removed) 1329 usbi_remove_pollfd(HANDLE_CTX(dev_handle), hpriv->fd); 1330 close(hpriv->fd); 1367 1331 } 1368 1332 … … 1371 1335 { 1372 1336 int r; 1373 if (sysfs_can_relate_devices != 1) 1374 return LIBUSB_ERROR_NOT_SUPPORTED; 1375 1376 r = sysfs_get_active_config(handle->dev, config); 1337 1338 if (sysfs_can_relate_devices) { 1339 r = sysfs_get_active_config(handle->dev, config); 1340 } else { 1341 r = usbfs_get_active_config(handle->dev, 1342 _device_handle_priv(handle)->fd); 1343 if (r == LIBUSB_SUCCESS) 1344 *config = _device_priv(handle->dev)->active_config; 1345 } 1377 1346 if (r < 0) 1378 1347 return r; … … 1403 1372 } 1404 1373 1405 if (!sysfs_has_descriptors) { 1406 /* update our cached active config descriptor */ 1407 if (config == -1) { 1408 if (priv->config_descriptor) { 1409 free(priv->config_descriptor); 1410 priv->config_descriptor = NULL; 1411 } 1412 } else { 1413 r = cache_active_config(handle->dev, fd, config); 1414 if (r < 0) 1415 usbi_warn(HANDLE_CTX(handle), 1416 "failed to update cached config descriptor, error %d", r); 1417 } 1418 } 1419 1420 return 0; 1421 } 1422 1423 static int op_claim_interface(struct libusb_device_handle *handle, int iface) 1374 /* update our cached active config descriptor */ 1375 priv->active_config = config; 1376 1377 return LIBUSB_SUCCESS; 1378 } 1379 1380 static int claim_interface(struct libusb_device_handle *handle, int iface) 1424 1381 { 1425 1382 int fd = _device_handle_priv(handle)->fd; … … 1440 1397 } 1441 1398 1442 static int op_release_interface(struct libusb_device_handle *handle, int iface)1399 static int release_interface(struct libusb_device_handle *handle, int iface) 1443 1400 { 1444 1401 int fd = _device_handle_priv(handle)->fd; … … 1511 1468 for (i = 0; i < USB_MAXINTERFACES; i++) { 1512 1469 if (handle->claimed_interfaces & (1L << i)) { 1513 op_release_interface(handle, i);1470 release_interface(handle, i); 1514 1471 } 1515 1472 } … … 1532 1489 for (i = 0; i < USB_MAXINTERFACES; i++) { 1533 1490 if (handle->claimed_interfaces & (1L << i)) { 1534 r = op_claim_interface(handle, i); 1491 /* 1492 * A driver may have completed modprobing during 1493 * IOCTL_USBFS_RESET, and bound itself as soon as 1494 * IOCTL_USBFS_RESET released the device lock 1495 */ 1496 r = detach_kernel_driver_and_claim(handle, i); 1535 1497 if (r) { 1536 1498 usbi_warn(HANDLE_CTX(handle), 1537 "failed to re-claim interface %d after reset", i); 1499 "failed to re-claim interface %d after reset: %s", 1500 i, libusb_error_name(r)); 1538 1501 handle->claimed_interfaces &= ~(1L << i); 1502 ret = LIBUSB_ERROR_NOT_FOUND; 1539 1503 } 1540 1504 } … … 1543 1507 usbi_mutex_unlock(&handle->lock); 1544 1508 return ret; 1509 } 1510 1511 static int do_streams_ioctl(struct libusb_device_handle *handle, long req, 1512 uint32_t num_streams, unsigned char *endpoints, int num_endpoints) 1513 { 1514 int r, fd = _device_handle_priv(handle)->fd; 1515 struct usbfs_streams *streams; 1516 1517 if (num_endpoints > 30) /* Max 15 in + 15 out eps */ 1518 return LIBUSB_ERROR_INVALID_PARAM; 1519 1520 streams = malloc(sizeof(struct usbfs_streams) + num_endpoints); 1521 if (!streams) 1522 return LIBUSB_ERROR_NO_MEM; 1523 1524 streams->num_streams = num_streams; 1525 streams->num_eps = num_endpoints; 1526 memcpy(streams->eps, endpoints, num_endpoints); 1527 1528 r = ioctl(fd, req, streams); 1529 1530 free(streams); 1531 1532 if (r < 0) { 1533 if (errno == ENOTTY) 1534 return LIBUSB_ERROR_NOT_SUPPORTED; 1535 else if (errno == EINVAL) 1536 return LIBUSB_ERROR_INVALID_PARAM; 1537 else if (errno == ENODEV) 1538 return LIBUSB_ERROR_NO_DEVICE; 1539 1540 usbi_err(HANDLE_CTX(handle), 1541 "streams-ioctl failed error %d errno %d", r, errno); 1542 return LIBUSB_ERROR_OTHER; 1543 } 1544 return r; 1545 } 1546 1547 static int op_alloc_streams(struct libusb_device_handle *handle, 1548 uint32_t num_streams, unsigned char *endpoints, int num_endpoints) 1549 { 1550 return do_streams_ioctl(handle, IOCTL_USBFS_ALLOC_STREAMS, 1551 num_streams, endpoints, num_endpoints); 1552 } 1553 1554 static int op_free_streams(struct libusb_device_handle *handle, 1555 unsigned char *endpoints, int num_endpoints) 1556 { 1557 return do_streams_ioctl(handle, IOCTL_USBFS_FREE_STREAMS, 0, 1558 endpoints, num_endpoints); 1559 } 1560 1561 static unsigned char *op_dev_mem_alloc(struct libusb_device_handle *handle, 1562 size_t len) 1563 { 1564 struct linux_device_handle_priv *hpriv = _device_handle_priv(handle); 1565 unsigned char *buffer = (unsigned char *)mmap(NULL, len, 1566 PROT_READ | PROT_WRITE, MAP_SHARED, hpriv->fd, 0); 1567 if (buffer == MAP_FAILED) { 1568 usbi_err(HANDLE_CTX(handle), "alloc dev mem failed errno %d", 1569 errno); 1570 return NULL; 1571 } 1572 return buffer; 1573 } 1574 1575 static int op_dev_mem_free(struct libusb_device_handle *handle, 1576 unsigned char *buffer, size_t len) 1577 { 1578 if (munmap(buffer, len) != 0) { 1579 usbi_err(HANDLE_CTX(handle), "free dev mem failed errno %d", 1580 errno); 1581 return LIBUSB_ERROR_OTHER; 1582 } else { 1583 return LIBUSB_SUCCESS; 1584 } 1545 1585 } 1546 1586 … … 1565 1605 } 1566 1606 1567 return 1;1607 return (strcmp(getdrv.driver, "usbfs") == 0) ? 0 : 1; 1568 1608 } 1569 1609 … … 1573 1613 int fd = _device_handle_priv(handle)->fd; 1574 1614 struct usbfs_ioctl command; 1615 struct usbfs_getdriver getdrv; 1575 1616 int r; 1576 1617 … … 1578 1619 command.ioctl_code = IOCTL_USBFS_DISCONNECT; 1579 1620 command.data = NULL; 1621 1622 getdrv.interface = interface; 1623 r = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv); 1624 if (r == 0 && strcmp(getdrv.driver, "usbfs") == 0) 1625 return LIBUSB_ERROR_NOT_FOUND; 1580 1626 1581 1627 r = ioctl(fd, IOCTL_USBFS_IOCTL, &command); … … 1628 1674 } 1629 1675 1676 static int detach_kernel_driver_and_claim(struct libusb_device_handle *handle, 1677 int interface) 1678 { 1679 struct usbfs_disconnect_claim dc; 1680 int r, fd = _device_handle_priv(handle)->fd; 1681 1682 dc.interface = interface; 1683 strcpy(dc.driver, "usbfs"); 1684 dc.flags = USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER; 1685 r = ioctl(fd, IOCTL_USBFS_DISCONNECT_CLAIM, &dc); 1686 if (r == 0 || (r != 0 && errno != ENOTTY)) { 1687 if (r == 0) 1688 return 0; 1689 1690 switch (errno) { 1691 case EBUSY: 1692 return LIBUSB_ERROR_BUSY; 1693 case EINVAL: 1694 return LIBUSB_ERROR_INVALID_PARAM; 1695 case ENODEV: 1696 return LIBUSB_ERROR_NO_DEVICE; 1697 } 1698 usbi_err(HANDLE_CTX(handle), 1699 "disconnect-and-claim failed errno %d", errno); 1700 return LIBUSB_ERROR_OTHER; 1701 } 1702 1703 /* Fallback code for kernels which don't support the 1704 disconnect-and-claim ioctl */ 1705 r = op_detach_kernel_driver(handle, interface); 1706 if (r != 0 && r != LIBUSB_ERROR_NOT_FOUND) 1707 return r; 1708 1709 return claim_interface(handle, interface); 1710 } 1711 1712 static int op_claim_interface(struct libusb_device_handle *handle, int iface) 1713 { 1714 if (handle->auto_detach_kernel_driver) 1715 return detach_kernel_driver_and_claim(handle, iface); 1716 else 1717 return claim_interface(handle, iface); 1718 } 1719 1720 static int op_release_interface(struct libusb_device_handle *handle, int iface) 1721 { 1722 int r; 1723 1724 r = release_interface(handle, iface); 1725 if (r) 1726 return r; 1727 1728 if (handle->auto_detach_kernel_driver) 1729 op_attach_kernel_driver(handle, iface); 1730 1731 return 0; 1732 } 1733 1630 1734 static void op_destroy_device(struct libusb_device *dev) 1631 1735 { 1632 1736 struct linux_device_priv *priv = _device_priv(dev); 1633 if (!sysfs_has_descriptors) { 1634 if (priv->dev_descriptor) 1635 free(priv->dev_descriptor); 1636 if (priv->config_descriptor) 1637 free(priv->config_descriptor); 1638 } 1737 if (priv->descriptors) 1738 free(priv->descriptors); 1639 1739 if (priv->sysfs_dir) 1640 1740 free(priv->sysfs_dir); … … 1692 1792 } 1693 1793 1694 static int submit_bulk_transfer(struct usbi_transfer *itransfer, 1695 unsigned char urb_type) 1794 static int submit_bulk_transfer(struct usbi_transfer *itransfer) 1696 1795 { 1697 1796 struct libusb_transfer *transfer = … … 1706 1805 int r; 1707 1806 int i; 1708 size_t alloc_size;1709 1710 if (tpriv->urbs)1711 return LIBUSB_ERROR_BUSY;1712 1807 1713 1808 if (is_out && (transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) && … … 1768 1863 usbi_dbg("need %d urbs for new transfer with length %d", num_urbs, 1769 1864 transfer->length); 1770 alloc_size = num_urbs * sizeof(struct usbfs_urb); 1771 urbs = malloc(alloc_size); 1865 urbs = calloc(num_urbs, sizeof(struct usbfs_urb)); 1772 1866 if (!urbs) 1773 1867 return LIBUSB_ERROR_NO_MEM; 1774 memset(urbs, 0, alloc_size);1775 1868 tpriv->urbs = urbs; 1776 1869 tpriv->num_urbs = num_urbs; … … 1782 1875 struct usbfs_urb *urb = &urbs[i]; 1783 1876 urb->usercontext = itransfer; 1784 urb->type = urb_type; 1877 switch (transfer->type) { 1878 case LIBUSB_TRANSFER_TYPE_BULK: 1879 urb->type = USBFS_URB_TYPE_BULK; 1880 urb->stream_id = 0; 1881 break; 1882 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 1883 urb->type = USBFS_URB_TYPE_BULK; 1884 urb->stream_id = itransfer->stream_id; 1885 break; 1886 case LIBUSB_TRANSFER_TYPE_INTERRUPT: 1887 urb->type = USBFS_URB_TYPE_INTERRUPT; 1888 break; 1889 } 1785 1890 urb->endpoint = transfer->endpoint; 1786 1891 urb->buffer = transfer->buffer + (i * bulk_buffer_len); 1787 1788 if (use_bulk_continuation && !is_out && i < num_urbs - 1)1892 /* don't set the short not ok flag for the last URB */ 1893 if (use_bulk_continuation && !is_out && (i < num_urbs - 1)) 1789 1894 urb->flags = USBFS_URB_SHORT_NOT_OK; 1790 1895 if (i == num_urbs - 1 && last_urb_partial) … … 1812 1917 r = LIBUSB_ERROR_IO; 1813 1918 } 1814 1919 1815 1920 /* if the first URB submission fails, we can simply free up and 1816 1921 * return failure immediately. */ … … 1876 1981 unsigned char *urb_buffer = transfer->buffer; 1877 1982 1878 if (tpriv->iso_urbs) 1879 return LIBUSB_ERROR_BUSY; 1880 1881 /* usbfs places a 32kb limit on iso URBs. we divide up larger requests 1882 * into smaller units to meet such restriction, then fire off all the 1883 * units at once. it would be simpler if we just fired one unit at a time, 1884 * but there is a big performance gain through doing it this way. 1885 * 1886 * Newer kernels lift the 32k limit (USBFS_CAP_NO_PACKET_SIZE_LIM), 1887 * using arbritary large transfers is still be a bad idea though, as 1888 * the kernel needs to allocate physical contiguous memory for this, 1889 * which may fail for large buffers. 1983 /* usbfs places arbitrary limits on iso URBs. this limit has changed 1984 * at least three times, and it's difficult to accurately detect which 1985 * limit this running kernel might impose. so we attempt to submit 1986 * whatever the user has provided. if the kernel rejects the request 1987 * due to its size, we return an error indicating such to the user. 1890 1988 */ 1891 1989 … … 1898 1996 num_urbs++; 1899 1997 this_urb_len = packet_len; 1998 /* check that we can actually support this packet length */ 1999 if (this_urb_len > MAX_ISO_BUFFER_LENGTH) 2000 return LIBUSB_ERROR_INVALID_PARAM; 1900 2001 } else { 1901 2002 this_urb_len += packet_len; 1902 2003 } 1903 2004 } 1904 usbi_dbg("need %d 32k URBs for transfer", num_urbs); 1905 1906 alloc_size = num_urbs * sizeof(*urbs); 1907 urbs = malloc(alloc_size); 2005 usbi_dbg("need %d %dk URBs for transfer", num_urbs, MAX_ISO_BUFFER_LENGTH / 1024); 2006 2007 urbs = calloc(num_urbs, sizeof(*urbs)); 1908 2008 if (!urbs) 1909 2009 return LIBUSB_ERROR_NO_MEM; 1910 memset(urbs, 0, alloc_size);1911 2010 1912 2011 tpriv->iso_urbs = urbs; … … 1942 2041 alloc_size = sizeof(*urb) 1943 2042 + (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc)); 1944 urb = malloc(alloc_size);2043 urb = calloc(1, alloc_size); 1945 2044 if (!urb) { 1946 2045 free_iso_urbs(tpriv); 1947 2046 return LIBUSB_ERROR_NO_MEM; 1948 2047 } 1949 memset(urb, 0, alloc_size);1950 2048 urbs[i] = urb; 1951 2049 … … 1972 2070 if (errno == ENODEV) { 1973 2071 r = LIBUSB_ERROR_NO_DEVICE; 2072 } else if (errno == EINVAL) { 2073 usbi_warn(TRANSFER_CTX(transfer), 2074 "submiturb failed, transfer too large"); 2075 r = LIBUSB_ERROR_INVALID_PARAM; 1974 2076 } else { 1975 2077 usbi_err(TRANSFER_CTX(transfer), … … 2025 2127 int r; 2026 2128 2027 if (tpriv->urbs)2028 return LIBUSB_ERROR_BUSY;2029 2030 2129 if (transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH) 2031 2130 return LIBUSB_ERROR_INVALID_PARAM; 2032 2131 2033 urb = malloc(sizeof(struct usbfs_urb));2132 urb = calloc(1, sizeof(struct usbfs_urb)); 2034 2133 if (!urb) 2035 2134 return LIBUSB_ERROR_NO_MEM; 2036 memset(urb, 0, sizeof(struct usbfs_urb));2037 2135 tpriv->urbs = urb; 2038 2136 tpriv->num_urbs = 1; … … 2068 2166 return submit_control_transfer(itransfer); 2069 2167 case LIBUSB_TRANSFER_TYPE_BULK: 2070 return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK); 2168 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 2169 return submit_bulk_transfer(itransfer); 2071 2170 case LIBUSB_TRANSFER_TYPE_INTERRUPT: 2072 return submit_bulk_transfer(itransfer , USBFS_URB_TYPE_INTERRUPT);2171 return submit_bulk_transfer(itransfer); 2073 2172 case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: 2074 2173 return submit_iso_transfer(itransfer); … … 2085 2184 struct libusb_transfer *transfer = 2086 2185 USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 2186 int r; 2187 2188 if (!tpriv->urbs) 2189 return LIBUSB_ERROR_NOT_FOUND; 2190 2191 r = discard_urbs(itransfer, 0, tpriv->num_urbs); 2192 if (r != 0) 2193 return r; 2087 2194 2088 2195 switch (transfer->type) { 2089 2196 case LIBUSB_TRANSFER_TYPE_BULK: 2197 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 2090 2198 if (tpriv->reap_action == ERROR) 2091 2199 break; 2092 2200 /* else, fall through */ 2093 case LIBUSB_TRANSFER_TYPE_CONTROL: 2094 case LIBUSB_TRANSFER_TYPE_INTERRUPT: 2095 case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: 2201 default: 2096 2202 tpriv->reap_action = CANCELLED; 2097 break; 2098 default: 2099 usbi_err(TRANSFER_CTX(transfer), 2100 "unknown endpoint type %d", transfer->type); 2101 return LIBUSB_ERROR_INVALID_PARAM; 2102 } 2103 2104 if (!tpriv->urbs) 2105 return LIBUSB_ERROR_NOT_FOUND; 2106 2107 return discard_urbs(itransfer, 0, tpriv->num_urbs); 2203 } 2204 2205 return 0; 2108 2206 } 2109 2207 … … 2118 2216 case LIBUSB_TRANSFER_TYPE_CONTROL: 2119 2217 case LIBUSB_TRANSFER_TYPE_BULK: 2218 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 2120 2219 case LIBUSB_TRANSFER_TYPE_INTERRUPT: 2121 usbi_mutex_lock(&itransfer->lock); 2122 if (tpriv->urbs) 2220 if (tpriv->urbs) { 2123 2221 free(tpriv->urbs); 2124 tpriv->urbs = NULL;2125 usbi_mutex_unlock(&itransfer->lock);2222 tpriv->urbs = NULL; 2223 } 2126 2224 break; 2127 2225 case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: 2128 usbi_mutex_lock(&itransfer->lock); 2129 if (tpriv->iso_urbs) 2226 if (tpriv->iso_urbs) { 2130 2227 free_iso_urbs(tpriv); 2131 usbi_mutex_unlock(&itransfer->lock); 2228 tpriv->iso_urbs = NULL; 2229 } 2132 2230 break; 2133 2231 default: … … 2486 2584 return handle_iso_completion(itransfer, urb); 2487 2585 case LIBUSB_TRANSFER_TYPE_BULK: 2586 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 2488 2587 case LIBUSB_TRANSFER_TYPE_INTERRUPT: 2489 2588 return handle_bulk_completion(itransfer, urb); … … 2519 2618 } 2520 2619 2620 if (!hpriv || hpriv->fd != pollfd->fd) { 2621 usbi_err(ctx, "cannot find handle for fd %d", 2622 pollfd->fd); 2623 continue; 2624 } 2625 2521 2626 if (pollfd->revents & POLLERR) { 2627 /* remove the fd from the pollfd set so that it doesn't continuously 2628 * trigger an event, and flag that it has been removed so op_close() 2629 * doesn't try to remove it a second time */ 2522 2630 usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd); 2631 hpriv->fd_removed = 1; 2632 2633 /* device will still be marked as attached if hotplug monitor thread 2634 * hasn't processed remove event yet */ 2635 usbi_mutex_static_lock(&linux_hotplug_lock); 2636 if (handle->dev->attached) 2637 linux_device_disconnected(handle->dev->bus_number, 2638 handle->dev->device_address); 2639 usbi_mutex_static_unlock(&linux_hotplug_lock); 2640 2641 if (hpriv->caps & USBFS_CAP_REAP_AFTER_DISCONNECT) { 2642 do { 2643 r = reap_for_handle(handle); 2644 } while (r == 0); 2645 } 2646 2523 2647 usbi_handle_disconnect(handle); 2524 2648 continue; 2525 2649 } 2526 2650 2527 r = reap_for_handle(handle); 2651 do { 2652 r = reap_for_handle(handle); 2653 } while (r == 0); 2528 2654 if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE) 2529 2655 continue; … … 2560 2686 const struct usbi_os_backend linux_usbfs_backend = { 2561 2687 .name = "Linux usbfs", 2688 .caps = USBI_CAP_HAS_HID_ACCESS|USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER, 2562 2689 .init = op_init, 2563 2690 .exit = op_exit, 2564 2691 .get_device_list = NULL, 2692 .hotplug_poll = op_hotplug_poll, 2565 2693 .get_device_descriptor = op_get_device_descriptor, 2566 2694 .get_active_config_descriptor = op_get_active_config_descriptor, 2567 2695 .get_config_descriptor = op_get_config_descriptor, 2696 .get_config_descriptor_by_value = op_get_config_descriptor_by_value, 2568 2697 2569 2698 .open = op_open, … … 2578 2707 .reset_device = op_reset_device, 2579 2708 2709 .alloc_streams = op_alloc_streams, 2710 .free_streams = op_free_streams, 2711 2712 .dev_mem_alloc = op_dev_mem_alloc, 2713 .dev_mem_free = op_dev_mem_free, 2714 2580 2715 .kernel_driver_active = op_kernel_driver_active, 2581 2716 .detach_kernel_driver = op_detach_kernel_driver, … … 2599 2734 .device_handle_priv_size = sizeof(struct linux_device_handle_priv), 2600 2735 .transfer_priv_size = sizeof(struct linux_transfer_priv), 2601 .add_iso_packet_size = 0,2602 2736 }; 2603 -
TabularUnified libusb1/trunk/libusb/os/linux_usbfs.h ¶
r1876 r1882 1 1 /* 2 2 * usbfs header structures 3 * Copyright (C)2007 Daniel Drake <dsd@gentoo.org>4 * Copyright (c)2001 Johannes Erdfelt <johannes@erdfelt.com>3 * Copyright © 2007 Daniel Drake <dsd@gentoo.org> 4 * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 82 82 }; 83 83 84 #define MAX_ISO_BUFFER_LENGTH 3276884 #define MAX_ISO_BUFFER_LENGTH 49152 * 128 85 85 #define MAX_BULK_BUFFER_LENGTH 16384 86 86 #define MAX_CTRL_BUFFER_LENGTH 4096 … … 95 95 int actual_length; 96 96 int start_frame; 97 int number_of_packets; 97 union { 98 int number_of_packets; /* Only used for isoc urbs */ 99 unsigned int stream_id; /* Only used with bulk streams */ 100 }; 98 101 int error_count; 99 102 unsigned int signr; … … 123 126 #define USBFS_CAP_NO_PACKET_SIZE_LIM 0x04 124 127 #define USBFS_CAP_BULK_SCATTER_GATHER 0x08 128 #define USBFS_CAP_REAP_AFTER_DISCONNECT 0x10 129 130 #define USBFS_DISCONNECT_CLAIM_IF_DRIVER 0x01 131 #define USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02 132 133 struct usbfs_disconnect_claim { 134 unsigned int interface; 135 unsigned int flags; 136 char driver[USBFS_MAXDRIVERNAME + 1]; 137 }; 138 139 struct usbfs_streams { 140 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */ 141 unsigned int num_eps; 142 unsigned char eps[0]; 143 }; 125 144 126 145 #define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer) … … 146 165 #define IOCTL_USBFS_RELEASE_PORT _IOR('U', 25, unsigned int) 147 166 #define IOCTL_USBFS_GET_CAPABILITIES _IOR('U', 26, __u32) 167 #define IOCTL_USBFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbfs_disconnect_claim) 168 #define IOCTL_USBFS_ALLOC_STREAMS _IOR('U', 28, struct usbfs_streams) 169 #define IOCTL_USBFS_FREE_STREAMS _IOR('U', 29, struct usbfs_streams) 170 171 extern usbi_mutex_static_t linux_hotplug_lock; 148 172 149 173 #if defined(HAVE_LIBUDEV) … … 151 175 int linux_udev_stop_event_monitor(void); 152 176 int linux_udev_scan_devices(struct libusb_context *ctx); 177 void linux_udev_hotplug_poll(void); 153 178 #else 154 179 int linux_netlink_start_event_monitor(void); 155 180 int linux_netlink_stop_event_monitor(void); 181 void linux_netlink_hotplug_poll(void); 156 182 #endif 157 183 158 184 void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name); 159 void linux_ hotplug_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name);185 void linux_device_disconnected(uint8_t busnum, uint8_t devaddr); 160 186 161 187 int linux_get_device_address (struct libusb_context *ctx, int detached, 162 uint8_t *busnum, uint8_t *devaddr,163 const char *dev_node,const char *sys_name);188 uint8_t *busnum, uint8_t *devaddr, const char *dev_node, 189 const char *sys_name); 164 190 int linux_enumerate_device(struct libusb_context *ctx, 165 uint8_t busnum, uint8_t devaddr, 166 const char *sysfs_dir); 191 uint8_t busnum, uint8_t devaddr, const char *sysfs_dir); 167 192 168 193 #endif -
TabularUnified libusb1/trunk/libusb/os/openbsd_usb.c ¶
r1876 r1882 1 1 /* 2 * Copyright (c) 2011Martin Pieuchot <mpi@openbsd.org>2 * Copyright © 2011-2013 Martin Pieuchot <mpi@openbsd.org> 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 17 17 */ 18 18 19 #include <config.h> 20 19 21 #include <sys/time.h> 20 22 #include <sys/types.h> … … 29 31 #include <dev/usb/usb.h> 30 32 31 #include "libusb.h"32 33 #include "libusbi.h" 33 34 34 35 struct device_priv { 35 char devnode[16];36 int fd; 36 char *devname; /* name of the ugen(4) node */ 37 int fd; /* device file descriptor */ 37 38 38 39 unsigned char *cdesc; /* active config descriptor */ … … 41 42 42 43 struct handle_priv { 43 int pipe[2]; /* for event notification */44 44 int endpoints[USB_MAX_ENDPOINTS]; 45 45 }; … … 75 75 static int obsd_cancel_transfer(struct usbi_transfer *); 76 76 static void obsd_clear_transfer_priv(struct usbi_transfer *); 77 static int obsd_handle_events(struct libusb_context *ctx, struct pollfd *, 78 nfds_t, int); 77 static int obsd_handle_transfer_completion(struct usbi_transfer *); 79 78 static int obsd_clock_gettime(int, struct timespec *); 80 79 … … 83 82 */ 84 83 static int _errno_to_libusb(int); 85 static int _cache_active_config_descriptor(struct libusb_device * , int);84 static int _cache_active_config_descriptor(struct libusb_device *); 86 85 static int _sync_control_transfer(struct usbi_transfer *); 87 86 static int _sync_gen_transfer(struct usbi_transfer *); 88 87 static int _access_endpoint(struct libusb_transfer *); 89 88 89 static int _bus_open(int); 90 91 90 92 const struct usbi_os_backend openbsd_backend = { 91 93 "Synchronous OpenBSD backend", 94 0, 92 95 NULL, /* init() */ 93 96 NULL, /* exit() */ 94 97 obsd_get_device_list, 98 NULL, /* hotplug_poll */ 95 99 obsd_open, 96 100 obsd_close, … … 99 103 obsd_get_active_config_descriptor, 100 104 obsd_get_config_descriptor, 105 NULL, /* get_config_descriptor_by_value() */ 101 106 102 107 obsd_get_configuration, … … 110 115 obsd_reset_device, 111 116 117 NULL, /* alloc_streams */ 118 NULL, /* free_streams */ 119 120 NULL, /* dev_mem_alloc() */ 121 NULL, /* dev_mem_free() */ 122 112 123 NULL, /* kernel_driver_active() */ 113 124 NULL, /* detach_kernel_driver() */ … … 120 131 obsd_clear_transfer_priv, 121 132 122 obsd_handle_events, 133 NULL, /* handle_events() */ 134 obsd_handle_transfer_completion, 123 135 124 136 obsd_clock_gettime, … … 126 138 sizeof(struct handle_priv), 127 139 0, /* transfer_priv_size */ 128 0, /* add_iso_packet_size */129 140 }; 141 142 #define DEVPATH "/dev/" 143 #define USBDEV DEVPATH "usb" 130 144 131 145 int … … 133 147 struct discovered_devs **discdevs) 134 148 { 149 struct discovered_devs *ddd; 135 150 struct libusb_device *dev; 136 151 struct device_priv *dpriv; 137 152 struct usb_device_info di; 153 struct usb_device_ddesc dd; 138 154 unsigned long session_id; 139 char devnode[16]; 140 int fd, err, i; 155 char devices[USB_MAX_DEVICES]; 156 char busnode[16]; 157 char *udevname; 158 int fd, addr, i, j; 141 159 142 160 usbi_dbg(""); 143 161 144 /* Only ugen(4) is supported */ 145 for (i = 0; i < USB_MAX_DEVICES; i++) { 146 /* Control endpoint is always .00 */ 147 snprintf(devnode, sizeof(devnode), "/dev/ugen%d.00", i); 148 149 if ((fd = open(devnode, O_RDONLY)) < 0) { 162 for (i = 0; i < 8; i++) { 163 snprintf(busnode, sizeof(busnode), USBDEV "%d", i); 164 165 if ((fd = open(busnode, O_RDWR)) < 0) { 150 166 if (errno != ENOENT && errno != ENXIO) 151 usbi_err(ctx, "could not open %s", devnode);167 usbi_err(ctx, "could not open %s", busnode); 152 168 continue; 153 169 } 154 170 155 if (ioctl(fd, USB_GET_DEVICEINFO, &di) < 0) 156 continue; 157 158 session_id = (di.udi_bus << 8 | di.udi_addr); 159 dev = usbi_get_device_by_session_id(ctx, session_id); 160 161 if (dev == NULL) { 162 dev = usbi_alloc_device(ctx, session_id); 163 if (dev == NULL) 171 bzero(devices, sizeof(devices)); 172 for (addr = 1; addr < USB_MAX_DEVICES; addr++) { 173 if (devices[addr]) 174 continue; 175 176 di.udi_addr = addr; 177 if (ioctl(fd, USB_DEVICEINFO, &di) < 0) 178 continue; 179 180 /* 181 * XXX If ugen(4) is attached to the USB device 182 * it will be used. 183 */ 184 udevname = NULL; 185 for (j = 0; j < USB_MAX_DEVNAMES; j++) 186 if (!strncmp("ugen", di.udi_devnames[j], 4)) { 187 udevname = strdup(di.udi_devnames[j]); 188 break; 189 } 190 191 session_id = (di.udi_bus << 8 | di.udi_addr); 192 dev = usbi_get_device_by_session_id(ctx, session_id); 193 194 if (dev == NULL) { 195 dev = usbi_alloc_device(ctx, session_id); 196 if (dev == NULL) { 197 close(fd); 198 return (LIBUSB_ERROR_NO_MEM); 199 } 200 201 dev->bus_number = di.udi_bus; 202 dev->device_address = di.udi_addr; 203 dev->speed = di.udi_speed; 204 205 dpriv = (struct device_priv *)dev->os_priv; 206 dpriv->fd = -1; 207 dpriv->cdesc = NULL; 208 dpriv->devname = udevname; 209 210 dd.udd_bus = di.udi_bus; 211 dd.udd_addr = di.udi_addr; 212 if (ioctl(fd, USB_DEVICE_GET_DDESC, &dd) < 0) { 213 libusb_unref_device(dev); 214 continue; 215 } 216 dpriv->ddesc = dd.udd_desc; 217 218 if (_cache_active_config_descriptor(dev)) { 219 libusb_unref_device(dev); 220 continue; 221 } 222 223 if (usbi_sanitize_device(dev)) { 224 libusb_unref_device(dev); 225 continue; 226 } 227 } 228 229 ddd = discovered_devs_append(*discdevs, dev); 230 if (ddd == NULL) { 231 close(fd); 164 232 return (LIBUSB_ERROR_NO_MEM); 165 166 dev->bus_number = di.udi_bus;167 dev->device_address = di.udi_addr;168 dev->speed = di.udi_speed;169 170 dpriv = (struct device_priv *)dev->os_priv;171 strlcpy(dpriv->devnode, devnode, sizeof(devnode));172 dpriv->fd = -1;173 174 if (ioctl(fd, USB_GET_DEVICE_DESC, &dpriv->ddesc) < 0) {175 err = errno;176 goto error;177 233 } 178 179 dpriv->cdesc = NULL; 180 if (_cache_active_config_descriptor(dev, fd)) { 181 err = errno; 182 goto error; 183 } 184 185 if ((err = usbi_sanitize_device(dev))) 186 goto error; 234 libusb_unref_device(dev); 235 236 *discdevs = ddd; 237 devices[addr] = 1; 187 238 } 239 188 240 close(fd); 189 190 if (discovered_devs_append(*discdevs, dev) == NULL) 191 return (LIBUSB_ERROR_NO_MEM); 192 } 193 194 return (LIBUSB_SUCCESS); 195 196 error: 197 close(fd); 198 libusb_unref_device(dev); 199 return _errno_to_libusb(err); 241 } 242 243 return (LIBUSB_SUCCESS); 200 244 } 201 245 … … 205 249 struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; 206 250 struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; 207 208 dpriv->fd = open(dpriv->devnode, O_RDWR); 209 if (dpriv->fd < 0) { 210 dpriv->fd = open(dpriv->devnode, O_RDONLY); 251 char devnode[16]; 252 253 if (dpriv->devname) { 254 /* 255 * Only open ugen(4) attached devices read-write, all 256 * read-only operations are done through the bus node. 257 */ 258 snprintf(devnode, sizeof(devnode), DEVPATH "%s.00", 259 dpriv->devname); 260 dpriv->fd = open(devnode, O_RDWR); 211 261 if (dpriv->fd < 0) 212 262 return _errno_to_libusb(errno); 213 } 214 215 usbi_dbg("open %s: fd %d", dpriv->devnode, dpriv->fd); 216 217 if (pipe(hpriv->pipe) < 0) 218 return _errno_to_libusb(errno); 219 220 return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN); 263 264 usbi_dbg("open %s: fd %d", devnode, dpriv->fd); 265 } 266 267 return (LIBUSB_SUCCESS); 221 268 } 222 269 … … 227 274 struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; 228 275 229 usbi_dbg("close: fd %d", dpriv->fd); 230 231 close(dpriv->fd); 232 dpriv->fd = -1; 233 234 usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); 235 236 close(hpriv->pipe[0]); 237 close(hpriv->pipe[1]); 276 if (dpriv->devname) { 277 usbi_dbg("close: fd %d", dpriv->fd); 278 279 close(dpriv->fd); 280 dpriv->fd = -1; 281 } 238 282 } 239 283 … … 258 302 { 259 303 struct device_priv *dpriv = (struct device_priv *)dev->os_priv; 260 usb_config_descriptor_t *ucd; 261 262 ucd = (usb_config_descriptor_t *) dpriv->cdesc; 304 usb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc; 305 263 306 len = MIN(len, UGETW(ucd->wTotalLength)); 264 307 … … 269 312 *host_endian = 0; 270 313 271 return ( LIBUSB_SUCCESS);314 return (len); 272 315 } 273 316 … … 276 319 unsigned char *buf, size_t len, int *host_endian) 277 320 { 278 struct device_priv *dpriv = (struct device_priv *)dev->os_priv; 279 struct usb_full_desc ufd; 321 struct usb_device_fdesc udf; 280 322 int fd, err; 281 323 282 usbi_dbg("index %d, len %d", idx, len); 283 284 /* A config descriptor may be requested before opening the device */ 285 if (dpriv->fd >= 0) { 286 fd = dpriv->fd; 287 } else { 288 fd = open(dpriv->devnode, O_RDONLY); 289 if (fd < 0) 290 return _errno_to_libusb(errno); 291 } 292 293 ufd.ufd_config_index = idx; 294 ufd.ufd_size = len; 295 ufd.ufd_data = buf; 296 297 if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) { 324 if ((fd = _bus_open(dev->bus_number)) < 0) 325 return _errno_to_libusb(errno); 326 327 udf.udf_bus = dev->bus_number; 328 udf.udf_addr = dev->device_address; 329 udf.udf_config_index = idx; 330 udf.udf_size = len; 331 udf.udf_data = buf; 332 333 usbi_dbg("index %d, len %d", udf.udf_config_index, len); 334 335 if (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) { 298 336 err = errno; 299 if (dpriv->fd < 0) 300 close(fd); 337 close(fd); 301 338 return _errno_to_libusb(err); 302 339 } 303 304 if (dpriv->fd < 0) 305 close(fd); 340 close(fd); 306 341 307 342 *host_endian = 0; 308 343 309 return ( LIBUSB_SUCCESS);344 return (len); 310 345 } 311 346 … … 314 349 { 315 350 struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; 316 317 usbi_dbg(""); 318 319 if (ioctl(dpriv->fd, USB_GET_CONFIG, config) < 0) 320 return _errno_to_libusb(errno); 321 322 usbi_dbg("configuration %d", *config); 351 usb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc; 352 353 *config = ucd->bConfigurationValue; 354 355 usbi_dbg("bConfigurationValue %d", *config); 323 356 324 357 return (LIBUSB_SUCCESS); … … 330 363 struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; 331 364 332 usbi_dbg("configuration %d", config); 365 if (dpriv->devname == NULL) 366 return (LIBUSB_ERROR_NOT_SUPPORTED); 367 368 usbi_dbg("bConfigurationValue %d", config); 333 369 334 370 if (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0) 335 371 return _errno_to_libusb(errno); 336 372 337 return _cache_active_config_descriptor(handle->dev , dpriv->fd);373 return _cache_active_config_descriptor(handle->dev); 338 374 } 339 375 … … 370 406 struct usb_alt_interface intf; 371 407 408 if (dpriv->devname == NULL) 409 return (LIBUSB_ERROR_NOT_SUPPORTED); 410 372 411 usbi_dbg("iface %d, setting %d", iface, altsetting); 373 412 … … 386 425 obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) 387 426 { 388 struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;389 427 struct usb_ctl_request req; 428 int fd, err; 429 430 if ((fd = _bus_open(handle->dev->bus_number)) < 0) 431 return _errno_to_libusb(errno); 390 432 391 433 usbi_dbg(""); 392 434 435 req.ucr_addr = handle->dev->device_address; 393 436 req.ucr_request.bmRequestType = UT_WRITE_ENDPOINT; 394 437 req.ucr_request.bRequest = UR_CLEAR_FEATURE; … … 397 440 USETW(req.ucr_request.wLength, 0); 398 441 399 if (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0) 400 return _errno_to_libusb(errno); 442 if (ioctl(fd, USB_REQUEST, &req) < 0) { 443 err = errno; 444 close(fd); 445 return _errno_to_libusb(err); 446 } 447 close(fd); 401 448 402 449 return (LIBUSB_SUCCESS); … … 419 466 420 467 free(dpriv->cdesc); 468 free(dpriv->devname); 421 469 } 422 470 … … 454 502 err = _sync_gen_transfer(itransfer); 455 503 break; 504 case LIBUSB_TRANSFER_TYPE_BULK_STREAM: 505 err = LIBUSB_ERROR_NOT_SUPPORTED; 506 break; 456 507 } 457 508 … … 459 510 return (err); 460 511 461 if (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0) 462 return _errno_to_libusb(errno); 512 usbi_signal_transfer_completion(itransfer); 463 513 464 514 return (LIBUSB_SUCCESS); … … 482 532 483 533 int 484 obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, 485 int num_ready) 486 { 487 struct libusb_device_handle *handle; 488 struct handle_priv *hpriv = NULL; 489 struct usbi_transfer *itransfer; 490 struct pollfd *pollfd; 491 int i, err = 0; 492 493 usbi_dbg(""); 494 495 pthread_mutex_lock(&ctx->open_devs_lock); 496 for (i = 0; i < nfds && num_ready > 0; i++) { 497 pollfd = &fds[i]; 498 499 if (!pollfd->revents) 500 continue; 501 502 hpriv = NULL; 503 num_ready--; 504 list_for_each_entry(handle, &ctx->open_devs, list, 505 struct libusb_device_handle) { 506 hpriv = (struct handle_priv *)handle->os_priv; 507 508 if (hpriv->pipe[0] == pollfd->fd) 509 break; 510 511 hpriv = NULL; 512 } 513 514 if (NULL == hpriv) { 515 usbi_dbg("fd %d is not an event pipe!", pollfd->fd); 516 err = ENOENT; 517 break; 518 } 519 520 if (pollfd->revents & POLLERR) { 521 usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); 522 usbi_handle_disconnect(handle); 523 continue; 524 } 525 526 if (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) { 527 err = errno; 528 break; 529 } 530 531 if ((err = usbi_handle_transfer_completion(itransfer, 532 LIBUSB_TRANSFER_COMPLETED))) 533 break; 534 } 535 pthread_mutex_unlock(&ctx->open_devs_lock); 536 537 if (err) 538 return _errno_to_libusb(err); 539 540 return (LIBUSB_SUCCESS); 534 obsd_handle_transfer_completion(struct usbi_transfer *itransfer) 535 { 536 return usbi_handle_transfer_completion(itransfer, LIBUSB_TRANSFER_COMPLETED); 541 537 } 542 538 … … 558 554 _errno_to_libusb(int err) 559 555 { 556 usbi_dbg("error: %s (%d)", strerror(err), err); 557 560 558 switch (err) { 561 559 case EIO: … … 567 565 case ENOMEM: 568 566 return (LIBUSB_ERROR_NO_MEM); 569 }570 571 usbi_dbg("error: %s", strerror(err));567 case ETIMEDOUT: 568 return (LIBUSB_ERROR_TIMEOUT); 569 } 572 570 573 571 return (LIBUSB_ERROR_OTHER); … … 575 573 576 574 int 577 _cache_active_config_descriptor(struct libusb_device *dev , int fd)575 _cache_active_config_descriptor(struct libusb_device *dev) 578 576 { 579 577 struct device_priv *dpriv = (struct device_priv *)dev->os_priv; 580 struct usb_ config_desc ucd;581 struct usb_ full_desc ufd;578 struct usb_device_cdesc udc; 579 struct usb_device_fdesc udf; 582 580 unsigned char* buf; 583 int len; 584 585 usbi_dbg("fd %d", fd); 586 587 ucd.ucd_config_index = USB_CURRENT_CONFIG_INDEX; 588 589 if ((ioctl(fd, USB_GET_CONFIG_DESC, &ucd)) < 0) 590 return _errno_to_libusb(errno); 591 592 usbi_dbg("active bLength %d", ucd.ucd_desc.bLength); 593 594 len = UGETW(ucd.ucd_desc.wTotalLength); 581 int fd, len, err; 582 583 if ((fd = _bus_open(dev->bus_number)) < 0) 584 return _errno_to_libusb(errno); 585 586 usbi_dbg("fd %d, addr %d", fd, dev->device_address); 587 588 udc.udc_bus = dev->bus_number; 589 udc.udc_addr = dev->device_address; 590 udc.udc_config_index = USB_CURRENT_CONFIG_INDEX; 591 if (ioctl(fd, USB_DEVICE_GET_CDESC, &udc) < 0) { 592 err = errno; 593 close(fd); 594 return _errno_to_libusb(errno); 595 } 596 597 usbi_dbg("active bLength %d", udc.udc_desc.bLength); 598 599 len = UGETW(udc.udc_desc.wTotalLength); 595 600 buf = malloc(len); 596 601 if (buf == NULL) 597 602 return (LIBUSB_ERROR_NO_MEM); 598 603 599 ufd.ufd_config_index = ucd.ucd_config_index; 600 ufd.ufd_size = len; 601 ufd.ufd_data = buf; 602 603 usbi_dbg("index %d, len %d", ufd.ufd_config_index, len); 604 605 if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) { 604 udf.udf_bus = dev->bus_number; 605 udf.udf_addr = dev->device_address; 606 udf.udf_config_index = udc.udc_config_index; 607 udf.udf_size = len; 608 udf.udf_data = buf; 609 610 usbi_dbg("index %d, len %d", udf.udf_config_index, len); 611 612 if (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) { 613 err = errno; 614 close(fd); 606 615 free(buf); 607 return _errno_to_libusb(errno); 608 } 616 return _errno_to_libusb(err); 617 } 618 close(fd); 609 619 610 620 if (dpriv->cdesc) … … 612 622 dpriv->cdesc = buf; 613 623 614 return ( 0);624 return (LIBUSB_SUCCESS); 615 625 } 616 626 … … 627 637 setup = (struct libusb_control_setup *)transfer->buffer; 628 638 629 usbi_dbg("type % d request %d value %dindex %d length %d timeout %d",639 usbi_dbg("type %x request %x value %x index %d length %d timeout %d", 630 640 setup->bmRequestType, setup->bRequest, 631 641 libusb_le16_to_cpu(setup->wValue), … … 633 643 libusb_le16_to_cpu(setup->wLength), transfer->timeout); 634 644 645 req.ucr_addr = transfer->dev_handle->dev->device_address; 635 646 req.ucr_request.bmRequestType = setup->bmRequestType; 636 647 req.ucr_request.bRequest = setup->bRequest; … … 644 655 req.ucr_flags = USBD_SHORT_XFER_OK; 645 656 646 if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) 647 return _errno_to_libusb(errno); 648 649 if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0) 650 return _errno_to_libusb(errno); 657 if (dpriv->devname == NULL) { 658 /* 659 * XXX If the device is not attached to ugen(4) it is 660 * XXX still possible to submit a control transfer but 661 * XXX with the default timeout only. 662 */ 663 int fd, err; 664 665 if ((fd = _bus_open(transfer->dev_handle->dev->bus_number)) < 0) 666 return _errno_to_libusb(errno); 667 668 if ((ioctl(fd, USB_REQUEST, &req)) < 0) { 669 err = errno; 670 close(fd); 671 return _errno_to_libusb(err); 672 } 673 close(fd); 674 } else { 675 if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) 676 return _errno_to_libusb(errno); 677 678 if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0) 679 return _errno_to_libusb(errno); 680 } 651 681 652 682 itransfer->transferred = req.ucr_actlen; … … 662 692 struct handle_priv *hpriv; 663 693 struct device_priv *dpriv; 664 char *s,devnode[16];694 char devnode[16]; 665 695 int fd, endpt; 666 696 mode_t mode; … … 675 705 676 706 if (hpriv->endpoints[endpt] < 0) { 677 /* Pick the right node given the control one */ 678 strlcpy(devnode, dpriv->devnode, sizeof(devnode)); 679 s = strchr(devnode, '.'); 680 snprintf(s, 4, ".%02d", endpt); 707 /* Pick the right endpoint node */ 708 snprintf(devnode, sizeof(devnode), DEVPATH "%s.%02d", 709 dpriv->devname, endpt); 681 710 682 711 /* We may need to read/write to the same endpoint later. */ … … 695 724 { 696 725 struct libusb_transfer *transfer; 726 struct device_priv *dpriv; 697 727 int fd, nr = 1; 698 728 699 729 transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 730 dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; 731 732 if (dpriv->devname == NULL) 733 return (LIBUSB_ERROR_NOT_SUPPORTED); 700 734 701 735 /* … … 726 760 return (0); 727 761 } 762 763 int 764 _bus_open(int number) 765 { 766 char busnode[16]; 767 768 snprintf(busnode, sizeof(busnode), USBDEV "%d", number); 769 770 return open(busnode, O_RDWR); 771 } -
TabularUnified libusb1/trunk/libusb/os/poll_posix.h ¶
r1876 r1882 5 5 #define usbi_read read 6 6 #define usbi_close close 7 #define usbi_pipe pipe8 7 #define usbi_poll poll 9 8 9 int usbi_pipe(int pipefd[2]); 10 10 11 #endif /* LIBUSB_POLL_POSIX_H */ -
TabularUnified libusb1/trunk/libusb/os/poll_windows.c ¶
r1876 r1882 1 1 /* 2 2 * poll_windows: poll compatibility wrapper for Windows 3 * Copyright (C) 2009-2010 Pete Batard <pbatard@gmail.com> 3 * Copyright © 2012-2013 RealVNC Ltd. 4 * Copyright © 2009-2010 Pete Batard <pete@akeo.ie> 4 5 * With contributions from Michael Plante, Orin Eman et al. 5 6 * Parts of poll implementation from libusb-win32, by Stephan Meyer et al. … … 32 33 * - call usbi_create_fd with this handle to obtain a custom fd. 33 34 * Note that if you need simultaneous R/W access, you need to call create_fd 34 * twice, once in _O_RDONLY and once in _O_WRONLYmode to obtain 2 separate35 * twice, once in RW_READ and once in RW_WRITE mode to obtain 2 separate 35 36 * pollable fds 36 37 * - leave the core functions call the poll routine and flag POLLIN/POLLOUT … … 40 41 * context. 41 42 */ 43 #include <config.h> 44 42 45 #include <errno.h> 43 #include <fcntl.h>44 46 #include <stdio.h> 45 47 #include <stdlib.h> 46 #include <io.h> 47 48 #include <libusbi.h> 48 49 #include "libusbi.h" 49 50 50 51 // Uncomment to debug the polling layer … … 55 56 // MSVC++ < 2005 cannot use a variadic argument and non MSVC 56 57 // compilers produce warnings if parenthesis are omitted. 57 #if defined(_MSC_VER) && _MSC_VER < 140058 #if defined(_MSC_VER) && (_MSC_VER < 1400) 58 59 #define poll_dbg 59 60 #else … … 66 67 #endif 67 68 68 #if defined(__CYGWIN__)69 // cygwin produces a warning unless these prototypes are defined70 extern int _open(char* name, int flags);71 extern int _close(int fd);72 extern int _snprintf(char *buffer, size_t count, const char *format, ...);73 #define NUL_DEVICE "/dev/null"74 #else75 #define NUL_DEVICE "NUL"76 #endif77 78 69 #define CHECK_INIT_POLLING do {if(!is_polling_set) init_polling();} while(0) 79 70 80 71 // public fd data 81 const struct winfd INVALID_WINFD = {-1, INVALID_HANDLE_VALUE, NULL, RW_NONE};72 const struct winfd INVALID_WINFD = {-1, INVALID_HANDLE_VALUE, NULL, NULL, NULL, RW_NONE}; 82 73 struct winfd poll_fd[MAX_FDS]; 83 74 // internal fd data … … 94 85 static volatile LONG compat_spinlock = 0; 95 86 87 #if !defined(_WIN32_WCE) 96 88 // CancelIoEx, available on Vista and later only, provides the ability to cancel 97 89 // a single transfer (OVERLAPPED) when used. As it may not be part of any of the 98 90 // platform headers, we hook into the Kernel32 system DLL directly to seek it. 99 91 static BOOL (__stdcall *pCancelIoEx)(HANDLE, LPOVERLAPPED) = NULL; 100 #define CancelIoEx_Available (pCancelIoEx != NULL) 101 static __inline BOOL cancel_io(int _index) 92 #define Use_Duplicate_Handles (pCancelIoEx == NULL) 93 94 static inline void setup_cancel_io(void) 95 { 96 HMODULE hKernel32 = GetModuleHandleA("KERNEL32"); 97 if (hKernel32 != NULL) { 98 pCancelIoEx = (BOOL (__stdcall *)(HANDLE,LPOVERLAPPED)) 99 GetProcAddress(hKernel32, "CancelIoEx"); 100 } 101 usbi_dbg("Will use CancelIo%s for I/O cancellation", 102 Use_Duplicate_Handles?"":"Ex"); 103 } 104 105 static inline BOOL cancel_io(int _index) 102 106 { 103 107 if ((_index < 0) || (_index >= MAX_FDS)) { … … 109 113 return TRUE; 110 114 } 111 if (CancelIoEx_Available) { 115 if (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) { 116 // Cancel outstanding transfer via the specific callback 117 (*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer); 118 return TRUE; 119 } 120 if (pCancelIoEx != NULL) { 112 121 return (*pCancelIoEx)(poll_fd[_index].handle, poll_fd[_index].overlapped); 113 122 } … … 118 127 return FALSE; 119 128 } 129 #else 130 #define Use_Duplicate_Handles FALSE 131 132 static __inline void setup_cancel_io() 133 { 134 // No setup needed on WinCE 135 } 136 137 static __inline BOOL cancel_io(int _index) 138 { 139 if ((_index < 0) || (_index >= MAX_FDS)) { 140 return FALSE; 141 } 142 if ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE) 143 || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) { 144 return TRUE; 145 } 146 if (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) { 147 // Cancel outstanding transfer via the specific callback 148 (*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer); 149 } 150 return TRUE; 151 } 152 #endif 120 153 121 154 // Init … … 128 161 } 129 162 if (!is_polling_set) { 130 pCancelIoEx = (BOOL (__stdcall *)(HANDLE,LPOVERLAPPED)) 131 GetProcAddress(GetModuleHandleA("KERNEL32"), "CancelIoEx"); 132 usbi_dbg("Will use CancelIo%s for I/O cancellation", 133 CancelIoEx_Available?"Ex":""); 163 setup_cancel_io(); 134 164 for (i=0; i<MAX_FDS; i++) { 135 165 poll_fd[i] = INVALID_WINFD; … … 140 170 is_polling_set = TRUE; 141 171 } 142 compat_spinlock = 0;172 InterlockedExchange((LONG *)&compat_spinlock, 0); 143 173 } 144 174 145 175 // Internal function to retrieve the table index (and lock the fd mutex) 146 int _fd_to_index_and_lock(int fd)176 static int _fd_to_index_and_lock(int fd) 147 177 { 148 178 int i; 149 179 150 if (fd < =0)180 if (fd < 0) 151 181 return -1; 152 182 … … 165 195 } 166 196 167 OVERLAPPED *create_overlapped(void)197 static OVERLAPPED *create_overlapped(void) 168 198 { 169 199 OVERLAPPED *overlapped = (OVERLAPPED*) calloc(1, sizeof(OVERLAPPED)); … … 179 209 } 180 210 181 void free_overlapped(OVERLAPPED *overlapped)211 static void free_overlapped(OVERLAPPED *overlapped) 182 212 { 183 213 if (overlapped == NULL) … … 189 219 } 190 220 free(overlapped); 191 }192 193 void reset_overlapped(OVERLAPPED *overlapped)194 {195 HANDLE event_handle;196 if (overlapped == NULL)197 return;198 199 event_handle = overlapped->hEvent;200 if (event_handle != NULL) {201 ResetEvent(event_handle);202 }203 memset(overlapped, 0, sizeof(OVERLAPPED));204 overlapped->hEvent = event_handle;205 221 } 206 222 … … 222 238 // mutex lock before too long 223 239 EnterCriticalSection(&_poll_fd[i].mutex); 224 if ( (poll_fd[i].fd > 0) && (poll_fd[i].handle != INVALID_HANDLE_VALUE) && (poll_fd[i].handle != 0)225 && (GetFileType(poll_fd[i].handle) == FILE_TYPE_UNKNOWN) ) {226 _close(poll_fd[i].fd);227 }228 240 free_overlapped(poll_fd[i].overlapped); 229 if ( !CancelIoEx_Available) {241 if (Use_Duplicate_Handles) { 230 242 // Close duplicate handle 231 243 if (_poll_fd[i].original_handle != INVALID_HANDLE_VALUE) { … … 238 250 } 239 251 } 240 compat_spinlock = 0;252 InterlockedExchange((LONG *)&compat_spinlock, 0); 241 253 } 242 254 … … 254 266 CHECK_INIT_POLLING; 255 267 256 overlapped = (OVERLAPPED*) calloc(1, sizeof(OVERLAPPED)); 268 overlapped = create_overlapped(); 269 257 270 if (overlapped == NULL) { 258 271 return -1; … … 261 274 overlapped->Internal = STATUS_PENDING; 262 275 overlapped->InternalHigh = 0; 263 264 // Read end of the "pipe"265 filedes[0] = _open(NUL_DEVICE, _O_WRONLY);266 if (filedes[0] < 0) {267 usbi_err(NULL, "could not create pipe: errno %d", errno);268 goto out1;269 }270 // We can use the same handle for both ends271 filedes[1] = filedes[0];272 poll_dbg("pipe filedes = %d", filedes[0]);273 274 // Note: manual reset must be true (second param) as the reset occurs in read275 overlapped->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);276 if(!overlapped->hEvent) {277 goto out2;278 }279 276 280 277 for (i=0; i<MAX_FDS; i++) { … … 287 284 } 288 285 289 poll_fd[i].fd = filedes[0]; 286 // Use index as the unique fd number 287 poll_fd[i].fd = i; 288 // Read end of the "pipe" 289 filedes[0] = poll_fd[i].fd; 290 // We can use the same handle for both ends 291 filedes[1] = filedes[0]; 292 290 293 poll_fd[i].handle = DUMMY_HANDLE; 291 294 poll_fd[i].overlapped = overlapped; … … 297 300 } 298 301 } 299 300 CloseHandle(overlapped->hEvent); 301 out2: 302 _close(filedes[0]); 303 out1: 304 free(overlapped); 302 free_overlapped(overlapped); 305 303 return -1; 306 304 } … … 320 318 * produce unexpected results 321 319 */ 322 struct winfd usbi_create_fd(HANDLE handle, int access_mode )323 { 324 int i , fd;320 struct winfd usbi_create_fd(HANDLE handle, int access_mode, struct usbi_transfer *itransfer, cancel_transfer *cancel_fn) 321 { 322 int i; 325 323 struct winfd wfd = INVALID_WINFD; 326 324 OVERLAPPED* overlapped = NULL; … … 332 330 } 333 331 334 if ((access_mode != _O_RDONLY) && (access_mode != _O_WRONLY)) { 335 usbi_warn(NULL, "only one of _O_RDONLY or _O_WRONLY are supported.\n" 332 wfd.itransfer = itransfer; 333 wfd.cancel_fn = cancel_fn; 334 335 if ((access_mode != RW_READ) && (access_mode != RW_WRITE)) { 336 usbi_warn(NULL, "only one of RW_READ or RW_WRITE are supported. " 336 337 "If you want to poll for R/W simultaneously, create multiple fds from the same handle."); 337 338 return INVALID_WINFD; 338 339 } 339 if (access_mode == _O_RDONLY) {340 if (access_mode == RW_READ) { 340 341 wfd.rw = RW_READ; 341 342 } else { … … 343 344 } 344 345 345 // Ensure that we get a non system conflicting unique fd, using346 // the same fd attribution system as the pipe ends347 fd = _open(NUL_DEVICE, _O_WRONLY);348 if (fd < 0) {349 return INVALID_WINFD;350 }351 352 346 overlapped = create_overlapped(); 353 347 if(overlapped == NULL) { 354 _close(fd);355 348 return INVALID_WINFD; 356 349 } … … 364 357 continue; 365 358 } 366 wfd.fd = fd; 359 // Use index as the unique fd number 360 wfd.fd = i; 367 361 // Attempt to emulate some of the CancelIoEx behaviour on platforms 368 362 // that don't have it 369 if ( !CancelIoEx_Available) {363 if (Use_Duplicate_Handles) { 370 364 _poll_fd[i].thread_id = GetCurrentThreadId(); 371 365 if (!DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(), … … 388 382 } 389 383 free_overlapped(overlapped); 390 _close(fd);391 384 return INVALID_WINFD; 392 385 } 393 386 394 void _free_index(int _index)387 static void _free_index(int _index) 395 388 { 396 389 // Cancel any async IO (Don't care about the validity of our handles for this) 397 390 cancel_io(_index); 398 // close fake handle for devices399 if ( (poll_fd[_index].handle != INVALID_HANDLE_VALUE) && (poll_fd[_index].handle != 0)400 && (GetFileType(poll_fd[_index].handle) == FILE_TYPE_UNKNOWN) ) {401 _close(poll_fd[_index].fd);402 }403 391 // close the duplicate handle (if we have an actual duplicate) 404 if ( !CancelIoEx_Available) {392 if (Use_Duplicate_Handles) { 405 393 if (_poll_fd[_index].original_handle != INVALID_HANDLE_VALUE) { 406 394 CloseHandle(poll_fd[_index].handle); … … 418 406 * Note that the associated Windows handle is not closed by this call 419 407 */ 420 void usbi_free_fd( intfd)408 void usbi_free_fd(struct winfd *wfd) 421 409 { 422 410 int _index; … … 424 412 CHECK_INIT_POLLING; 425 413 426 _index = _fd_to_index_and_lock( fd);414 _index = _fd_to_index_and_lock(wfd->fd); 427 415 if (_index < 0) { 428 416 return; 429 417 } 430 418 _free_index(_index); 419 *wfd = INVALID_WINFD; 431 420 LeaveCriticalSection(&_poll_fd[_index].mutex); 432 421 } … … 442 431 CHECK_INIT_POLLING; 443 432 444 if (fd < =0)433 if (fd < 0) 445 434 return INVALID_WINFD; 446 435 … … 602 591 if ((timeout != 0) && (triggered == 0) && (nb_handles_to_wait_on != 0)) { 603 592 if (timeout < 0) { 604 poll_dbg("starting infinite wait for % d handles...", (int)nb_handles_to_wait_on);593 poll_dbg("starting infinite wait for %u handles...", (unsigned int)nb_handles_to_wait_on); 605 594 } else { 606 poll_dbg("starting %d ms wait for % d handles...", timeout, (int)nb_handles_to_wait_on);595 poll_dbg("starting %d ms wait for %u handles...", timeout, (unsigned int)nb_handles_to_wait_on); 607 596 } 608 597 ret = WaitForMultipleObjects(nb_handles_to_wait_on, handles_to_wait_on, … … 652 641 errno = EBADF; 653 642 } else { 654 if (poll_fd[_index].overlapped != NULL) { 655 // Must be a different event for each end of the pipe 656 CloseHandle(poll_fd[_index].overlapped->hEvent); 657 free(poll_fd[_index].overlapped); 658 } 659 r = _close(poll_fd[_index].fd); 660 if (r != 0) { 661 errno = EIO; 662 } 643 free_overlapped(poll_fd[_index].overlapped); 663 644 poll_fd[_index] = INVALID_WINFD; 664 645 LeaveCriticalSection(&_poll_fd[_index].mutex); … … 673 654 { 674 655 int _index; 656 UNUSED(buf); 675 657 676 658 CHECK_INIT_POLLING; … … 691 673 } 692 674 693 poll_dbg("set pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId());675 poll_dbg("set pipe event (fd = %d, thread = %08X)", _index, (unsigned int)GetCurrentThreadId()); 694 676 SetEvent(poll_fd[_index].overlapped->hEvent); 695 677 poll_fd[_index].overlapped->Internal = STATUS_WAIT_0; … … 709 691 int _index; 710 692 ssize_t r = -1; 693 UNUSED(buf); 711 694 712 695 CHECK_INIT_POLLING; … … 725 708 726 709 if (WaitForSingleObject(poll_fd[_index].overlapped->hEvent, INFINITE) != WAIT_OBJECT_0) { 727 usbi_warn(NULL, "waiting for event failed: % d", (int)GetLastError());710 usbi_warn(NULL, "waiting for event failed: %u", (unsigned int)GetLastError()); 728 711 errno = EIO; 729 712 goto out; 730 713 } 731 714 732 poll_dbg("clr pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId());715 poll_dbg("clr pipe event (fd = %d, thread = %08X)", _index, (unsigned int)GetCurrentThreadId()); 733 716 poll_fd[_index].overlapped->InternalHigh--; 734 717 // Don't reset unless we don't have any more events to process -
TabularUnified libusb1/trunk/libusb/os/poll_windows.h ¶
r1876 r1882 1 1 /* 2 2 * Windows compat: POSIX compatibility wrapper 3 * Copyright (C) 2009-2010 Pete Batard <pbatard@gmail.com> 3 * Copyright © 2012-2013 RealVNC Ltd. 4 * Copyright © 2009-2010 Pete Batard <pete@akeo.ie> 4 5 * With contributions from Michael Plante, Orin Eman et al. 5 6 * Parts of poll implementation from libusb-win32, by Stephan Meyer et al. … … 22 23 #pragma once 23 24 24 #include <windows.h>25 26 25 #if defined(_MSC_VER) 27 26 // disable /W4 MSVC warnings that are benign … … 34 33 #endif 35 34 #define STATUS_COMPLETED_SYNCHRONOUSLY STATUS_REPARSE 35 #if defined(_WIN32_WCE) 36 // WinCE doesn't have a HasOverlappedIoCompleted() macro, so attempt to emulate it 37 #define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) != STATUS_PENDING) 38 #endif 36 39 #define HasOverlappedIoCompletedSync(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) == STATUS_COMPLETED_SYNCHRONOUSLY) 37 40 38 41 #define DUMMY_HANDLE ((HANDLE)(LONG_PTR)-2) 39 42 43 /* Windows versions */ 40 44 enum windows_version { 41 WINDOWS_UNSUPPORTED, 42 WINDOWS_XP, 43 WINDOWS_2003, // also includes XP 64 44 WINDOWS_VISTA_AND_LATER, 45 WINDOWS_CE = -2, 46 WINDOWS_UNDEFINED = -1, 47 WINDOWS_UNSUPPORTED = 0, 48 WINDOWS_XP = 0x51, 49 WINDOWS_2003 = 0x52, // Also XP x64 50 WINDOWS_VISTA = 0x60, 51 WINDOWS_7 = 0x61, 52 WINDOWS_8 = 0x62, 53 WINDOWS_8_1_OR_LATER = 0x63, 54 WINDOWS_MAX 45 55 }; 46 extern enum windows_versionwindows_version;56 extern int windows_version; 47 57 48 58 #define MAX_FDS 256 … … 69 79 70 80 // fd struct that can be used for polling on Windows 81 typedef int cancel_transfer(struct usbi_transfer *itransfer); 82 71 83 struct winfd { 72 84 int fd; // what's exposed to libusb core 73 85 HANDLE handle; // what we need to attach overlapped to the I/O op, so we can poll it 74 86 OVERLAPPED* overlapped; // what will report our I/O status 87 struct usbi_transfer *itransfer; // Associated transfer, or NULL if completed 88 cancel_transfer *cancel_fn; // Function pointer to cancel transfer API 75 89 enum rw_type rw; // I/O transfer direction: read *XOR* write (NOT BOTH) 76 90 }; … … 85 99 void init_polling(void); 86 100 void exit_polling(void); 87 struct winfd usbi_create_fd(HANDLE handle, int access_mode); 88 void usbi_free_fd(int fd); 101 struct winfd usbi_create_fd(HANDLE handle, int access_mode, 102 struct usbi_transfer *transfer, cancel_transfer *cancel_fn); 103 void usbi_free_fd(struct winfd* winfd); 89 104 struct winfd fd_to_winfd(int fd); 90 105 struct winfd handle_to_winfd(HANDLE handle); … … 115 130 } while (0) 116 131 #endif 117 -
TabularUnified libusb1/trunk/libusb/os/threads_posix.c ¶
r1876 r1882 2 2 * libusb synchronization using POSIX Threads 3 3 * 4 * Copyright (C)2011 Vitali Lovich <vlovich@aliph.com>5 * Copyright (C)2011 Peter Stuge <peter@stuge.se>4 * Copyright © 2011 Vitali Lovich <vlovich@aliph.com> 5 * Copyright © 2011 Peter Stuge <peter@stuge.se> 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 20 20 */ 21 21 22 #ifdef _XOPEN_SOURCE 23 # if _XOPEN_SOURCE < 500 24 # undef _XOPEN_SOURCE 25 # define _XOPEN_SOURCE 500 22 #include <config.h> 23 24 #include <time.h> 25 #if defined(__linux__) || defined(__OpenBSD__) 26 # if defined(__OpenBSD__) 27 # define _BSD_SOURCE 26 28 # endif 27 #else 28 #define _XOPEN_SOURCE 500 29 #endif /* _XOPEN_SOURCE */ 29 # include <unistd.h> 30 # include <sys/syscall.h> 31 #elif defined(__APPLE__) 32 # include <mach/mach.h> 33 #elif defined(__CYGWIN__) 34 # include <windows.h> 35 #endif 30 36 31 37 #include "threads_posix.h" 38 #include "libusbi.h" 32 39 33 int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr) 40 int usbi_cond_timedwait(pthread_cond_t *cond, 41 pthread_mutex_t *mutex, const struct timeval *tv) 34 42 { 35 int err; 36 pthread_mutexattr_t stack_attr; 37 if (!attr) { 38 attr = &stack_attr; 39 err = pthread_mutexattr_init(&stack_attr); 40 if (err != 0) 41 return err; 43 struct timespec timeout; 44 int r; 45 46 r = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout); 47 if (r < 0) 48 return r; 49 50 timeout.tv_sec += tv->tv_sec; 51 timeout.tv_nsec += tv->tv_usec * 1000; 52 while (timeout.tv_nsec >= 1000000000L) { 53 timeout.tv_nsec -= 1000000000L; 54 timeout.tv_sec++; 42 55 } 43 56 44 err = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE); 45 if (err != 0) 46 goto finish; 57 return pthread_cond_timedwait(cond, mutex, &timeout); 58 } 47 59 48 err = pthread_mutex_init(mutex, attr); 49 50 finish: 51 if (attr == &stack_attr) 52 pthread_mutexattr_destroy(&stack_attr); 53 54 return err; 60 int usbi_get_tid(void) 61 { 62 int ret = -1; 63 #if defined(__ANDROID__) 64 ret = gettid(); 65 #elif defined(__linux__) 66 ret = syscall(SYS_gettid); 67 #elif defined(__OpenBSD__) 68 /* The following only works with OpenBSD > 5.1 as it requires 69 real thread support. For 5.1 and earlier, -1 is returned. */ 70 ret = syscall(SYS_getthrid); 71 #elif defined(__APPLE__) 72 ret = mach_thread_self(); 73 mach_port_deallocate(mach_task_self(), ret); 74 #elif defined(__CYGWIN__) 75 ret = GetCurrentThreadId(); 76 #endif 77 /* TODO: NetBSD thread ID support */ 78 return ret; 55 79 } -
TabularUnified libusb1/trunk/libusb/os/threads_posix.h ¶
r1876 r1882 2 2 * libusb synchronization using POSIX Threads 3 3 * 4 * Copyright (C)2010 Peter Stuge <peter@stuge.se>4 * Copyright © 2010 Peter Stuge <peter@stuge.se> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 23 23 24 24 #include <pthread.h> 25 #ifdef HAVE_SYS_TIME_H 26 #include <sys/time.h> 27 #endif 25 28 26 29 #define usbi_mutex_static_t pthread_mutex_t … … 30 33 31 34 #define usbi_mutex_t pthread_mutex_t 32 #define usbi_mutex_init pthread_mutex_init35 #define usbi_mutex_init(mutex) pthread_mutex_init((mutex), NULL) 33 36 #define usbi_mutex_lock pthread_mutex_lock 34 37 #define usbi_mutex_unlock pthread_mutex_unlock … … 37 40 38 41 #define usbi_cond_t pthread_cond_t 39 #define usbi_cond_init pthread_cond_init42 #define usbi_cond_init(cond) pthread_cond_init((cond), NULL) 40 43 #define usbi_cond_wait pthread_cond_wait 41 #define usbi_cond_timedwait pthread_cond_timedwait42 44 #define usbi_cond_broadcast pthread_cond_broadcast 43 45 #define usbi_cond_destroy pthread_cond_destroy 44 #define usbi_cond_signal pthread_cond_signal45 46 46 extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr); 47 #define usbi_tls_key_t pthread_key_t 48 #define usbi_tls_key_create(key) pthread_key_create((key), NULL) 49 #define usbi_tls_key_get pthread_getspecific 50 #define usbi_tls_key_set pthread_setspecific 51 #define usbi_tls_key_delete pthread_key_delete 52 53 int usbi_cond_timedwait(pthread_cond_t *cond, 54 pthread_mutex_t *mutex, const struct timeval *tv); 55 56 int usbi_get_tid(void); 47 57 48 58 #endif /* LIBUSB_THREADS_POSIX_H */ -
TabularUnified libusb1/trunk/libusb/os/threads_windows.c ¶
r1876 r1882 2 2 * libusb synchronization on Microsoft Windows 3 3 * 4 * Copyright (C)2010 Michael Plante <michael.plante@gmail.com>4 * Copyright © 2010 Michael Plante <michael.plante@gmail.com> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 20 20 21 21 #include <config.h> 22 22 23 #include <objbase.h> 23 24 #include <errno.h> 24 #include <stdarg.h>25 25 26 26 #include "libusbi.h" 27 27 28 29 int usbi_mutex_init(usbi_mutex_t *mutex, 30 const usbi_mutexattr_t *attr) { 31 if(! mutex) return ((errno=EINVAL)); 28 struct usbi_cond_perthread { 29 struct list_head list; 30 DWORD tid; 31 HANDLE event; 32 }; 33 34 int usbi_mutex_static_lock(usbi_mutex_static_t *mutex) 35 { 36 if (!mutex) 37 return EINVAL; 38 while (InterlockedExchange(mutex, 1) == 1) 39 SleepEx(0, TRUE); 40 return 0; 41 } 42 43 int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) 44 { 45 if (!mutex) 46 return EINVAL; 47 InterlockedExchange(mutex, 0); 48 return 0; 49 } 50 51 int usbi_mutex_init(usbi_mutex_t *mutex) 52 { 53 if (!mutex) 54 return EINVAL; 32 55 *mutex = CreateMutex(NULL, FALSE, NULL); 33 if(!*mutex) return ((errno=ENOMEM)); 34 return 0; 35 } 36 int usbi_mutex_destroy(usbi_mutex_t *mutex) { 56 if (!*mutex) 57 return ENOMEM; 58 return 0; 59 } 60 61 int usbi_mutex_lock(usbi_mutex_t *mutex) 62 { 63 DWORD result; 64 65 if (!mutex) 66 return EINVAL; 67 result = WaitForSingleObject(*mutex, INFINITE); 68 if (result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) 69 return 0; // acquired (ToDo: check that abandoned is ok) 70 else 71 return EINVAL; // don't know how this would happen 72 // so don't know proper errno 73 } 74 75 int usbi_mutex_unlock(usbi_mutex_t *mutex) 76 { 77 if (!mutex) 78 return EINVAL; 79 if (ReleaseMutex(*mutex)) 80 return 0; 81 else 82 return EPERM; 83 } 84 85 int usbi_mutex_trylock(usbi_mutex_t *mutex) 86 { 87 DWORD result; 88 89 if (!mutex) 90 return EINVAL; 91 result = WaitForSingleObject(*mutex, 0); 92 if (result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) 93 return 0; // acquired (ToDo: check that abandoned is ok) 94 else if (result == WAIT_TIMEOUT) 95 return EBUSY; 96 else 97 return EINVAL; // don't know how this would happen 98 // so don't know proper error 99 } 100 101 int usbi_mutex_destroy(usbi_mutex_t *mutex) 102 { 37 103 // It is not clear if CloseHandle failure is due to failure to unlock. 38 104 // If so, this should be errno=EBUSY. 39 if(!mutex || !CloseHandle(*mutex)) return ((errno=EINVAL)); 105 if (!mutex || !CloseHandle(*mutex)) 106 return EINVAL; 40 107 *mutex = NULL; 41 108 return 0; 42 109 } 43 int usbi_mutex_trylock(usbi_mutex_t *mutex) { 44 DWORD result; 45 if(!mutex) return ((errno=EINVAL)); 46 result = WaitForSingleObject(*mutex, 0); 47 if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) 48 return 0; // acquired (ToDo: check that abandoned is ok) 49 if(result == WAIT_TIMEOUT) 50 return ((errno=EBUSY)); 51 return ((errno=EINVAL)); // don't know how this would happen 52 // so don't know proper errno 53 } 54 int usbi_mutex_lock(usbi_mutex_t *mutex) { 55 DWORD result; 56 if(!mutex) return ((errno=EINVAL)); 57 result = WaitForSingleObject(*mutex, INFINITE); 58 if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) 59 return 0; // acquired (ToDo: check that abandoned is ok) 60 return ((errno=EINVAL)); // don't know how this would happen 61 // so don't know proper errno 62 } 63 int usbi_mutex_unlock(usbi_mutex_t *mutex) { 64 if(!mutex) return ((errno=EINVAL)); 65 if(!ReleaseMutex(*mutex)) return ((errno=EPERM )); 66 return 0; 67 } 68 69 int usbi_mutex_static_lock(usbi_mutex_static_t *mutex) { 70 if(!mutex) return ((errno=EINVAL)); 71 while (InterlockedExchange((LONG *)mutex, 1) == 1) { 72 SleepEx(0, TRUE); 73 } 74 return 0; 75 } 76 int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) { 77 if(!mutex) return ((errno=EINVAL)); 78 *mutex = 0; 79 return 0; 80 } 81 82 83 84 int usbi_cond_init(usbi_cond_t *cond, 85 const usbi_condattr_t *attr) { 86 if(!cond) return ((errno=EINVAL)); 87 list_init(&cond->waiters ); 110 111 int usbi_cond_init(usbi_cond_t *cond) 112 { 113 if (!cond) 114 return EINVAL; 115 list_init(&cond->waiters); 88 116 list_init(&cond->not_waiting); 89 117 return 0; 90 118 } 91 int usbi_cond_destroy(usbi_cond_t *cond) { 119 120 int usbi_cond_destroy(usbi_cond_t *cond) 121 { 92 122 // This assumes no one is using this anymore. The check MAY NOT BE safe. 93 struct usbi_cond_perthread *pos, *prev_pos = NULL; 94 if(!cond) return ((errno=EINVAL)); 95 if(!list_empty(&cond->waiters)) return ((errno=EBUSY )); // (!see above!) 96 list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) { 97 free(prev_pos); 123 struct usbi_cond_perthread *pos, *next_pos; 124 125 if(!cond) 126 return EINVAL; 127 if (!list_empty(&cond->waiters)) 128 return EBUSY; // (!see above!) 129 list_for_each_entry_safe(pos, next_pos, &cond->not_waiting, list, struct usbi_cond_perthread) { 98 130 CloseHandle(pos->event); 99 131 list_del(&pos->list); 100 prev_pos = pos; 101 } 102 free(prev_pos); 103 104 return 0; 105 } 106 107 int usbi_cond_broadcast(usbi_cond_t *cond) { 132 free(pos); 133 } 134 return 0; 135 } 136 137 int usbi_cond_broadcast(usbi_cond_t *cond) 138 { 108 139 // Assumes mutex is locked; this is not in keeping with POSIX spec, but 109 140 // libusb does this anyway, so we simplify by not adding more sync … … 111 142 int fail = 0; 112 143 struct usbi_cond_perthread *pos; 113 if(!cond) return ((errno=EINVAL)); 144 145 if (!cond) 146 return EINVAL; 114 147 list_for_each_entry(pos, &cond->waiters, list, struct usbi_cond_perthread) { 115 if (!SetEvent(pos->event))148 if (!SetEvent(pos->event)) 116 149 fail = 1; 117 150 } 118 151 // The wait function will remove its respective item from the list. 119 return fail ? ((errno=EINVAL)): 0;120 } 121 int usbi_cond_signal(usbi_cond_t *cond) { 122 // Assumes mutex is locked; this is not in keeping with POSIX spec, but 123 // libusb does this anyway, so we simplify by not adding more sync124 // primitives to the CV definition! 152 return fail ? EINVAL : 0; 153 } 154 155 __inline static int usbi_cond_intwait(usbi_cond_t *cond, 156 usbi_mutex_t *mutex, DWORD timeout_ms) 157 { 125 158 struct usbi_cond_perthread *pos; 126 if(!cond) return ((errno=EINVAL)); 127 if(list_empty(&cond->waiters)) return 0; // no one to wakeup. 128 pos = list_entry(&cond->waiters.next, struct usbi_cond_perthread, list); 129 // The wait function will remove its respective item from the list. 130 return SetEvent(pos->event) ? 0 : ((errno=EINVAL)); 131 } 132 static int __inline usbi_cond_intwait(usbi_cond_t *cond, 133 usbi_mutex_t *mutex, 134 DWORD timeout_ms) { 135 struct usbi_cond_perthread *pos; 136 int found = 0, r; 137 DWORD r2,tid = GetCurrentThreadId(); 138 if(!cond || !mutex) return ((errno=EINVAL)); 159 int r, found = 0; 160 DWORD r2, tid = GetCurrentThreadId(); 161 162 if (!cond || !mutex) 163 return EINVAL; 139 164 list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) { 140 165 if(tid == pos->tid) { … … 143 168 } 144 169 } 145 if(!found) { 146 pos = (struct usbi_cond_perthread*) calloc(1, sizeof(struct usbi_cond_perthread)); 147 if(!pos) return ((errno=ENOMEM)); // This errno is not POSIX-allowed. 170 171 if (!found) { 172 pos = calloc(1, sizeof(struct usbi_cond_perthread)); 173 if (!pos) 174 return ENOMEM; // This errno is not POSIX-allowed. 148 175 pos->tid = tid; 149 176 pos->event = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset. 150 if (!pos->event) {177 if (!pos->event) { 151 178 free(pos); 152 return ((errno=ENOMEM));179 return ENOMEM; 153 180 } 154 181 list_add(&pos->list, &cond->not_waiting); … … 159 186 160 187 r = usbi_mutex_unlock(mutex); 161 if(r) return r; 188 if (r) 189 return r; 190 162 191 r2 = WaitForSingleObject(pos->event, timeout_ms); 163 r = usbi_mutex_lock(mutex); 164 if(r) return r; 192 r = usbi_mutex_lock(mutex); 193 if (r) 194 return r; 165 195 166 196 list_del(&pos->list); 167 197 list_add(&pos->list, &cond->not_waiting); 168 198 169 if(r2 == WAIT_TIMEOUT) return ((errno=ETIMEDOUT)); 170 171 return 0; 199 if (r2 == WAIT_OBJECT_0) 200 return 0; 201 else if (r2 == WAIT_TIMEOUT) 202 return ETIMEDOUT; 203 else 204 return EINVAL; 172 205 } 173 206 // N.B.: usbi_cond_*wait() can also return ENOMEM, even though pthread_cond_*wait cannot! 174 int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex) { 207 int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex) 208 { 175 209 return usbi_cond_intwait(cond, mutex, INFINITE); 176 210 } 211 177 212 int usbi_cond_timedwait(usbi_cond_t *cond, 178 usbi_mutex_t *mutex, 179 const struct timespec *abstime) { 180 FILETIME filetime; 181 ULARGE_INTEGER rtime; 182 struct timeval targ_time, cur_time, delta_time; 183 struct timespec cur_time_ns; 213 usbi_mutex_t *mutex, const struct timeval *tv) 214 { 184 215 DWORD millis; 185 extern const uint64_t epoch_time; 186 187 GetSystemTimeAsFileTime(&filetime); 188 rtime.LowPart = filetime.dwLowDateTime; 189 rtime.HighPart = filetime.dwHighDateTime; 190 rtime.QuadPart -= epoch_time; 191 cur_time_ns.tv_sec = (long)(rtime.QuadPart / 10000000); 192 cur_time_ns.tv_nsec = (long)((rtime.QuadPart % 10000000)*100); 193 TIMESPEC_TO_TIMEVAL(&cur_time, &cur_time_ns); 194 195 TIMESPEC_TO_TIMEVAL(&targ_time, abstime); 196 timersub(&targ_time, &cur_time, &delta_time); 197 if(delta_time.tv_sec < 0) // abstime already passed? 198 millis = 0; 199 else { 200 millis = delta_time.tv_usec/1000; 201 millis += delta_time.tv_sec *1000; 202 if (delta_time.tv_usec % 1000) // round up to next millisecond 203 millis++; 204 } 205 216 217 millis = (DWORD)(tv->tv_sec * 1000) + (tv->tv_usec / 1000); 218 /* round up to next millisecond */ 219 if (tv->tv_usec % 1000) 220 millis++; 206 221 return usbi_cond_intwait(cond, mutex, millis); 207 222 } 208 223 224 int usbi_tls_key_create(usbi_tls_key_t *key) 225 { 226 if (!key) 227 return EINVAL; 228 *key = TlsAlloc(); 229 if (*key == TLS_OUT_OF_INDEXES) 230 return ENOMEM; 231 else 232 return 0; 233 } 234 235 void *usbi_tls_key_get(usbi_tls_key_t key) 236 { 237 return TlsGetValue(key); 238 } 239 240 int usbi_tls_key_set(usbi_tls_key_t key, void *value) 241 { 242 if (TlsSetValue(key, value)) 243 return 0; 244 else 245 return EINVAL; 246 } 247 248 int usbi_tls_key_delete(usbi_tls_key_t key) 249 { 250 if (TlsFree(key)) 251 return 0; 252 else 253 return EINVAL; 254 } 255 256 int usbi_get_tid(void) 257 { 258 return (int)GetCurrentThreadId(); 259 } -
TabularUnified libusb1/trunk/libusb/os/threads_windows.h ¶
r1876 r1882 2 2 * libusb synchronization on Microsoft Windows 3 3 * 4 * Copyright (C)2010 Michael Plante <michael.plante@gmail.com>4 * Copyright © 2010 Michael Plante <michael.plante@gmail.com> 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 22 22 #define LIBUSB_THREADS_WINDOWS_H 23 23 24 #include <windows.h> 24 #define usbi_mutex_static_t volatile LONG 25 #define USBI_MUTEX_INITIALIZER 0 25 26 26 #define usbi_mutex_static_t volatile LONG 27 #define USBI_MUTEX_INITIALIZER 0 27 #define usbi_mutex_t HANDLE 28 28 29 #define usbi_mutex_t HANDLE 30 31 struct usbi_cond_perthread { 32 struct list_head list; 33 DWORD tid; 34 HANDLE event; 35 }; 36 struct usbi_cond_t_ { 29 typedef struct usbi_cond { 37 30 // Every time a thread touches the CV, it winds up in one of these lists. 38 // It stays there until the CV is destroyed, even if the thread 39 // terminates. 31 // It stays there until the CV is destroyed, even if the thread terminates. 40 32 struct list_head waiters; 41 33 struct list_head not_waiting; 42 }; 43 typedef struct usbi_cond_t_ usbi_cond_t; 34 } usbi_cond_t; 44 35 45 36 // We *were* getting timespec from pthread.h: … … 48 39 #define _TIMESPEC_DEFINED 1 49 40 struct timespec { 50 51 41 long tv_sec; 42 long tv_nsec; 52 43 }; 53 44 #endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */ … … 58 49 #endif 59 50 60 #define usbi_mutexattr_t void 61 #define usbi_condattr_t void 62 63 // all Windows mutexes are recursive 64 #define usbi_mutex_init_recursive(mutex, attr) usbi_mutex_init((mutex), (attr)) 51 #define usbi_tls_key_t DWORD 65 52 66 53 int usbi_mutex_static_lock(usbi_mutex_static_t *mutex); 67 54 int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex); 68 55 69 70 int usbi_mutex_init(usbi_mutex_t *mutex, 71 const usbi_mutexattr_t *attr); 56 int usbi_mutex_init(usbi_mutex_t *mutex); 72 57 int usbi_mutex_lock(usbi_mutex_t *mutex); 73 58 int usbi_mutex_unlock(usbi_mutex_t *mutex); … … 75 60 int usbi_mutex_destroy(usbi_mutex_t *mutex); 76 61 77 int usbi_cond_init(usbi_cond_t *cond, 78 const usbi_condattr_t *attr); 79 int usbi_cond_destroy(usbi_cond_t *cond); 62 int usbi_cond_init(usbi_cond_t *cond); 80 63 int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex); 81 64 int usbi_cond_timedwait(usbi_cond_t *cond, 82 usbi_mutex_t *mutex, 83 const struct timespec *abstime); 65 usbi_mutex_t *mutex, const struct timeval *tv); 84 66 int usbi_cond_broadcast(usbi_cond_t *cond); 85 int usbi_cond_signal(usbi_cond_t *cond); 67 int usbi_cond_destroy(usbi_cond_t *cond); 68 69 int usbi_tls_key_create(usbi_tls_key_t *key); 70 void *usbi_tls_key_get(usbi_tls_key_t key); 71 int usbi_tls_key_set(usbi_tls_key_t key, void *value); 72 int usbi_tls_key_delete(usbi_tls_key_t key); 73 74 int usbi_get_tid(void); 86 75 87 76 #endif /* LIBUSB_THREADS_WINDOWS_H */ 88 -
TabularUnified libusb1/trunk/libusb/sync.c ¶
r1879 r1882 1 1 /* 2 2 * Synchronous I/O functions for libusb 3 * Copyright (C)2007-2008 Daniel Drake <dsd@gentoo.org>3 * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org> 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 19 19 20 20 #include <config.h> 21 21 22 #include <errno.h> 22 23 #include <stdint.h> … … 27 28 28 29 /** 29 * @defgroup syncio Synchronous device I/O30 * @defgroup libusb_syncio Synchronous device I/O 30 31 * 31 32 * This page documents libusb's synchronous (blocking) API for USB device I/O. 32 33 * This interface is easy to use but has some limitations. More advanced users 33 * may wish to consider using the \ref asyncio "asynchronous I/O API" instead.34 */ 35 36 static void LIBUSB_CALL ctrl_transfer_cb(struct libusb_transfer *transfer)34 * may wish to consider using the \ref libusb_asyncio "asynchronous I/O API" instead. 35 */ 36 37 static void LIBUSB_CALL sync_transfer_cb(struct libusb_transfer *transfer) 37 38 { 38 39 int *completed = transfer->user_data; … … 42 43 } 43 44 44 /** \ingroup syncio 45 static void sync_transfer_wait_for_completion(struct libusb_transfer *transfer) 46 { 47 int r, *completed = transfer->user_data; 48 struct libusb_context *ctx = HANDLE_CTX(transfer->dev_handle); 49 50 while (!*completed) { 51 r = libusb_handle_events_completed(ctx, completed); 52 if (r < 0) { 53 if (r == LIBUSB_ERROR_INTERRUPTED) 54 continue; 55 usbi_err(ctx, "libusb_handle_events failed: %s, cancelling transfer and retrying", 56 libusb_error_name(r)); 57 libusb_cancel_transfer(transfer); 58 continue; 59 } 60 } 61 } 62 63 /** \ingroup libusb_syncio 45 64 * Perform a USB control transfer. 46 65 * … … 68 87 * device 69 88 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 89 * \returns LIBUSB_ERROR_BUSY if called from event handling context 90 * \returns LIBUSB_ERROR_INVALID_PARAM if the transfer size is larger than 91 * the operating system and/or hardware can support 70 92 * \returns another LIBUSB_ERROR code on other failures 71 93 */ … … 74 96 unsigned char *data, uint16_t wLength, unsigned int timeout) 75 97 { 76 struct libusb_transfer *transfer = libusb_alloc_transfer(0);98 struct libusb_transfer *transfer; 77 99 unsigned char *buffer; 78 100 int completed = 0; 79 101 int r; 80 102 103 if (usbi_handling_events(HANDLE_CTX(dev_handle))) 104 return LIBUSB_ERROR_BUSY; 105 106 transfer = libusb_alloc_transfer(0); 81 107 if (!transfer) 82 108 return LIBUSB_ERROR_NO_MEM; 83 109 84 110 #ifndef __OS2__ 85 buffer = malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);111 buffer = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength); 86 112 #else 87 buffer = _tmalloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);113 buffer = (unsigned char*)_tmalloc(LIBUSB_CONTROL_SETUP_SIZE + wLength); 88 114 #endif 89 115 if (!buffer) { … … 98 124 99 125 libusb_fill_control_transfer(transfer, dev_handle, buffer, 100 ctrl_transfer_cb, &completed, timeout);126 sync_transfer_cb, &completed, timeout); 101 127 transfer->flags = LIBUSB_TRANSFER_FREE_BUFFER; 102 128 r = libusb_submit_transfer(transfer); … … 106 132 } 107 133 108 while (!completed) { 109 r = libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed); 110 if (r < 0) { 111 if (r == LIBUSB_ERROR_INTERRUPTED) 112 continue; 113 libusb_cancel_transfer(transfer); 114 while (!completed) 115 if (libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed) < 0) 116 break; 117 libusb_free_transfer(transfer); 118 return r; 119 } 120 } 134 sync_transfer_wait_for_completion(transfer); 121 135 122 136 if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN) … … 154 168 } 155 169 156 static void LIBUSB_CALL bulk_transfer_cb(struct libusb_transfer *transfer)157 {158 int *completed = transfer->user_data;159 *completed = 1;160 usbi_dbg("actual_length=%d", transfer->actual_length);161 /* caller interprets results and frees transfer */162 }163 164 170 static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, 165 171 unsigned char endpoint, unsigned char *buffer, int length, 166 172 int *transferred, unsigned int timeout, unsigned char type) 167 173 { 168 struct libusb_transfer *transfer = libusb_alloc_transfer(0);174 struct libusb_transfer *transfer; 169 175 int completed = 0; 170 176 int r; 171 177 178 if (usbi_handling_events(HANDLE_CTX(dev_handle))) 179 return LIBUSB_ERROR_BUSY; 180 181 transfer = libusb_alloc_transfer(0); 172 182 if (!transfer) 173 183 return LIBUSB_ERROR_NO_MEM; 174 184 175 185 libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, 176 bulk_transfer_cb, &completed, timeout);186 sync_transfer_cb, &completed, timeout); 177 187 transfer->type = type; 178 188 … … 183 193 } 184 194 185 while (!completed) { 186 r = libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed); 187 if (r < 0) { 188 if (r == LIBUSB_ERROR_INTERRUPTED) 189 continue; 190 libusb_cancel_transfer(transfer); 191 while (!completed) 192 if (libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed) < 0) 193 break; 194 libusb_free_transfer(transfer); 195 return r; 196 } 197 } 198 199 *transferred = transfer->actual_length; 195 sync_transfer_wait_for_completion(transfer); 196 197 if (transferred) 198 *transferred = transfer->actual_length; 199 200 200 switch (transfer->status) { 201 201 case LIBUSB_TRANSFER_COMPLETED: … … 228 228 } 229 229 230 /** \ingroup syncio230 /** \ingroup libusb_syncio 231 231 * Perform a USB bulk transfer. The direction of the transfer is inferred from 232 232 * the direction bits of the endpoint address. … … 254 254 * bulk reads, the maximum number of bytes to receive into the data buffer. 255 255 * \param transferred output location for the number of bytes actually 256 * transferred. 256 * transferred. Since version 1.0.21 (\ref LIBUSB_API_VERSION >= 0x01000105), 257 * it is legal to pass a NULL pointer if you do not wish to receive this 258 * information. 257 259 * \param timeout timeout (in millseconds) that this function should wait 258 260 * before giving up due to no response being received. For an unlimited … … 264 266 * \returns LIBUSB_ERROR_PIPE if the endpoint halted 265 267 * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see 266 * \ref packetoverflow268 * \ref libusb_packetoverflow 267 269 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 270 * \returns LIBUSB_ERROR_BUSY if called from event handling context 268 271 * \returns another LIBUSB_ERROR code on other failures 269 272 */ … … 276 279 } 277 280 278 /** \ingroup syncio281 /** \ingroup libusb_syncio 279 282 * Perform a USB interrupt transfer. The direction of the transfer is inferred 280 283 * from the direction bits of the endpoint address. … … 304 307 * bulk reads, the maximum number of bytes to receive into the data buffer. 305 308 * \param transferred output location for the number of bytes actually 306 * transferred. 309 * transferred. Since version 1.0.21 (\ref LIBUSB_API_VERSION >= 0x01000105), 310 * it is legal to pass a NULL pointer if you do not wish to receive this 311 * information. 307 312 * \param timeout timeout (in millseconds) that this function should wait 308 313 * before giving up due to no response being received. For an unlimited … … 313 318 * \returns LIBUSB_ERROR_PIPE if the endpoint halted 314 319 * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see 315 * \ref packetoverflow320 * \ref libusb_packetoverflow 316 321 * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 322 * \returns LIBUSB_ERROR_BUSY if called from event handling context 317 323 * \returns another LIBUSB_ERROR code on other error 318 324 */ … … 324 330 transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT); 325 331 } 326 -
TabularUnified libusb1/trunk/libusb/version.h ¶
r1876 r1882 1 1 /* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */ 2 #include "version_nano.h" 2 3 #ifndef LIBUSB_MAJOR 3 4 #define LIBUSB_MAJOR 1 … … 7 8 #endif 8 9 #ifndef LIBUSB_MICRO 9 #define LIBUSB_MICRO 1610 #define LIBUSB_MICRO 21 10 11 #endif 11 /* LIBUSB_NANO may be used for Windows internal versioning. 0 means unused. */12 12 #ifndef LIBUSB_NANO 13 13 #define LIBUSB_NANO 0 … … 15 15 /* LIBUSB_RC is the release candidate suffix. Should normally be empty. */ 16 16 #ifndef LIBUSB_RC 17 #define LIBUSB_RC " -rc6"17 #define LIBUSB_RC "" 18 18 #endif -
TabularUnified libusb1/trunk/missing ¶
r1876 r1882 2 2 # Common wrapper for a few potentially missing GNU programs. 3 3 4 scriptversion=201 2-06-26.16; # UTC4 scriptversion=2013-10-28.13; # UTC 5 5 6 6 # Copyright (C) 1996-2013 Free Software Foundation, Inc. … … 161 161 autom4te*) 162 162 echo "You might have modified some maintainer files that require" 163 echo "the 'autom a4te' program to be rebuilt."163 echo "the 'autom4te' program to be rebuilt." 164 164 program_details 'autom4te' 165 165 ;; -
TabularUnified libusb1/trunk/msvc/config.h ¶
r1876 r1882 6 6 #endif 7 7 8 /* Visual Studio 2015 and later defines timespec */ 9 #if defined(_MSC_VER) && (_MSC_VER >= 1900) 10 #define _TIMESPEC_DEFINED 1 11 #endif 12 13 /* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */ 14 #pragma warning(disable:4200) 15 /* Disable: warning C6258: Using TerminateThread does not allow proper thread clean up */ 16 #pragma warning(disable: 6258) 17 /* Disable: warning C4996: 'GetVersionA': was declared deprecated */ 18 #pragma warning(disable: 4996) 19 20 #if defined(_PREFAST_) 21 /* Disable "Banned API" errors when using the MS's WDK OACR/Prefast */ 22 #pragma warning(disable:28719) 23 /* Disable "The function 'InitializeCriticalSection' must be called from within a try/except block" */ 24 #pragma warning(disable:28125) 25 #endif 26 8 27 /* Default visibility */ 9 28 #define DEFAULT_VISIBILITY /**/ 10 29 11 /* Debug message logging */ 12 //#define ENABLE_DEBUG_LOGGING 1 13 14 /* Message logging */ 30 /* Enable global message logging */ 15 31 #define ENABLE_LOGGING 1 16 32 17 /* Windows backend */ 18 #define OS_WINDOWS 1 33 /* Uncomment to start with debug message logging enabled */ 34 // #define ENABLE_DEBUG_LOGGING 1 35 36 /* Uncomment to enabling logging to system log */ 37 // #define USE_SYSTEM_LOGGING_FACILITY 19 38 20 39 /* type of second poll() argument */ 21 40 #define POLL_NFDS_TYPE unsigned int 22 41 23 /* no way to run git describe from MSVC? */ 24 #define LIBUSB_DESCRIBE "" 42 /* Windows/WinCE backend */ 43 #if defined(_WIN32_WCE) 44 #define OS_WINCE 1 45 #define HAVE_MISSING_H 46 #else 47 #define OS_WINDOWS 1 48 #define HAVE_SIGNAL_H 1 49 #define HAVE_SYS_TYPES_H 1 50 #endif -
TabularUnified libusb1/trunk/msvc/ddk_build.cmd ¶
r1876 r1882 1 @rem default builds static library.2 @rem you can pass the following arguments (case insensitive):3 @rem - "DLL" to build a DLL instead of a static library4 @rem - "/MT" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT)5 1 @echo off 2 ::# default builds static library. 3 ::# you can pass the following arguments (case insensitive): 4 ::# - "DLL" to build a DLL instead of a static library 5 ::# - "/MT" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT) 6 ::# - "USBDK" to build with UsbDk backend 6 7 7 8 if Test%BUILD_ALT_DIR%==Test goto usage 8 9 9 remprocess commandline parameters10 ::# process commandline parameters 10 11 set TARGET=LIBRARY 11 12 set STATIC_LIBC= 13 set WITH_USBDK= 12 14 set version=1.0 15 set PWD=%~dp0 16 set BUILD_CMD=build -bcwgZ -M2 17 18 :more_args 13 19 14 20 if "%1" == "" goto no_more_args 15 rem/I for case insensitive21 ::# /I for case insensitive 16 22 if /I Test%1==TestDLL set TARGET=DYNLINK 17 23 if /I Test%1==Test/MT set STATIC_LIBC=1 24 if /I Test%1==TestUSBDK set WITH_USBDK=1 25 26 shift 27 goto more_args 28 18 29 :no_more_args 19 30 … … 23 34 del target 24 35 @echo on 25 build -cwgZ 36 %BUILD_CMD% 26 37 @echo off 27 38 if errorlevel 1 goto builderror … … 74 85 copy ..\..\msvc\listdevs_sources sources >NUL 2>&1 75 86 @echo on 76 build -cwgZ 87 %BUILD_CMD% 77 88 @echo off 78 if errorlevel 1 goto build listdevserror89 if errorlevel 1 goto builderror 79 90 cd ..\.. 80 91 … … 85 96 copy %srcPath%\listdevs.pdb %dstPath%\examples 86 97 98 @echo off 99 100 if exist examples\xusb_ddkbuild goto md8 101 md examples\xusb_ddkbuild 102 :md8 103 104 cd examples\xusb_ddkbuild 105 copy ..\..\msvc\xusb_sources sources >NUL 2>&1 106 @echo on 107 %BUILD_CMD% 108 @echo off 109 if errorlevel 1 goto builderror 110 cd ..\.. 111 112 set srcPath=examples\xusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir% 113 @echo on 114 115 copy %srcPath%\xusb.exe %dstPath%\examples 116 copy %srcPath%\xusb.pdb %dstPath%\examples 117 118 @echo off 119 120 if exist examples\getopt\getopt_ddkbuild goto md9 121 md examples\getopt\getopt_ddkbuild 122 :md9 123 124 cd examples\getopt\getopt_ddkbuild 125 copy ..\..\..\msvc\getopt_sources sources >NUL 2>&1 126 @echo on 127 %BUILD_CMD% 128 @echo off 129 if errorlevel 1 goto builderror 130 cd ..\..\.. 131 132 if exist examples\fxload_ddkbuild goto md10 133 md examples\fxload_ddkbuild 134 :md10 135 136 cd examples\fxload_ddkbuild 137 copy ..\..\msvc\fxload_sources sources >NUL 2>&1 138 @echo on 139 %BUILD_CMD% 140 @echo off 141 if errorlevel 1 goto builderror 142 cd ..\.. 143 144 set srcPath=examples\fxload_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir% 145 @echo on 146 147 copy %srcPath%\fxload.exe %dstPath%\examples 148 copy %srcPath%\fxload.pdb %dstPath%\examples 149 150 @echo off 151 152 if exist examples\hotplugtest_ddkbuild goto md11 153 md examples\hotplugtest_ddkbuild 154 :md11 155 156 cd examples\hotplugtest_ddkbuild 157 copy ..\..\msvc\hotplugtest_sources sources >NUL 2>&1 158 @echo on 159 %BUILD_CMD% 160 @echo off 161 if errorlevel 1 goto builderror 162 cd ..\.. 163 164 set srcPath=examples\hotplugtest_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir% 165 @echo on 166 167 copy %srcPath%\hotplugtest.exe %dstPath%\examples 168 copy %srcPath%\hotplugtest.pdb %dstPath%\examples 169 170 @echo off 171 87 172 cd msvc 88 goto done89 90 91 :builderror92 cd ..\..\msvc93 echo Build failed94 goto done95 96 :buildlistdevserror97 cd ..\..\msvc98 echo listdevs build failed99 173 goto done 100 174 … … 104 178 goto done 105 179 180 :builderror 181 echo Build failed 182 106 183 :done 184 cd %PWD% -
TabularUnified libusb1/trunk/msvc/libusb.dsw ¶
r1876 r1882 43 43 ############################################################################### 44 44 45 Project: "xusb"=".\xusb.dsp" - Package Owner=<4> 46 47 Package=<5> 48 {{{ 49 }}} 50 51 Package=<4> 52 {{{ 53 Begin Project Dependency 54 Project_Dep_Name libusb_static 55 End Project Dependency 56 }}} 57 58 ############################################################################### 59 45 60 Global: 46 61 -
TabularUnified libusb1/trunk/msvc/libusb_dll.dsp ¶
r1876 r1882 136 136 # Begin Source File 137 137 138 SOURCE=..\libusb\os\windows_ usb.c138 SOURCE=..\libusb\os\windows_winusb.c 139 139 # End Source File 140 140 # End Group … … 180 180 # Begin Source File 181 181 182 SOURCE=..\libusb\os\windows_usb.h 182 SOURCE=..\libusb\os\windows_winusb.h 183 # End Source File 184 # Begin Source File 185 186 SOURCE=..\libusb\os\windows_common.h 183 187 # End Source File 184 188 # End Group -
TabularUnified libusb1/trunk/msvc/libusb_sources ¶
r1876 r1882 13 13 !ENDIF 14 14 15 !IFDEF WITH_USBDK 16 BACKEND_DEFINES="/DUSE_USBDK" 17 !ENDIF 18 15 19 INCLUDES=..;..\..\msvc;$(DDK_INC_PATH) 16 C_DEFINES= $(C_DEFINES) $(LIBUSB_DEFINES) /DDDKBUILD20 C_DEFINES= $(C_DEFINES) $(LIBUSB_DEFINES) $(BACKEND_DEFINES) /DDDKBUILD 17 21 18 22 # http://jpassing.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/ … … 30 34 ..\descriptor.c \ 31 35 ..\io.c \ 36 ..\strerror.c \ 32 37 ..\sync.c \ 38 ..\hotplug.c \ 33 39 threads_windows.c \ 34 40 poll_windows.c \ 35 windows_usb.c \ 41 windows_winusb.c \ 42 windows_usbdk.c \ 43 windows_nt_common.c \ 36 44 ..\libusb-1.0.rc -
TabularUnified libusb1/trunk/msvc/libusb_static.dsp ¶
r1876 r1882 120 120 # Begin Source File 121 121 122 SOURCE=..\libusb\os\windows_ usb.c122 SOURCE=..\libusb\os\windows_winusb.c 123 123 # End Source File 124 124 # End Group … … 164 164 # Begin Source File 165 165 166 SOURCE=..\libusb\os\windows_usb.h 166 SOURCE=..\libusb\os\windows_winusb.h 167 # End Source File 168 # Begin Source File 169 170 SOURCE=..\libusb\os\windows_common.h 167 171 # End Source File 168 172 # End Group
Note:
See TracChangeset
for help on using the changeset viewer.