forked from rjpcomputing/wxpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_wxPack.bat
198 lines (159 loc) · 5.74 KB
/
build_wxPack.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@echo off
:SETUP_ENVIRONMENT
:: ~dp0 expands %0 to a drive letter and path.
:: google for "batch parameter modifiers"
set WXWIN=%~dp0wxwidgets
echo %WXWIN%
goto CONFIGURE
:CONFIGURE
echo Copy the setup configuration into the source tree
copy setup.h /Y wxwidgets\include\wx\msw
copy setup.h /Y wxwidgets\include\wx
echo Copy the documentation into the install tree
xcopy /Y /I /S support wxwidgets
echo Copy build script to build directory
copy wxBuild_wxWidgets.bat /Y wxwidgets\build\msw
echo Create directories for binary targets in GCC because of a bug in the wx Makefiles.
mkdir wxwidgets\lib\gcc_dll\msw\wx
mkdir wxwidgets\lib\gcc_dll\mswd\wx
mkdir wxwidgets\lib\gcc_dll\mswu\wx
mkdir wxwidgets\lib\gcc_dll\mswud\wx
mkdir wxwidgets\lib\gcc_lib\msw\wx
mkdir wxwidgets\lib\gcc_lib\mswd\wx
mkdir wxwidgets\lib\gcc_lib\mswu\wx
mkdir wxwidgets\lib\gcc_lib\mswud\wx
echo Get wxFormBuilders source
svn checkout https://svn.code.sf.net/p/wxformbuilder/code/3.x/trunk/ wxformbuilder
echo Get wxAdditions source
svn checkout https://svn.code.sf.net/p/wxformbuilder/code/plugins/additions/trunk/ wxwidgets/additions
echo Cleaning up the old wxPack installs...
del /F /Q %~dp0install\wxPack_v*
goto BUILD_WXCOMPILED
:BUILD_WXCOMPILED
echo -- WXCOMPILED ---------------------------------------------------------
echo --
echo Starting to build wxCompiled from %CD%
echo Change into the build directory of the source tree
cd wxwidgets\build\msw
echo Run the build file for each compiler
call wxBuild_wxWidgets.bat VC100 ALL
if ERRORLEVEL 1 goto ERROR
call wxBuild_wxWidgets.bat VC100_64 ALL
if ERRORLEVEL 1 goto ERROR
call wxBuild_wxWidgets.bat MINGW4 ALL
if ERRORLEVEL 1 goto ERROR
::call wxBuild_wxWidgets.bat MINGW4 NULL LIB_RELEASE_UNICODE
::call wxBuild_wxWidgets.bat MINGW4 NULL DLL_RELEASE_UNICODE
echo Change to installer directory
cd ..\..\..\install\wxCompiled
:: Make installer for wxCompiled
echo Building wxCompiled installer...
call "%ProgramFiles%\Inno Setup 5\iscc.exe" /Q /F"wxWidgets_Compiled-setup" "wxWidgets_Compiled.iss"
if ERRORLEVEL 1 goto ERROR
cd ..\..
echo Done building wxCompiled. Current Directory: %CD%
goto BUILD_WXADDITIONS
:BUILD_WXADDITIONS
echo -- WXADDITIONS --------------------------------------------------------
echo --
echo Starting to build wxAdditions from %CD%
echo Change to additions build directory
cd wxwidgets\additions\build
call build_wxadditions.bat VC100
if ERRORLEVEL 1 goto ERROR
call build_wxadditions.bat VC100_64
if ERRORLEVEL 1 goto ERROR
call build_wxadditions.bat MINGW4
if ERRORLEVEL 1 goto ERROR
echo Move 64bit directory to lib64
:: Move Visual C++ 10.0 64-bit directories.
if not exist ..\lib64 mkdir ..\lib64
if exist ..\lib\vc_amd64_lib move /Y ..\lib\vc_amd64_lib ..\lib64\vc_lib
if exist ..\lib\vc_amd64_dll move /Y ..\lib\vc_amd64_dll ..\lib64\vc_dll
echo Build the wxFormBuilder plugin
call build_wxfb_plugin.bat
echo Change to installer directory
cd ..\..\..\install\wxAdditions
:: Make installer for wxAdditions
echo Building wxAdditions installer...
"%ProgramFiles%\Inno Setup 5\iscc.exe" /Q /F"wxAdditions-setup" "wxAdditions.iss"
if ERRORLEVEL 1 goto ERROR
cd ..\..
echo Done building wxAdditions. Current Directory: %CD%
goto BUILD_WXFORMBUILDER
:BUILD_WXFORMBUILDER
echo -- WXFORMBUILDER ------------------------------------------------------
echo --
echo Starting to build wxFormBuilder from '%CD%'
:: MinGW Gcc install location. This must match you systems configuration.
set GCCDIR=C:\MinGW4
set CC=gcc
set CXX=g++
echo Assuming that MinGW has been installed to:
echo %GCCDIR%
echo.
:: -- Add MinGW directory to the systems PATH --
echo Setting environment for MinGW Gcc...
if "%OS%" == "Windows_NT" set PATH=%GCCDIR%\BIN;%PATH%
if "%OS%" == "" set PATH="%GCCDIR%\BIN";"%PATH%"
echo.
echo Change to wxFormBuilder build directory
cd wxformbuilder
echo Copying over wxWidgets dlls from %WXWIN%
copy %WXWIN%\lib\gcc_dll\wxmsw28u_gcc.dll /Y output\
echo Copying over MinGW dlls
copy %GCCDIR%\bin\mingwm10.dll /Y output\
::copy %GCCDIR%\bin\libgcc_s_dw2-1.dll /Y output\
copy %GCCDIR%\bin\libintl-8.dll /Y output\
copy %GCCDIR%\bin\libiconv-2.dll /Y output\
echo Create the build files.
call premake.exe --target gnu --unicode --with-wx-shared
if ERRORLEVEL 1 goto ERROR
echo Building wxFormBuilder.
call mingw32-make.exe CONFIG=Release -j %NUMBER_OF_PROCESSORS%
if ERRORLEVEL 1 goto ERROR
echo Change to installer directory.
cd install\windows
echo Building wxFormBuilder installer. Current Directory: %CD%
call "%ProgramFiles%\Inno Setup 5\ISCC.exe" /Q /F"wxFormBuilder-setup" "wxFormBuilder.iss"
if ERRORLEVEL 1 goto ERROR
cd ..\..\..
echo Done building wxFormBuilder. Current Directory: %CD%
::goto BUILD_WXVC
goto BUILD_WXPACK
:BUILD_WXVC
echo -- WXVC ---------------------------------------------------------------
echo --
echo Starting to build wxVC from %CD%
echo Change to wxVC installer directory
cd install\wxVC
echo Building wxVC installer...
call "%ProgramFiles%\Inno Setup 5\iscc.exe" /Q /F"wxVC-setup" "wxVC.iss"
if ERRORLEVEL 1 goto ERROR
cd ..\..
echo Done building wxVC. Current Directory: %CD%
goto BUILD_WXPACK
:BUILD_WXPACK
echo -- WXPACK -------------------------------------------------------------
echo --
echo Starting to build wxPack from %CD%
echo Change to wxPack installer directory
cd install
echo Building wxPack installer...
call "%ProgramFiles%\Inno Setup 5\iscc.exe" /Q "wxPack.iss"
if ERRORLEVEL 1 goto ERROR
cd ..
echo Done building wxPack. Current Directory: %CD%
goto END
:ERROR
set ERR=%ERRORLEVEL%
echo An error (%ERR%) occurred...
echo.
echo Cleaning up the old wxPack installs...
del /F /Q %~dp0install\wxPack_v*
exit %ERR%
goto END
:END
echo.
echo End (%ERRORLEVEL%)
exit %ERRORLEVEL%