Skip to content

Commit

Permalink
updated build files
Browse files Browse the repository at this point in the history
  • Loading branch information
virmitio committed Jun 3, 2013
1 parent feb6546 commit 7117ada
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 455 deletions.
241 changes: 63 additions & 178 deletions copkg/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,192 +1,77 @@
/* target information */
@import "version.inc";
@import default_tools;

#product-info {
product-name: "libjpeg";
version: "8d";
original-source-location: "http://ijg.org/files/jpegsr8d.zip";
original-source-website: "http://ijg.org";
license: "Custom license, see README";
packager: "Rafael Rivera <[email protected]>";
}

ItemGroup {
sources = "..\*.c";
headers = "..\*.h";
};

test {
set: {
COMPILERS="${COMPILERS??vc10}";
PLAT="${PLAT??x86,x64}";
};

default : false;
uses: release;
build-command: @"
for %%A in (${COMPILERS}) do (
for %%B in (${PLAT}) do (
call :testroutine ""%%A"" ""%%B""
)
)
goto :eof

:testroutine
pushd output\%~1\%~2\Release\bin\

djpeg ..\..\..\..\..\testorig.jpg testout.jpg
fc /B testout.jpg ..\..\..\..\..\testimg.ppm
if ERRORLEVEL 1 goto failed

djpeg -bmp -color 256 ..\..\..\..\..\testorig.jpg testout.bmp
fc /B testout.bmp ..\..\..\..\..\testimg.bmp
if ERRORLEVEL 1 goto failed

cjpeg ..\..\..\..\..\testimg.ppm testout.jpg
fc /B testout.jpg ..\..\..\..\..\testimg.jpg
if ERRORLEVEL 1 goto failed

cjpeg -progressive -optimize ..\..\..\..\..\testimg.ppm testout.jpg
fc /B testout.jpg ..\..\..\..\..\testimgp.jpg
if ERRORLEVEL 1 goto failed

goto passed
:failed
echo ""Test(s) failed for (%~1,%~2)""
:passed
popd
goto :eof
";
};

