~ubuntu-branches/ubuntu/trusty/gdk-pixbuf/trusty-proposed

« back to all changes in this revision

Viewing changes to build/win32/gengir_gdkpixbuf.bat

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2013-05-09 02:01:16 UTC
  • mfrom: (1.4.1) (1.2.18 experimental)
  • Revision ID: package-import@ubuntu.com-20130509020116-azihjb1x3doqm1ba
Tags: 2.28.1-1
* New upstream release.
* Track stable releases again.
* Drop explicit Build-Depends on gir1.2-glib-2.0.
* Bump Standards-Version to 3.9.4.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@echo off
 
2
 
 
3
setlocal EnableDelayedExpansion
 
4
 
 
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.
 
12
 
 
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.
 
15
 
 
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" (
 
20
   set PLAT=Win32
 
21
   goto PLAT_OK
 
22
)
 
23
if /i "%PLAT%" == "x86-64" (
 
24
   set PLAT=x64
 
25
   goto PLAT_OK
 
26
)
 
27
goto ERR_PLAT
 
28
 
 
29
:PLAT_OK
 
30
if "%VSVER%" == "9" goto VSVER_OK
 
31
if "%VSVER%" == "10" goto VSVER_OK
 
32
if "%VSVER%" == "11" goto VSVER_OK
 
33
goto ERR_VSVER
 
34
:VSVER_OK
 
35
if /i "%CONF%" == "Release" goto CONF_OK
 
36
if /i "%CONF%" == "Debug" goto CONF_OK
 
37
goto ERR_CONF
 
38
:CONF_OK
 
39
if "%BASEDIR%" == "" goto ERR_BASEDIR
 
40
if not exist %BASEDIR% goto ERR_BASEDIR
 
41
 
 
42
if "%PKG_CONFIG_PATH%" == "" goto ERR_PKGCONFIG
 
43
if not exist %PKG_CONFIG_PATH%\gobject-2.0.pc goto ERR_PKGCONFIG
 
44
 
 
45
if "%MINGWDIR%" == "" goto ERR_MINGWDIR
 
46
if not exist %MINGWDIR%\bin\gcc.exe goto ERR_MINGWDIR
 
47
 
 
48
set CC=cl
 
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%
 
54
 
 
55
echo Setup filelist for generating GdkPixbuf .gir's...
 
56
 
 
57
call python gen-file-list-gdkpixbuf.py
 
58
 
 
59
echo Setup .bat for generating GdkPixbuf .gir's...
 
60
 
 
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 ===============================================================================
 
65
 
 
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
 
85
 
 
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
 
90
 
 
91
rem =============================================================
 
92
rem Finish setup of gdkpixbuf_gir.bat to create GdkPixbuf-2.0.gir
 
93
rem =============================================================
 
94
 
 
95
rem =======================
 
96
rem Now generate the .gir's
 
97
rem =======================
 
98
CALL gdkpixbuf_gir.bat
 
99
 
 
100
rem Clean up the .bat and the filelist for generating the .gir files...
 
101
del gdkpixbuf_gir.bat
 
102
del gdkpixbuf_list
 
103
 
 
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
 
107
 
 
108
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\share\gir-1.0
 
109
move /y *.gir %BASEDIR%\share\gir-1.0\
 
110
 
 
111
mkdir ..\..\build\win32\vs%VSVER%\%CONF%\%PLAT%\lib\girepository-1.0
 
112
move /y *.typelib %BASEDIR%\lib\girepository-1.0\
 
113
 
 
114
goto DONE
 
115
 
 
116
:ERR_PLAT
 
117
echo You need to specify a valid Platform [set PLAT=Win32 or PLAT=x64]
 
118
goto DONE
 
119
:ERR_VSVER
 
120
echo You need to specify your Visual Studio version [set VSVER=9 or VSVER=10 or VSVER=11]
 
121
goto DONE
 
122
:ERR_CONF
 
123
echo You need to specify a valid Configuration [set CONF=Release or CONF=Debug]
 
124
goto DONE
 
125
:ERR_BASEDIR
 
126
echo You need to specify a valid BASEDIR.
 
127
goto DONE
 
128
:ERR_PKGCONFIG
 
129
echo You need to specify a valid PKG_CONFIG_PATH
 
130
goto DONE
 
131
:ERR_MINGWDIR
 
132
echo You need to specify a valid MINGWDIR, where a valid gcc installation can be found.
 
133
goto DONE
 
134
:DONE
 
135