3
setlocal EnableDelayedExpansion
5
rem Needed environmental variables:
6
rem PLAT: Windows platform-Win32 (i.e. x86) or x64 (i.e. x86-64)
7
rem CONF: Configuration Type, Release or Debug
8
rem VSVER: Visual C++ version used [9, 10 or 11]
9
rem BASEDIR: Where the dependent libraries/headers are located
10
rem PKG_CONFIG_PATH: Where the GLib and its dependent pkg-config .pc files can be found
11
rem MINGWDIR: Installation path of MINGW GCC, so gcc.exe can be found in %MINGWDIR%\bin.
13
rem Note that the Python executable/installation and all the runtime dependencies of the
14
rem library/libraries need to be in your PATH or %BASEBIN%\bin.
16
rem Check the environemental variables...
17
if /i "%PLAT%" == "Win32" goto PLAT_OK
18
if /i "%PLAT%" == "x64" goto PLAT_OK
19
if /i "%PLAT%" == "x86" (
23
if /i "%PLAT%" == "x86-64" (
30
if "%VSVER%" == "9" goto VSVER_OK
31
if "%VSVER%" == "10" goto VSVER_OK
32
if "%VSVER%" == "11" goto VSVER_OK
35
if /i "%CONF%" == "Release" goto CONF_OK
36
if /i "%CONF%" == "Debug" goto CONF_OK
39
if "%BASEDIR%" == "" goto ERR_BASEDIR
40
if not exist %BASEDIR% goto ERR_BASEDIR
42
if "%PKG_CONFIG_PATH%" == "" goto ERR_PKGCONFIG
43
if not exist %PKG_CONFIG_PATH%\gobject-2.0.pc goto ERR_PKGCONFIG
45
if "%MINGWDIR%" == "" goto ERR_MINGWDIR
46
if not exist %MINGWDIR%\bin\gcc.exe goto ERR_MINGWDIR
49
set BINDIR=%CD%\vs%VSVER%\%CONF%\%PLAT%\bin
50
set INCLUDE=%BASEDIR%\include\glib-2.0;%BASEDIR%\lib\glib-2.0\include;%INCLUDE%
51
set LIB=%BINDIR%;%BASEDIR%\lib;%LIB%
52
set PATH=%BINDIR%;%BASEDIR%\bin;%PATH%;%MINGWDIR%\bin
53
set PYTHONPATH=%BASEDIR%\lib\gobject-introspection;%BINDIR%
55
echo Setup filelist for generating GdkPixbuf .gir's...
57
call python gen-file-list-gdkpixbuf.py
59
echo Setup .bat for generating GdkPixbuf .gir's...
61
rem ===============================================================================
62
rem Begin setup of gdkpixbuf_gir.bat to create GdkPixbuf-2.0.gir
63
rem (The ^^ is necessary to span the command to multiple lines on Windows cmd.exe!)
64
rem ===============================================================================
66
echo echo Generating GdkPixbuf-2.0.gir...> gdkpixbuf_gir.bat
67
echo @echo off>> gdkpixbuf_gir.bat
68
echo.>> gdkpixbuf_gir.bat
69
echo copy /b %BINDIR%\gdk_pixbuf-2.0.lib %BINDIR%\gdkpixbuf-2.0.lib>> gdkpixbuf_gir.bat
70
echo.>> gdkpixbuf_gir.bat
71
rem =====================================================================
72
rem Setup the command line flags to g-ir-scanner for GdkPixbuf-2.0.gir...
73
rem =====================================================================
74
echo python %BASEDIR%\bin\g-ir-scanner --verbose -I..\.. -I..\..\gdk-pixbuf ^^>> gdkpixbuf_gir.bat
75
echo -I%BASEDIR%\include\glib-2.0 -I%BASEDIR%\lib\glib-2.0\include ^^>> gdkpixbuf_gir.bat
76
echo --namespace=GdkPixbuf --nsversion=2.0 ^^>> gdkpixbuf_gir.bat
77
echo --include=GModule-2.0 --include=Gio-2.0 ^^>> gdkpixbuf_gir.bat
78
echo --no-libtool --library=gdk_pixbuf-2-vs%VSVER% ^^>> gdkpixbuf_gir.bat
79
echo --reparse-validate --add-include-path=%BASEDIR%\share\gir-1.0 --add-include-path=. ^^>> gdkpixbuf_gir.bat
80
echo --pkg-export gdk-pixbuf-2.0 --warn-all --strip-prefix=Gdk --c-include="gdk-pixbuf/gdk-pixbuf.h" ^^>> gdkpixbuf_gir.bat
81
echo -I..\.. -DGDK_PIXBUF_COMPILATION ^^>> gdkpixbuf_gir.bat
82
echo --filelist=gdkpixbuf_list ^^>> gdkpixbuf_gir.bat
83
echo -o GdkPixbuf-2.0.gir>> gdkpixbuf_gir.bat
84
echo.>> gdkpixbuf_gir.bat
86
echo del %BINDIR%\gdkpixbuf-2.0.lib>> gdkpixbuf_gir.bat
87
echo.>> gdkpixbuf_gir.bat
88
echo Completed setup of .bat for generating GdkPixbuf-2.0.gir.
89
echo.>> gdkpixbuf_gir.bat
91
rem =============================================================
92
rem Finish setup of gdkpixbuf_gir.bat to create GdkPixbuf-2.0.gir
93
rem =============================================================
95
rem =======================
96
rem Now generate the .gir's
97
rem =======================
98
CALL gdkpixbuf_gir.bat
100
rem Clean up the .bat and the filelist for generating the .gir files...
101
del gdkpixbuf_gir.bat
104
rem Now compile the generated .gir files
105
%BASEDIR%\bin\g-ir-compiler --includedir=. --debug --verbose GdkPixbuf-2.0.gir -o GdkPixbuf-2.0.typelib
106
rem Copy the generated .girs and .typelibs to their appropriate places
108
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\share\gir-1.0
109
move /y *.gir %BASEDIR%\share\gir-1.0\
111
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\lib\girepository-1.0
112
move /y *.typelib %BASEDIR%\lib\girepository-1.0\
117
echo You need to specify a valid Platform [set PLAT=Win32 or PLAT=x64]
120
echo You need to specify your Visual Studio version [set VSVER=9 or VSVER=10 or VSVER=11]
123
echo You need to specify a valid Configuration [set CONF=Release or CONF=Debug]
126
echo You need to specify a valid BASEDIR.
129
echo You need to specify a valid PKG_CONFIG_PATH
132
echo You need to specify a valid MINGWDIR, where a valid gcc installation can be found.