package {
set: COMP="${COMP??vc10}";
set: PLAT="${PLAT??x86, x64}";
default : false;
uses : sign;
default {

targets: {
@"copkg\libjpeg[vc10]-${package-version}-x86.msi",
@"copkg\libjpeg-dev[vc10]-${package-version}-x86.msi",
@"copkg\libjpeg-dev-common-${package-version}-any.msi",
@"copkg\libjpeg[vc10]-${package-version}-x64.msi",
@"copkg\libjpeg-dev[vc10]-${package-version}-x64.msi"
.Copy {
SourceFiles : "@(sources)";
DestinationFolder = @"$(MSBuildThisFileDirectory)..\msvc\";
};
.Copy {
SourceFiles : "@(headers)";
DestinationFolder = @"$(MSBuildThisFileDirectory)..\msvc\";
};

build-command : @"
pushd COPKG
autopackage libjpeg-dev-common.autopkg || goto failed

for %%A in (${COMP}) do (
for %%B in (${PLAT}) do (
autopackage --COMP=%%A --PLAT=%%B libjpeg.autopkg libjpeg-dev.autopkg || goto failed
)
)
popd
ptk update-version
";

clean-command: @"del COPKG\*.msi COPKG\*.wixpdb";
};


update-version {
default : false;

build-command : @"
REM auto-increment version.inc file...
.Copy {
SourceFiles : {
$(MSBuildThisFileDirectory)vcxproj.inc,
$(MSBuildThisFileDirectory)..\jconfig.vc,
$(MSBuildThisFileDirectory)..\makejsln.v11,
$(MSBuildThisFileDirectory)..\makeasln.v11,
$(MSBuildThisFileDirectory)..\makelvcx.v11,
$(MSBuildThisFileDirectory)..\makecvcx.v11,
$(MSBuildThisFileDirectory)..\makedvcx.v11,
$(MSBuildThisFileDirectory)..\maketvcx.v11,
$(MSBuildThisFileDirectory)..\makewvcx.v11,
$(MSBuildThisFileDirectory)..\makervcx.v11,
};
DestinationFiles : {
$(MSBuildThisFileDirectory)..\msvc\vcxproj.inc,
$(MSBuildThisFileDirectory)..\msvc\jconfig.h,
$(MSBuildThisFileDirectory)..\msvc\makejsln.sln,
$(MSBuildThisFileDirectory)..\msvc\makeasln.sln,
$(MSBuildThisFileDirectory)..\msvc\jpeg.vcxproj,
$(MSBuildThisFileDirectory)..\msvc\cjpeg.vcxproj,
$(MSBuildThisFileDirectory)..\msvc\djpeg.vcxproj,
$(MSBuildThisFileDirectory)..\msvc\jpegtran.vcxproj,
$(MSBuildThisFileDirectory)..\msvc\wrjpgcom.vcxproj,
$(MSBuildThisFileDirectory)..\msvc\rdjpgcom.vcxproj,
};
};

pushd COPKG
setlocal EnableDelayedExpansion
for /F ""tokens=4,5,6,7 delims=.; "" %%v in (version.inc) do (
set /a build=%%y + 1
set VERSTRING=#define { package-version: %%v.%%w.%%x.!build!; }
)
echo !VERSTRING! > version.inc
popd
";
}
("v110, v100", "Win32, x64", "Debug,Release", "Dynamic, Static", "cdecl") => {
.PushEnvironment {};
.LoadSystemEnvironment {};
.SetEnvironmentFromTarget.Target = "VC_${0}_${1}";
.Message.Text = @"

release {
set: {
COMPILERS="${COMPILERS??vc10}";
PLAT="${PLAT??x86, x64}";
CONFIG="Release";
};

build-command: @"
for %%A in (${COMPILERS}) do (
for %%B in (${PLAT}) do (
ptk -nologo base --CONFIG=${CONFIG} --COMP=%%A --PLAT=%%B
)
)
";
};

sign {
default : false;
uses: release;
build-command: @"simplesigner.exe --nologo --sign output\**.dll output\**.exe";
Env: ${0}-${1} : ${2} ${3} ${4}
EnvExists: $(IsEnvironmentValid)";

.Exec {
Condition="$(IsEnvironmentValid)";
Command = @"msbuild $(MSBuildThisFileDirectory)..\msvc\makejsln.sln /p:PlatformToolset=${0};Platform=${1};Configuration=${2};UsesConfigurationType=${3};CallingConvention=${4}";
};
.Exec {
Condition="$(IsEnvironmentValid)";
Command = @"msbuild $(MSBuildThisFileDirectory)..\msvc\makeasln.sln /p:PlatformToolset=${0};Platform=${1};Configuration=${2};UsesConfigurationType=${3};CallingConvention=${4}";
};

.PopEnvironment{};
};

};


x86 {
set: PLAT=x86;
uses: base;
clean {
.RemoveDir.Directories = @"$(MSBuildThisFileDirectory)..\msvc\intermediate";
};

x64 {
set: PLAT=x64;
uses: base;
nuke {
.RemoveDir.Directories = @"$(MSBuildThisFileDirectory)..\msvc\output";
};

base {
set: {
CONFIG="${CONFIG??Release}";
COMP="${COMP??vc10}";
PLAT="${PLAT??x86}";
};

compiler:"${COMP}";
platform:"${PLAT}";

targets: {
// main library
"output\${COMP}\${PLAT}\${CONFIG}\bin\jpeg.lib",
"output\${COMP}\${PLAT}\${CONFIG}\bin\jpegs.lib",
"output\${COMP}\${PLAT}\${CONFIG}\bin\jpeg.dll",
// extra utilities
"output\${COMP}\${PLAT}\${CONFIG}\bin\cjpeg.exe",
"output\${COMP}\${PLAT}\${CONFIG}\bin\djpeg.exe",
"output\${COMP}\${PLAT}\${CONFIG}\bin\jpegtran.exe",
"output\${COMP}\${PLAT}\${CONFIG}\bin\rdjpgcom.exe",
"output\${COMP}\${PLAT}\${CONFIG}\bin\wrjpgcom.exe",
};

build-command:@"
copy jconfig.vc jconfig.h
copy makejsln.v10 makejsln.sln
copy makeasln.v10 makeasln.sln
copy makejvcx.v10 jpeg.vcxproj
copy makelvcx.v10 jpegdll.vcxproj
copy makecvcx.v10 cjpeg.vcxproj
copy makedvcx.v10 djpeg.vcxproj
copy maketvcx.v10 jpegtran.vcxproj
copy makewvcx.v10 wrjpgcom.vcxproj
copy makervcx.v10 rdjpgcom.vcxproj

REM this makes it so that DLLs can have their own SxS Activation Context in an embedded resource.
echo %_CL% | findstr ISOLATION_AWARE || set _CL=%CL% /D ISOLATION_AWARE_ENABLED

if ""${PLAT}"" == ""x86"" (
msbuild /p:Platform=Win32 /p:Configuration=${CONFIG} makejsln.sln
msbuild /p:Platform=Win32 /p:Configuration=${CONFIG} makeasln.sln
) else (
msbuild /p:Platform=x64 /p:Configuration=${CONFIG} makejsln.sln
msbuild /p:Platform=x64 /p:Configuration=${CONFIG} makeasln.sln
)

";

clean-command:@"
attrib -S -H -R *
del /Q *.sdf *.suo *.sln *.vcxproj *.user jconfig.h 2>NUL
rmdir /S /Q output 2>NUL
";
};
9 changes: 3 additions & 6 deletions copkg/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ if "%1"=="noclean" (
setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64
call :build x64 Release v110 || goto :eof
REM call :build x64 Debug v110 || goto :eof
call :build x64 Debug v110 || goto :eof
endlocal

setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86
call :build Win32 Release v110 || goto :eof
REM call :build Win32 Debug v110 || goto :eof
call :build Win32 Debug v110 || goto :eof
endlocal

REM TODO - DELETE THE FOLLOWING LINE
goto :eof

setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
call :build x64 Release v100 || goto :eof
Expand Down Expand Up @@ -56,7 +53,7 @@ copy makewvcx.v11 msvc\wrjpgcom.vcxproj
copy makervcx.v11 msvc\rdjpgcom.vcxproj
copy *.h msvc
copy *.c msvc

msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:ConfigurationType=DynamicLibrary /P:CallingConvention=Cdecl msvc\makejsln.sln || goto :eof
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:ConfigurationType=StaticLibrary /P:CallingConvention=Cdecl msvc\makejsln.sln || goto :eof
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:ConfigurationType=DynamicLibrary /P:CallingConvention=stdcall msvc\makejsln.sln || goto :eof
Expand Down
22 changes: 22 additions & 0 deletions makeasln.v11
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32
Expand All @@ -37,6 +39,26 @@ Global
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|x64.ActiveCfg = Release|x64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|x64.Build.0 = Release|x64
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Debug|Win32.ActiveCfg = Debug|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Debug|Win32.Build.0 = Debug|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Debug|x64.ActiveCfg = Debug|x64
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Debug|x64.Build.0 = Debug|x64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Debug|Win32.ActiveCfg = Debug|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Debug|Win32.Build.0 = Debug|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Debug|x64.ActiveCfg = Debug|x64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Debug|x64.Build.0 = Debug|x64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Debug|Win32.ActiveCfg = Debug|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Debug|Win32.Build.0 = Debug|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Debug|x64.ActiveCfg = Debug|x64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Debug|x64.Build.0 = Debug|x64
{C81513DB-78DC-46BC-BC98-82E745203976}.Debug|Win32.ActiveCfg = Debug|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Debug|Win32.Build.0 = Debug|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Debug|x64.ActiveCfg = Debug|x64
{C81513DB-78DC-46BC-BC98-82E745203976}.Debug|x64.Build.0 = Debug|x64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Debug|Win32.ActiveCfg = Debug|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Debug|Win32.Build.0 = Debug|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Debug|x64.ActiveCfg = Debug|x64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Debug|x64.Build.0 = Debug|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 7117ada

Please sign in to comment.