krzysztofgawrys / libmpsse

Automatically exported from code.google.com/p/libmpsse
0 stars 0 forks source link

fast.o target is missing LIBFTDI1 define #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build code against libftdi1 installed to non-system directory
2. Call make with the path to the include/ that contains libftdi1/
2. Compilation will fail at fast.o
make CFLAGS="-I/home/cmorgan/local_install/include -fPIC"
...
gcc -I/home/cmorgan/local_install/include -fPIC -lftdi1 -L 
/home/cmorgan/local_install/lib64 -c fast.c
In file included from fast.c:10:0:
mpsse.h:9:18: fatal error: ftdi.h: No such file or directory
 #include <ftdi.h>
                  ^
compilation terminated.
make: *** [fast.o] Error 1

3. Modify the make line to include the libftdi1 directory like:
 make CFLAGS="-I/home/cmorgan/local_install/include/libftdi1 -fPIC"

4. Now other files will fail to compile like:

n/local_install/lib64 -DSWIGPYTHON -DLIBFTDI1=1 -c support.c
support.c:11:27: fatal error: libftdi1/ftdi.h: No such file or directory
 #include <libftdi1/ftdi.h>
                           ^
compilation terminated.

5.Go back to the original make line to finish the compile:

make CFLAGS="-I/home/cmorgan/local_install/include -fPIC"

The issue appears to be this in the makefile:

mpsse.o: support.o
        $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c

fast.o: support.o
        $(CC) $(CFLAGS) $(LDFLAGS) -c fast.c <------------ Lack of LIBFTDI1 define

support.o:
    $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c

When fast.o is being built fast.c is compiled which eventually includes mpsse.h 
which looks for the 0.x series libftdi headers like <ftdi.h> instead of 
<libftdi1/ftdi.h>.

Modifying Makefile.in to go from:

fast.o: support.o
        $(CC) $(CFLAGS) $(LDFLAGS) -c fast.c

to: 

fast.o: support.o
        $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c fast.c

Fixes the issue here.

I can submit a patch or test etc, just email me, chmorgan@gmail.com

Original issue reported on code.google.com by chmor...@gmail.com on 13 Sep 2013 at 9:35

GoogleCodeExporter commented 8 years ago
The fast.o target should already have LIBFTDI1 defined in the Makefile in the 
SVN trunk.

Original comment by heffne...@gmail.com on 16 Sep 2013 at 6:00

GoogleCodeExporter commented 8 years ago
Oh ok. I was using the released version. Sorry about reporting an already fixed 
issue...

Original comment by chmor...@gmail.com on 16 Sep 2013 at 6:07