igrr / esptool-ck

ESP8266 build/flash helper tool by Christian Klippel
GNU General Public License v2.0
360 stars 123 forks source link

Compilation fails with ‘CRTSCTS’ undeclared #2

Closed probonopd closed 9 years ago

probonopd commented 9 years ago

On Ubuntu 14.04.1 LTS compilation fails:

me@host:~/esptool-ck$ make
gcc -Iinfohelper -Ielf -Ibinimage -Iargparse -Iserialport -Iespcomm  -std=c99 -Os -Wall  -DLINUX -c serialport/serialport.c -o build/serialport/serialport.o
serialport/serialport.c: In function ‘serialport_open’:
serialport/serialport.c:374:22: error: ‘CRTSCTS’ undeclared (first use in this function)
     term.c_cflag &= ~CRTSCTS;
                      ^
serialport/serialport.c:374:22: note: each undeclared identifier is reported only once for each function it appears in
make: *** [build/serialport/serialport.o] Error 1
probonopd commented 9 years ago

This can be fixed by using the -std=gnu99 compiler flag instead of -std=c99 (but since I don't know what this does to other platforms, it is probably best to change the Makefile so that this flag is used only on Linux platforms).

igrr commented 9 years ago

I've switched to -std=gnu99 for all platforms and it seems to be okay.