Linux: removed the duplicated linking of libudev

Existence checking and linking of libudev is already carried out by means of
pkgconfig.

Change-Id: I5233ab2ce7ed342d95e8ba646b4024c8ad6b8a78
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Windows: acquire identifiers using the SetupDiGetDeviceInstanceId function

This decision uses one identification string of the device instead of the
list of hardware identifiers. See more detail in MSDN:

* http://msdn.microsoft.com/en-us/library/windows/hardware/ff551106%28v=vs.85%29.aspx
* http://msdn.microsoft.com/en-us/library/windows/hardware/ff541327%28v=vs.85%29.aspx

The device instance ID unambiguously identifies the device in system and
contains necessary values of identifiers, that allows to resolve some
issues:

* we can abandon a patch: https://codereview.qt-project.org/#change,61633
and Task-number: QTBUG-32684 automatically will be resolved
* we can apply a patch: https://codereview.qt-project.org/#change,61752
because instance ID also contains the serial number info

Checked on Windows 7 and 8 with USB PL2303 converter, USB Modem ZTE MF180,
USB Android Modems, USB Motorola CDC ACM device.

Change-Id: If3b67b5b34d65de060a0e7682ba426cd94a01fa7
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Qt 4: Refactor the shell handling for header generation

It does not make much sense to use branches for only a minor difference, hence
there is now a precheck for the host os and the quote variable is set
accordingly.

This is a slightly modified version of what QtCreator's qtcreator.pro is using.
Basically, single quote is used here for the quote variable rather than double
quote as double quote is causing issues at least on my machine.

Task-number: QTBUG-33125
Change-Id: I9eb0a0a62e1404a095cfc3b1bd68c519552d23b8
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Linux: Are added the missed QLatin1Char into libudev implementation

Change-Id: Ic125079bd9154f9094aaf2878c514eeac2753038
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Unix: Deleting a duplicating call of a non-blocking mode on descriptor

The call fcntl(fd, F_SETFL, FNDELAY) is superfluous because a flag FNDELAY
duplicates by functionality an existing flag O_NONBLOCK in open() function.
See more info, e.g.: http://linux.die.net/man/2/open

Tested on Gnu/Linux distro's with Qt4 and Qt5.

Change-Id: I01be72e78a9493af8077245cbf6a88e8c9d164ee
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Fix the compilation for Android with Qt 5.

1) The termios struct is basically copied and pasted from the documentation:
http://linux.die.net/man/3/termios

Since, it is just an interface without complicated methods, it is not
copyrightable, so it is safe enough.

2) This is also the same situation with the two defines we need for the kernel
interface. They are just interface numbers, and not something that
copyrightable. This has also been double checked and discussed with Lars in
email.

3) The ::tcdrain convenience method cannot be used on Android, so the fallback
"raw" ioctl syscall is used with the relevant parameters, e.g. TCSBREAK.

http://linux.die.net/man/3/tcdrain

5) cfsetspeed seems to be a BSD 4.4 extension based on the termios(3) man page:

http://linux.die.net/man/3/termios

"cfsetspeed() is a 4.4BSD extension.  It takes the same arguments as
cfsetispeed(), and sets both input and output speed."

... hence this is replaced with separate calls for input and output without a
specific Android "ifdef" in the code. It is actually also more consistent with
the setcfispeed and setcfospeed just right above that snippet.

Task-number: QTBUG-33139

Change-Id: If0abb8cec9e900fa2b6fc24df938cb778a344d55
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Use the term 'directions' for representing the directions

1) The previous 'dir' is incorrect because it should be plural for consistency
based upon the other variable names.

2) 'dir' can be misleading in the context where such a term is also used for
representing a directory, like in our case.

Change-Id: I650cc64c2669286a4d7ef071a2ab3b7b63228977
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Merge branch 'stable' into dev

Change-Id: Ie8f70b5101225453355a1eb6b0fdc3f3d8a34824