Re: Problem developing extension for PHP on Windows
| From: | Johannes Schlüter | Date: | Thu, 26 Jul 2007 22:16:04 +0000 |
| Subject: | Re: Problem developing extension for PHP on Windows | ||
| References: | 1 | Groups: | php.pear.dev php.pecl.dev |
| Request: | Send a blank email to pear-dev+get-47711@lists.php.net to get a copy of this message | ||
Hi Tom,
you were most likely searching for PECL, not PEAR - PEAR maintains PHP
based libraries, PECL has C stuff.
Anyways:
On Thu, 2007-07-26 at 17:20 -0400, "Tom Hearn" wrote:
> I know this is probably different then most questions seeing as you are
> generally a UNIX group (or I would imagine at least).
Well, PHP is - from what I can see - mainly used on UNIX(-like)
operating systems so it's quite natural that most devs care for that :-)
> I am having a problem linking a library to an extension in windows, I keep
> getting undefined errors because I cannot find out how to actually link the
> DLL in my project's config.w32 file, and consequently in the final makefile.
>
>
>
> I have had an AWFUL time finding documentation for the windows side of this,
> which I realize is a small subset of PEAR developers, but does anyone have
> any recommendations on good resources for Win32 developers?
Yes, all that stuff is badly documented, mostly all documentation on
this is in source, I've never built wrote my own confing.w32 files, so I
don't really know, but:
> My config.32 file is as follows:
>
>
>
> ARG_ENABLE("ipworks", "enable ipworks support", "yes");
It's common sense in PHP to use ENABLE for self-contained extensions
without external dependencies since you're linking against a lib you
should use
ARG_WITH("ipworks", "ipworks support", "yes");
instead.
> if (PHP_IPWORKS != "no") {
>
>
> PHP_ADD_LIBRARY_WITH_PATH("ipworks6.lib","C:\Program Files\nsoftware\IPWorks
> V6 C++ Edition\lib",IPWORKS_SHARED_LIBADD)
>
> AC_DEFINE(HAVE_IPWORKSLIB,1,[ ])
>
>
>
> PHP_NEW_EXTENSION("ipworks", "ipworks.c
> dns.c filemailer.c ftp.c htmlmailer.c http.c icmpport.c imap.c ipport.c
> ldap.c mcast.c mime.c mx.c netclock.c netcode.c nntp.c ping.c pop.c rcp.c
> rexec.c rshell.c rss.c smpp.c smtp.c snmpagent.c snmpmgr.c snpp.c soap.c
> syslog.c telnet.c tftp.c traceroute.c udpport.c webdav.c webform.c
> webupload.c whois.c xmlp.c xmpp.c")
>
> PHP_SUBST(IPWORKS_SHARED_LIBADD)
>
> }
I wonder if that even works with configure.js, this looks more like m4
than w32 stuff. From reading other config.w32 files I guess it sohuld
look something like
if (PHP_IPWORKS != "no") {
if (CHECK_LIB("ipworks6.lib", "ipworks", PHP_IPWORKS) &&
CHECK_HEADER_ADD_INCLUDE("ipworks.h", "CFLAGS_IPWORKS", PHP_IPWORKS))
{
EXTENSION("ipworks", "ipworks.c [...] xmpp.c")
AC_DEFINE('HAVE_IPWORKS', 1, 'Have ipworks library');
} else {
WARNING("ipworks not enabled; libraries and headers not found");
}
}
But well, as said: I don't know the stuff either and just copy&pasted
form other exts, maybe somebody else on pecl-dev knows more.
johannes
p.s. Please respond to pecl-dev, not pear-dev since I guess most of them
there aren't that much interested in this stuff (and if they are, they
are most likely on pecl-dev, too)