Compiling the example hello world extension on OSX with PHP 5.1

Compiling the example hello world extension on OSX with PHP 5.1

am 07.07.2005 03:28:44 von Dan Rossi

Hi there I am trying to compile the demo example hello world extension
on OSX with no luck I keep getting errors when trying to compile.

iElectro:/usr/share/php-5.1.0b2/ext/hello electroteque$ make
gcc -dynamic -flat_namespace -bundle -undefined suppress -DPHP_ATOM_INC
-I/usr/share/php-5.1.0b2/ext/hello/include
-I/usr/share/php-5.1.0b2/ext/hello/main
-I/usr/share/php-5.1.0b2/ext/hello -I/usr/include/php
-I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
-I/sw/include -DHAVE_CONFIG_H -I/sw/include -L/sw/lib -o hello.so
hello.lo
ld: hello.lo bad magic number (not a Mach-O file)


Extension link is
http://www.zend.com/php/internals/extension-writing1.php#Hea ding5


Any ideas what the issue is ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Compiling the example hello world extension on OSX with

am 07.07.2005 03:43:37 von Rasmus Lerdorf

Dan Rossi wrote:
> Hi there I am trying to compile the demo example hello world extension
> on OSX with no luck I keep getting errors when trying to compile.
>
> iElectro:/usr/share/php-5.1.0b2/ext/hello electroteque$ make
> gcc -dynamic -flat_namespace -bundle -undefined suppress -DPHP_ATOM_INC
> -I/usr/share/php-5.1.0b2/ext/hello/include
> -I/usr/share/php-5.1.0b2/ext/hello/main
> -I/usr/share/php-5.1.0b2/ext/hello -I/usr/include/php
> -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
> -I/sw/include -DHAVE_CONFIG_H -I/sw/include -L/sw/lib -o hello.so
> hello.lo
> ld: hello.lo bad magic number (not a Mach-O file)
>
>
> Extension link is
> http://www.zend.com/php/internals/extension-writing1.php#Hea ding5
>
>
> Any ideas what the issue is ?

Yeah, the OSX build is a bit messed up right now. You can fix it
manually by doing a copy-paste of the final link line and replace
hello.lo with hello.o

-Rasmus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Compiling the example hello world extension on OSX with PHP 5.1

am 07.07.2005 04:00:06 von Dan Rossi

On 07/07/2005, at 11:43 AM, Rasmus Lerdorf wrote:

>>
>
> Yeah, the OSX build is a bit messed up right now. You can fix it
> manually by doing a copy-paste of the final link line and replace
> hello.lo with hello.o
>
> -Rasmus
>
>

thanks mate however I get file cannot be found, i even tried to symlink
it sneakily no luck

iElectro:/usr/share/php-5.1.0b2/ext/hello root# gcc -dynamic
-flat_namespace -bundle -undefined suppress -DPHP_ATOM_INC
-I/usr/share/php-5.1.0b2/ext/hello/include
-I/usr/share/php-5.1.0b2/ext/hello/main
-I/usr/share/php-5.1.0b2/ext/hello -I/usr/include/php
-I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
-I/sw/include -DHAVE_CONFIG_H -I/sw/include -L/sw/lib -o hello.so
hello.o
gcc: hello.o: No such file or directory
gcc: no input files


with symlink

ld: hello.o bad magic number (not a Mach-O file)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Compiling the example hello world extension on OSX with

am 07.07.2005 04:29:23 von Rasmus Lerdorf

Dan Rossi wrote:
>
> On 07/07/2005, at 11:43 AM, Rasmus Lerdorf wrote:
>
>>>
>>
>> Yeah, the OSX build is a bit messed up right now. You can fix it
>> manually by doing a copy-paste of the final link line and replace
>> hello.lo with hello.o
>>
>> -Rasmus
>>
>>
>
> thanks mate however I get file cannot be found, i even tried to symlink
> it sneakily no luck

Well, where is it? Probably in a libs or .libs directory.

-Rasmus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Compiling the example hello world extension on OSX with PHP 5.1

am 07.07.2005 04:39:32 von Dan Rossi

On 07/07/2005, at 12:29 PM, Rasmus Lerdorf wrote:
>
> Well, where is it? Probably in a libs or .libs directory.
>
> -Rasmus
>
>

You aint the Demigod for nothing you know :P

iElectro:/usr/share/php-5.1.0b2/ext/hello root# gcc -dynamic
-flat_namespace -bundle -undefined suppress -DPHP_ATOM_INC
-I/usr/share/php-5.1.0b2/ext/hello/include
-I/usr/share/php-5.1.0b2/ext/hello/main
-I/usr/share/php-5.1.0b2/ext/hello -I/usr/include/php
-I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend
-I/sw/include -DHAVE_CONFIG_H -I/sw/include -L/sw/lib -o hello.so
..libs/hello.o

This worked ;)


Ok I feel great pain trying to do things like this on the mac, ie
apache2 wont compile so fink is the only option, I know, i'm gonna get
my noisy Sun rack going again however development on the powerbook
rocks :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php