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