jaswantfalconet / php-sweph

Automatically exported from code.google.com/p/php-sweph
0 stars 0 forks source link

Compile problem on FreeBSD #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

thanks, for this great script.

I wanted to compile it on FreeBSD 9.1, amd64 version.
After placing libswe.a and the .h files in the right directories (I got them 
using the port collection) I get a compiled ~130 kb .so file. In your tutorial 
it can be clearly seen that it should be greater than 700 kb. When I add it to 
php modules it is recognized, but can`t execute it`s functions, although their 
names are listable.
How do you include the libswe.a using config.m4?

Sorry for this newby question, but it did get me running around in circles in 
the last couple of days.

Original issue reported on code.google.com by czompocs...@gmail.com on 13 May 2013 at 8:43

GoogleCodeExporter commented 8 years ago
My mistake. I had to change the config.m4 file to --with-sweph and added the 
PHP_ADD_LIBRARY_WITH_PATH(swe,/user/local/lib,SWEPH_SHARED_LIBADD) command to 
include the libswe.a archive. Because using amd64 bit this resulted in a

relocation R_X86_64_32 against `' can not be used
when making a shared object; recompile with -fPIC  

type error.
So I had to change the cflags in the orginial sweph source makefile to CFLAGS 
+=-g -fPIC.
Now it can be successfully compiled and used as a php extension.

Please consider this issue closed.

Original comment by czompocs...@gmail.com on 17 May 2013 at 11:33

GoogleCodeExporter commented 8 years ago

Original comment by cyjoelc...@gmail.com on 17 Jul 2013 at 10:55