Cyberjock,
I actually tried it, and it worked!
The reason I called my friend a linux-guru, is that he knows so much more of linux than I do.
Probably that says so much more of me than of him..... ;)
I know FreeNAS is based on (Free)BSD, but the system is more like linux than Windows isn't it?
Anyway: the steps I used to complete my task:
1.
mkdir /usr/local/mochad
2.
cd /usr/local/mochad
3.
wget http://downloads.sourceforge.net/project/mochad/mochad-0.1.16.tar.gz
4.
tar zxvf mochad-0.1.16.tar.gz
5.
cd mochad-0.1.16.tar.gz
6.
setenv CPPFLAGS "-I/usr/local/include"
7.
setenv LDFLAGS "-lusb"
When you try to compile the file at this point, you will get an error:
decode.o: In function `get_timems':
/usr/local/mochad/mochad-0.1.16/decode.c:591: undefined reference to `ftime'
*** [mochad] Error code 1
You have to make a small change to the file: /usr/local/mochad/decode.c
But first, make a copy, just to be sure...
8.
cp /usr/local/mochad/mochad-0.1.16/decode.c /usr/local/mochad/mochad-0.1.16/decode.c.orig
Edit the file decode.c in your favorite editor.
Comment out the include <sys/timeb.h> section:
/*#include <sys/timeb.h>*/
Insert the following include:
#include <sys/time.h>
Find the comment
/* Get system time in milliseconds */
Change the section below form:
/* Get system time in milliseconds */
static timems_t get_timems(void)
{
struct timeb tp;
ftime(&tp);
return (timems_t) (tp.time * 1000) + tp.millitm;
}
To:
/* Get system time in milliseconds */
static timems_t get_timems(void)
{
struct timeval tp;
struct timezone tz;
gettimeofday(&tp, &tz);
return (timems_t) (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
}
Save your file.
Now compile!
9.
make clean
10.
make
11. start mochad, and have fun!
I hope this instruction was detailed enough and will be of some use to anybody.
Martijn