Just built this on OSX 10.7.4, but I have trouble getting --enable-bitforce to work, and beeing a newbie on these kind of things I would like if anybody can help. If I can be of any help, I built it with these steps:
...
The error I get when trying with --enable-bitforce is:
CC cgminer-fpgautils.o
fpgautils.c: In function ‘serial_open’:
fpgautils.c:214: error: ‘CBAUD’ undeclared (first use in this function)
fpgautils.c:214: error: (Each undeclared identifier is reported only once
fpgautils.c:214: error: for each function it appears in.)
make[1]: *** [cgminer-fpgautils.o] Error 1
make: *** [install-recursive] Error 1
...
CBAUD is part of termios.h - which is included by termio.h - the same place B115200 comes from.
The actual definition of both of them is in bits/termios.h
Find where B115200 is defined and CBAUD should be in the same place:
grep B115200 /usr/include/*
grep B115200 /usr/include/*/*
grep CBAUD /usr/include/*
grep CBAUD /usr/include/*/*
If it's missing then all I can guess is that OSX has done something very strange ...
The addition of CBAUD was to fix an old issue that setting the serial BAUD rate should only change the bits that represent the BAUD, not zero everything else.
I ran across this same issue, and tried to do some research into it. The best I could find was:
http://earthworm.isti.com/trac/earthworm/ticket/151This is because CBAUD is a Linux extension to the POSIX Terminal I/O definitions. The fix is to use the standard POSIX Terminal I/O functions to set the serial input and output BAUD rates (e.g., if CBAUD is undefined)...
Dunno how to change that in the fpgautils.c file, though that looks to be the root cause since CBAUD is showing up as undeclared.
After some bungling around with fpgautils.c, I managed to get things working. Where CBAUD is undefined in OSX (why? dunno...), it throws the error around line 214:
my_termios.c_cflag &= ~CBAUD;
my_termios.c_cflag |= B115200;
break;
So using the link I posted earlier
http://earthworm.isti.com/trac/earthworm/ticket/151 as a template, I changed it to this:
#ifdef CBAUD
my_termios.c_cflag &= ~CBAUD; // baudrate mask
my_termios.c_cflag |= B115200; // baudrate
#else
cfsetispeed( &my_termios, B115200 );
cfsetospeed( &my_termios, B115200 );
#endif
break;
This allowed it to compile in OSX, and I'm currently testing it out now. Any help regarding the change I made would be awesome, as it LOOKS like it worked (it's mining right now), but I have no idea if this breaks anything else.
Oh, I have uploaded my updated version here:
http://bitcoin.phraust.com/fpgautils.c