xref: /aoo42x/main/odk/util/check.pl (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28#
29# check - a perl script to check some files and directories if they exists
30# A first simple check if the SDK was built completely.
31#
32#use IO::File;
33
34$return = 0;
35
36$StartDir = "$ARGV[0]";
37$OperatingSystem = "$ARGV[1]";
38$ExePrefix = "$ARGV[2]";
39
40print "Check for $OperatingSystem\n";
41
42if (-d "$StartDir") {
43    # check binaries
44    print "check binaries: ";
45    if (-d "$StartDir/bin") {
46	my @binarylist = ( "idlc","idlcpp","cppumaker","javamaker",
47			   "regcompare","autodoc",
48			   "unoapploader", "uno-skeletonmaker" );
49
50	foreach $i (@binarylist)
51	{
52	    if (! -e "$StartDir/bin/$i$ExePrefix") {
53		$return++;
54		print "\nERROR: \"$StartDir/bin/$i$ExePrefix\" is missing\n";
55	    } else {
56		print "+";
57	    }
58	}
59
60	if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
61	    if ($OperatingSystem eq "windows" && ! -e "$StartDir/bin/climaker.exe") {
62		$return++;
63		print "\nERROR: \"$StartDir/bin/climaker.exe\" is missing\n";
64	    } else {
65		print "+";
66	    }
67	}
68	if ($OperatingSystem eq "macosx") {
69	    if (! -e "$StartDir/bin/addsym-macosx.sh") {
70		$return++;
71		print "\nERROR: \"$StartDir/bin/addsym-macosx.sh\" is missing\n";
72	    } else {
73		print "+";
74	    }
75	}
76    } else {
77	$return++;
78    }
79    print "\n";
80
81    # packaging files
82    print "check packaging files: ";
83    if (-d "$StartDir/docs") {
84	my @filelist = ( "install.html",
85			 "notsupported.html","sdk_styles.css","tools.html",
86			 "images/arrow-1.gif", "images/arrow-3.gif",
87			 "images/odk-footer-logo.gif",
88			 "images/bg_table.png","images/bg_table2.png",
89			 "images/bg_table3.png", "images/nav_down.png",
90			 "images/nav_home.png","images/nav_left.png",
91			 "images/nav_right.png","images/nav_up.png",
92			 "images/sdk_head-1.png", "images/sdk_head-2.png",
93			 "images/sdk_line-1.gif", "images/sdk_line-2.gif",
94			 "common/ref/idl.css", "images/nada.gif",
95			 "images/arrow-2.gif", "images/bluball.gif",
96			 "images/orc-main-app_32.png", "images/ooo-main-app_32.png");
97
98	foreach $i (@filelist)
99	{
100	    if (! -e "$StartDir/docs/$i") {
101		$return++;
102		print "\nERROR: \"$StartDir/docs/$i\" is missing\n";
103	    } else {
104		print "+";
105	    }
106	}
107    } else {
108	$return++;
109    }
110    print "\n";
111
112    #check configure files
113    print "check config files: ";
114    if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
115	if (! -e "$StartDir/setsdkenv_windows.bat") {
116	    print "\nERROR: \"$StartDir/setsdkenv_windows.bat\" is missing\n";
117	    $return++;
118	}
119	if (! -e "$StartDir/setsdkenv_windows.template") {
120	    print "\nERROR: \"$StartDir/setsdkenv_windows.template\" is missing\n";
121	    $return++;
122	}
123	if (! -e "$StartDir/cfgWin.js") {
124	    print "\nERROR: \"$StartDir/cfgWin.js\" is missing\n";
125	    $return++;
126	}
127    } else {
128	if (! -e "$StartDir/configure.pl") {
129	    print "\nERROR: \"$StartDir/configure.pl\" is missing\n";
130	    $return++;
131	}
132	if (! -e "$StartDir/config.guess") {
133	    print "\nERROR: \"$StartDir/config.guess\" is missing\n";
134	    $return++;
135	}
136	if (! -e "$StartDir/config.sub") {
137	    print "\nERROR: \"$StartDir/config.sub\" is missing\n";
138	    $return++;
139       }
140	if (! -e "$StartDir/setsdkenv_unix") {
141	    print "\nERROR: \"$StartDir/setsdkenv_unix\" is missing\n";
142	    $return++;
143	}
144	if (! -e "$StartDir/setsdkenv_unix.sh.in") {
145	    print "\nERROR: \"$StartDir/setsdkenv_unix.sh.in\" is missing\n";
146	    $return++;
147	}
148	if (! -e "$StartDir/setsdkenv_unix.csh.in") {
149	    print "\nERROR: \"$StartDir/setsdkenv_unix.csh.in\" is missing\n";
150	    $return++;
151	}
152    }
153    print "\n";
154
155    #check setting files
156    print "check setting files: ";
157    if (-d "$StartDir/settings") {
158	if (! -e "$StartDir/settings/settings.mk") {
159	    print "\nERROR: \"$StartDir/settings/settings.mk\" is missing\n";
160	    $return++;
161	}
162	if (! -e "$StartDir/settings/std.mk") {
163	    print "\nERROR: \"$StartDir/settings/std.mk\" is missing\n";
164	    $return++;
165	}
166	if (! -e "$StartDir/settings/stdtarget.mk") {
167	    print "\nERROR: \"$StartDir/settings/stdtarget.mk\" is missing\n";
168	    $return++;
169	}
170    } else {
171	$return++;
172    }
173    print "\n";
174
175    #check cpp docu, it is only a first and simple check
176    # improvement required
177    print "check cpp docu: ";
178    if (-d "$StartDir/docs/cpp/ref") {
179	if (! -e "$StartDir/docs/cpp/ref/index.html") {
180	    print "\nERROR: \"$StartDir/docs/cpp/ref/index.html\" is missing\n";
181	    $return++;
182	}
183	if (! -d "$StartDir/docs/cpp/ref/index-files") {
184	    print "\nERROR: \"$StartDir/docs/cpp/ref/index-files\" is missing\n";
185	    $return++;
186	}
187	if (! -e "$StartDir/docs/cpp/ref/index-files/index-10.html") {
188	    print "\nERROR: \"$StartDir/docs/cpp/ref/index-files/index-10.html\" is missing\n";
189	    $return++;
190	}
191
192	my @dir_list = ( "com","com/sun","com/sun/star","com/sun/star/uno",
193			 "com/sun/star/uno/Any","com/sun/star/uno/Type",
194			 "com/sun/star/uno/Array","com/sun/star/uno/WeakReferenceHelper",
195			 "com/sun/star/uno/Reference","com/sun/star/uno/WeakReference",
196			 "com/sun/star/uno/Environment","com/sun/star/uno/Sequence",
197			 "com/sun/star/uno/BaseReference","com/sun/star/uno/Mapping",
198			 "com/sun/star/uno/ContextLayer","com/sun/star/uno/TypeDescription",
199			 "osl","osl/File","osl/Pipe","osl/FileStatus","osl/FileBase",
200			 "osl/Guard","osl/Mutex","osl/VolumeInfo","osl/GetGlobalMutex",
201			 "osl/Security","osl/Profile","osl/DatagramSocket","osl/SocketAddr",
202			 "osl/StreamPipe","osl/ResettableGuard","osl/AcceptorSocket",
203			 "osl/ClearableGuard","osl/VolumeDevice","rtl","rtl/Uri","rtl/math",
204			 "rtl/OUStringHash","rtl/MalformedUriException","rtl/OUStringBuffer",
205			 "rtl/OUString","rtl/Reference","rtl/ByteSequence","rtl/OLocale",
206			 "rtl/Logfile","rtl/OString","rtl/IReference","rtl/OStringBuffer",
207			 "rtl/OStringHash","_typelib_CompoundTypeDescription","cppu",
208			 "cppu/ContextEntry_Init","cppu/ImplInheritanceHelper10",
209			 "cppu/ImplInheritanceHelper11","cppu/ImplInheritanceHelper12",
210			 "cppu/WeakAggImplHelper1","cppu/WeakAggImplHelper2",
211			 "cppu/WeakAggImplHelper3","cppu/WeakAggImplHelper4",
212			 "cppu/WeakAggImplHelper5","cppu/WeakAggImplHelper6",
213			 "cppu/WeakAggImplHelper7","cppu/WeakAggImplHelper8",
214			 "cppu/WeakAggImplHelper9",
215			 "cppu/OMultiTypeInterfaceContainerHelperInt32","cppu/AccessControl",
216			 "cppu/OPropertyArrayHelper","cppu/ImplHelper1","cppu/ImplHelper2",
217			 "cppu/ImplHelper3","cppu/ImplHelper4","cppu/ImplHelper5",
218			 "cppu/ImplHelper6","cppu/ImplHelper7","cppu/ImplHelper8",
219			 "cppu/ImplHelper9","cppu/WeakComponentImplHelper10",
220			 "cppu/WeakComponentImplHelper11","cppu/WeakComponentImplHelper12",
221			 "cppu/UnoUrl","cppu/WeakComponentImplHelper1",
222			 "cppu/WeakComponentImplHelper2","cppu/WeakComponentImplHelper3",
223			 "cppu/WeakComponentImplHelper4","cppu/WeakComponentImplHelper5",
224			 "cppu/WeakComponentImplHelper6","cppu/WeakComponentImplHelper7",
225			 "cppu/WeakComponentImplHelper8","cppu/WeakComponentImplHelper9",
226			 "cppu/OInterfaceIteratorHelper",
227			 "cppu/OMultiTypeInterfaceContainerHelper","cppu/UnoUrlDescriptor",
228			 "cppu/IPropertyArrayHelper","cppu/OBroadcastHelperVar",
229			 "cppu/OComponentHelper","cppu/OWeakAggObject",
230			 "cppu/ImplementationEntry","cppu/WeakImplHelper10",
231			 "cppu/WeakImplHelper11","cppu/WeakImplHelper12",
232			 "cppu/OPropertySetHelper","cppu/ImplHelper10","cppu/ImplHelper11",
233			 "cppu/ImplHelper12","cppu/WeakAggImplHelper10",
234			 "cppu/WeakAggImplHelper11","cppu/WeakAggImplHelper12",
235			 "cppu/ImplInheritanceHelper1","cppu/ImplInheritanceHelper2",
236			 "cppu/ImplInheritanceHelper3","cppu/ImplInheritanceHelper4",
237			 "cppu/ImplInheritanceHelper5","cppu/ImplInheritanceHelper6",
238			 "cppu/ImplInheritanceHelper7","cppu/ImplInheritanceHelper8",
239			 "cppu/ImplInheritanceHelper9","cppu/OTypeCollection",
240			 "cppu/WeakAggComponentImplHelper10",
241			 "cppu/WeakAggComponentImplHelper11",
242			 "cppu/WeakAggComponentImplHelper12",
243			 "cppu/WeakAggComponentImplHelper1",
244			 "cppu/WeakAggComponentImplHelper2",
245			 "cppu/WeakAggComponentImplHelper3",
246			 "cppu/WeakAggComponentImplHelper4",
247			 "cppu/WeakAggComponentImplHelper5",
248			 "cppu/WeakAggComponentImplHelper6",
249			 "cppu/WeakAggComponentImplHelper7",
250			 "cppu/WeakAggComponentImplHelper8",
251			 "cppu/WeakAggComponentImplHelper9",
252			 "cppu/OMultiTypeInterfaceContainerHelperVar",
253			 "cppu/OInterfaceContainerHelper","cppu/OImplementationId",
254			 "cppu/AggImplInheritanceHelper1","cppu/AggImplInheritanceHelper2",
255			 "cppu/AggImplInheritanceHelper3","cppu/AggImplInheritanceHelper4",
256			 "cppu/AggImplInheritanceHelper5","cppu/AggImplInheritanceHelper6",
257			 "cppu/AggImplInheritanceHelper7","cppu/AggImplInheritanceHelper8",
258			 "cppu/AggImplInheritanceHelper9","cppu/AggImplInheritanceHelper10",
259			 "cppu/AggImplInheritanceHelper11","cppu/AggImplInheritanceHelper12",
260			 "cppu/WeakImplHelper1","cppu/WeakImplHelper2","cppu/WeakImplHelper3",
261			 "cppu/WeakImplHelper4","cppu/WeakImplHelper5","cppu/WeakImplHelper6",
262			 "cppu/WeakImplHelper7","cppu/WeakImplHelper8","cppu/WeakImplHelper9",
263			 "cppu/OWeakObject","__store_FindData","_rtl_StandardModuleCount",
264			 "RTUik","RTConstValue","_typelib_TypeDescriptionReference",
265			 "_typelib_InterfaceMethodTypeDescription","store","RegistryKey",
266			 "_typelib_Union_Init","_sal_Sequence","_typelib_Parameter_Init",
267			 "_typelib_TypeDescription","_uno_Environment",
268			 "_typelib_InterfaceAttributeTypeDescription",
269			 "_rtl_ModuleCount","_uno_ExtEnvironment",
270			 "_typelib_IndirectTypeDescription",
271			 "Registry_Api","_oslFileStatus",
272			 "_typelib_InterfaceMemberTypeDescription","RegistryValueList",
273			 "RegistryTypeWriter_Api","_rtl_TextEncodingInfo",
274			 "namespace_anonymous_1",
275			 "_oslVolumeInfo","_uno_Interface",
276			 "_typelib_InterfaceTypeDescription","_uno_Mapping","Registry",
277			 "RegistryTypeReader_Api","_typelib_Uik",
278			 "_typelib_ArrayTypeDescription",
279			 "RegistryKeyArray","RegistryTypeReader","RegistryKeyNames",
280			 "RTConstValueUnion","_typelib_UnionTypeDescription","_uno_Any",
281			 "RegistryTypeWriter","_rtl_Locale","_typelib_CompoundMember_Init",
282			 "_typelib_EnumTypeDescription","_typelib_MethodParameter");
283
284	foreach $i (@dir_list)
285	{
286	    if (! -d "$StartDir/docs/cpp/ref/names/$i") {
287		$return++;
288		print "\nERROR: \"$StartDir/docs/cpp/ref/names/$i\" is missing\n";
289	    } else {
290		print "+";
291	    }
292	}
293    } else {
294	$return++;
295    }
296    print "\n";
297
298    #check java docu, it is only a first and simple check
299    # improvement required
300    my $solar_java = $ENV{"SOLAR_JAVA"};
301    my $JDK = $ENV{"JDK"};
302    if (defined($solar_java) && $solar_java ne "" && (!defined($JDK) || $JDK ne "gcj")) {
303	print "check java docu: ";
304	if (-d "$StartDir/docs/java/ref") {
305	    if (! -e "$StartDir/docs/java/ref/index.html") {
306		print "\nERROR: \"$StartDir/docs/java/ref/index.html\" is missing\n";
307		$return++;
308	    }
309
310	    my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
311			     "uno","uno/class-use","comp","comp/helper",
312			     "comp/helper/class-use");
313
314	    foreach $i (@dir_list)
315	    {
316		if (! -d "$StartDir/docs/java/ref/com/sun/star/$i") {
317		    $return++;
318		    print "\nERROR: \"$StartDir/docs/java/ref/com/sun/star/$i\" is missing\n";
319		} else {
320		    print "+";
321		}
322	    }
323	} else {
324	    $return++;
325	}
326	print "\n";
327    }
328
329    #check idl docu, it is only a first and simple check
330    # improvement required
331    print "check idl docu: ";
332    if (-d "$StartDir/docs/common/ref") {
333	if (! -e "$StartDir/docs/common/ref/module-ix.html") {
334	    print "\nERROR: \"$StartDir/docs/common/ref/module-ix.html\" is missing\n";
335	    $return++;
336	}
337	if (! -d "$StartDir/docs/common/ref/index-files") {
338	    print "\nERROR: \"$StartDir/docs/common/ref/index-files\" is missing\n";
339	    $return++;
340	}
341	if (! -e "$StartDir/docs/common/ref/index-files/index-10.html") {
342	    print "\nERROR: \"$StartDir/docs/common/ref/index-files/index-10.html\" is missing\n";
343	    $return++;
344	}
345
346	my @idl_dirlist = ( "accessibility",
347			    "animations",
348			    "auth",
349			    "awt",
350			    "awt/tab",
351			    "awt/tree",
352			    "awt/grid",
353			    "beans",
354			    "bridge",
355			    "bridge/oleautomation",
356			    "chart",
357			    "chart2",
358			    "chart2/data",
359			    "configuration",
360			    "configuration/backend",
361			    "configuration/backend/xml",
362			    "configuration/bootstrap",
363			    "connection",
364			    "container",
365			    "datatransfer",
366			    "datatransfer/clipboard",
367			    "datatransfer/dnd",
368			    "deployment",
369			    "deployment/ui",
370			    "document",
371			    "drawing",
372			    "drawing/framework",
373			    "embed",
374			    "form",
375			    "form/binding",
376			    "form/component",
377			    "form/control",
378			    "form/inspection",
379			    "form/runtime",
380			    "form/submission",
381			    "form/validation",
382			    "formula",
383			    "frame",
384			    "frame/status",
385			    "gallery",
386			    "geometry",
387			    "graphic",
388			    "i18n",
389			    "image",
390			    "inspection",
391			    "installation",
392			    "io",
393			    "java",
394			    "lang",
395			    "ldap",
396			    "linguistic2",
397			    "loader",
398			    "logging",
399			    "mail",
400			    "media",
401			    "mozilla",
402			    "packages",
403			    "packages/manifest",
404			    "packages/zip",
405			    "plugin",
406			    "presentation",
407			    "reflection",
408			    "registry",
409			    "rendering",
410			    "report",
411			    "report/inspection",
412			    "resource",
413			    "scanner",
414			    "script",
415			    "script/browse",
416			    "script/provider",
417			    "sdb",
418			    "sdb/application",
419			    "sdb/tools",
420			    "sdbc",
421			    "sdbcx",
422			    "security",
423			    "setup",
424			    "sheet",
425			    "smarttags",
426			    "style",
427			    "svg",
428			    "sync",
429			    "sync2",
430			    "system",
431			    "table",
432			    "task",
433			    "test",
434			    "test/bridge",
435			    "test/performance",
436			    "text",
437			    "text/fieldmaster",
438			    "text/textfield",
439			    "text/textfield/docinfo",
440			    "ucb",
441			    "ui",
442			    "ui/dialogs",
443			    "uno",
444			    "uri",
445			    "util",
446			    "util/logging",
447			    "view",
448			    "xforms",
449			    "xml",
450			    "xml/crypto",
451			    "xml/crypto/sax",
452			    "xml/csax",
453			    "xml/dom",
454			    "xml/dom/events",
455			    "xml/dom/views",
456			    "xml/input",
457			    "xml/sax",
458			    "xml/wrapper",
459			    "xml/xpath",
460			    "xsd" );
461
462	foreach $i (@idl_dirlist)
463	{
464	    if (! -d "$StartDir/docs/common/ref/com/sun/star/$i") {
465		$return++;
466		print "\nERROR: \"$StartDir/docs/common/ref/com/sun/star/$i\" is missing\n";
467	    } else {
468		print "+";
469	    }
470	}
471    } else {
472	$return++;
473    }
474    print "\n";
475
476} else {
477    $return++;
478}
479
480if( $return != 0 )
481{
482    print "ERROR\n";
483    unlink "$ARGV[3]";
484} else {
485    print "OK\n";
486}
487exit $return;
488