-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwin32-fixup.pl
More file actions
98 lines (87 loc) · 3.21 KB
/
win32-fixup.pl
File metadata and controls
98 lines (87 loc) · 3.21 KB
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
#! e:/program files/perl/bin/perl.exe
# version info can be found in 'configure.ac'
require "../local-paths.lib";
$gtk_version = "2.24.26";
$major = 2;
$minor = 24;
$micro = 26;
$interface_age = 26;
$binary_age = 2426;
$current_minus_age = 0;
$gettext_package = "gtk20";
$gtk_icon_dir = "../rc";
$gtk_binary_version = "v2.24"; # Used to locate various modules and '.rc' files. Change this only when absolutely necessary !
$exec_prefix = "lib";
sub process_file
{
my $outfilename = shift;
my $infilename = $outfilename . ".in";
open (INPUT, "< $infilename") || exit 1;
open (OUTPUT, "> $outfilename") || exit 1;
while (<INPUT>) {
s/\@ATK_API_VERSION@/$atk_api_version/g;
s/\@PANGO_API_VERSION@/$pango_api_version/g;
s/\@GLIB_API_VERSION@/$glib_api_version/g;
s/\@GTK_API_VERSION@/$gtk_api_version/g;
s/\@GDK_PIXBUF_API_VERSION@/$gdk_pixbuf_api_version/g;
s/\@GTK_VERSION@/$gtk_version/g;
s/\@GTK_MAJOR_VERSION\@/$major/g;
s/\@GTK_MINOR_VERSION\@/$minor/g;
s/\@GTK_MICRO_VERSION\@/$micro/g;
s/\@GTK_BINARY_VERSION\@/$gtk_binary_version/g;
s/\@GTK_BINARY_AGE\@/$binary_age/g;
s/\@GTK_INTERFACE_AGE\@/$interface_age/g;
s/\@LT_CURRENT_MINUS_AGE@/$current_minus_age/g;
s/\@GETTEXT_PACKAGE\@/$gettext_package/g;
s/\@PERL@/$perl_path/g;
s/\@GlibBuildRootFolder@/$glib_build_root_folder/g;
s/\@GtkBuildRootFolder@/$gtk_build_root_folder/g;
s/\@GdkPixbufBuildRootFolder@/$gdk_pixbuf_build_root_folder/g;
s/\@GtkBuildProjectFolder@/$gtk_build_project_folder/g;
s/\@GenericIncludeFolder@/$generic_include_folder/g;
s/\@GenericLibraryFolder@/$generic_library_folder/g;
s/\@GenericWin32LibraryFolder@/$generic_win32_library_folder/g;
s/\@GenericWin32BinaryFolder@/$generic_win32_binary_folder/g;
s/\@Debug32TestSuiteFolder@/$debug32_testsuite_folder/g;
s/\@Release32TestSuiteFolder@/$release32_testsuite_folder/g;
s/\@Debug32TargetFolder@/$debug32_target_folder/g;
s/\@Release32TargetFolder@/$release32_target_folder/g;
s/\@TargetSxSFolder@/$target_sxs_folder/g;
s/\@prefix@/$prefix/g;
s/\@exec_prefix@/$exec_prefix/g;
s/\@includedir@/$generic_include_folder/g;
s/\@libdir@/$generic_library_folder/g;
s/\@srcdir@/$gtk_icon_dir/g;
s/\@gdktarget@/$target/g;
s/\@VERSION@/$gtk_version/g;
print OUTPUT;
}
}
my $command=join(' ',@ARGV);
if (-1 != index($command, "-X64")) {
$target = "64";
} else {
$target = "32";
}
process_file ("config.h.win32");
process_file ("gtk/gtkversion.h");
process_file ("demos/gtk-demo/geninclude.pl");
process_file ("gail.pc");
process_file ("gdk-2.0.pc");
process_file ("gtk+-2.0.pc");
if (-1 != index($command, "-buildall")) {
process_file ("msvc/gtk.vsprops");
process_file ("gdk/win32/rc/gdk.rc");
process_file ("gtk/gtk-win32.rc");
@validate_args = ( "gtk-update-icon-cache", "--validate", "gtk/stock-icons" );
system(@validate_args);
if ($? == 0) {
my $output = `gtk-update-icon-cache --force --ignore-theme-index --source builtin_icons gtk/stock-icons > gtk/gtkbuiltincache.h.in`;
if ($? != 0) {
print "An error occurred while generating \"gtkbuiltincache.h.in\" !!!\n";
}
}
else {
print "Failed while validating \"stock-icons\" !!!\n";
}
}