[PHP-DEV] Building PHP extensions

2001-12-25 Thread Craig Morrison


Please pardon the intrusion, if this is too far off-topic for the list I
apologize now and welcome pointers to documentation, links, etc..

My build environment is: Windows 2000 Professional, MSVC++ 6.0 SP5.

I have been reading at www.php.net in the manual on how to build extensions to
PHP. I have the source code to both 4.0.6 and 4.1.0. The documentation clearly
dictates the structure and procedures that need to be followed to create an
extension. However, the documentation clearly has *nix slant.

As a reference, I am attempting to build the example extension defined in
listing 9.3 at:

  http://www.php.net/manual/en/zend.creating.php

Using the 4.0.6 source tree I get preprocessor errors for undefined symbols
(STANDARD_MODULE_HEADERS is one). When trying to build under the 4.1.0 tree
these errors go away, but I get linker errors because of missing libs. Yes, I
have all the neccessary include and lib directories set. I have checked both
trees and the libs in question do not exist.

I am attempting to build the extension in a directory created under the ./ext
directory in both trees with a project workspace modelled after those in other
directories off that part of the tree.

Anyone care to punt me in the right direction?

-- 

Craig Morrison
  MTS Professional @ http://www.mtsprofessional.com/
  A Win32 Email server that works for _you_.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Markus Fischer

First, the documentation doesn't cover the latest changes.
Read the source, luke.

On Tue, Dec 25, 2001 at 05:25:49PM -0500, Craig Morrison wrote : 
 Using the 4.0.6 source tree I get preprocessor errors for undefined symbols
 (STANDARD_MODULE_HEADERS is one). When trying to build under the 4.1.0 tree
 these errors go away, but I get linker errors because of missing libs.

That's one of the major differences. You need some zend api
dependend #ifdef's to make the module header work under both
API's:

#if ZEND_MODULE_API_NO = 20010901
STANDARD_MODULE_HEADER,
#endif

and

#if ZEND_MODULE_API_NO = 20010901
NO_VERSION,
#endif


 [...] have all the neccessary include and lib directories set. I have checked both
 trees and the libs in question do not exist.

The exact error (what lib is missing? whats your config.m4
and Makefile.in is looking like? Have you checked against
other extensions how they do it? Have you used ./ext_skel?
etc...) would help.

- Markus

-- 
Please always Cc to me when replying to me on the lists.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Craig Morrison


Markus Fischer wrote:
 
 That's one of the major differences. You need some zend api
 dependend #ifdef's to make the module header work under both
 API's:

Ahh, thanks!

 
 The exact error (what lib is missing? whats your config.m4
 and Makefile.in is looking like? Have you checked against
 other extensions how they do it? Have you used ./ext_skel?
 etc...) would help.

Please remember this is being built under Win32 with MSVC++ 6.0. ext_skel is a
shell script which I can not run here.

Configuration: wini - Win32 Debug_TS
Linking...
LINK : fatal error LNK1104: cannot open file php4ts-debug.lib
Error executing link.exe.

php_wini.dll - 1 error(s), 0 warning(s)

I am assuming this is because that library hasn't been built by me from the
PHP sources, correct?

When I try to build the sources from the Win32\php4.dsw I get a very long
message about bcmath\libbcmath\output.c and main\output.c producing an object
file in the same output directory and the project refuses to build.

-- 

Craig Morrison
  MTS Professional @ http://www.mtsprofessional.com/
  A Win32 Email server that works for _you_.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Markus Fischer

On Tue, Dec 25, 2001 at 05:56:47PM -0500, Craig Morrison wrote : 
 
 Markus Fischer wrote:
  
  That's one of the major differences. You need some zend api
  dependend #ifdef's to make the module header work under both
  API's:
 
 Ahh, thanks!
 
  
  The exact error (what lib is missing? whats your config.m4
  and Makefile.in is looking like? Have you checked against
  other extensions how they do it? Have you used ./ext_skel?
  etc...) would help.
 
 Please remember this is being built under Win32 with MSVC++ 6.0. ext_skel is a
 shell script which I can not run here.
 
 Configuration: wini - Win32 Debug_TS
 Linking...
 LINK : fatal error LNK1104: cannot open file php4ts-debug.lib
 Error executing link.exe.
 
 php_wini.dll - 1 error(s), 0 warning(s)
 
 I am assuming this is because that library hasn't been built by me from the
 PHP sources, correct?

Bingo

 
 When I try to build the sources from the Win32\php4.dsw I get a very long
 message about bcmath\libbcmath\output.c and main\output.c producing an object
 file in the same output directory and the project refuses to build.

Use php4ts.dsw

-- 
Please always Cc to me when replying to me on the lists.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Craig Morrison


Markus Fischer wrote:
 
 
  When I try to build the sources from the Win32\php4.dsw I get a very long
  message about bcmath\libbcmath\output.c and main\output.c producing an object
  file in the same output directory and the project refuses to build.
 
 Use php4ts.dsw

At the risk of asking too much..

I get more errors than you can shake a stick at when trying to build with this
project also.

Is there a definitive list somewhere of exactly what is needed (tools,
headers, etc) to build PHP under Win32 using MSVC 6.0?

-- 

Craig Morrison
  MTS Professional @ http://www.mtsprofessional.com/
  A Win32 Email server that works for _you_.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Markus Fischer

On Tue, Dec 25, 2001 at 06:37:12PM -0500, Craig Morrison wrote : 
 Is there a definitive list somewhere of exactly what is needed (tools,
 headers, etc) to build PHP under Win32 using MSVC 6.0?

You need a support zip called win32build.zip mentioned
somewhere in the FAQ where to download and adjust the MSVC
pathes appropriate. After that, it compiles out of the box
(with just a few warnings, ignore them).

-- 
Please always Cc to me when replying to me on the lists.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Building PHP extensions

2001-12-25 Thread Craig Morrison


Markus Fischer wrote:
 
 You need a support zip called win32build.zip mentioned
 somewhere in the FAQ where to download and adjust the MSVC
 pathes appropriate. After that, it compiles out of the box
 (with just a few warnings, ignore them).

Thanks for the pointer.. I had read that part of the documentation before but
it completely slipped my mind to look back at it. I was looking for the
information in the wrong place.

All is well in PHP build-land here. Now I'm off to work on that extension.

Again, thanks for your help.

-- 

Craig Morrison
  MTS Professional @ http://www.mtsprofessional.com/
  A Win32 Email server that works for _you_.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]