Skip to content

Commit 05b9b20

Browse files
committed
Add new (optional!) win32 build infrastructure.
Will follow up to internals@ shortly.
1 parent 30b631d commit 05b9b20

29 files changed

+1439
-0
lines changed

buildconf.bat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
cscript /nologo win32\build\buildconf.js

ext/bcmath/config.w32

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
5+
6+
if (PHP_BCMATH == "yes") {
7+
EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src");
8+
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
9+
outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \
10+
num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
11+
nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath");
12+
13+
AC_DEFINE('WITH_BCMATH', 1, 'Have BCMATH library');
14+
}

ext/calendar/config.w32

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("calendar", "calendar conversion support", "yes");
5+
6+
if (PHP_CALENDAR == "yes") {
7+
EXTENSION("calendar", "calendar.c dow.c french.c gregor.c jewish.c \
8+
julian.c easter.c cal_unix.c");
9+
AC_DEFINE('HAVE_CALENDAR', 1, 'Have calendar');
10+
}

ext/com_dotnet/config.w32

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("com_dotnet", "COM and .Net support", "yes");
5+
6+
if (PHP_COM_DOTNET == "yes") {
7+
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
8+
com_handlers.c com_iterator.c com_misc.c com_olechar.c \
9+
com_typeinfo.c com_variant.c");
10+
AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
11+
// TODO: do a header check for this
12+
AC_DEFINE('HAVE_MSCOREE_H', 0, 'Have .net headers');
13+
}

ext/ctype/config.w32

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("ctype", "ctype", "yes");
5+
6+
if (PHP_CTYPE == "yes") {
7+
EXTENSION("ctype", "ctype.c");
8+
AC_DEFINE('HAVE_CTYPE', 1, 'Have ctype');
9+
}

ext/dom/config.w32

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("dom", "DOM support", "yes");
5+
6+
if (PHP_DOM == "yes" && PHP_LIBXML == "yes") {
7+
EXTENSION("dom", "php_dom.c attr.c document.c domerrorhandler.c \
8+
domstringlist.c domexception.c namelist.c processinginstruction.c \
9+
cdatasection.c documentfragment.c domimplementation.c element.c \
10+
node.c string_extend.c characterdata.c documenttype.c \
11+
domimplementationlist.c entity.c nodelist.c text.c comment.c \
12+
domconfiguration.c domimplementationsource.c entityreference.c \
13+
notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \
14+
domlocator.c namednodemap.c userdatahandler.c");
15+
AC_DEFINE("HAVE_DOM", 1, "DOM support");
16+
}
17+
18+

ext/ftp/config.w32

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("ftp", "ftp support", "yes");
5+
6+
if (PHP_FTP == "yes") {
7+
EXTENSION("ftp", "php_ftp.c ftp.c");
8+
AC_DEFINE('HAVE_FTP', 1, 'Have FTP support');
9+
}

ext/libxml/config.w32

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("libxml", "LibXML support", "yes");
5+
6+
if (PHP_LIBXML == "yes") {
7+
EXTENSION("libxml", "libxml.c", false /* never shared */);
8+
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
9+
ADD_FLAG("LIBS_LIBXML", "libxml2.lib iconv.lib");
10+
}
11+
12+

ext/mbstring/config.w32

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("mbstring", "multibyte string functions", "no");
5+
ARG_ENABLE("mbregex", "multibyte regex support", "no");
6+
7+
if (PHP_MBSTRING == "yes") {
8+
9+
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.vc6",
10+
"ext\\mbstring\\libmbfl\\config.h", true);
11+
FSO.CopyFile("ext\\mbstring\\oniguruma\\win32\\config.h",
12+
"ext\\mbstring\\oniguruma\\config.h", true);
13+
14+
EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", null,
15+
"-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
16+
/D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 /D HAVE_STDARG_PROTOTYPES=1 \
17+
/D HAVE_CONFIG_H /D HAVE_STDLIB_H /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1");
18+
19+
ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
20+
mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
21+
mbfilter_byte2.c mbfilter_byte4.c mbfilter_cp1251.c mbfilter_cp1252.c \
22+
mbfilter_cp866.c mbfilter_cp932.c mbfilter_cp936.c mbfilter_euc_cn.c \
23+
mbfilter_euc_jp.c mbfilter_euc_jp_win.c mbfilter_euc_kr.c \
24+
mbfilter_euc_tw.c mbfilter_htmlent.c mbfilter_hz.c mbfilter_iso2022_kr.c \
25+
mbfilter_iso8859_1.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c \
26+
mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_2.c \
27+
mbfilter_iso8859_3.c mbfilter_iso8859_4.c mbfilter_iso8859_5.c \
28+
mbfilter_iso8859_6.c mbfilter_iso8859_7.c mbfilter_iso8859_8.c \
29+
mbfilter_iso8859_9.c mbfilter_jis.c mbfilter_koi8r.c mbfilter_qprint.c \
30+
mbfilter_sjis.c mbfilter_ucs2.c mbfilter_ucs4.c mbfilter_uhc.c \
31+
mbfilter_utf16.c mbfilter_utf32.c mbfilter_utf7.c mbfilter_utf7imap.c \
32+
mbfilter_utf8.c mbfilter_uuencode.c", "mbstring");
33+
34+
ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
35+
mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
36+
mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
37+
mbfl_string.c mbfl_allocators.c", "mbstring");
38+
39+
ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c nls_kr.c \
40+
nls_neutral.c nls_ru.c nls_uni.c nls_zh.c", "mbstring");
41+
42+
AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
43+
AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN');
44+
AC_DEFINE('HAVE_MBSTR_JA', 1, 'CN');
45+
AC_DEFINE('HAVE_MBSTR_KR', 1, 'CN');
46+
AC_DEFINE('HAVE_MBSTR_RU', 1, 'CN');
47+
AC_DEFINE('HAVE_MBSTR_TW', 1, 'CN');
48+
AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
49+
50+
if (PHP_MBREGEX == "yes") {
51+
ADD_SOURCES("ext/mbstring/oniguruma", "regcomp.c regerror.c \
52+
regexec.c reggnu.c regparse.c regposerr.c", "mbstring");
53+
ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
54+
}
55+
}

ext/odbc/config.w32

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("odbc", "ODBC support", "yes");
5+
6+
if (PHP_ODBC == "yes") {
7+
EXTENSION("odbc", "php_odbc.c");
8+
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
9+
ADD_FLAG('LIBS_ODBC', 'odbc32.lib odbccp32.lib');
10+
}
11+
12+

ext/pcre/config.w32

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("pcre-regex", "Perl Compatible Regular Expressions", "yes");
5+
6+
if (PHP_PCRE_REGEX == "yes") {
7+
EXTENSION("pcre", "php_pcre.c", PHP_PCRE_REGEX_SHARED,
8+
"-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -Iext/pcre/pcrelib");
9+
ADD_SOURCES("ext/pcre/pcrelib", "maketables.c get.c study.c pcre.c", "pcre");
10+
11+
AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library');
12+
AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library');
13+
}

ext/session/config.w32

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("session", "session support", "yes");
5+
6+
if (PHP_SESSION == "yes") {
7+
EXTENSION("session", "session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
8+
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
9+
}
10+
11+

ext/simplexml/config.w32

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("simplexml", "Simple XML support", "yes");
5+
6+
if (PHP_SIMPLEXML == "yes" && PHP_LIBXML == "yes") {
7+
EXTENSION("simplexml", "simplexml.c");
8+
AC_DEFINE("HAVE_SIMPLEXML", 1, "Simple XML support");
9+
}
10+
11+

ext/sqlite/config.w32

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("sqlite", "SQLite support", "yes");
5+
6+
if (PHP_SQLITE == "yes") {
7+
FSO.CopyFile("ext\\sqlite\\libsqlite\\src\\sqlite.w32.h",
8+
"ext\\sqlite\\libsqlite\\src\\sqlite.h");
9+
10+
FSO.CopyFile("ext\\sqlite\\libsqlite\\src\\sqlite_config.w32.h",
11+
"ext\\sqlite\\libsqlite\\src\\config.h");
12+
13+
EXTENSION("sqlite", "sqlite.c sess_sqlite.c", null,
14+
"/D PHP_SQLITE_EXPORTS /Iext/sqlite/libsqlite/src");
15+
16+
ADD_SOURCES("ext/sqlite/libsqlite/src", "opcodes.c parse.c encode.c \
17+
auth.c btree.c build.c delete.c expr.c func.c hash.c insert.c \
18+
main.c os.c pager.c printf.c random.c select.c table.c tokenize.c \
19+
update.c util.c vdbe.c attach.c btree_rb.c pragma.c vacuum.c \
20+
copy.c where.c trigger.c", "sqlite");
21+
22+
AC_DEFINE("HAVE_SQLITE", 1, "SQLite support");
23+
ADD_DEF_FILE("ext\\sqlite\\php_sqlite.def");
24+
}
25+
26+

ext/standard/config.w32

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// vim:ft=javascript
2+
// $Id$
3+
4+
ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");
5+
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
6+
7+
ARG_WITH("config-file-path", "Where to find php.ini",
8+
'(getenv("SystemRoot"))?getenv("SystemRoot"):""');
9+
10+
AC_DEFINE("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, null, false);
11+
12+
EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
13+
crc32.c crypt.c cyr_convert.c datetime.c dir.c dl.c dns.c exec.c \
14+
file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
15+
info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c microtime.c \
16+
pack.c pageinfo.c parsedate.c quot_print.c rand.c reg.c soundex.c \
17+
string.c scanf.c syslog.c type.c uniqid.c url.c url_scanner.c var.c \
18+
versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
19+
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
20+
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
21+
user_filters.c uuencode.c filters.c proc_open.c sunfuncs.c \
22+
streamsfuncs.c http.c", false /* never shared */);
23+

ext/tokenizer/config.w32

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("tokenizer", "tokenizer support", "yes");
5+
6+
if (PHP_TOKENIZER == "yes") {
7+
EXTENSION("tokenizer", "tokenizer.c");
8+
AC_DEFINE("HAVE_TOKENIZER", 1, "Tokenizer support");
9+
}
10+
11+

ext/wddx/config.w32

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("wddx", "WDDX support", "yes");
5+
6+
if (PHP_WDDX == "yes" && PHP_LIBXML == "yes") {
7+
EXTENSION("wddx", "wddx.c");
8+
AC_DEFINE("HAVE_WDDX", 1, "WDDX support");
9+
}
10+
11+

ext/xml/config.w32

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_WITH("xml", "XML support", "yes");
5+
6+
if (PHP_XML == "yes" && PHP_LIBXML == "yes") {
7+
EXTENSION("xml", "xml.c compat.c");
8+
AC_DEFINE("HAVE_XML", 1, "XML support");
9+
}
10+
11+

ext/zlib/config.w32

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("zlib", "ZLIB support", "yes");
5+
6+
if (PHP_ZLIB == "yes") {
7+
EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c", null, "/D ZLIB_EXPORTS");
8+
AC_DEFINE("HAVE_ZLIB", 1, "Tokenizer support");
9+
ADD_FLAG("LIBS_ZLIB", "zlib.lib");
10+
}
11+
12+

sapi/apache/config.w32

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// vim:ft=javascript
2+
// $Id$
3+
4+
ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'yes');
5+
6+
ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null);
7+
ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null);
8+
9+
if (PHP_APACHE_INCLUDES == null) {
10+
if (FSO.FileExists('C:\\Program Files\\Apache Group\\Apache\\include\\httpd.h')) {
11+
PHP_APACHE_INCLUDES = "C:\\Program Files\\Apache Group\\Apache\\include";
12+
} else if (FSO.FileExists(PHP_PHP_BUILD + "\\apache\\src\\include\\httpd.h")) {
13+
PHP_APACHE_INCLUDES = PHP_PHP_BUILD + "\\apache\\src\\include";
14+
}
15+
}
16+
17+
if (!FSO.FileExists(PHP_APACHE_INCLUDES + "\\httpd.h")) {
18+
ERROR("Could not find apache headers");
19+
}
20+
21+
if (PHP_APACHE_LIBS == null) {
22+
if (FSO.FileExists('C:\\Program Files\\Apache Group\\Apache\\libexec\\ApacheCore.lib')) {
23+
PHP_APACHE_LIBS = "C:\\Program Files\\Apache Group\\Apache\\libexec";
24+
} else if (FSO.FileExists(PHP_PHP_BUILD + "\\apache\\src\\corer\\ApacheCore.lib")) {
25+
PHP_APACHE_LIBS = PHP_PHP_BUILD + "\\apache\\src\\corer";
26+
}
27+
}
28+
29+
if (!FSO.FileExists(PHP_APACHE_LIBS + "\\ApacheCore.lib")) {
30+
ERROR("Could not find apache libraries");
31+
}
32+
33+
34+
if (PHP_APACHE == "yes") {
35+
SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c',
36+
'php' + PHP_VERSION + 'apache.dll',
37+
'/D APACHEPHP4_EXPORTS /D APACHE_READDIR_H /I "' + PHP_APACHE_INCLUDES + '"');
38+
ADD_FLAG('LIBS_APACHE', '/libpath:"' + PHP_APACHE_LIBS + '" ApacheCore.lib');
39+
}

sapi/cgi/config.w32

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// vim:ft=javascript
2+
// $Id$
3+
4+
ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes');
5+
ARG_ENABLE('fastcgi', 'Build FastCGI support into CGI binary', 'yes');
6+
ARG_ENABLE('path-info-check',
7+
'If this is disabled, paths such as /info.php/test?a=b will fail to work', 'yes');
8+
9+
ARG_ENABLE("force-cgi-redirect", "Enable the security check for internal \
10+
server redirects. You should use this if you are running the CGI \
11+
version with Apache.", "yes");
12+
13+
AC_DEFINE("FORCE_CGI_REDIRECT", PHP_FORCE_CGI_REDIRECT == "yes" ? 1 : 0, "CGI redirect mode");
14+
AC_DEFINE("ENABLE_PATHINFO_CHECK", PHP_PATH_INFO_CHECK == "yes" ? 1 : 0, "Pathinfo check");
15+
16+
if (PHP_CGI == "yes") {
17+
AC_DEFINE('PHP_FASTCGI', PHP_FASTCGI == "yes" ? 1 : 0);
18+
if (PHP_FASTCGI == "yes") {
19+
SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe', '-Isapi/cgi/libfcgi/include /D FCGI_STATIC');
20+
ADD_SOURCES('sapi/cgi/libfcgi', 'fcgi_stdio.c fcgiapp.c os_win32.c', 'cgi');
21+
ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib');
22+
} else {
23+
SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe');
24+
}
25+
}

sapi/cli/config.w32

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// vim:ft=javascript
2+
// $Id$
3+
4+
ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes');
5+
6+
if (PHP_CLI == "yes") {
7+
SAPI('cli', 'getopt.c php_cli.c', 'php.exe');
8+
}
9+

sapi/isapi/config.w32

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// vim:ft=javascript
2+
// $Id$
3+
4+
ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'yes');
5+
6+
if (PHP_ISAPI == "yes") {
7+
SAPI('isapi', 'php4isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP4ISAPI_EXPORTS');
8+
ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php4isapi.def');
9+
}

0 commit comments

Comments
 (0)