diff options
author | uwe <uwe@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-07-03 19:44:12 +0000 |
---|---|---|
committer | uwe <uwe@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-07-03 19:44:12 +0000 |
commit | 30a2d44d430213d24aba23dcd41afea27af0d747 (patch) | |
tree | 5069863aa7d5100dfc18010d20f19fd8d8df2884 /serial.c | |
parent | a97ddd07208825a7331155fe8aced7025c981872 (diff) | |
download | flashrom-30a2d44d430213d24aba23dcd41afea27af0d747.tar.gz |
Fix and improve Windows/MinGW/MSYS build.
- Makefile: Use $(OS_ARCH) to add some MinGW-specific workarounds and
settings, so that a simple "make" is sufficient on MinGW (instead of
manual Makefile hacking).
- Explicitly set CC=gcc in the Makefile, otherwise you get an error like
"cc: command not found" on MinGW.
- MinGW doesn't have ffs(), use gcc's __builtin_ffs() instead.
- Add /usr/local/include and /usr/local/lib to CPPFLAGS/LDFLAGS, that's
where libusb-win32 and libftdi stuff is usually placed on MinGW/MSYS.
- Disable serprog (no sockets) and all PCI-based programmers (no libpci)
for now. That leaves dummy, ft2232_spi, and buspirate_spi enabled on
MinGW per default.
- serial.c: Use correct type for 'tmp', both on Windows/MinGW (DWORD)
and POSIX (ssize_t).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1363 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -192,7 +192,11 @@ int serialport_shutdown(void *data) int serialport_write(unsigned char *buf, unsigned int writecnt) { - long tmp = 0; +#ifdef _WIN32 + DWORD tmp = 0; +#else + ssize_t tmp = 0; +#endif while (writecnt > 0) { #ifdef _WIN32 @@ -215,7 +219,11 @@ int serialport_write(unsigned char *buf, unsigned int writecnt) int serialport_read(unsigned char *buf, unsigned int readcnt) { - long tmp = 0; +#ifdef _WIN32 + DWORD tmp = 0; +#else + ssize_t tmp = 0; +#endif while (readcnt > 0) { #ifdef _WIN32 |