Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIXED Apple OS X library compilation and installation with libftdi1 from MacPorts #49

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. "./configure" fails

This problem is related to my previous response on another issue:
https://code.google.com/p/libmpsse/issues/detail?id=32#c2

For Mac OS X + MacPorts, it seems that there is an easier way to globally 
enable (custom) builds to use the "/opt/local" in the search path of compiler.

edit your environment settings (eg. "/etc/profile") and append:
export LDFLAGS="-L/opt/local/lib"
export CFLAGS="-I/opt/local/include"
export CPPFLAGS="-I/opt/local/include"

Remember to (re)open a new terminal for the changes to take effect and then it 
works just fine to execute the default configure:
------------------------------------------
$ ./configure
------------------------------------------

Although it actually might make sense to update the install path for libmpsse 
accordingly:
------------------------------------------
$ ./configure --prefix=/opt/local/
------------------------------------------

Next, to be able to run "make install" in OS X, the "-D" option should not 
present in the Makefile. So replace all "install -D ..." to "install ..." and 
you can install it without a problem.
------------------------------------------
$ sudo make install
------------------------------------------
I'm not sure if the "-D" option is necessary for other unix systems like 
linux/bsd, otherwise it might be a suggestion to just remove this directive 
from the "Makefile.in" in the current repository.

Last issue I ran into is compiling the examples afterwards.
The Makefile in the "libmpsse/src/examples" directory currently does not work 
with globally defined compile and linker flags.
------------------------------------------
$ cd libmpsse/src/examples
$ make
------------------------------------------
cc -I/opt/local/include spiflash.c -o spiflash -lmpsse
ld: library not found for -lmpsse
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [spiflash] Error 1
------------------------------------------

However, when we patch the first line of "libmpsse/src/examples/Makefile":
"LDFLAGS=-lmpsse" -> "LDFLAGS+=-lmpsse"
Then it works just fine!
------------------------------------------
$ cd libmpsse/src/examples
$ make
------------------------------------------
cc -I/opt/local/include spiflash.c -o spiflash -L/opt/local/lib -lmpsse
cc -I/opt/local/include spiflashfast.c -o spiflashfast -L/opt/local/lib -lmpsse
cc -I/opt/local/include i2ceeprom.c -o i2ceeprom -L/opt/local/lib -lmpsse
cc -I/opt/local/include ds1305.c -o ds1305 -L/opt/local/lib -lmpsse
cc -I/opt/local/include gpio.c -o gpio -L/opt/local/lib -lmpsse
cc -I/opt/local/include bitbang.c -o bitbang -L/opt/local/lib -lmpsse
------------------------------------------
Also this patch might be useful to actually embed into the repository.

Original issue reported on code.google.com by verdult on 19 Aug 2014 at 8:28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant