Monday, April 30, 2007

Compiling Flow-tools on OSX/gcc4

Recent (at least 4.0.x) versions of gcc don't like flow-tools but there is a patch

franz-g4:~/Desktop/flow-tools-0.68 mdfranz$ ./configure --prefix=/opt/local
checking for a BSD-compatible install... /usr/bin/install -c


SNIP

franz-g4:~/Desktop/flow-tools-0.68 mdfranz$ make
Making all in lib
make all-am
source='ftio.c' object='ftio.o' libtool=no \
depfile='.deps/ftio.Po' tmpdepfile='.deps/ftio.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
gcc -I. -I./lib -I. -I. -I. -g -Wall -g -Wall -c `test -f 'ftio.c' || echo './'`ftio.c
ftio.c: In function 'readn':
ftio.c:2270: error: address of register variable 'ptr' requested
ftio.c:2270: warning: target of assignment not really an lvalue; this will be a hard error in the future
ftio.c:2270: confused by earlier errors, bailing out
make[2]: *** [ftio.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
franz-g4:~/Desktop/flow-tools-0.68 mdfranz$ patch -p1 <>

2 comments:

palevoblog said...

You might check the RPM I maintain for Fedora - it contains many fixes (including GCC stuff).

Just grab the .src.rpm somewhere on the fedora mirror and unpack it.

Anonymous said...

I found rpm2cpio helpful in extracting the patches. I also had to NOT apply flow-tools-0.68-0004-Make-flow-tools-more-FHS-compliant-and-buildable-by-newer-toolchain.patch as it was breaking stuff, but all the other patches applied cleanly. Thanks! Mike Hunter