bnagy / gapstone

gapstone is a Go binding for the capstone disassembly library
Other
151 stars 43 forks source link

Fix capstone includes #1

Closed jroimartin closed 10 years ago

jroimartin commented 10 years ago

Capstone headers are installed in "$(DESTDIR)$(PREFIX)/include/capstone". The affected includes have been updated according to this:

// #include <capstone/capstone.h>
jroimartin commented 10 years ago

I have just noticed that "-I /usr/include/capstone" is specified. The real problem here is that the headers are not always installed in that path. In my case, they are installed under /usr/local/include/capstone. What about making this change and removing the CFLAG "-I/usr/include/capstone"? (Assuming that the headers will be installed under standard paths like /usr/include o /usr/local/include)

bnagy commented 10 years ago

Under OSX I wasn't previously able to get it to link without the -l directive, but I don't know if the upstream install script changed. Which platforms did you test the PR on? Thanks for the help!

jroimartin commented 10 years ago

I tested it on Debian GNU/Linux AMD64. I don't know in OSX, but in linux "/usr/include" and "/usr/local/include" doesn't need to be specified using the -I directive, because they are part of the gcc's standard search paths. When you previously tried it, did you use "#include " or "#include <capstone/capstone.h>"?

bnagy commented 10 years ago

You're right. I didn't try with the correct include path. Great - I really hated that hardwired path. :)

jroimartin commented 10 years ago

Great! Thank you :)