xref: /aoo4110/main/odk/util/check.pl (revision b1cdbd2c)
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    }
145    print "\n";
146
147    #check setting files
148    print "check setting files: ";
149    if (-d "$StartDir/settings") {
150	if (! -e "$StartDir/settings/settings.mk") {
151	    print "\nERROR: \"$StartDir/settings/settings.mk\" is missing\n";
152	    $return++;
153	}
154	if (! -e "$StartDir/settings/std.mk") {
155	    print "\nERROR: \"$StartDir/settings/std.mk\" is missing\n";
156	    $return++;
157	}
158	if (! -e "$StartDir/settings/stdtarget.mk") {
159	    print "\nERROR: \"$StartDir/settings/stdtarget.mk\" is missing\n";
160	    $return++;
161	}
162    } else {
163	$return++;
164    }
165    print "\n";
166
167    #check cpp docu, it is only a first and simple check
168    # improvement required
169    print "check cpp docu: ";
170    if (-d "$StartDir/docs/cpp/ref") {
171	if (! -e "$StartDir/docs/cpp/ref/index.html") {
172	    print "\nERROR: \"$StartDir/docs/cpp/ref/index.html\" is missing\n";
173	    $return++;
174	}
175	if (! -d "$StartDir/docs/cpp/ref/index-files") {
176	    print "\nERROR: \"$StartDir/docs/cpp/ref/index-files\" is missing\n";
177	    $return++;
178	}
179	if (! -e "$StartDir/docs/cpp/ref/index-files/index-10.html") {
180	    print "\nERROR: \"$StartDir/docs/cpp/ref/index-files/index-10.html\" is missing\n";
181	    $return++;
182	}
183
184	my @dir_list = ( "com","com/sun","com/sun/star","com/sun/star/uno",
185			 "com/sun/star/uno/Any","com/sun/star/uno/Type",
186			 "com/sun/star/uno/Array","com/sun/star/uno/WeakReferenceHelper",
187			 "com/sun/star/uno/Reference","com/sun/star/uno/WeakReference",
188			 "com/sun/star/uno/Environment","com/sun/star/uno/Sequence",
189			 "com/sun/star/uno/BaseReference","com/sun/star/uno/Mapping",
190			 "com/sun/star/uno/ContextLayer","com/sun/star/uno/TypeDescription",
191			 "osl","osl/File","osl/Pipe","osl/FileStatus","osl/FileBase",
192			 "osl/Guard","osl/Mutex","osl/VolumeInfo","osl/GetGlobalMutex",
193			 "osl/Security","osl/Profile","osl/DatagramSocket","osl/SocketAddr",
194			 "osl/StreamPipe","osl/ResettableGuard","osl/AcceptorSocket",
195			 "osl/ClearableGuard","osl/VolumeDevice","rtl","rtl/Uri","rtl/math",
196			 "rtl/OUStringHash","rtl/MalformedUriException","rtl/OUStringBuffer",
197			 "rtl/OUString","rtl/Reference","rtl/ByteSequence","rtl/OLocale",
198			 "rtl/Logfile","rtl/OString","rtl/IReference","rtl/OStringBuffer",
199			 "rtl/OStringHash","_typelib_CompoundTypeDescription","cppu",
200			 "cppu/ContextEntry_Init","cppu/ImplInheritanceHelper10",
201			 "cppu/ImplInheritanceHelper11","cppu/ImplInheritanceHelper12",
202			 "cppu/WeakAggImplHelper1","cppu/WeakAggImplHelper2",
203			 "cppu/WeakAggImplHelper3","cppu/WeakAggImplHelper4",
204			 "cppu/WeakAggImplHelper5","cppu/WeakAggImplHelper6",
205			 "cppu/WeakAggImplHelper7","cppu/WeakAggImplHelper8",
206			 "cppu/WeakAggImplHelper9",
207			 "cppu/OMultiTypeInterfaceContainerHelperInt32","cppu/AccessControl",
208			 "cppu/OPropertyArrayHelper","cppu/ImplHelper1","cppu/ImplHelper2",
209			 "cppu/ImplHelper3","cppu/ImplHelper4","cppu/ImplHelper5",
210			 "cppu/ImplHelper6","cppu/ImplHelper7","cppu/ImplHelper8",
211			 "cppu/ImplHelper9","cppu/WeakComponentImplHelper10",
212			 "cppu/WeakComponentImplHelper11","cppu/WeakComponentImplHelper12",
213			 "cppu/UnoUrl","cppu/WeakComponentImplHelper1",
214			 "cppu/WeakComponentImplHelper2","cppu/WeakComponentImplHelper3",
215			 "cppu/WeakComponentImplHelper4","cppu/WeakComponentImplHelper5",
216			 "cppu/WeakComponentImplHelper6","cppu/WeakComponentImplHelper7",
217			 "cppu/WeakComponentImplHelper8","cppu/WeakComponentImplHelper9",
218			 "cppu/OInterfaceIteratorHelper",
219			 "cppu/OMultiTypeInterfaceContainerHelper","cppu/UnoUrlDescriptor",
220			 "cppu/IPropertyArrayHelper","cppu/OBroadcastHelperVar",
221			 "cppu/OComponentHelper","cppu/OWeakAggObject",
222			 "cppu/ImplementationEntry","cppu/WeakImplHelper10",
223			 "cppu/WeakImplHelper11","cppu/WeakImplHelper12",
224			 "cppu/OPropertySetHelper","cppu/ImplHelper10","cppu/ImplHelper11",
225			 "cppu/ImplHelper12","cppu/WeakAggImplHelper10",
226			 "cppu/WeakAggImplHelper11","cppu/WeakAggImplHelper12",
227			 "cppu/ImplInheritanceHelper1","cppu/ImplInheritanceHelper2",
228			 "cppu/ImplInheritanceHelper3","cppu/ImplInheritanceHelper4",
229			 "cppu/ImplInheritanceHelper5","cppu/ImplInheritanceHelper6",
230			 "cppu/ImplInheritanceHelper7","cppu/ImplInheritanceHelper8",
231			 "cppu/ImplInheritanceHelper9","cppu/OTypeCollection",
232			 "cppu/WeakAggComponentImplHelper10",
233			 "cppu/WeakAggComponentImplHelper11",
234			 "cppu/WeakAggComponentImplHelper12",
235			 "cppu/WeakAggComponentImplHelper1",
236			 "cppu/WeakAggComponentImplHelper2",
237			 "cppu/WeakAggComponentImplHelper3",
238			 "cppu/WeakAggComponentImplHelper4",
239			 "cppu/WeakAggComponentImplHelper5",
240			 "cppu/WeakAggComponentImplHelper6",
241			 "cppu/WeakAggComponentImplHelper7",
242			 "cppu/WeakAggComponentImplHelper8",
243			 "cppu/WeakAggComponentImplHelper9",
244			 "cppu/OMultiTypeInterfaceContainerHelperVar",
245			 "cppu/OInterfaceContainerHelper","cppu/OImplementationId",
246			 "cppu/AggImplInheritanceHelper1","cppu/AggImplInheritanceHelper2",
247			 "cppu/AggImplInheritanceHelper3","cppu/AggImplInheritanceHelper4",
248			 "cppu/AggImplInheritanceHelper5","cppu/AggImplInheritanceHelper6",
249			 "cppu/AggImplInheritanceHelper7","cppu/AggImplInheritanceHelper8",
250			 "cppu/AggImplInheritanceHelper9","cppu/AggImplInheritanceHelper10",
251			 "cppu/AggImplInheritanceHelper11","cppu/AggImplInheritanceHelper12",
252			 "cppu/WeakImplHelper1","cppu/WeakImplHelper2","cppu/WeakImplHelper3",
253			 "cppu/WeakImplHelper4","cppu/WeakImplHelper5","cppu/WeakImplHelper6",
254			 "cppu/WeakImplHelper7","cppu/WeakImplHelper8","cppu/WeakImplHelper9",
255			 "cppu/OWeakObject","__store_FindData","_rtl_StandardModuleCount",
256			 "RTUik","RTConstValue","_typelib_TypeDescriptionReference",
257			 "_typelib_InterfaceMethodTypeDescription","store","RegistryKey",
258			 "_typelib_Union_Init","_sal_Sequence","_typelib_Parameter_Init",
259			 "_typelib_TypeDescription","_uno_Environment",
260			 "_typelib_InterfaceAttributeTypeDescription",
261			 "_rtl_ModuleCount","_uno_ExtEnvironment",
262			 "_typelib_IndirectTypeDescription",
263			 "Registry_Api","_oslFileStatus",
264			 "_typelib_InterfaceMemberTypeDescription","RegistryValueList",
265			 "RegistryTypeWriter_Api","_rtl_TextEncodingInfo",
266			 "namespace_anonymous_1",
267			 "_oslVolumeInfo","_uno_Interface",
268			 "_typelib_InterfaceTypeDescription","_uno_Mapping","Registry",
269			 "RegistryTypeReader_Api","_typelib_Uik",
270			 "_typelib_ArrayTypeDescription",
271			 "RegistryKeyArray","RegistryTypeReader","RegistryKeyNames",
272			 "RTConstValueUnion","_typelib_UnionTypeDescription","_uno_Any",
273			 "RegistryTypeWriter","_rtl_Locale","_typelib_CompoundMember_Init",
274			 "_typelib_EnumTypeDescription","_typelib_MethodParameter");
275
276	foreach $i (@dir_list)
277	{
278	    if (! -d "$StartDir/docs/cpp/ref/names/$i") {
279		$return++;
280		print "\nERROR: \"$StartDir/docs/cpp/ref/names/$i\" is missing\n";
281	    } else {
282		print "+";
283	    }
284	}
285    } else {
286	$return++;
287    }
288    print "\n";
289
290    #check java docu, it is only a first and simple check
291    # improvement required
292    my $solar_java = $ENV{"SOLAR_JAVA"};
293    my $JDK = $ENV{"JDK"};
294    if (defined($solar_java) && $solar_java ne "" && (!defined($JDK) || $JDK ne "gcj")) {
295	print "check java docu: ";
296	if (-d "$StartDir/docs/java/ref") {
297	    if (! -e "$StartDir/docs/java/ref/index.html") {
298		print "\nERROR: \"$StartDir/docs/java/ref/index.html\" is missing\n";
299		$return++;
300	    }
301
302	    my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
303			     "uno","uno/class-use","comp","comp/helper",
304			     "comp/helper/class-use");
305
306	    foreach $i (@dir_list)
307	    {
308		if (! -d "$StartDir/docs/java/ref/com/sun/star/$i") {
309		    $return++;
310		    print "\nERROR: \"$StartDir/docs/java/ref/com/sun/star/$i\" is missing\n";
311		} else {
312		    print "+";
313		}
314	    }
315	} else {
316	    $return++;
317	}
318	print "\n";
319    }
320
321    #check idl docu, it is only a first and simple check
322    # improvement required
323    print "check idl docu: ";
324    if (-d "$StartDir/docs/common/ref") {
325	if (! -e "$StartDir/docs/common/ref/module-ix.html") {
326	    print "\nERROR: \"$StartDir/docs/common/ref/module-ix.html\" is missing\n";
327	    $return++;
328	}
329	if (! -d "$StartDir/docs/common/ref/index-files") {
330	    print "\nERROR: \"$StartDir/docs/common/ref/index-files\" is missing\n";
331	    $return++;
332	}
333	if (! -e "$StartDir/docs/common/ref/index-files/index-10.html") {
334	    print "\nERROR: \"$StartDir/docs/common/ref/index-files/index-10.html\" is missing\n";
335	    $return++;
336	}
337
338	my @idl_dirlist = ( "accessibility",
339			    "animations",
340			    "auth",
341			    "awt",
342			    "awt/tab",
343			    "awt/tree",
344			    "awt/grid",
345			    "beans",
346			    "bridge",
347			    "bridge/oleautomation",
348			    "chart",
349			    "chart2",
350			    "chart2/data",
351			    "configuration",
352			    "configuration/backend",
353			    "configuration/backend/xml",
354			    "configuration/bootstrap",
355			    "connection",
356			    "container",
357			    "datatransfer",
358			    "datatransfer/clipboard",
359			    "datatransfer/dnd",
360			    "deployment",
361			    "deployment/ui",
362			    "document",
363			    "drawing",
364			    "drawing/framework",
365			    "embed",
366			    "form",
367			    "form/binding",
368			    "form/component",
369			    "form/control",
370			    "form/inspection",
371			    "form/runtime",
372			    "form/submission",
373			    "form/validation",
374			    "formula",
375			    "frame",
376			    "frame/status",
377			    "gallery",
378			    "geometry",
379			    "graphic",
380			    "i18n",
381			    "image",
382			    "inspection",
383			    "installation",
384			    "io",
385			    "java",
386			    "lang",
387			    "ldap",
388			    "linguistic2",
389			    "loader",
390			    "logging",
391			    "mail",
392			    "media",
393			    "mozilla",
394			    "packages",
395			    "packages/manifest",
396			    "packages/zip",
397			    "plugin",
398			    "presentation",
399			    "reflection",
400			    "registry",
401			    "rendering",
402			    "report",
403			    "report/inspection",
404			    "resource",
405			    "scanner",
406			    "script",
407			    "script/browse",
408			    "script/provider",
409			    "sdb",
410			    "sdb/application",
411			    "sdb/tools",
412			    "sdbc",
413			    "sdbcx",
414			    "security",
415			    "setup",
416			    "sheet",
417			    "smarttags",
418			    "style",
419			    "svg",
420			    "sync",
421			    "sync2",
422			    "system",
423			    "table",
424			    "task",
425			    "test",
426			    "test/bridge",
427			    "test/performance",
428			    "text",
429			    "text/fieldmaster",
430			    "text/textfield",
431			    "text/textfield/docinfo",
432			    "ucb",
433			    "ui",
434			    "ui/dialogs",
435			    "uno",
436			    "uri",
437			    "util",
438			    "util/logging",
439			    "view",
440			    "xforms",
441			    "xml",
442			    "xml/crypto",
443			    "xml/crypto/sax",
444			    "xml/csax",
445			    "xml/dom",
446			    "xml/dom/events",
447			    "xml/dom/views",
448			    "xml/input",
449			    "xml/sax",
450			    "xml/wrapper",
451			    "xml/xpath",
452			    "xsd" );
453
454	foreach $i (@idl_dirlist)
455	{
456	    if (! -d "$StartDir/docs/common/ref/com/sun/star/$i") {
457		$return++;
458		print "\nERROR: \"$StartDir/docs/common/ref/com/sun/star/$i\" is missing\n";
459	    } else {
460		print "+";
461	    }
462	}
463    } else {
464	$return++;
465    }
466    print "\n";
467
468} else {
469    $return++;
470}
471
472if( $return != 0 )
473{
474    print "ERROR\n";
475    unlink "$ARGV[3]";
476} else {
477    print "OK\n";
478}
479exit $return;
480