> If you have cygwin flex and bison, you don't need to copy anything.

And if I don't have any? Can it be made as simple as "unpack and compile"?
If you'll read this page
http://www.php.net/manual/en/install.windows.building.php
 you notice redundant instructions for copying files and setting up
MSVC++. I've made a .bat file to automate the process and avoid making
these repeated operations manually every time I need to compile PHP 4
for testing. I'm looking into get this process even more simple and
without unnecessary garbage left on my c: drive. Files are attached.

> You also don't *have* to recompile resolv.lib; just build a release
> build and use that, even when you're building a debug version of PHP.

Why do I need to build it at all if it is included in win32build.zip?

Should I update installation instructions on
http://www.php.net/manual/en/install.windows.building.php then?

>
> --Wez.
>
> On 10/22/05, techtonik <[EMAIL PROTECTED]> wrote:
> > ||*()*|| Greetings, phpinnards.. =)
> >
> >   I tried to automate build system for PHP 4 a bit and after that
> > can't get some stupid questions out of my head. Install instructions
> > located as usual
> http://www.php.net/manual/en/install.windows.building.php
> >
> >   There are at least two inconveniences:
> >   1. Need to copy bison.sample from win32build\bin to c:\usr\local\lib
> >   2. Need to recompile resolv.lib every time target changes
> >
> >   So the questions are the following
> >   1.1 Why not to get rid of this bison.sample copy operation either by
> >       1.1.1 upgrade bison.exe in win32build.zip from 1.27 to at
> >             least 1.34, which adds -S options to specify bison.sample
> >             explicitly and also includes some memory leak fixes
> >
> http://sourceforge.net/project/shownotes.php?release_id=274058
> >         or
> >       1.1.2 set up environment variable BISON_SIMPLE somewhere in
> >             build files/scripts?
> >
> >   2.1 Why resolv.lib needs to be recompiled every time when target
> >       changes from "debug" to "release" and vice versa
> >       2.1.1 Why it is not possible to supply a separate resolv_debug.lib
> >             and resolv_release.lib files in win32build.zip and rewrite
> >             dependencies for them in windows build files?
> >
> > Thanks.
> >
> > .techtonik
> > --
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
@echo off
echo.
echo Instructions on compiling PHP under windows can be found at
echo http://www.php.net/manual/en/install.windows.building.php

if not exist "win32build" goto nowin32build
if not exist "bindlib_w32" goto nobindlib_w32
if not exist "php-src" goto nophpsources
if not exist "win32build\bin\bison.simple" goto nobison

if exist "c:\usr\local\lib\bison.simple" goto bisonskip
echo.
echo Creating the directories c:\usr\local\lib
if not exist "c:\usr" mkdir c:\usr
if not exist "c:\usr\local" mkdir c:\usr\local
if not exist "c:\usr\local\lib" mkdir c:\usr\local\lib

echo Copying bison.simple from win32build\bin to c:\usr\local\lib
copy "win32build\bin\bison.simple" "c:\usr\local\lib\bison.simple"

:bisonskip

echo.
echo Reading configuration from config.bat
if not exist "config.bat" goto noconfig
call config.bat
call %VCVARS%

rem detect passed options - debug or normal - to know how to build resolv.lib
if "%1"=="debug" (
  echo Debug version of resolv.lib chosen - PHP must be built the same way
  msdev bindlib_w32\bindlib.dsp /MAKE "bindlib - Win32 Debug"
  echo Copying bindlib_w32\Debug\resolv.lib to win32build\lib 
  copy bindlib_w32\Debug\resolv.lib win32build\lib\resolv.lib
  echo.
  echo Compiling PHP CGI Debug version
  msdev php-src\win32\php4ts.dsp /MAKE "php4ts - Win32 Debug_TS"
  echo Compiling PHP CLI Debug version
  msdev php-src\win32\php4ts.dsp /MAKE "php4ts_cli - Win32 Debug_TS"
) else (
  if "%1"=="release" (
    echo Release version of resolv.lib chosen - PHP must be built the same way
    msdev bindlib_w32\bindlib.dsp /MAKE "bindlib - Win32 Release"
    echo Copying bindlib_w32\Release\resolv.lib to win32build\lib 
    copy bindlib_w32\Release\resolv.lib win32build\lib\resolv.lib
    echo.
    echo Compiling PHP CGI Release version
    msdev php-src\win32\php4ts.dsp /MAKE "php4ts - Win32 Release_TS"
    echo Compiling PHP CLI Release version
    msdev php-src\win32\php4ts.dsp /MAKE "php4ts_cli - Win32 Release_TS"
  ) else (
    goto nocomptype
  )
)


echo.
echo See http://www.php.net/manual/en/install.windows.building.php
echo for further details.
exit 0

:nowin32build
echo.
echo Error: "win32build" subdirectory doesn't exist - download and
echo        extract it from http://www.php.net/extra/win32build.zip
exit 1

:nobison
echo.
echo Error: file "win32build\bin\bison.simple" doesn't exist
exit 1

:nobindlib_w32
echo.
echo Error: "bindlib_w32" subdirectory doesn't exist - create and extract
echo         files to it from http://www.php.net/extra/bindlib_w32.zip
exit 1

:nophpsources
echo.
echo Error: "php-src" subdirectory doesn't exist - unpack php sources and
echo        rename "php-x.x.x" to "php-src"
exit 1

:nocomptype
echo.
echo Error: supply either "debug" or "release" string as the first parameter
echo        to this .bat file
goto usage

:noconfig
echo.
echo Error: no configuration found - rename config.bat.samp to config.bat
echo        setup appropriate paths for your system
exit 1

:usage
echo.
echo "Usage: bootstrap.bat [debug|release]"

@echo off

rem set paths to your build environment here

set BISON_SIMPLE=./win32build/bin/bison.simple
set VCVARS=../../VC98/Bin/VCVARS32.BAT
--- php4dllts_old.dsp   Wed Nov 17 02:10:26 2004
+++ php4dllts.dsp       Sat Oct 22 18:41:44 2005
@@ -55,7 +55,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib 
Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 
/nodefaultlib:"libcmt" /out:"..\Debug_TS\php4ts_debug.dll" /pdbtype:sept 
/libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" 
/libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug_TS" 
/libpath:"Debug_TS" /libpath:"..\..\zlib\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib 
Urlmon.lib /nologo /version:4.0 /dll /debug /machine:I386 
/nodefaultlib:"libcmt" /out:"..\Debug_TS\php4ts_debug.dll" /pdbtype:sept 
/libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" 
/libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug_TS" 
/libpath:"Debug_TS" /libpath:"..\..\zlib\Debug" /libpath:"..\..\win32build\lib"
 
 !ELSEIF  "$(CFG)" == "php4dllts - Win32 Release_TS"
 
@@ -81,7 +81,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib 
Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" 
/out:"..\Release_TS\php4ts.dll" /libpath:"..\TSRM\Release_TS" 
/libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" 
/libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" 
/libpath:"..\..\zlib\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib zlib.lib 
Urlmon.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" 
/out:"..\Release_TS\php4ts.dll" /libpath:"..\TSRM\Release_TS" 
/libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" 
/libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" 
/libpath:"..\..\zlib\Release" /libpath:"..\..\win32build\lib"
 
 !ELSEIF  "$(CFG)" == "php4dllts - Win32 Release_TS_inline"
 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to