deuill / go-php

PHP bindings for the Go programming language (Golang)
MIT License
930 stars 105 forks source link

Need a way to support mulitple include paths #20

Closed elwinar closed 8 years ago

elwinar commented 8 years ago

I'm currently working in a docker to compile and run tests, and it happens that the docker container for golang is based upon Debian Jessie.

On Jessie (and probably many other distributions), the correct include path for main/php.h is /usr/include/php5, which is not the value given in the various CGO headers.

Any though on how to make this more portable ?

deuill commented 8 years ago

Hmmmm, indeed. The most portable solution would be adding something like -I /usr/include/php5 in the php5.go file, as incorrect/non-existing include directives don't throw errors, I believe.

Could you try that locally and respond on whether it works for you or not? I can work on a patch if it does, or look into it further if it doesn't.

P.S.: It seems that versions of Debian with PHP7 packages (testing and unstable for now) place the files in /usr/include/php as expected, so there's no fix required for PHP7.

elwinar commented 8 years ago

I've already done that locally, and that works.

Something along these lines while in the vendor/github.com/deuill/go-php directory:

sed -i '/s/\/usr\/include\/php/\/usr\/include\/php5/g' **/*.go

Thanks for the quick reply.

deuill commented 8 years ago

No problem, I'll add that directive and close this once the commit goes in. Happy hacking.

deuill commented 8 years ago

(Hopefullly) closed by 0882169cff2bc982773234e7f85c774a8cb015df. Feel free to open a new issue if this doesn't work for you.