You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/12/08 13:08:32 UTC
svn commit: r1043373 - in /subversion/trunk/build/generator/templates:
build_zlib.ezt zlib.dsp.ezt zlib.vcproj.ezt zlib.vcxproj.ezt
Author: rhuijben
Date: Wed Dec 8 12:08:32 2010
New Revision: 1043373
URL: http://svn.apache.org/viewvc?rev=1043373&view=rev
Log:
Allow building zlib for more then one platform on Windows. This patch
will enable passing the platform to build_zlib.bat and will then apply
some fixes there.
* build/generator/templates/build_zlib.ezt
Accept platform argument. Use different ml arguments for different zlib
versions.
* build/generator/templates/zlib.dsp.ezt
* build/generator/templates/zlib.vcxproj.ezt
* build/generator/templates/zlib.vcproj.ezt
Call build_zlib.bat with additional argument
Modified:
subversion/trunk/build/generator/templates/build_zlib.ezt
subversion/trunk/build/generator/templates/zlib.dsp.ezt
subversion/trunk/build/generator/templates/zlib.vcproj.ezt
subversion/trunk/build/generator/templates/zlib.vcxproj.ezt
Modified: subversion/trunk/build/generator/templates/build_zlib.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/build_zlib.ezt?rev=1043373&r1=1043372&r2=1043373&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/build_zlib.ezt (original)
+++ subversion/trunk/build/generator/templates/build_zlib.ezt Wed Dec 8 12:08:32 2010
@@ -25,32 +25,47 @@
@rem *
@rem * From this directory, run this batch file like so:
@rem *
-@rem * .\build_zlib debug|release (rebuild)
+@rem * .\build_zlib debug|release Win32|X64 [rebuild|clean]
@rem *
@rem **************************************************************************
@rem **************************************************************************
cd /D [zlib_path]
set exitcode=0
+set zlib_version=[zlib_version]
+
+if /i "%1" == "release" goto release
+if /i "%1" == "debug" goto debug
+goto pIerr
+
+:checkplatform
+if /i "%2" == "Win32" goto PWin32
+if /i "%2" == "x64" goto PX64
+goto pIIerr
+
+:checkrebuild
+
[if-any use_ml]
@rem **************************************************************************
@rem Compile ASM sources with ML
set ASFLAGS=-nologo -Zi -coff
set LOC=-DASMV -DASMINF
-set OBJA=gvmat32c.obj gvmat32.obj inffas32.obj
+[is zlib_version "1.2.4"]
+set OBJA=contrib\masmx86\gvmat32c.obj contrib\masmx86\gvmat32.obj contrib\masmx86\inffas32.obj
set ASM_OPTS=ASFLAGS="%ASFLAGS%" LOC="%LOC%" OBJA="%OBJA%"
-if not exist gvmat32c.c copy contrib\masmx86\gvmat32c.c .
-if not exist gvmat32.asm copy contrib\masmx86\gvmat32.asm .
-if not exist inffas32.asm copy contrib\masmx86\inffas32.asm .[end]
+[else]
+if /i "%2" == "Win32" (
+ set ASM_OPTS=LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj"
+) else if /i "%2" == "x64" (
+ set ASM_OPTS=LOC="-DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.c" AS=ml64
+)
+[end]
+[end]
-if /i "%1" == "release" goto release
-if /i "%1" == "debug" goto debug
-goto pIerr
-:checkrebuild
-if /i "%2" == "rebuild" goto rebuild
-if /i "%2" == "clean" goto clean
-if not "%2" == "" goto pIIerr
+if /i "%3" == "rebuild" goto rebuild
+if /i "%3" == "clean" goto clean
+if not "%3" == "" goto pIIIerr
set target= %STATICLIB%
goto build
@@ -66,19 +81,31 @@ goto build
:release
set STATICLIB=zlibstat.lib
set CC_OPTS=/MD /O2 /Zi
-goto checkrebuild
+goto checkplatform
@rem **************************************************************************
:debug
set STATICLIB=zlibstatD.lib
-set CC_OPTS=/MDd /Gm /Gi /ZI /Od /GZ /D_DEBUG
+set CC_OPTS=/MDd /Gm /ZI /Od /GZ /D_DEBUG
+goto checkplatform
+
+@rem **************************************************************************
+:PWin32
+goto checkrebuild
+
+@rem **************************************************************************
+:PX64
goto checkrebuild
@rem **************************************************************************
:build
-set COMMON_CC_OPTS=/nologo /W3 /FD /DWIN32 /D_WINDOWS
-set CFLAGS=%COMMON_CC_OPTS% %CC_OPTS% $(LOC)
-set BUILD_OPTS=%ASM_OPTS% CFLAGS="%COMMON_CC_OPTS% %CC_OPTS% $(LOC)"
+set COMMON_CC_OPTS=/nologo /W3 /DWIN32 /D_WINDOWS
+[is zlib_version "1.2.4"]
+set CFLAGS=%COMMON_CC_OPTS% %CC_OPTS% %LOC%
+set BUILD_OPTS=%ASM_OPTS% CFLAGS="%COMMON_CC_OPTS% %CC_OPTS% %LOC%"
+[else]
+set BUILD_OPTS=%ASM_OPTS%
+[end]
@echo nmake /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target%
nmake /nologo /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target%
if not errorlevel 0 goto err
@@ -91,7 +118,13 @@ goto err
@rem **************************************************************************
:pIIerr
-echo error: Second parameter should be "rebuild" or empty
+echo error: Second parameter should be "Win32" or "X64"
+goto err
+
+
+@rem **************************************************************************
+:pIIIerr
+echo error: Third parameter should be "rebuild" or empty
goto err
@rem **************************************************************************
Modified: subversion/trunk/build/generator/templates/zlib.dsp.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/zlib.dsp.ezt?rev=1043373&r1=1043372&r2=1043373&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/zlib.dsp.ezt (original)
+++ subversion/trunk/build/generator/templates/zlib.dsp.ezt Wed Dec 8 12:08:32 2010
@@ -32,7 +32,7 @@ CFG=zlib - Win32 Debug
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "[zlib_path]\Release"
# PROP BASE Intermediate_Dir "[zlib_path]\Release"
-# PROP BASE Cmd_Line "build_zlib.bat release"
+# PROP BASE Cmd_Line "build_zlib.bat release Win32"
# PROP BASE Rebuild_Opt "rebuild"
# PROP BASE Target_File "[zlib_path]\zlibstat.lib"
# PROP BASE Bsc_Name ""
@@ -40,7 +40,7 @@ CFG=zlib - Win32 Debug
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "[zlib_path]\Release"
# PROP Intermediate_Dir "[zlib_path]\Release"
-# PROP Cmd_Line "cmd /c build_zlib.bat release"
+# PROP Cmd_Line "cmd /c build_zlib.bat release Win32"
# PROP Rebuild_Opt "rebuild"
# PROP Target_File "[zlib_path]\zlibstat.lib"
# PROP Bsc_Name ""
@@ -51,7 +51,7 @@ CFG=zlib - Win32 Debug
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "[zlib_path]\Debug"
# PROP BASE Intermediate_Dir "[zlib_path]\Debug"
-# PROP BASE Cmd_Line "build_zlib.bat debug"
+# PROP BASE Cmd_Line "build_zlib.bat debug Win32"
# PROP BASE Rebuild_Opt "rebuild"
# PROP BASE Target_File "[zlib_path]\zlibstatD.lib"
# PROP BASE Bsc_Name ""
@@ -59,7 +59,7 @@ CFG=zlib - Win32 Debug
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "[zlib_path]\Debug"
# PROP Intermediate_Dir "[zlib_path]\Debug"
-# PROP Cmd_Line "cmd /c build_zlib.bat debug"
+# PROP Cmd_Line "cmd /c build_zlib.bat debug Win32"
# PROP Rebuild_Opt "rebuild"
# PROP Target_File "[zlib_path]\zlibstatD.lib"
# PROP Bsc_Name ""
Modified: subversion/trunk/build/generator/templates/zlib.vcproj.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/zlib.vcproj.ezt?rev=1043373&r1=1043372&r2=1043373&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/zlib.vcproj.ezt (original)
+++ subversion/trunk/build/generator/templates/zlib.vcproj.ezt Wed Dec 8 12:08:32 2010
@@ -40,9 +40,9 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="cmd /c build_zlib.bat debug"
- ReBuildCommandLine="cmd /c build_zlib.bat debug rebuild"
- CleanCommandLine="cmd /c build_zlib.bat debug clean"
+ BuildCommandLine="cmd /c build_zlib.bat debug [platforms]"
+ ReBuildCommandLine="cmd /c build_zlib.bat debug [platforms] rebuild"
+ CleanCommandLine="cmd /c build_zlib.bat debug [platforms] clean"
Output="[zlib_path]\zlibstatD.lib"/>
</Configuration>
<Configuration
@@ -56,9 +56,9 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="cmd /c build_zlib.bat release"
- ReBuildCommandLine="cmd /c build_zlib.bat release rebuild"
- CleanCommandLine="cmd /c build_zlib.bat release clean"
+ BuildCommandLine="cmd /c build_zlib.bat release [platforms]"
+ ReBuildCommandLine="cmd /c build_zlib.bat release [platforms] rebuild"
+ CleanCommandLine="cmd /c build_zlib.bat release [platforms] clean"
Output="[zlib_path]\zlibstat.lib"/>
</Configuration>
[end] </Configurations>
Modified: subversion/trunk/build/generator/templates/zlib.vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/zlib.vcxproj.ezt?rev=1043373&r1=1043372&r2=1043373&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/zlib.vcxproj.ezt (original)
+++ subversion/trunk/build/generator/templates/zlib.vcxproj.ezt Wed Dec 8 12:08:32 2010
@@ -44,9 +44,9 @@
<PropertyGroup>
[for configs][for platforms] <OutDir Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">.\</IntDir>
- <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs]</NMakeBuildCommandLine>
- <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs] rebuild</NMakeReBuildCommandLine>
- <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs] clean</NMakeCleanCommandLine>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs] [platforms]</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs] [platforms] rebuild</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">cmd /c "$(ProjectDir)build_zlib.bat" [configs] [platforms] clean</NMakeCleanCommandLine>
<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='[configs]|[platforms]'">[zlib_path]\[is configs "Release"]zlibstat.lib[else]zlibstatD.lib[end]</NMakeOutput>
[end][end] </PropertyGroup>
<ItemDefinitionGroup>